@font-face {
  font-family: Matter;
  src: url('/media/matter-light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: Matter;
  src: url('/media/matter-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Matter;
  src: url('/media/matter-medium.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Azeret Semimono';
  src: url('/media/azeret-regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --cream: #f5f7f2;
  --panel: #242424;
  --surface: #2a2a29;
  --line: #464644;
  --line-soft: #383836;
  --text: var(--cream);
  --muted: #b6b7b2;
  --green: #b9db9d;
  --red: #f7a999;
  --header-height: 54px;
  --gutter: clamp(20px, 3.125vw, 52px);
  --sans: Matter, Arial, sans-serif;
  --mono: 'Azeret Semimono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.shell, .app-shell { width: min(1540px, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 4; background: var(--bg); }
.header-layout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--header-height); gap: 20px; }
.header-layout > :last-child, .header-layout > .desktop-action { justify-self: end; }
.desktop-nav { display: flex; gap: clamp(24px, 5vw, 64px); align-items: center; font-size: 15px; }
.desktop-nav a:hover, .desktop-nav [aria-current] { text-decoration: underline; text-underline-offset: 5px; }
.brand { display: inline-flex; gap: 9px; align-items: center; width: max-content; white-space: nowrap; font-size: 21px; line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: -.055em; }
.brand-mark { width: 18px; height: 18px; position: relative; display: inline-grid; place-items: center; transform: rotate(12deg); }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%); }
.brand-mark::before { inset: 0; background: currentColor; }
.brand-mark::after { inset: 3px; background: var(--bg); transform: rotate(-24deg); }
.button, .bracket-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; font: 400 13px/1.4 var(--mono); }
.button { border: 1px solid transparent; min-height: 38px; padding: 7px 13px; border-radius: 7px; transition: background .2s, color .2s, border-color .2s; }
.button-primary { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.button-primary:hover { background: #dce2d7; border-color: #dce2d7; }
.button-outline { background: transparent; border-color: currentColor; color: var(--text); }
.button-outline:hover { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.bracket-link { min-height: 36px; position: relative; padding-inline: 12px; }
.bracket-link::before, .bracket-link::after { content: ''; flex: 0 0 7px; width: 7px; height: 16px; border: 1px solid currentColor; transition: transform .2s; }
.bracket-link::before { border-right: 0; border-radius: 5px 0 0 5px; }
.bracket-link::after { border-left: 0; border-radius: 0 5px 5px 0; }
.bracket-link:hover::before { transform: translateX(-3px); }
.bracket-link:hover::after { transform: translateX(3px); }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { cursor: pointer; list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav { display: grid; position: absolute; right: 0; top: 100%; gap: 0; min-width: 175px; padding: 6px; background: var(--bg); border: 1px solid var(--line); }
.mobile-nav nav a { display: block; padding: 8px 11px; }
.mobile-nav nav a:hover { background: var(--surface); }
.muted { color: var(--muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.mono { font-family: var(--mono); }

.app .site-header { border-bottom: 1px solid var(--line-soft); }
.app-main { padding-top: clamp(30px, 4vw, 62px); }
.app-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.app-heading h1 { font: 400 clamp(38px, 5.2vw, 64px)/1.04 var(--sans); letter-spacing: -.045em; margin: 7px 0 8px; }
.app-heading p { color: var(--muted); }
.connection i { display: inline-block; flex: 0 0 auto; border-radius: 50%; width: 6px; height: 6px; background: currentColor; }
.stream-toolbar { display: flex; gap: 8px; }
.stream-toolbar select { min-width: 132px; min-height: 38px; }
.app-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); margin-bottom: 25px; }
.app-metrics div { padding: 15px 18px; display: grid; gap: 7px; }
.app-metrics div:first-child { padding-left: 0; }
.app-metrics div + div { border-left: 1px solid var(--line); }
.app-metrics span { font-size: 14px; color: var(--muted); }
.app-metrics strong { font: 400 clamp(17px, 2.2vw, 26px)/1.3 var(--mono); letter-spacing: -.055em; }
.workspace { display: grid; grid-template-columns: clamp(235px, 23vw, 292px) minmax(0, 1fr); align-items: start; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; min-width: 0; overflow: hidden; }
.filter-head, .feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.filter-head h2, .feed-head h2 { font-size: 18px; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); font: 400 11px/1.4 var(--mono); }
.text-button:hover { color: var(--text); text-decoration: underline; }
.count { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; min-width: 20px; height: 20px; font: 400 10px/1 var(--mono); }
.filters details { border-bottom: 1px solid var(--line-soft); }
.filters summary { padding: 12px 15px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: '+'; color: var(--muted); }
.filters details[open] summary::after { content: '−'; }
.filter-fields { display: grid; gap: 10px; padding: 0 15px 14px; }
.filter-fields label, .filter-fields legend { color: var(--muted); font-size: 14px; }
.filter-fields label { display: grid; gap: 4px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.range { border: 0; padding: 0; margin: 0; min-width: 0; }
.range legend { padding: 0; margin: 0 0 4px; }
input, select { width: 100%; color: var(--text); border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 6px 8px; min-width: 0; min-height: 35px; font-size: 14px; }
input::placeholder { color: #b6b7b2; opacity: 1; }
.checkbox { display: flex !important; align-items: center; gap: 8px !important; }
.checkbox input { min-height: 16px; width: 16px; accent-color: var(--cream); margin: 2px 0; }
.filter-note { font-size: 12px; color: var(--muted); }
.filter-bottom { padding: 14px 15px; }
.filter-bottom .button { width: 100%; }
.feed-head { border-bottom: 0; padding: 15px 17px; }
.feed-subtitle { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 3px; }
.connection { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.connection[data-state="live"] { color: var(--green); }
.connection[data-state="demo"], .connection[data-state="polling"] { color: var(--text); }
.connection[data-state="offline"] { color: #f0c79e; }
.search { display: flex; align-items: center; gap: 6px; max-width: 320px; min-width: min(35%, 230px); border: 1px solid var(--line); background: var(--surface); border-radius: 5px; padding-left: 10px; color: var(--muted); }
.search > span { font-size: 21px; line-height: 1; }
.search input { border: 0; outline-offset: 1px; }
.feed-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 17px 12px; }
.segments { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; }
.segments button { border: 0; color: var(--muted); background: transparent; border-radius: 3px; font-size: 14px; padding: 4px 10px; }
.segments button:hover { color: var(--text); }
.segments button[aria-pressed="true"] { color: var(--bg); background: var(--cream); }
.feed-count { display: flex; gap: 12px; align-items: center; font: 400 11px/1.4 var(--mono); color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 690px; text-align: left; }
th { font-weight: 400; background: var(--surface); color: var(--muted); white-space: nowrap; }
th, td { padding: 10px 12px; font-size: 14px; border-block: 1px solid var(--line-soft); }
th:first-child, td:first-child { padding-left: 17px; }
td { vertical-align: middle; height: 55px; }
tbody tr:hover { background: var(--surface); }
.row-token { display: flex; align-items: center; gap: 8px; min-width: 104px; }
.token-dot { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; flex: 0 0 auto; background: hsl(var(--coin) 24% 28%); color: hsl(var(--coin) 50% 88%); font: 400 11px/1 var(--mono); overflow: hidden; }
.row-token strong, .row-token small { display: block; max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.usd { white-space: nowrap; font: 400 13px/1.3 var(--mono); }
.tx, .row-side, .row-age, .montra-link { white-space: nowrap; }
.tx { color: var(--muted); font-size: 11px; }
.tx:hover, .montra-link:hover { text-decoration: underline; color: var(--text); }
.montra-link { color: var(--text); }
.empty { display: grid; min-height: 259px; place-content: center; justify-items: center; text-align: center; gap: 9px; padding: 22px; }
.empty p { font-weight: 500; }
.empty small { color: var(--muted); max-width: 370px; }
.empty button { margin-top: 4px; }
.feed-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 17px; border-top: 1px solid var(--line-soft); color: var(--muted); }
.app-footnote { color: var(--muted); font-size: 12px; padding: 12px 0 21px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.token-button { padding: 0; border: 0; text-align: left; background: transparent; color: inherit; }
.token-button:hover strong { text-decoration: underline; }
.token-dialog { width: min(460px, calc(100% - 32px)); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 20px; }
.token-dialog::backdrop { background: #101010c9; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.token-dialog p { font-size: 13px; overflow-wrap: anywhere; }
.token-dialog dl { margin: 20px 0; }
.token-dialog dl div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.token-dialog dt { color: var(--muted); }
.token-dialog dd { margin: 0; text-align: right; }

@media (max-width: 870px) {
  .feed-head { align-items: stretch; flex-wrap: wrap; }
  .search { max-width: none; flex: 1 1 170px; }
  .feed-count #update-time { display: none; }
}
@media (max-width: 720px) {
  .header-layout { grid-template-columns: 1fr auto; min-height: var(--header-height); }
  .desktop-nav, .desktop-action { display: none; }
  .mobile-nav { display: block; }
  .app-heading { flex-wrap: wrap; }
  .app-metrics { grid-template-columns: 1fr 1fr; }
  .app-metrics div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .app-metrics div:nth-child(3) { border-left: 0; padding-left: 0; }
  .workspace { display: flex; flex-direction: column; }
  .filters, .feed { width: 100%; }
  .filters .filter-fields { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
}
@media (max-width: 390px) {
  .brand { font-size: 18px; gap: 6px; }
  .brand-mark { width: 15px; height: 15px; }
  .app-metrics strong { font-size: 16px; }
  .app-metrics div { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
