/* ============================================================================
   DEGENA design system v2 — tokens + components (full redesign, 2026-07-10)
   Near-black graphite · warm off-white · electric green actions · gold = KOTH only.
   Self-hosted fonts, zero external requests. Hierarchy works with glow removed.
   ============================================================================ */

/* ---- fonts (self-hosted) --------------------------------------------------- */
@font-face { font-family: 'Neue Montreal'; src: url('/assets/fonts/NeueMontreal-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Neue Montreal'; src: url('/assets/fonts/NeueMontreal-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Neue Montreal'; src: url('/assets/fonts/NeueMontreal-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Proxima Nova'; src: url('/assets/fonts/Proxima Nova Font.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inconsolata'; src: url('/assets/fonts/Inconsolata-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inconsolata'; src: url('/assets/fonts/Inconsolata-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inconsolata'; src: url('/assets/fonts/Inconsolata-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* ---- tokens ---------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg-0: #07090B;          /* page */
  --bg-1: #0C0F13;          /* card */
  --bg-2: #12161C;          /* raised / input */
  --bg-3: #1A2028;          /* hover */
  --line: #1D242D;          /* hairline */
  --line-2: #2B3440;        /* strong */
  /* text (warm off-white ramp) */
  --tx-1: #F4F1EA;
  --tx-2: #A9B1BB;
  --tx-3: #77828F;
  --tx-lbl: #8B95A3;        /* data labels — higher contrast than tx-3 */
  /* brand + semantics */
  --green: #00FFA3;
  --green-2: #46FFBE;
  --green-deep: #00C97F;
  --green-ink: #041710;     /* text on green */
  --red: #FF5C72;
  --gold: #FFC24B;          /* KOTH + milestones ONLY */
  --gold-2: #FFE08F;
  --amber: #FFB020;         /* bonding stage */
  --violet: #A78BFA;        /* graduated stage */
  /* type */
  --f-body: 'Proxima Nova', 'Neue Montreal', -apple-system, 'Segoe UI', sans-serif;
  --f-head: 'Neue Montreal', 'Proxima Nova', sans-serif;
  --f-mono: 'Inconsolata', ui-monospace, 'SF Mono', monospace;
  /* geometry */
  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px -12px rgba(0,0,0,.55);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5), 0 18px 48px -18px rgba(0,0,0,.65);
  --ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--green-deep);
  /* shell */
  --bar-h: 64px;
  --mobnav-h: 60px;
}

/* ---- base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; }
body {
  margin: 0; color: var(--tx-1);
  background:
    radial-gradient(1000px 520px at 88% -140px, rgba(0,255,163,.05), transparent 62%),
    radial-gradient(900px 560px at -140px 104%, rgba(255,176,32,.028), transparent 62%),
    var(--bg-0);
  background-attachment: fixed;
  font: 400 15px/1.5 var(--f-body); letter-spacing: .1px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 700; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--tx-1); }
code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
::selection { background: rgba(0,255,163,.22); }
:focus { outline: none; }
:focus-visible { box-shadow: var(--ring); border-radius: var(--r-s); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-track { background: transparent; }

/* utilities */
.dim { color: var(--tx-3); }
.sub { color: var(--tx-2); }
.up { color: var(--green); }
.down { color: var(--red); }
.gold { color: var(--gold); }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wrap { max-width: 1760px; margin: 0 auto; padding: 0 clamp(14px, 2.4vw, 44px); }
.copyable { cursor: copy; }
.no-usd { color: var(--tx-3); font-size: 11.5px; }
/* ETH unit icon — a real ether diamond (masked, inherits currentColor), never mistakable
   for a menu glyph. Title attr carries the unit for screen readers / hover. */
.eth {
  display: inline-block; width: 8px; height: 12.5px; margin-right: 4.5px; vertical-align: -1px;
  background: currentColor; opacity: .72;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 19'><path d='M6 0l5.8 9.7L6 13.2.2 9.7z'/><path opacity='.65' d='M6 14.4l5.8-3.5L6 19 .2 10.9z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 19'><path d='M6 0l5.8 9.7L6 13.2.2 9.7z'/><path opacity='.65' d='M6 14.4l5.8-3.5L6 19 .2 10.9z'/></svg>") center / contain no-repeat;
}
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font: 600 14.5px/1 var(--f-body); letter-spacing: .1px;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-green { background: var(--green); color: var(--green-ink); font-weight: 700; }
.btn-green:hover:not([disabled]) { background: var(--green-2); box-shadow: 0 4px 22px -6px rgba(0,255,163,.45); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #E8A62E); color: #241703; font-weight: 700; }
.btn-gold:hover:not([disabled]) { box-shadow: 0 4px 22px -6px rgba(255,194,75,.45); }
.btn-red { background: var(--red); color: #1C0308; font-weight: 700; }
.btn-red:hover:not([disabled]) { background: #FF7A8C; }
.btn-outline { background: var(--bg-2); border-color: var(--line-2); color: var(--tx-1); }
.btn-outline:hover:not([disabled]) { background: var(--bg-3); border-color: #39434F; }
.btn-ghost { background: transparent; color: var(--tx-2); }
.btn-ghost:hover:not([disabled]) { background: var(--bg-2); color: var(--tx-1); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; color: var(--tx-3);
  transition: background .15s, color .15s; flex: 0 0 auto;
}
.iconbtn:hover { background: var(--bg-3); color: var(--tx-1); }

/* ---- badges / chips ---------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font: 600 11.5px/1 var(--f-body); letter-spacing: .3px;
  background: var(--bg-3); color: var(--tx-2); border: 1px solid var(--line-2);
  white-space: nowrap; vertical-align: middle;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); background: rgba(0,255,163,.09); border-color: rgba(0,255,163,.25); }
.badge.gold { color: var(--gold); background: rgba(255,194,75,.09); border-color: rgba(255,194,75,.3); }
.badge.amber { color: var(--amber); background: rgba(255,176,32,.09); border-color: rgba(255,176,32,.3); }
.badge.violet { color: var(--violet); background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.3); }
.badge.red { color: var(--red); background: rgba(255,92,114,.09); border-color: rgba(255,92,114,.3); }
.badge.route { color: var(--tx-2); background: rgba(5,7,9,.62); border-color: var(--line-2); backdrop-filter: blur(4px); }

/* filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--tx-2);
  font: 600 13.5px/1 var(--f-body); display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.chip:hover { background: var(--bg-3); color: var(--tx-1); }
.chip.active { background: var(--tx-1); border-color: var(--tx-1); color: var(--bg-0); }
.chip .n { font-family: var(--f-mono); font-size: 12px; opacity: .75; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  height: 30px; padding: 0 13px; border-radius: 7px; color: var(--tx-3);
  font: 600 13px/1 var(--f-body); transition: background .13s, color .13s;
}
.seg button:hover { color: var(--tx-1); }
.seg button.active { background: var(--bg-3); color: var(--tx-1); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.seg.green button.active { background: rgba(0,255,163,.13); color: var(--green); }

/* view toggle (grid/table) */
.viewtog { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.viewtog button { width: 34px; height: 30px; border-radius: 7px; color: var(--tx-3); display: grid; place-items: center; }
.viewtog button.active { background: var(--bg-3); color: var(--green); }

/* ---- cards ------------------------------------------------------------------- */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
/* premium depth: gradient hairline + top light-catch, still legible with glow removed */
.lux {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(165deg, rgba(255,255,255,.14), rgba(255,255,255,.03) 34%, rgba(0,255,163,.10) 88%) border-box;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.045);
}
.card-p { padding: 20px; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-hd h3 { font-size: 16.5px; font-weight: 700; }
.tag { font: 500 12px/1 var(--f-mono); color: var(--tx-3); background: var(--bg-2); padding: 4px 8px; border-radius: 6px; }

/* ---- inputs ------------------------------------------------------------------ */
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--tx-1);
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--tx-3); }
.input:focus { border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(0,255,163,.12); }
.input.invalid { border-color: var(--red); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .suffix { position: absolute; right: 13px; color: var(--tx-3); font: 600 13px/1 var(--f-mono); pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font: 600 13.5px/1 var(--f-body); color: var(--tx-2); }
.hint { font-size: 12.5px; color: var(--tx-3); }
.hint.err, .err { color: var(--red); font-size: 12.5px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--tx-3); }
.kv b { font-family: var(--f-mono); font-weight: 500; }

/* ---- progress ------------------------------------------------------------------ */
.prog { height: 7px; border-radius: 99px; background: var(--bg-3); overflow: hidden; position: relative; }
.prog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-deep), var(--green)); transition: width .5s cubic-bezier(.3,.7,.3,1); min-width: 3px; }
.prog.gold i { background: linear-gradient(90deg, #D98E1B, var(--gold), var(--gold-2)); }
.prog.thin { height: 4px; }
.buypressure { height: 4px; border-radius: 99px; background: rgba(255,92,114,.4); overflow: hidden; width: 64px; }
.buypressure i { display: block; height: 100%; background: var(--green-deep); }

/* ---- avatar / identicon ---------------------------------------------------------- */
.ava {
  position: relative; width: 40px; height: 40px; border-radius: 26%;
  display: grid; place-items: center; flex: 0 0 auto; overflow: hidden;
  font: 700 15px/1 var(--f-head); color: rgba(255,255,255,.92);
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.09);
  background: var(--bg-3);
}
.ava::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(120% 90% at 20% 12%, rgba(255,255,255,.28), transparent 42%); pointer-events: none; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- tables ------------------------------------------------------------------------ */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-1); box-shadow: var(--shadow-1); }
table.dt { width: 100%; border-collapse: collapse; min-width: 980px; }
.dt thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg-1);
  font: 600 12px/1 var(--f-body); letter-spacing: .07em; text-transform: uppercase; color: var(--tx-3);
  text-align: right; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.dt thead th.l, .dt td.l { text-align: left; }
.dt tbody td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line); font-size: 15px; white-space: nowrap; }
.dt tbody tr { cursor: pointer; transition: background .12s; }
.dt tbody tr:hover { background: var(--bg-2); }
.dt tbody tr:last-child td { border-bottom: 0; }
.pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pair .sym { font-weight: 700; font-size: 15px; }
.pair .sym .q { color: var(--tx-3); font-weight: 500; font-size: 12.5px; }
.pair .nm { color: var(--tx-3); font-size: 12.5px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- stat tiles ---------------------------------------------------------------------- */
.stat { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; min-width: 0; }
.stat-l { font: 600 11.5px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-lbl); margin-bottom: 8px; display: flex; gap: 5px; align-items: center; }
.stat-v { font-size: 21px; font-weight: 700; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.stat-s { font-size: 12px; margin-top: 5px; }

/* ---- skeletons -------------------------------------------------------------------------- */
.skel { background: linear-gradient(100deg, var(--bg-2) 40%, var(--bg-3) 50%, var(--bg-2) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- toasts -------------------------------------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-2); animation: toastin .22s cubic-bezier(.3,1.3,.5,1); cursor: pointer;
}
.toast .ic { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.toast.ok .ic { color: var(--green); } .toast.err .ic { color: var(--red); } .toast.info .ic { color: var(--tx-2); }
.toast .t { font-weight: 700; font-size: 14px; }
.toast .d { color: var(--tx-3); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.toast .d a { color: var(--green); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ---- overlays: scrim / drawer / dialog -------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(3,5,7,.66); backdrop-filter: blur(2px); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 96vw); z-index: 80;
  background: var(--bg-1); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.3,.9,.3,1); overflow-y: auto;
}
.drawer.open { transform: none; }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-hd h3 { font-size: 17px; }
.dialog { position: fixed; inset: 0; z-index: 82; display: grid; place-items: center; padding: 18px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.dialog.open { opacity: 1; pointer-events: auto; }
.dialog .box { width: min(440px, 100%); background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-l); box-shadow: var(--shadow-2); transform: scale(.97); transition: transform .18s; }
.dialog.open .box { transform: none; }

/* ---- tooltips ------------------------------------------------------------------------------------ */
.tip { position: relative; cursor: help; color: var(--tx-3); }
.tip:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--tx-1);
  padding: 7px 11px; border-radius: 8px; font: 400 12px/1.45 var(--f-body);
  width: max-content; max-width: 240px; z-index: 30; box-shadow: var(--shadow-2); white-space: normal;
}

/* ---- empty / error states -------------------------------------------------------------------------- */
.state { text-align: center; padding: 48px 22px; color: var(--tx-2); }
.state .ic { font-size: 30px; margin-bottom: 12px; opacity: .85; }
.state h3 { font-size: 19px; margin-bottom: 8px; color: var(--tx-1); }
.state p { margin: 0 auto 16px; max-width: 460px; font-size: 14.5px; color: var(--tx-3); line-height: 1.55; }

/* ---- tx status box ------------------------------------------------------------------------------------ */
.txstatus { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 13.5px; background: var(--bg-2); border: 1px solid var(--line-2); }
.txstatus.ok { border-color: rgba(0,255,163,.35); background: rgba(0,255,163,.07); }
.txstatus.err { border-color: rgba(255,92,114,.4); background: rgba(255,92,114,.07); }
.txstatus .tx-ic { flex: 0 0 auto; font-weight: 800; margin-top: 1px; }
.txstatus.ok .tx-ic { color: var(--green); } .txstatus.err .tx-ic { color: var(--red); }
.txstatus .tx-msg { font-weight: 600; }
.txstatus .tx-hash { color: var(--tx-3); font-size: 12px; margin-top: 3px; }

/* ==================================================================================================
   APP SHELL — top bar (desktop) + bottom tab bar (mobile)
   ================================================================================================== */
.appbar {
  position: sticky; top: 0; z-index: 60; height: var(--bar-h);
  background: color-mix(in srgb, var(--bg-0) 86%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.appbar .wrap { display: flex; align-items: center; gap: 18px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 21px/1 var(--f-head); letter-spacing: .02em; color: var(--tx-1); flex: 0 0 auto; }
.brand .mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(150deg, #0F1E18, #081009); border: 1px solid rgba(0,255,163,.35); box-shadow: 0 0 18px -4px rgba(0,255,163,.5); flex: 0 0 auto; }
.brand .mark svg { width: 21px; height: 21px; display: block; }
.navlinks { display: flex; gap: 4px; }
.navlinks a { padding: 9px 15px; border-radius: 9px; color: var(--tx-2); font: 600 15px/1 var(--f-body); transition: background .14s, color .14s; }
.navlinks a:hover { color: var(--tx-1); background: var(--bg-2); }
.navlinks a.active { color: var(--tx-1); background: var(--bg-3); }
.search {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--tx-3); flex: 1 1 460px; max-width: 560px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(0,255,163,.1); color: var(--tx-2); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 14.5px; color: var(--tx-1); }
.search input::placeholder { color: var(--tx-3); }
.search kbd { font: 600 11px/1 var(--f-mono); background: var(--bg-3); border: 1px solid var(--line-2); padding: 4px 6px; border-radius: 5px; color: var(--tx-3); }
.chain-pill { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font: 600 13px/1 var(--f-body); color: var(--tx-2); flex: 0 0 auto; }
.chain-pill .rh { width: 9px; height: 9px; border-radius: 3px; background: linear-gradient(135deg, #B7F7C6, #29CC6A); }
.sync { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font: 500 12.5px/1 var(--f-mono); color: var(--tx-3); white-space: nowrap; flex: 0 0 auto; }
.sync.live { color: var(--green); border-color: rgba(0,255,163,.28); background: rgba(0,255,163,.06); }
.sync .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(0,255,163,.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(0,255,163,0); } 100% { box-shadow: 0 0 0 0 rgba(0,255,163,0); } }
.sync .ring { width: 15px; height: 15px; }
.wdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 2px; }

/* mobile bottom tab bar */
.mobnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
  height: calc(var(--mobnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-1) 92%, transparent);
  backdrop-filter: blur(16px); border-top: 1px solid var(--line-2);
}
.mobnav .items { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--mobnav-h); }
.mobnav a, .mobnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tx-3); font: 600 10.5px/1 var(--f-body); letter-spacing: .02em; }
.mobnav a.active { color: var(--green); }
.mobnav svg { width: 21px; height: 21px; }
.mobnav .launchfab { position: relative; }
.mobnav .launchfab .fab {
  position: absolute; top: -18px; width: 46px; height: 46px; border-radius: 15px;
  background: var(--green); color: var(--green-ink); display: grid; place-items: center;
  box-shadow: 0 6px 20px -4px rgba(0,255,163,.55); border: 4px solid var(--bg-0);
}
.mobnav .launchfab span { margin-top: 24px; }

/* ---- page scaffolding ------------------------------------------------------------ */
.page { padding-top: clamp(16px, 2.2vw, 28px); padding-bottom: 72px; }
/* inline info hint (font-safe, no unicode glyph) */
.inf { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line-2); font: 700 9px/1 var(--f-mono); color: var(--tx-3); margin-left: 4px; vertical-align: 1px; }
.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.02em; }
.page-sub { color: var(--tx-3); margin: 6px 0 0; font-size: 14.5px; max-width: 640px; }
.section { margin-top: clamp(22px, 2.6vw, 34px); }
.section-hd { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-hd h2 { font-size: clamp(19px, 1.7vw, 23px); letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.backlink { color: var(--tx-3); font-size: 13.5px; display: inline-block; margin-bottom: 12px; }
.backlink:hover { color: var(--tx-1); }

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

/* ---- shell responsiveness ----------------------------------------------------------- */
@media (max-width: 1180px) { .navlinks a { padding: 9px 11px; font-size: 14px; } .search { flex-basis: 300px; } }
@media (max-width: 980px) {
  .navlinks, .chain-pill, .hide-m { display: none; }
  .mobnav { display: block; }
  body { padding-bottom: calc(var(--mobnav-h) + env(safe-area-inset-bottom)); }
  .search { flex: 1; max-width: none; }
  .search kbd { display: none; }
  .appbar .wrap { gap: 10px; }
  .brand .txt { display: none; }   /* icon-only brand on small screens */
  .sync { padding: 0 10px; font-size: 11.5px; }
}
@media (max-width: 560px) {
  .sync { display: none; }
  .btn-lg { height: 46px; }
}
