/* ══════════════════════════════════════════════════════════════════════════
   METRA — design system
   ──────────────────────────────────────────────────────────────────────────
   Replaces mt-pleurat.css and mt-ui.css. Those were override layers painted
   over Kuantara's CSS, which produced a hybrid that read as neither product.
   This is a foundation instead: one semantic token set, one type scale, one
   spacing rhythm, and components defined rather than patched.

   Light is the default because the reference is light. Terminal density is
   loosened deliberately — the air IS the design, and preserving 10px rows was
   what kept the old look alive underneath the paint.
   ══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  /* ── Messari Terminal palette ─────────────────────────────────────────
     Sampled from the live product. The move that defines the look: panels
     are DARKER than the canvas (#0F1218 on #12161E), so a card recedes into
     the page instead of lifting off it, and the 1px #21242C border — not a
     shadow — is what separates regions. Shadows are absent by design; on a
     near-black field they read as smudge. */
  --s-canvas:   #12161E;   /* page */
  --s-sunken:   #0B0E14;   /* wells, table headers */
  --s-raised:   #0F1218;   /* panels — darker than canvas, on purpose */
  --s-raised-2: #161A23;   /* hover / active rows */

  --ink:   #F3F4F6;
  --ink-2: #9CA3AF;
  --ink-3: #6B7280;
  --ink-4: #4B5563;

  --line:       #21242C;   /* solid hairline, always visible */
  --line-2:     #1A1D24;
  --line-solid: #21242C;

  /* Messari signals with blue and keeps amber out of it entirely. */
  --accent:        #016BD4;
  --accent-bright: #3B8FE8;
  --accent-text:   #7AA0E8;
  --accent-ink:    #FFFFFF;
  --accent-wash:   rgba(1,107,212,.12);
  --accent-wash-2: rgba(1,107,212,.22);
  --accent-ring:   rgba(1,107,212,.55);

  --up: #00CC3D;  --down: #F33F54;  --info: #7AA0E8;  --warn: #E8A33D;
  --up-wash: rgba(0,204,61,.12);  --down-wash: rgba(243,63,84,.12);

  /* Inter is the terminal face: tight apertures, real tabular figures. */
  --sans: 'Inter','SF Pro Text',-apple-system,system-ui,'Segoe UI',sans-serif;
  --mono: 'Roboto Mono','SF Mono',ui-monospace,Menlo,monospace;
  --fs-micro: 10px;  --fs-xs: 11px;  --fs-sm: 12px;   --fs-md: 13px;
  --fs-lg:    15px;  --fs-xl: 18px;  --fs-2xl: 22px;
  --fs-h2: 16px;
  --fs-h1: 18px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 28px; --sp-7: 40px;

  --r-card: 8px;  --r-ctl: 4px;  --r-pill: 100px;
  --e: cubic-bezier(.4,0,.2,1);
  --t: .13s;  --t-2: .22s;
  /* borders do the separating; shadows stay almost invisible */
  --sh-1: none;
  --sh-2: 0 4px 16px -4px rgba(0,0,0,.6);
  --sh-3: 0 24px 60px -16px rgba(0,0,0,.85);

  --nav-w: 232px;
}

:root[data-mt-theme="light"] {
  --s-canvas:#FFFCF0; --s-sunken:#F6F1E3; --s-raised:#FFFFFF; --s-raised-2:#FBF8EE;
  --ink:#0F1524; --ink-2:#383C48; --ink-3:#5E6475; --ink-4:#7E8494;
  --line:rgba(15,21,36,.11); --line-2:rgba(15,21,36,.055); --line-solid:#E4DECC;
  --accent:#A86A08; --accent-bright:#E2952A; --accent-text:#9C5F07; --accent-ink:#FFFCF0;
  --accent-wash:rgba(226,149,42,.10); --accent-wash-2:rgba(226,149,42,.18);
  --accent-ring:rgba(226,149,42,.42);
  --up:#0E7A50; --down:#B8322A; --info:#2560B8; --warn:#8A6206;
  --up-wash:rgba(14,122,80,.10); --down-wash:rgba(184,50,42,.10);
  --sh-1:0 1px 2px rgba(15,21,36,.05);
  --sh-2:0 6px 20px -6px rgba(15,21,36,.14), 0 1px 3px rgba(15,21,36,.06);
  --sh-3:0 28px 70px -20px rgba(15,21,36,.26), 0 6px 18px rgba(15,21,36,.08);
}

/* ══ legacy bridge ═════════════════════════════════════════════════════════
   Pages were written against Kuantara's variable names. Rather than rewrite
   77 stylesheets, those names are re-pointed at the tokens above so old rules
   inherit the new system automatically. */
:root {
  --kt-bg:var(--s-canvas);   --bg:var(--s-canvas);   --bg0:var(--s-canvas);
  --kt-bg1:var(--s-sunken);  --bg1:var(--s-sunken);
  --kt-bg2:var(--s-raised);  --bg2:var(--s-raised);
  --kt-bg3:var(--s-raised-2);--bg3:var(--s-raised-2);
  --kt-text:var(--ink);      --text:var(--ink);
  --kt-text2:var(--ink-2);   --text2:var(--ink-2);
  --kt-muted:var(--ink-3);   --muted:var(--ink-3);   --text3:var(--ink-3);
  --kt-dim:var(--ink-4);     --dim:var(--ink-4);
  --kt-border:var(--line);   --border:var(--line);
  --kt-border2:var(--line-2);--border2:var(--line-2);
  --kt-gold:var(--accent-text); --gold:var(--accent-text); --kt-accent:var(--accent-text);
  --kt-border-active:var(--accent);
  --kt-goldf:var(--accent-wash);   --kt-goldgl:var(--accent-wash-2);
  --kt-gold-dim:var(--ink-3);      --gold-dim:var(--ink-3);
  --mt-on-accent:var(--accent-ink);
  --kt-up:var(--up);   --green:var(--up);   --kt-upf:var(--up-wash);
  --kt-dn:var(--down); --red:var(--down);   --kt-dnf:var(--down-wash);
  --kt-down:var(--down);
  --kt-blue:var(--info); --blue:var(--info); --kt-bluef:rgba(47,111,208,.10);
  --kt-ws-on:var(--up); --kt-ws-off:var(--down); --kt-ws-con:var(--accent);
  --kt-font:var(--sans); --font:var(--sans);
  --kt-ease:var(--e); --kt-fast:var(--t); --kt-dur:var(--t-2);
  --radius:var(--r-ctl); --kt-radius:var(--r-ctl);
}

/* ══ base ══════════════════════════════════════════════════════════════════ */
html, body {
  background: var(--s-canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body, button, input, select, textarea, h1,h2,h3,h4,h5,h6, a, label, p, li, div, span {
  font-family: var(--sans);
}
/* digits keep a mono face so columns stay aligned */
table, th, td, code, pre, kbd, input[type="number"], .mono,
[class*="price"], [class*="value"], [class*="num"] {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
h1,h2,h3,h4 { letter-spacing: -.022em; font-weight: 600; line-height: 1.18; }
::selection { background: var(--accent-wash-2); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 100px;
  border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }
* { scrollbar-color: var(--ink-4) transparent; scrollbar-width: thin; }

/* ══ components ════════════════════════════════════════════════════════════
   Defined once, here — not patched per page. */

/* ── buttons ─────────────────────────────────────────────────────────────
   Square corners with real padding, the way the reference does it. */
button, .btn, .kt-btn, .kt-btn-main, .hs-btn, .seg button,
.ws-layout-btn, .compact-btn, .free-btn, .ws-fbar-btn, .pal-bk-btn {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .005em;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  background: var(--s-raised);
  color: var(--ink-2);
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--t) var(--e), border-color var(--t) var(--e),
              color var(--t) var(--e), transform var(--t) var(--e),
              box-shadow var(--t) var(--e);
}
button:not(:disabled):hover, .btn:not(:disabled):hover, .kt-btn:not(:disabled):hover {
  border-color: var(--accent-ring);
  color: var(--ink);
  background: var(--accent-wash);
}
button:not(:disabled):active, .btn:not(:disabled):active { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; }

.kt-btn-main, .btn.primary, button.primary, .seg button.on,
.kt-main-tab.kt-main-active, .filter-btn.active {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-color: var(--accent) !important;
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.kt-btn-main:not(:disabled):hover, .btn.primary:not(:disabled):hover {
  filter: brightness(1.06); box-shadow: var(--sh-2);
}

/* ── inputs ──────────────────────────────────────────────────────────────── */
input, select, textarea {
  font-size: var(--fs-sm);
  background: var(--s-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--ink);
  padding: 8px 11px;
  transition: border-color var(--t) var(--e), box-shadow var(--t) var(--e);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
::placeholder { color: var(--ink-4); }

/* ── segmented ───────────────────────────────────────────────────────────── */
.seg {
  display: inline-flex; flex-shrink: 0; min-width: max-content;
  background: var(--s-sunken); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 3px; gap: 2px; overflow: visible;
}
.seg button {
  border: 0; background: transparent; padding: 6px 12px;
  border-radius: 6px; flex-shrink: 0; white-space: nowrap; color: var(--ink-3);
}
.seg button:hover { background: var(--s-raised); color: var(--ink); }

/* ── tabs ────────────────────────────────────────────────────────────────── */
.kt-main-tab, .kt-tab, .hs-movers-tab {
  position: relative; background: transparent !important; border: 0;
  color: var(--ink-3); padding: 10px 15px; font-size: var(--fs-sm);
  border-radius: 0;
}
.kt-main-tab::after, .kt-tab::after, .hs-movers-tab::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  background: var(--accent-bright); border-radius: 2px;
  transform: scaleX(0); transition: transform var(--t-2) var(--e);
}
.kt-main-tab:hover, .kt-tab:hover, .hs-movers-tab:hover { color: var(--ink); }
.kt-main-tab.kt-main-active, .kt-tab.kt-active, .hs-movers-tab.active {
  color: var(--ink) !important; font-weight: 600;
  background: transparent !important; box-shadow: none;
}
.kt-main-tab.kt-main-active::after, .kt-tab.kt-active::after,
.hs-movers-tab.active::after { transform: scaleX(1); }

/* ── panels ──────────────────────────────────────────────────────────────── */
.kt-panel, .panel, .card, .kt-card, .kt-result-main, .kt-chart-card,
[class*="-panel"], [class*="-card"] {
  background: var(--s-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-1);
}
.kt-panel-header, .panel-header {
  font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}

/* ── tables — the air lives here ─────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--s-sunken) !important;
  color: var(--ink-3) !important;
  font-family: var(--sans);
  font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--line-2) !important;
  color: var(--ink);
}
tbody tr { transition: background var(--t) var(--e); }
tbody tr:hover { background: var(--accent-wash) !important; }

/* ── pills & chips ───────────────────────────────────────────────────────── */
.pill, .chip, .kt-pill, .kt-chip, .badge {
  border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 600;
  letter-spacing: .04em; padding: 3px 9px;
}
.pill.up   { background: var(--up-wash);   color: var(--up); }
.pill.down { background: var(--down-wash); color: var(--down); }
.up { color: var(--up); } .down { color: var(--down); } .mut { color: var(--ink-4); }

/* ── status dots ─────────────────────────────────────────────────────────── */
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.dot.ok   { background: var(--up);     box-shadow: 0 0 0 3px var(--up-wash); }
.dot.err  { background: var(--down);   box-shadow: 0 0 0 3px var(--down-wash); }
.dot.busy { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
            animation: mt-pulse 1.3s var(--e) infinite; }
@keyframes mt-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ── loading ─────────────────────────────────────────────────────────────── */
@keyframes mt-shimmer { 0% { background-position: -180% 0 } 100% { background-position: 180% 0 } }
.kt-loading, .loading, [class*="skeleton"], .hs-movers-state {
  background: linear-gradient(90deg, transparent, var(--accent-wash), transparent);
  background-size: 180% 100%; animation: mt-shimmer 1.5s var(--e) infinite;
}
@keyframes mt-spin { to { transform: rotate(360deg) } }
.kt-spinning, .spinning { animation: mt-spin .9s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ══ application shell ═════════════════════════════════════════════════════
   Injected by mt-shell.js on top-level pages. The page's own root element is
   pushed right rather than restructured, so no existing layout is rewritten. */

body.mt-has-shell {
  padding-left: var(--nav-w);
  padding-top: 52px;
  overflow: auto !important;
  height: auto !important;
}
body.mt-has-shell > #app,
body.mt-has-shell > .kt-app,
body.mt-has-shell > .kt-wrap { min-height: calc(100vh - 52px); height: auto; }

/* ── sidebar ─────────────────────────────────────────────────────────────── */
.mt-nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 900;
  display: flex; flex-direction: column;
  background: var(--s-sunken);
  border-right: 1px solid var(--line);
}
.mt-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
}
.mt-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mt-brand-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.mt-brand-t {
  font-size: 19px; font-weight: 600; letter-spacing: -.035em; color: var(--ink);
}
.mt-theme {
  border: 1px solid var(--line); background: var(--s-raised); color: var(--ink-3);
  width: 30px; height: 30px; border-radius: var(--r-pill); padding: 0;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.mt-theme:hover { color: var(--accent-text); border-color: var(--accent-ring); }

.mt-nav-search { position: relative; padding: 13px 14px 9px; }
.mt-nav-search input {
  width: 100%; font-size: var(--fs-sm); padding: 9px 34px 9px 12px;
  background: var(--s-raised); border-radius: var(--r-ctl);
}
.mt-nav-search kbd {
  position: absolute; right: 23px; top: 50%; transform: translateY(-30%);
  font-size: 10px; color: var(--ink-4); border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 6px; background: var(--s-sunken); pointer-events: none;
}

.mt-nav-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.mt-nav-group { margin-bottom: 12px; }
.mt-nav-gtitle {
  font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-4); padding: 11px 10px 6px;
}
.mt-nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-ctl);
  text-decoration: none; color: var(--ink-2);
  transition: background var(--t) var(--e), color var(--t) var(--e);
}
.mt-nav-item:hover { background: var(--s-raised); color: var(--ink); }
.mt-nav-item.is-active { background: var(--accent-wash-2); color: var(--ink); font-weight: 600; }
.mt-nav-item.is-active::before {
  content: ''; position: absolute; left: -8px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-bright);
}
.mt-nav-code {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--ink-4); min-width: 30px;
}
.mt-nav-item.is-active .mt-nav-code, .mt-nav-item:hover .mt-nav-code { color: var(--accent-text); }
.mt-nav-name { font-size: var(--fs-sm); flex: 1; line-height: 1.3; }
.mt-nav-fav {
  opacity: 0; border: 0; background: none; color: var(--ink-4); padding: 2px;
  font-size: 12px; line-height: 1; transition: opacity var(--t) var(--e), color var(--t) var(--e);
}
.mt-nav-item:hover .mt-nav-fav { opacity: .5; }
.mt-nav-fav.on { opacity: 1; color: var(--accent); }
.mt-nav-fav:hover { opacity: 1 !important; color: var(--accent); }

.mt-nav-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; border-top: 1px solid var(--line);
  font-size: var(--fs-micro); color: var(--ink-4);
}
.mt-nav-foot kbd {
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; background: var(--s-raised);
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
.mt-top {
  position: fixed; top: 0; left: var(--nav-w); right: 0; height: 52px; z-index: 890;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: color-mix(in srgb, var(--s-canvas) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.mt-burger { display: none; border: 0; background: none; font-size: 17px; color: var(--ink-2); }
.mt-crumb { display: flex; align-items: center; gap: 9px; }
.mt-crumb-g {
  font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
}
.mt-crumb-sep { color: var(--ink-4); }
.mt-crumb-n { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.02em; color: var(--ink); }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  body.mt-has-shell { padding-left: 0; }
  .mt-top { left: 0; }
  .mt-burger { display: block; }
  .mt-nav { transform: translateX(-100%); transition: transform var(--t-2) var(--e); box-shadow: var(--sh-3); }
  .mt-nav-open .mt-nav { transform: none; }
}

/* controls lifted out of the retired legacy bar */
.mt-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mt-top-actions > * {
  position: static !important; margin: 0 !important;
  width: 32px; height: 32px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--s-raised); color: var(--ink-3);
  display: grid !important; place-items: center; cursor: pointer;
}
.mt-top-actions > *:hover { color: var(--accent); border-color: var(--accent-ring); }
.mt-top-actions svg { width: 15px; height: 15px; }

/* ── measured a11y/legibility fixes ──────────────────────────────────────
   Audited at 1440px: 64 nav codes at 9.5px, stat labels at 8.5px, number
   inputs 23px tall. Below the ~10.5px / 28px floors people can comfortably
   read and hit. */
.mt-nav-code { font-size: 10.5px; min-width: 34px; }
.mt-nav-gtitle { font-size: 10.5px; }
.mt-nav-item { padding: 9px 10px; }
.stat .k, .k { font-size: 10px !important; letter-spacing: .1em; }
.lbl { font-size: 10px; }
input, select, button, .seg button { min-height: 30px; }
.num, input.num { min-height: 30px; height: auto; }
/* fav star is a hover affordance inside a 38px row — the row is the hit area,
   so it gets padding rather than its own 28px box */
.mt-nav-fav { padding: 6px; margin: -6px; }

/* sidebar earns its place down to 960px, not 1080 */
@media (min-width: 961px) and (max-width: 1080px) {
  body.mt-has-shell { padding-left: var(--nav-w); }
  .mt-top { left: var(--nav-w); }
  .mt-burger { display: none; }
  .mt-nav { transform: none; box-shadow: none; }
}

/* ══ discipline pass ═══════════════════════════════════════════════════════
   The audit found 11 type sizes (down to 6px), 14 spacing values and 7 radii
   on a single screen. The tokens existed; pages predating them did not use
   them. Rather than edit 76 stylesheets, the vocabulary is clamped here.
   Minimalism is subtraction: fewer sizes, one rhythm, three shapes. */

/* — type: floor at 11px, snap the strays — */
[style*="font-size:6"], [style*="font-size:7"], [style*="font-size: 6"], [style*="font-size: 7"] {
  font-size: 11px !important;
}
.kt-panel-header, .panel-header, .lbl, .stat .k, .k,
.mt-nav-gtitle, .mt-crumb-g, thead th, .eyebrow {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
}
/* anything the pages set below the floor comes back up to it */
body, td, th, p, span, div, li, a, label, button, input, select { font-size: inherit; }
table, tbody td { font-size: 12.5px; }
.mt-nav-name, .kt-label { font-size: 13px; }

/* — one section-heading treatment, so panels stop competing with their data — */
h1, .mt-crumb-n { font-size: 19px; font-weight: 600; letter-spacing: -.022em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; }
h3, h4, h5, h6 { font-size: 13px; font-weight: 600; }

/* — shape: three radii, nothing else — */
.pill, .chip, .kt-pill, .kt-chip, .badge, [class*="pill"], [class*="badge"],
.mt-theme, .mt-nav-search kbd, .mt-nav-foot kbd { border-radius: 100px; }
.kt-panel, .panel, .card, .kt-card, .kt-result-main, .kt-chart-card,
[class*="-panel"], [class*="-card"], .modal, .kt-modal, .sheet { border-radius: 14px; }
button, .btn, .kt-btn, .kt-btn-main, input, select, textarea,
.seg, .seg button, .mt-nav-item { border-radius: 8px; }

/* — weight: three, not five — */
[style*="font-weight:800"], [style*="font-weight: 800"],
[style*="font-weight:900"], [style*="font-weight: 900"] { font-weight: 600 !important; }

/* — skip link: invisible until tabbed to — */
.mt-skip {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  text-decoration: none; transition: top var(--t) var(--e);
}
.mt-skip:focus { top: 8px; }

/* — sort affordance — */
thead th[data-k] { position: relative; padding-right: 20px !important; }
thead th[data-k]::after {
  content: '↕'; position: absolute; right: 7px; opacity: .25; font-size: 9px;
}
thead th[aria-sort="ascending"]::after  { content: '↑'; opacity: 1; color: var(--accent-text); }
thead th[aria-sort="descending"]::after { content: '↓'; opacity: 1; color: var(--accent-text); }

/* — search empty state — */
.mt-nav-empty {
  margin: 18px 12px; padding: 14px; text-align: center;
  font-size: 12.5px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: 8px;
}

/* — mobile: tell people the row continues sideways — */
@media (max-width: 1080px) {
  #wrap, .kt-table-wrap, #toolbar, #stats {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .mt-nav { box-shadow: var(--sh-3); }
  /* drawer backdrop — clicking it closes, and it dims what it covers */
  .mt-nav-open body.mt-has-shell::after {
    content: ''; position: fixed; inset: 0; z-index: 880;
    background: color-mix(in srgb, var(--ink) 34%, transparent);
  }
}

/* ══ numbers are the hero ══════════════════════════════════════════════════
   The critique's second test: can a number be read in 200ms? It could not —
   data sat at the same size and weight as its labels, and labels were louder
   (11px, 2.5px tracking) than the figures they described. */

table, tbody td { font-size: 13px; }
tbody td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'zero' 1;
  color: var(--ink);
  letter-spacing: -.01em;
}
/* the first column is identity, the rest are quantities */
tbody td:not(:first-child) { font-weight: 500; }

/* Labels step back: smaller tracking, dimmer, never competing with a figure. */
thead th, .kt-panel-header, .panel-header, .lbl, .stat .k, .k,
.mt-nav-gtitle, .mt-crumb-g, .eyebrow {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-3);
  font-weight: 500;
}
.stat .v { font-size: 17px; font-weight: 600; letter-spacing: -.02em;
           font-variant-numeric: tabular-nums; }

/* Direction carries colour; the figure stays legible. */
.up, td.up, .pill.up   { color: var(--up); }
.down, td.down, .pill.down { color: var(--down); }

/* ══ empty states read as instruments, not as blank documents ═════════════ */
#empty, .kt-empty, [class*="-empty"], .hs-movers-state {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px,
      var(--line-2) 27px 28px);
  color: var(--ink-3);
  min-height: 140px;
}
/* skeleton rows so a waiting table still looks like a table */
@keyframes mt-sk { 0%,100% { opacity:.35 } 50% { opacity:.7 } }
.mt-skeleton td {
  color: transparent !important;
}
.mt-skeleton td::after {
  content: ''; display: block; height: 9px; border-radius: 3px;
  background: var(--line-solid); animation: mt-sk 1.4s var(--e) infinite;
}
.mt-skeleton td:first-child::after { width: 68%; }
.mt-skeleton td::after { width: 42%; margin-left: auto; }

/* ══ Messari component language ════════════════════════════════════════════
   Pure visual wrapper: every rule below targets classes the pages already
   emit. No markup, no props, no data keys are touched. */

/* ── panels: recessed card, hairline border, no shadow ─────────────────── */
.kt-panel, .panel, .card, .kt-card, .kt-result-main, .kt-chart-card,
[class*="-panel"], [class*="-card"], #stats, #wrap {
  background: var(--s-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: none;
}

/* Panel header: title left, controls right, hairline under. */
.kt-panel-header, .panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;          /* Messari uses sentence case, not caps */
  color: var(--ink);
}

/* ── stat blocks: label above, figure below, delta beside ──────────────── */
#stats { display: flex; gap: 0; }
.stat {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  min-width: 128px;
}
.stat .k {
  font-size: 11px; font-weight: 400; letter-spacing: 0;
  text-transform: none; color: var(--ink-3);
}
.stat .v {
  font-size: 20px; font-weight: 600; letter-spacing: -.02em;
  margin-top: 3px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── tables: dense rows, hairline rules, hover lift ────────────────────── */
table { border-collapse: collapse; width: 100%; }
thead th {
  background: var(--s-sunken) !important;
  color: var(--ink-3) !important;
  font-family: var(--sans);
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--line) !important;
}
tbody td {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--line-2) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  color: var(--ink);
}
tbody tr:hover { background: var(--s-raised-2) !important; }
tbody td:first-child { color: var(--ink); font-weight: 500; }

/* ── timeframe pills — the 12H 1D 1W 1M row ────────────────────────────── */
.seg {
  display: inline-flex; gap: 0; padding: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-ctl); overflow: hidden;
}
.seg button {
  border: 0; border-right: 1px solid var(--line);
  background: transparent; color: var(--ink-3);
  padding: 5px 11px; font-size: 11px; font-weight: 500; border-radius: 0;
  min-height: 26px;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--s-raised-2); color: var(--ink); }
.seg button.on {
  background: var(--s-raised-2) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  box-shadow: none;
}

/* ── buttons ───────────────────────────────────────────────────────────── */
button, .btn, .kt-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--r-ctl);
  min-height: 30px;
}
button:not(:disabled):hover, .btn:not(:disabled):hover {
  background: var(--s-raised-2); border-color: var(--ink-4); color: var(--ink);
}
.kt-btn-main, .btn.primary, button.primary, .filter-btn.active {
  background: var(--accent) !important; border-color: var(--accent) !important;
  color: #fff !important; font-weight: 600;
}
.kt-btn-main:hover, .btn.primary:hover { background: var(--accent-bright) !important; }

/* ── inputs ────────────────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--s-sunken); border: 1px solid var(--line);
  border-radius: var(--r-ctl); color: var(--ink);
  font-size: 12px; padding: 6px 10px;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: none; }

/* ── tabs: underline, sentence case ────────────────────────────────────── */
.kt-main-tab, .kt-tab, .hs-movers-tab {
  font-size: 12px; font-weight: 500; padding: 9px 13px;
  color: var(--ink-3); text-transform: none; letter-spacing: 0;
}
.kt-main-tab::after, .kt-tab::after, .hs-movers-tab::after { background: var(--accent); }
.kt-main-tab.kt-main-active, .kt-tab.kt-active, .hs-movers-tab.active { color: var(--ink) !important; }

/* ── direction ─────────────────────────────────────────────────────────── */
.up, td.up { color: var(--up); }
.down, td.down { color: var(--down); }
.pill { border-radius: var(--r-ctl); font-size: 10.5px; font-weight: 600; padding: 2px 7px; }
.pill.up { background: var(--up-wash); color: var(--up); }
.pill.down { background: var(--down-wash); color: var(--down); }

/* ── shell chrome follows the same language ────────────────────────────── */
.mt-nav { background: var(--s-canvas); border-right: 1px solid var(--line); }
.mt-nav-head { border-bottom: 1px solid var(--line); padding: 14px 16px; }
.mt-brand-t { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.mt-brand-dot { background: var(--accent); box-shadow: none; width: 9px; height: 9px; }
.mt-nav-item { border-radius: var(--r-ctl); padding: 6px 10px; }
.mt-nav-item:hover { background: var(--s-raised-2); }
.mt-nav-item.is-active { background: var(--s-raised-2); color: var(--ink); font-weight: 500; }
.mt-nav-item.is-active::before { background: var(--accent); }
.mt-nav-code { color: var(--ink-4); font-family: var(--mono); font-size: 10px; }
.mt-nav-item.is-active .mt-nav-code, .mt-nav-item:hover .mt-nav-code { color: var(--accent-text); }
.mt-nav-name { font-size: 12.5px; }
.mt-nav-gtitle { font-size: 10.5px; color: var(--ink-4); letter-spacing: .04em; }
.mt-top {
  background: var(--s-canvas); border-bottom: 1px solid var(--line);
  backdrop-filter: none; height: 48px;
}
.mt-crumb-n { font-size: 15px; font-weight: 600; }
.mt-crumb-g { font-size: 11px; color: var(--ink-3); letter-spacing: 0; text-transform: none; }

/* ── sector chips, fed by the Messari taxonomy ─────────────────────────── */
.mt-sector {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: 3px;
  background: var(--s-raised-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
