/* ═══════════════════════════════════════════════════════════
   TOKENSHARE — market prototype
   dark infra-dashboard theme · zero external assets
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #07090d;
  --bg-2:      #0b0f15;
  --panel:     #0d1219;
  --line:      #1b2431;
  --line-hi:   #2c3a4c;
  --text:      #d5dde6;
  --dim:       #7c8896;
  --faint:     #727e8b;
  --green:     #3ddc97;
  --green-dim: #1d5c43;
  --amber:     #e8b44a;
  --red:       #e06c60;
  --base-blue: #4e7cff;
  --monad-vi:  #9d8cff;
  /* surface/overlay/ink tokens — re-inked by the light palette below */
  --term-bg:   #05070a;
  --topbar-bg: rgba(7, 9, 13, 0.85);
  --overlay-bg: rgba(4, 6, 9, 0.72);
  --grid-line: rgba(120, 150, 190, 0.045);
  --scanline:  rgba(255, 255, 255, 0.022);
  --t-s:       #8fb8ff;
  --sm-line:   #5b6b7d;
  --shadow-term:  0 0 0 1px rgba(0,0,0,0.4), 0 24px 60px -30px rgba(0,0,0,0.8);
  --shadow-modal: 0 0 0 1px rgba(0,0,0,0.4), 0 30px 80px -20px rgba(0,0,0,0.9);
  --shadow-drop:  0 18px 44px rgba(0,0,0,0.6);
  color-scheme: dark;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* utility-class display rules must never resurrect hidden elements */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint blueprint grid over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

main, .topbar, .footer { position: relative; z-index: 1; }

::selection { background: rgba(61, 220, 151, 0.25); }

a { color: inherit; text-decoration: none; }
a:focus-visible, [tabindex]:focus-visible { outline: 1px solid var(--green); outline-offset: 3px; }

code, pre, .mono { font-family: var(--mono); }

/* long prose must wrap, never clip */
p, .lede, .sec-sub, .kicker, .tagline { overflow-wrap: break-word; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ── reveal on scroll ─────────────────────────────────────── */
/* hidden start state only when JS is present to reveal them;
   no-JS keeps every element visible (html.js is set by app.js) */
html.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0s); }
html.js .rv.in { opacity: 1; transform: none; }

/* ═══ LIGHT MODE — system-following (prefers-color-scheme) ═══
   same terminal layout, re-inked for daylight: paper-gray surfaces,
   deep-ink text, accents darkened to hold AA contrast. flipping the OS
   appearance re-themes the page live — no toggle, no JS, no storage */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg:        #f1f4f7;
    --bg-2:      #e7ecf1;
    --panel:     #fbfcfd;
    --line:      #d2dae2;
    --line-hi:   #aeb9c5;
    --text:      #17202b;
    --dim:       #46545f;
    --faint:     #5e6a77;
    --green:     #0a7a4f;
    --green-dim: #75b29b;
    --amber:     #8f6104;
    --red:       #b3261e;
    --base-blue: #2f52c8;
    --monad-vi:  #6a4fd0;
    --term-bg:   #eef1f4;
    --topbar-bg: rgba(241, 244, 247, 0.85);
    --overlay-bg: rgba(226, 232, 238, 0.72);
    --grid-line: rgba(55, 75, 100, 0.05);
    --scanline:  rgba(23, 32, 43, 0.03);
    --t-s:       #3558b8;
    --sm-line:   #75828f;
    --shadow-term:  0 0 0 1px rgba(23,32,43,0.05), 0 20px 44px -26px rgba(23,32,43,0.25);
    --shadow-modal: 0 0 0 1px rgba(23,32,43,0.05), 0 26px 64px -20px rgba(23,32,43,0.3);
    --shadow-drop:  0 14px 34px rgba(23,32,43,0.16);
  }
}

/* ═══ TOP BAR ═══ */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.brand { font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; font-weight: 700; }
.brand::before { content: "▮ "; color: var(--green); }
.brand-dim { color: var(--faint); font-weight: 400; }
.topnav { display: flex; gap: 22px; }
.topnav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--dim);
  padding: 4px 2px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.topnav a:hover { color: var(--green); border-bottom-color: var(--green); }

/* current-page marker — exactly one boxed [ X ] per page, paired with
   aria-current="page" (green; POLICY keeps its amber risk identity) */
.topnav a.nav-current {
  color: var(--green); border: 1px solid var(--green-dim); padding: 4px 10px;
}
.topnav a.nav-current:hover { background: rgba(61,220,151,0.08); box-shadow: 0 0 14px rgba(61,220,151,0.15); border-bottom-color: var(--green-dim); }
.topnav a.nav-policy.nav-current { color: var(--amber); border-color: rgba(232,180,74,0.4); font-size: 11px; }
.topnav a.nav-policy.nav-current:hover { color: var(--amber); border-color: var(--amber); background: rgba(232,180,74,0.06); box-shadow: 0 0 14px rgba(232,180,74,0.12); }

/* ═══ CHAPTER STRIP — landing-only second header row (index.html) ═══
   numbered like the sections (01–04); the scrollspy in app.js marks the
   visible chapter with aria-current="location" on these links only —
   the global nav above is never touched */
.chapternav { border-top: 1px solid var(--line); }
.chapternav-in {
  display: flex; gap: 26px; align-items: baseline;
  overflow-x: auto; scrollbar-width: none;
  padding-top: 2px; padding-bottom: 2px; /* room for the focus ring (overflow clips it) */
}
.chapternav-in::-webkit-scrollbar { display: none; }
.chapternav a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  color: var(--dim); white-space: nowrap; flex: none;
  padding: 8px 0 7px; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.chapternav a:hover { color: var(--green); }
.chapternav a:focus-visible { outline-offset: 2px; }
.chapternav a .ch-num { color: var(--faint); margin-right: 7px; transition: color .2s; }
.chapternav a[aria-current="location"] { color: var(--green); border-bottom-color: var(--green); }
.chapternav a[aria-current="location"] .ch-num { color: var(--green); }

/* ═══ HERO ═══ */
.hero { padding: 96px 0 88px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start; }
/* grid items default to min-width:auto — the <pre> inside .term would
   force the column to its longest line and clip sibling text on mobile */
.hero-copy, .hero-term { min-width: 0; }

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--green); margin-bottom: 26px;
}
.kicker::before { content: "// "; color: var(--faint); }

h1 {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(3.2rem, 7.5vw, 5.6rem);
  line-height: 0.95; letter-spacing: -0.02em; color: var(--text);
}
.cursor {
  display: inline-block; width: 0.55em; height: 0.82em; margin-left: 0.12em;
  background: var(--green); vertical-align: baseline; transform: translateY(0.08em);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tagline {
  font-family: var(--mono); font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--text); margin-top: 26px; letter-spacing: 0.01em;
}
.lede { color: var(--dim); max-width: 54ch; margin-top: 16px; font-size: 15.5px; }

.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em;
  color: var(--green); border: 1px solid var(--green-dim); padding: 11px 18px;
  background: rgba(61, 220, 151, 0.06); transition: background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--green); box-shadow: 0 0 18px rgba(61, 220, 151, 0.15); background: rgba(61, 220, 151, 0.1); }
.btn-ghost { color: var(--dim); border-color: var(--line-hi); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--dim); box-shadow: none; }
/* destructive action (console deactivate) — red thin border, hover deepens */
.btn-danger { color: var(--red); border-color: rgba(224,108,96,0.4); background: rgba(224,108,96,0.05); }
.btn-danger:hover { border-color: var(--red); background: rgba(224,108,96,0.12); box-shadow: 0 0 18px rgba(224,108,96,0.15); }
.btn-danger:focus-visible { outline: 1px solid var(--red); outline-offset: 3px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, auto); gap: 0 36px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); width: fit-content;
}
.hero-stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint); margin-bottom: 6px; }
.hero-stats dd {
  font-family: var(--mono); font-size: 21px; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}

/* ═══ TERMINAL BLOCKS ═══ */
.term {
  background: var(--term-bg); border: 1px solid var(--line); position: relative; overflow: hidden;
  box-shadow: var(--shadow-term);
}
/* subtle scanlines, terminal only */
.term::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, var(--scanline) 0 1px, transparent 1px 3px);
}
.term-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-hi); }
.term-title { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 8px; letter-spacing: 0.06em; }
.term-body {
  padding: 18px; font-size: 12.5px; line-height: 1.75; color: var(--dim);
  overflow-x: auto; white-space: pre; font-variant-numeric: tabular-nums;
}
.term-cap { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 10px; letter-spacing: 0.04em; }
.term-wide { margin-top: 40px; }

.t-p { color: var(--green); }
.t-g { color: var(--green); }
.t-a { color: var(--amber); }
.t-d { color: var(--faint); }
.t-n { color: var(--text); font-variant-numeric: tabular-nums; }
.t-s { color: var(--t-s); }

/* ═══ SECTIONS ═══ */
/* two-row header on the landing page (52px global + ~38px chapter strip)
   → section anchors must clear ~91px plus breathing room */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }

.sec-head { margin-bottom: 44px; position: relative; }
.sec-head h2 {
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 0.22em;
  display: flex; align-items: center; gap: 16px; color: var(--text);
}
.sec-num { color: var(--green); }
.sec-rule { flex: 1; height: 1px; background: var(--line); max-width: 220px; }
.sec-sub { color: var(--dim); font-size: 14.5px; margin-top: 14px; max-width: 68ch; }

/* ═══ CARDS (shared) ═══ */
.card {
  background: var(--panel); border: 1px solid var(--line); position: relative;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
/* corner ticks */
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
  transition: border-color .25s;
}
.card::before { top: -1px; left: -1px; border-top: 1px solid var(--faint); border-left: 1px solid var(--faint); }
.card::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--faint); border-right: 1px solid var(--faint); }
.card:hover { border-color: var(--line-hi); box-shadow: 0 0 24px rgba(61, 220, 151, 0.06); transform: translateY(-2px); }
.card:hover::before, .card:hover::after { border-color: var(--green); }

/* ═══ MARKET ═══ */
.ticker {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); background: var(--bg-2);
  display: inline-flex; gap: 12px; align-items: baseline;
  padding: 7px 12px; margin-top: 20px; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.ticker-label { color: var(--green); font-size: 10px; letter-spacing: 0.16em; }
.ticker-label::before { content: "● "; animation: pulse 2s ease infinite; display: inline-block; }
@keyframes pulse { 50% { opacity: 0.25; } }

.listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; }
.listing, .fstep, .ffork, .feat { min-width: 0; }

.listing { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.listing.inactive { opacity: 0.55; }
.listing.inactive:hover { transform: none; box-shadow: none; border-color: var(--line); }

.ls-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ls-addr { font-family: var(--mono); font-size: 14px; color: var(--text); letter-spacing: 0.02em; }
.badge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; padding: 4px 8px;
  border: 1px solid var(--green-dim); color: var(--green); background: rgba(61,220,151,0.07);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.badge::before { content: "●"; font-size: 8px; animation: pulse 2s ease infinite; }
.badge.off { border-color: var(--line-hi); color: var(--faint); background: transparent; }
.badge.off::before { animation: none; }

.ls-endpoint {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 2px solid var(--line-hi); padding-left: 10px;
}

.ls-models { display: flex; flex-wrap: wrap; gap: 6px; }
.mtag {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); padding: 3px 8px; background: var(--bg-2);
}
/* chips grow to fill their wrap row — no ragged orphan lines */
.ls-models .mtag { flex: 1 1 auto; text-align: center; }

/* clickable model selector (v2 per-model pricing) */
.msel { cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.msel:hover { color: var(--text); border-color: var(--line-hi); }
.msel:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }
.msel[aria-pressed="true"] {
  color: var(--green); border-color: var(--green-dim);
  background: rgba(61,220,151,0.09); box-shadow: inset 0 -1px 0 var(--green-dim);
}

/* three tier cells — minmax(0,1fr) + compact type keep $x.xxxxxx inside
   the frame at the 340px card minimum (was 17px + " /1M" → overflow).
   mono advance = 0.6em: 13.5px → "$48.000000" ≈ 78px vs 84px cell content */
.ls-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.ls-price { padding: 10px 7px; text-align: left; min-width: 0; }
.ls-price + .ls-price { border-left: 1px solid var(--line); }
.ls-price .tier { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--faint); display: block; margin-bottom: 6px; }
.ls-price .usd {
  font-family: var(--mono); font-size: 13.5px; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; display: block;
  white-space: nowrap;
}
.ls-price .units { font-family: var(--mono); font-size: 8.5px; color: var(--faint); display: block; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls-prices-cap { font-family: var(--mono); font-size: 9px; color: var(--faint); letter-spacing: 0.06em; margin-top: -8px; }
.ls-prices-empty {
  border: 1px dashed var(--line); padding: 14px 10px; text-align: center;
  font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em;
}

.ls-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 6px 10px;
  flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  border-top: 1px solid var(--line); padding-top: 12px; font-variant-numeric: tabular-nums;
}

.chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; padding: 3px 7px;
  border: 1px solid; display: inline-block; white-space: nowrap;
}
.chip-base  { color: var(--base-blue); border-color: rgba(78,124,255,0.35); background: rgba(78,124,255,0.07); }
.chip-monad { color: var(--monad-vi); border-color: rgba(157,140,255,0.35); background: rgba(157,140,255,0.07); }

.mock-note { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 22px; letter-spacing: 0.06em; }
.mock-note::before { content: "note · "; color: var(--amber); }

/* ═══ FULL MARKET SUBPAGE (market.html) ═══ */
.mkt-head { margin-top: 34px; }
.mkt-stats-side dd { font-size: 13px; color: var(--dim); }

/* provenance line under the page head */
.mkt-source {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  margin: 12px 0 4px; letter-spacing: 0.03em; line-height: 1.7; cursor: help;
}
.mkt-source b { color: var(--text); font-weight: 400; }
.mkt-source.bad { color: var(--red); }

/* skeleton cards while the enumeration eth_calls resolve */
.listing.skel { gap: 14px; }
.skel-line {
  height: 13px; background: var(--bg-2); border: 1px solid var(--line);
  opacity: 0.7; animation: skelpulse 1.15s ease infinite;
}
.skel-line:nth-child(2) { animation-delay: .12s; }
.skel-line:nth-child(3) { animation-delay: .24s; }
.skel-line:nth-child(4) { animation-delay: .36s; }
@keyframes skelpulse { 50% { opacity: 0.32; } }

/* toolbar: search + sort + count + refresh */
.mkt-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0 12px; }
.f-search { flex: 1 1 260px; }
.f-sort-w { display: flex; flex-direction: column; gap: 7px; flex: none; }
.f-sort-w select { min-width: 220px; }
.f-count { font-size: 11px; color: var(--faint); letter-spacing: 0.08em; padding-bottom: 12px; flex: none; }
.mkt-toolbar .btn { flex: none; margin-bottom: 1px; }

/* model filter chips (single-select, ALL default) */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.filter-chips:empty { display: none; }
.fchip {
  font-family: var(--mono); font-size: 10.5px; color: var(--dim);
  border: 1px solid var(--line); background: var(--bg-2); padding: 4px 9px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.fchip i { font-style: normal; color: var(--faint); margin-left: 4px; font-size: 9px; }
.fchip:hover { color: var(--text); border-color: var(--line-hi); }
.fchip:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }
.fchip.on { color: var(--green); border-color: var(--green-dim); background: rgba(61,220,151,0.09); }
.fchip.on i { color: var(--green); } /* text role — green-dim fails AA on both themes */

/* pager */
.mkt-pager {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px;
}
.pg-info { font-size: 10.5px; color: var(--faint); letter-spacing: 0.1em; }

/* landing full-market entry panel (index.html, static/no-JS visible) */
.market-entry {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none;
  border: 1px dashed var(--line-hi); padding: 26px 24px; margin-top: 18px;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.market-entry-l1 {
  font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--text); display: flex; align-items: center; justify-content: space-between;
}
.market-entry-arrow { color: var(--green); font-size: 22px; transition: transform .25s; }
.market-entry-l2 { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.7; letter-spacing: 0.03em; }
.market-entry:hover { border-color: var(--green-dim); background: rgba(61,220,151,0.04); box-shadow: 0 0 24px rgba(61,220,151,0.07); }
.market-entry:hover .market-entry-arrow { transform: translateX(6px); }

@media (max-width: 700px) {
  .mkt-toolbar { align-items: stretch; }
  .f-search { flex-basis: 100%; }
  .f-sort-w { flex: 1 1 auto; }
  .f-sort-w select { min-width: 0; width: 100%; }
  .f-count { padding-bottom: 0; align-self: center; }
  .mkt-pager { flex-wrap: wrap; }
}

/* ═══ MECHANISM FLOW ═══ */
.flow {
  display: grid;
  grid-template-columns: 1fr 26px 1fr 26px 1fr 26px 1.15fr;
  align-items: stretch; gap: 0;
}
.fstep {
  background: var(--panel); border: 1px solid var(--line); padding: 20px 18px; position: relative;
  transition: border-color .25s;
}
.fstep:hover { border-color: var(--line-hi); }
.fnum {
  font-family: var(--mono); font-size: 10px; color: var(--green); letter-spacing: 0.1em;
  border: 1px solid var(--green-dim); width: 22px; height: 22px; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 14px;
}
.fstep h3 { font-family: var(--mono); font-size: 14px; letter-spacing: 0.18em; margin-bottom: 8px; }
.fstep code { font-family: var(--mono); font-size: 11px; color: var(--t-s); display: block; margin-bottom: 10px; }
.fstep p { font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.inl {
  font-family: var(--mono); font-size: 0.92em; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); padding: 0 4px;
}

.farrow { position: relative; align-self: center; height: 1px; background: var(--line-hi); }
.farrow::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border-left: 8px solid var(--line-hi); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
}

.ffork { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.fout-ok { border-color: var(--green-dim); }
.fout-ok h3 { color: var(--green); }
.fout-bad { border-color: rgba(224,108,96,0.3); }
.fout-bad h3 { color: var(--red); }
.fout-bad .fnum { color: var(--red); border-color: rgba(224,108,96,0.35); }
.ffork-split {
  font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.2em;
  text-align: center; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.ffork-split::before, .ffork-split::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ═══ STATE MACHINE ═══ */
.sm-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--bg-2); }
.sm-scroll svg { display: block; width: 100%; min-width: 760px; height: auto; }

.sm-title { font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: 0.14em; fill: var(--text); }
.sm-sub   { font-family: var(--mono); font-size: 10.5px; fill: var(--faint); }
.sm-lbl   { font-family: var(--mono); font-size: 12.5px; fill: var(--dim); }
.sm-dim   { fill: var(--faint); font-size: 11px; }

/* edge/marker paint via CSS — overrides the inline presentation attributes
   (stroke=/fill= in index.html) so the light palette can re-ink the diagram */
#smachine .edge path { stroke: var(--sm-line); }
#smachine .edge[data-touch="locked settled"] path { stroke: var(--green); }
#smachine .edge[data-touch="locked refunded"] path { stroke: var(--red); }
#smachine marker path { fill: var(--sm-line); }

.node-fill { fill: var(--panel); stroke: var(--line-hi); stroke-width: 1.25; transition: stroke .2s, filter .2s; }
.node-idle  { fill: var(--bg); }
.node-locked  { stroke: rgba(232,180,74,0.55); }
.node-settled { stroke: var(--green-dim); }
.node-refunded { stroke: rgba(224,108,96,0.45); }

.sm-node { cursor: default; transition: opacity .25s; }
.sm-node:hover .node-fill, .sm-node:focus-visible .node-fill { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(61,220,151,0.35)); }
.edge { transition: opacity .25s; }

#smachine.focus .sm-node:not(.on),
#smachine.focus .edge:not(.on) { opacity: 0.16; }
#smachine.focus .edge.on path { filter: drop-shadow(0 0 4px rgba(61,220,151,0.5)); }

.sm-list { list-style: none; margin-top: 26px; border: 1px solid var(--line); }
.sm-list li {
  display: flex; gap: 18px; align-items: baseline; padding: 10px 16px;
  font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--line);
  counter-increment: sm; position: relative;
}
.sm-list li:last-child { border-bottom: none; }
.sm-list { counter-reset: sm; }
.sm-list li::before {
  content: "0" counter(sm); font-family: var(--mono); font-size: 11px; color: var(--green); min-width: 20px;
}
.sm-list code { font-family: var(--mono); font-size: 12px; color: var(--text); min-width: 300px; }
.sm-list span { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ═══ FEATURES ═══ */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feat { padding: 26px 24px; }
.feat-wide { grid-column: 1 / -1; } /* full-width capstone row (no-op in the 1-col mobile grid) */
.fico { width: 26px; height: 26px; color: var(--green); margin-bottom: 18px; }
.feat h3 { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.2em; margin-bottom: 12px; }
.feat p { font-size: 14px; color: var(--dim); line-height: 1.65; }
.feat .chip { margin: 0 2px; }

/* ═══ FOOTER ═══ */
.footer { padding: 56px 0 44px; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.foot-brand { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: 0.14em; margin-bottom: 10px; }
.foot-brand::before { content: "▮ "; color: var(--green); }
.foot-head { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--faint); margin-bottom: 10px; }
.foot-line { font-size: 13.5px; color: var(--dim); line-height: 1.7; }
.foot-fine { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 24px; letter-spacing: 0.03em; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding: 72px 0; }

  .flow { grid-template-columns: 1fr; gap: 0; }
  .farrow { width: 1px; height: 26px; margin: 0 auto; background: var(--line-hi); }
  .farrow::after {
    right: -4px; top: auto; bottom: -1px;
    border-top: 8px solid var(--line-hi); border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-bottom: none;
  }
  .ffork { margin-top: 0; }
  .ffork-split { padding: 4px 0; }
}

@media (max-width: 700px) {
  .section { padding: 64px 0; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px 28px; width: 100%; }
  .features { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .brand-dim { display: none; }
  .listings { grid-template-columns: 1fr; }
  .sm-list code { min-width: 0; }
  .sm-list li { flex-wrap: wrap; gap: 4px 14px; }
  .hero-cta .btn { width: 100%; text-align: center; }
}

.nav-toggle {
  display: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--dim); background: none; border: 1px solid var(--line-hi);
  padding: 6px 10px; cursor: pointer; transition: color .2s, border-color .2s;
}
.nav-toggle:hover { color: var(--green); border-color: var(--green); }

@media (max-width: 560px) {
  .nav-toggle { display: block; }
  .topnav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 6px 24px 10px;
    background: var(--bg-2); border-bottom: 1px solid var(--line-hi);
  }
  .topnav.open { display: flex; }
  .topnav a { font-size: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
  .topnav a:last-child { border-bottom: none; }
  /* boxed current page stays a chip inside the dropdown column */
  .topnav a.nav-current { align-self: flex-start; padding: 8px 12px; margin: 6px 0 2px; border-bottom: 1px solid var(--green-dim); }
  .topnav a.nav-policy.nav-current { border-bottom-color: rgba(232,180,74,0.4); }
  .chapternav-in { gap: 18px; }
}

/* ═══ MARKET LIVE BAR ═══ */
.mkt-bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-top: 22px; flex-wrap: wrap;
}
.mkt-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.mkt-stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint); margin-bottom: 5px; }
.mkt-stats dd { font-family: var(--mono); font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; }
.mkt-notice {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--amber);
  border: 1px solid rgba(232,180,74,0.35); background: rgba(232,180,74,0.05);
  padding: 14px 16px; margin-bottom: 22px;
}
.mkt-notice b { color: var(--amber); }
.mkt-notice.flash-bd { animation: flashbd 0.9s ease; }
.mkt-notice .dim { color: var(--faint); display: block; margin-top: 4px; }
.ls-loading {
  grid-column: 1 / -1; font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  display: flex; align-items: center; gap: 10px; padding: 26px 4px;
}
.ls-link { color: var(--green); border-bottom: 1px dotted var(--green-dim); }
.ls-link:hover { border-bottom-style: solid; }
.ls-health { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.08em; margin-left: auto; }
.ls-top .badge { margin-left: 0; }
.hdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-hi); flex: none; transition: background .3s; }
.hdot.ok { background: var(--green); box-shadow: 0 0 8px rgba(61,220,151,0.55); animation: pulse 2.4s ease infinite; }
.hdot.off { background: var(--faint); }
.chip-kimi { color: var(--green); border-color: var(--green-dim); background: rgba(61,220,151,0.07); margin-left: 10px; vertical-align: middle; }
.hero-net { font-size: 14px !important; line-height: 1.4; }
#mkt-refresh { cursor: pointer; }

/* TEE badge (M7) — violet, distinct from ACTIVE green */
.badge.tee { color: var(--monad-vi); border-color: rgba(157,140,255,0.4); background: rgba(157,140,255,0.07); }
.badge.tee::before { content: "◈"; animation: none; }
.badge.tee:hover { border-color: var(--monad-vi); box-shadow: 0 0 12px rgba(157,140,255,0.25); }

/* click-to-copy */
[data-copy] { cursor: copy; }
.copied { position: relative; }
.copied::after {
  content: "copied"; position: absolute; top: -1.5em; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--green);
  background: var(--bg-2); border: 1px solid var(--green-dim); padding: 1px 6px; white-space: nowrap;
  pointer-events: none; z-index: 10;
}
.ls-meta b { font-weight: 400; }
.net-warn .btn { margin-left: 10px; }

/* ═══ CONSOLE ═══ */
.console-page main { padding: 56px 0 72px; }
.con-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 28px; flex-wrap: wrap; margin-bottom: 30px;
}
.con-title {
  font-family: var(--mono); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1;
}
.con-sub { color: var(--dim); font-size: 14px; max-width: 62ch; margin-top: 14px; }

.wallet-box { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.wallet-box .btn { cursor: pointer; }
.wallet-box .btn.flash { animation: flashbd 0.9s ease; }
@keyframes flashbd { 0%,100% { box-shadow: none; } 40% { box-shadow: 0 0 22px rgba(61,220,151,0.5); border-color: var(--green); } }
.wallet-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.wallet-addr { font-size: 13px; color: var(--text); border-bottom: 1px dotted var(--line-hi); }
.wallet-addr:hover { color: var(--green); border-bottom-color: var(--green); }
.wallet-usdc { font-size: 13px; color: var(--green); font-variant-numeric: tabular-nums; }
.wallet-usdc::before { content: "USDC "; color: var(--faint); font-size: 10px; letter-spacing: 0.12em; }
.net-badge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; padding: 4px 8px; border: 1px solid;
}
.net-badge.ok { color: var(--monad-vi); border-color: rgba(157,140,255,0.4); background: rgba(157,140,255,0.07); }
.net-badge.bad { color: var(--red); border-color: rgba(224,108,96,0.45); background: rgba(224,108,96,0.07); animation: pulse 1.6s ease infinite; }

/* picked-wallet tag (M11) — sits left of the address */
.wallet-name {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; padding: 4px 8px;
  color: var(--faint); border: 1px solid var(--line); white-space: nowrap;
}

/* lib-6 connected-state wallet actions — ghost tier, never compete with
   the primary flows */
.wallet-ops { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.wallet-note {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.7; color: var(--amber);
  border: 1px dashed rgba(232,180,74,0.35); background: rgba(232,180,74,0.04);
  padding: 8px 10px; max-width: 360px; text-align: left;
  animation: flashnote 1.2s ease;
}
.wallet-note b { color: var(--amber); }
.wallet-note .dim { color: var(--faint); }
@keyframes flashnote { 0% { border-color: rgba(232,180,74,0.8); } 100% { border-color: rgba(232,180,74,0.35); } }

/* ═══ WALLET SELECTOR MODAL (M11 · EIP-6963) ═══ */
.wsel-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay-bg); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: wselfade .18s ease;
}
@keyframes wselfade { from { opacity: 0; } }
.wsel {
  width: 100%; max-width: 400px; position: relative; overflow: hidden;
  background: var(--term-bg); border: 1px solid var(--line-hi);
  box-shadow: var(--shadow-modal), 0 0 40px rgba(61,220,151,0.05);
  animation: wselpop .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes wselpop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
/* same terminal scanlines as .term */
.wsel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, var(--scanline) 0 1px, transparent 1px 3px);
}
.wsel-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.wsel-title { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 8px; letter-spacing: 0.06em; }
.wsel-list { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.wsel-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  font-family: var(--mono); font-size: 13px; color: var(--text); letter-spacing: 0.04em;
  background: var(--bg-2); border: 1px solid var(--line); padding: 12px 14px;
  cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.wsel-item:hover { border-color: var(--green-dim); background: rgba(61,220,151,0.06); box-shadow: 0 0 16px rgba(61,220,151,0.08); }
.wsel-item:focus-visible { outline: 1px solid var(--green); outline-offset: 2px; }
.wsel-icon { width: 22px; height: 22px; flex: none; }
.wsel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsel-rdns { font-size: 9.5px; color: var(--faint); letter-spacing: 0.08em; flex: none; }
/* no-wallet empty state */
.wsel-empty {
  border: 1px dashed var(--line); padding: 18px 14px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint); line-height: 1.8;
}
.wsel-install { display: flex; gap: 16px; margin-top: 10px; }
.wsel-install a { color: var(--green); border-bottom: 1px dotted var(--green-dim); }
.wsel-install a:hover { border-bottom-style: solid; }
.wsel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-2);
}
.wsel-hint { font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: 0.08em; }
.wsel-cancel {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; cursor: pointer;
  color: var(--dim); background: transparent; border: 1px solid var(--line-hi); padding: 7px 12px;
  transition: color .2s, border-color .2s;
}
.wsel-cancel:hover { color: var(--text); border-color: var(--dim); }

/* deactivate confirm dialog — wsel chrome, red accent */
.cnf { max-width: 460px; border-color: rgba(224,108,96,0.35);
  box-shadow: var(--shadow-modal), 0 0 40px rgba(224,108,96,0.07); }
.cnf .wsel-title { color: var(--red); }
.cnf-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cnf-copy { font-size: 13px; color: var(--text); line-height: 1.7; }
.cnf-det { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; line-height: 1.6; }
.cnf .wsel-foot { justify-content: flex-end; gap: 10px; }
.cnf .wsel-hint { margin-right: auto; }

/* tabs */
.tabs { display: inline-flex; border: 1px solid var(--line); background: var(--bg-2); margin-bottom: 26px; }
.tab-btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; cursor: pointer;
  color: var(--dim); background: transparent; border: none; padding: 11px 26px;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s, background .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); background: rgba(61,220,151,0.05); }
.tab-btn:focus-visible { outline: 1px solid var(--green); outline-offset: -1px; }

.panel { display: flex; flex-direction: column; gap: 18px; }
.panel[hidden] { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.grid-2 > .card, .grid-3 > .card { min-width: 0; }
/* shared ACCOUNT FUNDS panel (above the role tabs): balance | deposit | withdraw */
.acct-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 18px; align-items: start; margin-top: 6px; }
.acct-bal { border: 1px dashed var(--line); padding: 10px 14px; }
.acct-i { font-style: normal; color: var(--faint); letter-spacing: 0.04em; text-transform: none; }
.acct-act .btn { margin-top: 8px; }

.card-title {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--text); padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-title::before { content: "▸ "; color: var(--green); }
.card-tag { font-size: 9.5px; letter-spacing: 0.1em; color: var(--faint); font-weight: 400; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.empty-hint { font-family: var(--mono); font-size: 12px; color: var(--faint); line-height: 1.7; }
.empty-hint.err { color: var(--red); }
.dim { color: var(--faint); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.mono { font-family: var(--mono); }
.wrap-anywhere { overflow-wrap: anywhere; }

/* key-value rows */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 12.5px; border-bottom: 1px dashed var(--line); padding-bottom: 9px; }
.kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv > span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint); flex: none; }
.kv > b { font-weight: 400; color: var(--text); text-align: right; min-width: 0; }
.kv .mtag { margin-left: 4px; }

/* forms */
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--dim); }
.fld-lbl i { color: var(--faint); font-style: normal; letter-spacing: 0.04em; text-transform: none; }
.fld-hint { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.6; }
.fld-hint.err { color: var(--red); }
.fld-row { display: flex; gap: 12px; align-items: flex-end; }
.fld-row .fld { flex: 1; }
.btn-end { flex: none; }

input[type="text"], input[type="url"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); padding: 10px 12px;
  width: 100%; min-width: 0; border-radius: 0; outline: none;
  transition: border-color .2s, box-shadow .2s; appearance: none;
}
/* kill native search chrome (rounded field / cancel glyph) so type="search"
   matches the page's flat mono control language */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
input[type="search"] { border-radius: 0; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 16px rgba(61,220,151,0.08); }
input::placeholder, textarea::placeholder { color: var(--faint); }
/* keep autofilled fields on-palette in both modes (native autofill would
   otherwise force its own yellow/blue regardless of the color scheme) */
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg-2) inset;
  transition: background-color 999999s ease-out;
}

.model-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.model-checks:empty { display: none; }
.mcheck {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  flex: 1 1 auto; /* balanced wrap rows, same as market chips */
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); background: var(--bg-2); padding: 6px 10px;
  transition: color .2s, border-color .2s, background .2s;
}
.mcheck input { accent-color: var(--green); width: 12px; height: 12px; margin: 0; }
.mcheck:has(input:checked) { color: var(--green); border-color: var(--green-dim); background: rgba(61,220,151,0.06); }
/* M15 shared catalog: a model the stored key cannot serve — visible for
   honesty, never selectable */
.mcheck.off { color: var(--faint); border-style: dashed; background: transparent; cursor: not-allowed; }
.mcheck.off input { accent-color: var(--faint); }
.mtag.off { opacity: 0.55; border-style: dashed; }
.model-verify { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.model-verify .btn { flex: none; }
.model-verify-note {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  line-height: 1.5; min-width: 0; overflow-wrap: anywhere; flex: 1;
}
.model-verify-note.ok { color: var(--green); }
.model-verify-note.err { color: var(--red); }
.model-verify-note.warn { color: var(--amber); }

/* per-model price overrides (Registry v2 register form) */
.model-prices { display: flex; flex-direction: column; gap: 6px; }
.model-prices:empty { display: none; }
.mprice {
  display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 6px; align-items: center;
}
.mprice-head span {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em; color: var(--faint); padding: 0 2px;
}
.mprice-name {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mprice input[type="text"] { padding: 7px 8px; font-size: 11.5px; }

/* per-model price rows inside kv cards (MY LISTING / buyer lock info) */
.mpr { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mpr + .mpr { margin-top: 5px; }
.mpr .mtag { margin-left: 0; flex: none; }
.mpr .mono { font-size: 11.5px; }

/* M12 row-level model delist (Registry v4 removeModel) — a quiet danger link,
   deliberately lower-key than the card-level [ DEACTIVATE ALL ] .btn-danger:
   borderless until hovered, 9.5px, sits at the row's tail */
.mdel {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: rgba(224,108,96,0.72); background: none;
  border: 1px solid transparent; padding: 1px 5px; cursor: pointer; flex: none;
  transition: color .2s, border-color .2s, background .2s;
}
.mdel:hover { color: var(--red); border-color: rgba(224,108,96,0.45); background: rgba(224,108,96,0.08); }
.mdel:focus-visible { outline: 1px solid var(--red); outline-offset: 2px; }
/* last model — contract RemoveLastModel guard; steer to [ DEACTIVATE ] */
.mdel:disabled { color: var(--faint); border-color: transparent; background: none; cursor: not-allowed; opacity: 0.7; }
/* light mode inks the quiet red row-action at full strength — the alpha-blended
   base washes out on paper (≈2.2:1). must sit AFTER the base .mdel rule:
   equal specificity, so only source order wins the cascade */
@media (prefers-color-scheme: light) {
  .mdel { color: var(--red); }
}

/* MY LISTING foot — deactivate zone; collapses to zero when nothing shows */
.card-foot { display: flex; flex-direction: column; gap: 10px; padding: 0 18px; }
.card-foot:has(.btn:not([hidden])), .card-foot:has(.txbox:not(:empty)) { padding-bottom: 18px; }
/* inactive listing: price zone weakened + dashed separator note */
.weak { opacity: 0.45; }
.deact-note { border-top: 1px dashed var(--line); padding-top: 12px; }

.mswitch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.mswitch input { accent-color: var(--green); width: 14px; height: 14px; margin-top: 1px; }
.mswitch-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--dim); }
.mswitch-lbl i { display: block; color: var(--faint); font-style: normal; letter-spacing: 0.03em; text-transform: none; margin-top: 3px; }

/* tx preview */
.preview {
  font-size: 11.5px; line-height: 1.75; color: var(--dim); background: var(--term-bg);
  border: 1px solid var(--line); padding: 14px; overflow-x: auto; white-space: pre; min-height: 44px;
}

/* buttons */
.btn { cursor: pointer; text-align: center; display: inline-block; }
.btn-wide { width: 100%; }
.btn-sm { font-size: 11px; padding: 8px 12px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* tx lifecycle lines */
.txbox { display: flex; flex-direction: column; gap: 6px; }
.txbox:empty { display: none; }
.txl {
  display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 11.5px;
  border: 1px solid var(--line); background: var(--bg-2); padding: 9px 12px;
}
.txl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-hi); flex: none; transform: translateY(-1px); }
.txl-label { color: var(--text); flex: none; }
.txl-state { color: var(--dim); min-width: 0; overflow-wrap: anywhere; }
.txl-state a { color: var(--green); border-bottom: 1px dotted var(--green-dim); }
.txl.is-pending { border-color: rgba(232,180,74,0.4); }
.txl.is-pending .txl-dot { background: var(--amber); animation: pulse 1.1s ease infinite; }
.txl.is-ok { border-color: var(--green-dim); }
.txl.is-ok .txl-dot { background: var(--green); box-shadow: 0 0 8px rgba(61,220,151,0.5); }
.txl.is-bad { border-color: rgba(224,108,96,0.45); }
.txl.is-bad .txl-dot { background: var(--red); }
.txl.is-bad .txl-state { color: var(--red); }
.txl.is-skip { opacity: 0.55; border-style: dashed; }
.txl.is-skip .txl-state { color: var(--faint); }
.txl-dots i { font-style: normal; animation: pulse 1.2s ease infinite; }
.txl-dots i:nth-child(2) { animation-delay: .2s; }
.txl-dots i:nth-child(3) { animation-delay: .4s; }

/* mini info inside lock card */
.mini-info { border: 1px dashed var(--line); padding: 12px; display: flex; flex-direction: column; gap: 9px; }

/* paymentId reveal */
.pid-box:empty { display: none; }
.pid-box { border: 1px solid var(--green-dim); background: rgba(61,220,151,0.05); padding: 16px; text-align: center; }
.pid-label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em; color: var(--faint); margin-bottom: 6px; }
.pid {
  font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--green);
  letter-spacing: 0.04em; font-variant-numeric: tabular-nums; position: relative;
  animation: pidpop .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pidpop { from { transform: scale(.82); opacity: 0; } }

/* call demo */
.call-card .card-body { gap: 16px; }
.call-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.call-term { margin-top: 2px; }
.call-out { display: flex; flex-direction: column; gap: 7px; max-height: 340px; overflow-y: auto; white-space: normal; }
.call-reply {
  color: var(--text); border-left: 2px solid var(--green-dim); padding: 8px 12px;
  margin: 4px 0; background: rgba(61,220,151,0.04); overflow-wrap: anywhere; white-space: pre-wrap;
}

/* receipt panel */
.rcpt { border: 1px solid var(--line); padding: 16px 18px; font-size: 13px; line-height: 1.7; }
.rcpt.ok { border-color: var(--green-dim); background: rgba(61,220,151,0.05); }
.rcpt.ok > b { color: var(--green); }
.rcpt.bad { border-color: rgba(224,108,96,0.5); background: rgba(224,108,96,0.06); }
.rcpt.bad > b { color: var(--red); }
.rcpt.warn { border-color: rgba(232,180,74,0.4); background: rgba(232,180,74,0.05); }
.rcpt.warn > b { color: var(--amber); }
.rcpt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px; }
.rcpt-grid span { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--faint); margin-bottom: 5px; }
.rcpt-grid b { font-weight: 400; font-size: 13px; overflow-wrap: anywhere; }

/* inline verify diagnostics inside the register form (the standalone
   precheck card is gone — merged step) */
.verify-detail { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.verify-detail:empty { display: none; }
.verify-detail .empty-hint { margin: 0; }
.verify-detail .empty-hint .btn { margin-left: 6px; }

/* M15 shared-relay custody card */
.sc-ops { margin-top: 2px; align-items: center; flex-wrap: wrap; }
.sc-ops .btn { flex: none; }

/* disputes */
.disp-list { display: flex; flex-direction: column; gap: 8px; }
.disp {
  display: flex; align-items: baseline; gap: 12px; font-size: 12px;
  border: 1px solid var(--line); background: var(--bg-2); padding: 9px 12px;
  font-family: var(--mono); flex-wrap: wrap;
}
.disp-reason { color: var(--red); }
.disp .dim { margin-left: auto; font-size: 10.5px; }

/* balances card */
.bal-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; border-bottom: 1px dashed var(--line); padding-bottom: 9px; }
.bal-row:last-of-type { border-bottom: none; }
.bal-row > span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint); }
.bal-row b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }

/* ═══ buyer: LOCK hero (the core move) ═══ */
.lock-hero { border-color: var(--line-hi); }
.lock-hero .card-title { color: var(--green); }
.lock-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; }
.lock-side, .lock-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lock-main { border-left: 1px dashed var(--line); padding-left: 26px; }
.lock-main .btn-wide { margin-top: 2px; }

/* ═══ searchable seller picker (LOCK + CALL share the component) ═══ */
.spick { position: relative; }
.spick-list {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 330px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-hi);
  box-shadow: var(--shadow-drop), 0 0 0 1px rgba(61,220,151,0.06);
}
.spick-row {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.spick-row:last-child { border-bottom: none; }
.spick-row:hover { background: rgba(61,220,151,0.04); }
.spick-row.sel { background: rgba(61,220,151,0.08); box-shadow: inset 2px 0 0 var(--green-dim); }
.spick-row.off { opacity: 0.45; cursor: not-allowed; }
.spick-row.off:hover { background: transparent; }
.spick-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.spick-addr { font-family: var(--mono); font-size: 12.5px; color: var(--text); flex: none; }
.spick-host {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
}
.spick-models { display: flex; flex-wrap: wrap; gap: 5px; }
.spick-models .mtag { font-size: 10px; padding: 2px 6px; }
.spick-price { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.spick-empty { padding: 14px 12px; font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.6; }

/* ═══ M13: session locks list + mint modal + usage ═══ */
.locks-list { display: flex; flex-direction: column; gap: 8px; }
.lock-row { border: 1px solid var(--line); background: var(--bg-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.lock-row-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.lock-pid { color: var(--green); font-weight: 700; }
.lock-when { margin-left: auto; font-size: 10.5px; }
.lock-usage { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 7px; font-size: 11.5px; }
.usage-line b { color: var(--text); font-weight: 400; }
.usage-bar { height: 6px; background: var(--bg); border: 1px solid var(--line); }
.usage-bar > i { display: block; height: 100%; background: var(--green-dim); transition: width .4s ease; }
.usage-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* mint modal — wider than the wallet selector, same chrome */
.wsel.mint { max-width: 560px; }
.wsel-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mint-key {
  border: 1px solid var(--green-dim); background: rgba(61,220,151,0.05);
  padding: 10px 12px; font-size: 11.5px; line-height: 1.7; cursor: pointer;
  color: var(--text); user-select: all;
}
.mint-key:hover { border-color: var(--green); }
.mint-warn { font-family: var(--mono); font-size: 11px; color: var(--amber); line-height: 1.7; }
.mint-warn b { color: var(--amber); font-weight: 700; }
.mint-curl { cursor: pointer; }
.mint-curl:hover { border-color: var(--green-dim); }
.usage-warn { font-size: 10.5px; line-height: 1.5; }
.wsel.mint .preview { max-height: 150px; overflow: auto; }

/* ═══ M13 补件: api keys panel (status badges + meta/note lines) ═══ */
.kstat {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  padding: 3px 8px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px;
}
.kstat-active { color: var(--green); border-color: rgba(61,220,151,0.4); background: rgba(61,220,151,0.06); }
.kstat-expired { color: var(--faint); background: transparent; }
.kstat-revoked { color: var(--red); border-color: rgba(224,108,96,0.4); background: rgba(224,108,96,0.06); }
.kstat .rdot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(224,108,96,0.55); }
.key-meta { font-size: 10.5px; }
.key-note { font-size: 11px; line-height: 1.6; }
.key-row .lock-usage { margin-top: 2px; }

/* ═══ council lane-web fixes (six) ═══ */
/* hero plain-language line — between tagline and lede, warmer than lede */
.plainline { color: var(--text); max-width: 54ch; margin-top: 10px; font-size: 14px; line-height: 1.65; }
/* flow steps are anchors now (#5) — inherit the line's quiet look, glow on hover */
a.flow-step { color: var(--dim); text-decoration: none; border-bottom: 1px dashed transparent; }
a.flow-step:hover { color: var(--green); border-bottom-color: var(--green-dim); }
a.flow-step:hover b { color: var(--green); }
/* anchor targets: clear the 52px topbar when jumped to */
[id^="card-"] { scroll-margin-top: 66px; }
/* LOCK → DEPOSIT steering button (amber, quieter than danger) */
.btn-dep { color: var(--amber); border-color: rgba(232,180,74,0.4); background: rgba(232,180,74,0.05); text-decoration: none; align-self: flex-start; }
.btn-dep:hover { border-color: var(--amber); background: rgba(232,180,74,0.1); color: var(--amber); }
.wallet-faucets { font-family: var(--mono); font-size: 10.5px; color: var(--amber); line-height: 1.6; margin: 6px 0 0; }
.wallet-faucets a { color: var(--amber); border-bottom: 1px dashed rgba(232,180,74,0.5); text-decoration: none; }
.wallet-faucets a:hover { border-bottom-style: solid; }

/* PROOF block (index, bottom of the market section) — dashed frame:
   evidence area, visually distinct from the live board above */
.proof { margin-top: 26px; border: 1px dashed var(--line-hi); padding: 20px; }
.proof-head h3 { font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; color: var(--green); margin: 0 0 8px; }
.proof-head h3::before { content: "▸ "; }
.proof-sub { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.7; margin: 0 0 16px; }
.proof-sub a { color: var(--dim); }
.proof-sub a:hover { color: var(--green); }
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.proof-txs { display: flex; flex-direction: column; gap: 8px; }
.proof-tx {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--bg-2); padding: 9px 12px;
  text-decoration: none; transition: border-color .2s;
}
.proof-tx:hover { border-color: var(--green-dim); }
.proof-kind { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--green); border: 1px solid rgba(61,220,151,0.35); padding: 2px 6px; flex: none; }
.proof-hash { font-size: 12px; color: var(--text); }
.proof-note { font-family: var(--mono); font-size: 10.5px; color: var(--faint); flex-basis: 100%; }
.proof-rcpt { margin: 0; }
.proof-rcpt .term-body { max-height: none; }
@media (max-width: 860px) { .proof-grid { grid-template-columns: 1fr; } }

/* ═══ buyer flow guide + per-card one-liners (UX 补件) ═══
   step-hint sits deliberately one tier BELOW .fld-hint (11px faint):
   smaller, softer — explanation, not instruction */
.flow-line {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--faint); margin: -4px 0 0;
}
.flow-lbl { color: var(--dim); border: 1px solid var(--line); padding: 2px 7px; font-size: 9.5px; letter-spacing: 0.14em; }
.flow-step { color: var(--dim); white-space: nowrap; }
.flow-step b { color: var(--green); font-weight: 700; margin-right: 5px; } /* text role — green-dim fails AA on both themes */
.flow-arr { color: var(--faint); }
.flow-tail { margin-left: auto; font-size: 10.5px; letter-spacing: 0.02em; }
.step-hint { font-family: var(--mono); font-size: 10.5px; color: var(--faint); line-height: 1.6; margin: 0; opacity: 0.9; }
.lock-grid > .step-hint { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .flow-line { gap: 6px; font-size: 10.5px; }
  .flow-tail { margin-left: 0; flex-basis: 100%; }
}

/* ═══ CONSOLE RESPONSIVE ═══ */
@media (max-width: 1020px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .acct-grid { grid-template-columns: 1fr 1fr; }
  .acct-bal { grid-column: 1 / -1; }
  .call-grid { grid-template-columns: 1fr 1fr; }
  .rcpt-grid { grid-template-columns: repeat(2, 1fr); }
  .lock-grid { grid-template-columns: 1fr; }
  .lock-main { border-left: none; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 18px; }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .call-grid, .acct-grid { grid-template-columns: 1fr; }
  .con-head { flex-direction: column; align-items: stretch; }
  .wallet-box { align-items: flex-start; }
  .wallet-info { justify-content: flex-start; }
  .wallet-ops { justify-content: flex-start; }
  .fld-row { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tab-btn { flex: 1; }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* specificity must match html.js .rv above so this stays the final word */
  html.js .rv, .rv { opacity: 1; transform: none; transition: none; }
  .cursor, .badge::before, .ticker-label::before, .hdot.ok, .net-badge.bad,
  .txl.is-pending .txl-dot, .txl-dots i, .pid, .wallet-box .btn.flash,
  .market-entry-arrow { animation: none; transition: none; }
  .skel-line { animation: none; opacity: 0.5; }
  .wsel, .wsel-overlay { animation: none; }
  .card, .btn, .sm-node, .edge, .wsel-item, .wsel-cancel { transition: none; }
}

/* ═══ POLICY PAGE (policy.html) + quiet nav-policy link ═══ */
/* ⚠ POLICY nav link — deliberately quiet: faint, a notch smaller, amber on hover */
.topnav a.nav-policy { color: var(--faint); font-size: 10px; }
.topnav a.nav-policy:hover { color: var(--amber); border-bottom-color: var(--amber); }

.policy-page main { padding-bottom: 72px; }
.pol-list { display: flex; flex-direction: column; gap: 18px; }
.pol { padding: 24px; display: flex; gap: 20px; align-items: flex-start; }
.pol-num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--green);
  border: 1px solid var(--green-dim); width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.pol-body { min-width: 0; }
.pol h2 {
  font-family: var(--mono); font-size: 13.5px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--text); display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.pol p { font-size: 14px; color: var(--dim); line-height: 1.7; max-width: 80ch; }
.pol p b { color: var(--text); font-weight: 700; }
.pol-chip { flex: none; }

/* risk-bearing sections (02 testnet / 03 upstream ToS / 06 no warranty) — amber accent */
.pol-risk .pol-num { color: var(--amber); border-color: rgba(232,180,74,0.4); }
.pol-risk h2 { color: var(--amber); }
.pol-risk:hover { box-shadow: 0 0 24px rgba(232,180,74,0.06); }
.pol-risk:hover::before, .pol-risk:hover::after { border-color: var(--amber); }

.pol-back { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
@media (max-width: 700px) {
  .pol-back .btn { width: 100%; text-align: center; }
}

/* ═══ POLICY CONSENT GATE (console paid-action bar) ═══
   Restrained by design: one dashed bar above the tabs, reuses the
   existing .mswitch checkbox face + flashbd pulse. */
.policy-consent {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border: 1px dashed var(--line);
  background: var(--bg-2);
  padding: 12px 16px;
  margin: 0 0 18px;
}
.policy-consent.flash-bd { animation: flashbd 0.9s ease; }
.policy-consent-note {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--faint); max-width: 46ch; line-height: 1.6;
}
@media (max-width: 700px) {
  .policy-consent { flex-direction: column; gap: 8px; }
  .policy-consent-note { max-width: none; }
}
