:root {
  --bg: #0d0d0b;
  --ink: #f3f0e7;
  --ink-2: #b9b4a8;
  --ink-3: #8c877c;
  --line: rgba(243, 240, 231, .12);
  --line-2: rgba(243, 240, 231, .22);
  --panel: rgba(22, 21, 18, .78);
  --panel-2: rgba(32, 30, 26, .72);
  --y: #ffd23f;
  --y-ink: #141310;
  --y-soft: rgba(255, 210, 63, .12);
  --ok: #8fe3a8;
  --bad: #ff8a76;
  --r: 18px;
  --r-s: 10px;
  --sans: "Inter", "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; scrollbar-color: #3a3832 transparent; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
::selection { background: var(--y); color: var(--y-ink); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 30; background: var(--y); color: var(--y-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.mono, .num, .pct, .tier-badge, .tiers td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-2); }
.small { font-size: 13px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* Background: the actual 353-tier stair, faint, with the current share marked */
.bg { position: fixed; inset: 18vh 0 0 0; width: 100%; height: 82vh; z-index: -1; pointer-events: none; }
.bg-stair { fill: none; stroke: rgba(255, 210, 63, .26); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bg-tick { stroke: rgba(243, 240, 231, .07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bg-now { stroke: var(--y); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .5; animation: breathe 3.2s ease-in-out infinite; }
.bg-now.off { display: none; }
@keyframes breathe { 50% { opacity: .15; } }
html.intro .bg { animation: draw 1.3s var(--ease) both; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
html.intro main { animation: rise .7s .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
html.still .bg-now, html.still .bg, html.still main { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(13, 13, 11, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in, .source-in, main { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.top-in { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.brand svg { color: var(--y); }
.tabs { margin-left: auto; display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(243, 240, 231, .05); border: 1px solid var(--line); }
.tabs a { text-decoration: none; padding: 8px 20px; border-radius: 999px; font-weight: 700; color: var(--ink-2); transition: background .2s, color .2s; min-height: 40px; display: inline-flex; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--y); color: var(--y-ink); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn .i-play, html.still .icon-btn .i-pause { display: none; }
html.still .icon-btn .i-play { display: block; }

.source { border-top: 1px solid var(--line); }
.source-in { display: flex; align-items: center; gap: 16px; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: rgba(243, 240, 231, .12); color: var(--ink); }
.seg button[data-mode="preview"][aria-pressed="true"] { background: var(--y-soft); color: var(--y); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .45); }
.pulse { font-family: var(--mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pulse b { color: var(--ink); font-weight: 600; }
.pulse .tag { color: var(--y); }
.pulse .bad { color: var(--bad); }

/* Scenario controls: a yellow-edged strip above the views, only in scenario mode */
.scenario { margin-bottom: 20px; padding: 16px 20px; border-radius: var(--r); border: 1px solid rgba(255, 210, 63, .32); background: rgba(24, 22, 14, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px; margin-top: 12px; }
.sc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.sc-head .sc-note { flex: 1 1 240px; min-width: 0; }
.sc-toggle { margin-left: auto; }
.sc-head h2 { font-size: 15px; font-weight: 700; color: var(--y); }
.sc-presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.sc-presets button { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-2); min-height: 34px; }
.sc-presets button:hover { color: var(--ink); border-color: var(--y); }
.sc-presets button[aria-pressed="true"] { background: var(--y-soft); color: var(--y); border-color: rgba(255, 210, 63, .6); }
.sc-clock { display: grid; gap: 8px; align-content: start; }
.sc-time { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.sc-time strong { font-size: 18px; color: var(--ink); }
.sc-step { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-shares { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; align-content: start; }
.sc-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--y); }
.sc-field input { width: 120px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 210, 63, .4); background: rgba(0, 0, 0, .35); font-family: var(--mono); font-size: 14px; }
.sc-field input:disabled, .sc-range:disabled { opacity: .45; }
.sc-range { width: 100%; accent-color: var(--y); min-height: 32px; }
.sc-shares .sc-note { grid-column: 1 / -1; }
.sc-note { font-size: 12px; color: var(--ink-3); }
.sc-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--y); margin: 0; }

/* Layout */
main { padding-top: 28px; padding-bottom: 64px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.lbl { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.head { margin-bottom: 20px; }
.head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }

.mint-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 20px; align-items: start; }

/* Progress */
.big { margin: 6px 0 14px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.big .num { font-family: var(--sans); font-size: clamp(40px, 6vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big .of { font-size: 18px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pct { background: var(--y); color: var(--y-ink); font-weight: 700; font-size: 14px; border-radius: 8px; padding: 3px 10px; }
.pct.unknown { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.bar { position: relative; height: 22px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .4); overflow: hidden; margin-bottom: 14px; }
.bar.thin { height: 10px; margin: 10px 0 10px; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; min-width: 0; background: var(--y); border-radius: 999px; transition: width .5s var(--ease); }
.bar-fill.some { min-width: 4px; }
.bar.unknown { background: repeating-linear-gradient(135deg, rgba(243, 240, 231, .06) 0 6px, transparent 6px 12px); }
.bar-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .55; left: .2252%; }
.pool { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pool.met .dot { background: var(--y); }
.pool.open .dot { background: var(--ok); }
.pool.bad .dot { background: var(--bad); }
.tier-badge { border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 10px; font-size: 13px; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; }
.tier-badge.on { border-color: rgba(255, 210, 63, .6); color: var(--y); }

.state-msg { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 14px; color: var(--ink-2); }
.state-msg strong { color: var(--ink); display: block; margin-bottom: 2px; }
.state-msg.bad { border-color: rgba(255, 138, 118, .45); }
.state-msg.bad strong { color: var(--bad); }
.state-msg .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.tierblock { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.remain { font-size: 15px; color: var(--ink-2); }
.remain strong { color: var(--ink); font-weight: 600; }
.remain .y { color: var(--y); }
.mini-ladder { list-style: none; margin: 14px 0 12px; padding: 0; display: grid; gap: 4px; }
.mini-ladder li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 7px 12px; border-radius: 8px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mini-ladder li.done { opacity: .6; }
.mini-ladder li.cur { background: var(--y-soft); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .5); }
.mini-ladder li.cur .t { color: var(--y); font-weight: 700; }
.mini-ladder li.hit:not(.cur) { color: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .25); }
.mini-ladder .p { text-align: right; }
.more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.more:hover { color: var(--y); }

/* Mint form */
.qty-amt { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qty, .amount { border-radius: 14px; padding: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; margin: 12px 0; }
.step { height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); display: grid; place-items: center; transition: background .15s; }
.step:hover:not(:disabled) { background: rgba(243, 240, 231, .1); }
.step:disabled { opacity: .35; }
.stepper input { width: 100%; min-width: 0; text-align: center; font-family: var(--sans); font-size: 32px; font-weight: 800; background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 0; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.stepper input:focus-visible { outline: none; border-bottom-color: var(--y); }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips button { min-height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; font-family: var(--mono); font-weight: 600; transition: background .15s, color .15s; }
.chips button:hover { background: rgba(243, 240, 231, .08); }
.chips button[aria-pressed="true"] { background: var(--y); color: var(--y-ink); border-color: var(--y); }
.err { min-height: 0; font-size: 13px; color: var(--bad); margin-top: 6px; }
.err:empty { display: none; }

.amount { background: linear-gradient(180deg, rgba(255, 210, 63, .1), rgba(255, 210, 63, .04)); border-color: rgba(255, 210, 63, .38); display: flex; flex-direction: column; }
.amount .lbl { color: var(--y); }
.amt { margin: 10px 0 auto; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.amt .num { font-family: var(--sans); font-size: clamp(28px, 3.6vw, 38px); font-weight: 800; color: var(--y); letter-spacing: -.02em; font-variant-numeric: tabular-nums; word-break: break-all; }
.amt .unit { font-weight: 700; font-size: 15px; color: var(--ink); }
.per { font-family: var(--mono); font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.cross { font-family: var(--mono); font-size: 12px; color: var(--y); margin-top: 6px; }
.amount.flash .num { animation: flash .45s var(--ease); }
@keyframes flash { from { opacity: .35; transform: translateY(3px); } }

.detail { margin: 14px 0 16px; padding: 4px 16px; border-radius: 14px; border: 1px dashed var(--line-2); }
.detail div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.detail div + div { border-top: 1px solid var(--line); }
.detail dt { color: var(--ink-2); }
.detail dd { margin: 0; text-align: right; }

.cta { width: 100%; min-height: 58px; border-radius: 16px; border: 0; background: var(--y); color: var(--y-ink); font-size: 18px; font-weight: 800; letter-spacing: .01em; box-shadow: 0 6px 18px rgba(255, 210, 63, .18); transition: transform .15s var(--ease), box-shadow .15s; }
.cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255, 210, 63, .26); }
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta:disabled { background: rgba(243, 240, 231, .08); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.cta-note { font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 10px; }
.cta-note:empty { display: none; }
.foot { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 10px; }

/* Buttons */
.ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 8px 16px; min-height: 40px; font-size: 14px; font-weight: 600; }
.ghost:hover { border-color: var(--y); color: var(--y); }
.ghost.y { background: var(--y); color: var(--y-ink); border-color: var(--y); }

/* Mechanism */
.chart { margin: 0 0 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.chart figcaption span { color: var(--ink-2); }
.c-stair { fill: none; stroke: var(--y); stroke-width: 2; vector-effect: non-scaling-stroke; }
#c-grid line { stroke: var(--line); }
#c-grid text, #c-now text { fill: var(--ink-3); font: 11px var(--mono); }
.c-band { fill: rgba(243, 240, 231, .025); }
#c-now line { stroke: var(--ink); stroke-dasharray: 3 3; }
#c-now circle { fill: var(--y); stroke: var(--bg); stroke-width: 2; }
#c-now text.now { fill: var(--ink); }
.c-thr { stroke: rgba(143, 227, 168, .7) !important; }
.rules { margin: 20px 0 0; display: grid; gap: 0; }
.rules div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.rules dt { font-weight: 700; }
.rules dd { margin: 0; color: var(--ink-2); max-width: 70ch; }
.rules .live { display: block; margin-top: 4px; color: var(--y); font-family: var(--mono); font-size: 13px; }
.rules .live:empty { display: none; }

/* Tiers */
.tier-now { font-size: 15px; margin-bottom: 12px; color: var(--ink-2); }
.tier-now b { color: var(--y); }
.tier-now strong { color: var(--ink); }
.table-wrap { position: relative; max-height: min(62vh, 640px); overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); margin-bottom: 12px; scroll-behavior: smooth; }
.tiers { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tiers thead th { position: sticky; top: 0; z-index: 1; background: #171613; text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tiers .r { text-align: right; }
.tiers td { padding: 9px 16px; border-bottom: 1px solid rgba(243, 240, 231, .05); white-space: nowrap; }
.tiers td:first-child { color: var(--ink-3); width: 64px; }
.tiers td:nth-child(3), .tiers td:nth-child(4) { text-align: right; }
.tiers tr.done td { color: var(--ink-3); }
.tiers tr.done td:last-child { color: var(--ink-3); }
.tiers tr.cur td { background: var(--y-soft); color: var(--ink); font-weight: 600; border-bottom-color: rgba(255, 210, 63, .35); }
.tiers tr.cur td:first-child { color: var(--y); box-shadow: inset 3px 0 0 var(--y); }
.tiers tr.cur td:last-child { color: var(--y); }
.tiers tr.hit:not(.cur) td { background: rgba(255, 210, 63, .05); }
.tiers tr.hit:not(.cur) td:last-child { color: var(--y); }
.tiers td:last-child { color: var(--ink-3); font-size: 12px; }

/* Quantity boundary + what the minter receives */
.fit { margin-top: 8px; border: 1px solid rgba(255, 210, 63, .5); background: var(--y-soft); color: var(--y); border-radius: 10px; padding: 6px 12px; min-height: 36px; font-size: 13px; font-weight: 600; }
.fit:hover { background: rgba(255, 210, 63, .2); }
.receive { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); }
.receive-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; font-size: 17px; }
.receive-h strong { font-family: var(--mono); font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.receive-tok { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.receive-tok span:last-child { color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 8px; font-size: 13px; }
.receive-note { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.receive + .detail { margin-top: 10px; }

/* Wallet (read-only) */
.w-open { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.w-open:hover { border-color: var(--y); }
.w-open.on { font-family: var(--mono); font-size: 13px; border-color: rgba(143, 227, 168, .5); }
.w-open.on svg { color: var(--ok); }
.w-open.warn { border-color: rgba(255, 138, 118, .6); }
.w-open.warn svg { color: var(--bad); }
.w-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.w-row.warn { border-color: rgba(255, 138, 118, .45); color: var(--bad); }
.w-row-text { min-width: 0; overflow-wrap: anywhere; }
.ghost.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; flex: none; }

.w-dlg { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 48px); overflow: auto; padding: 20px; border-radius: var(--r); border: 1px solid var(--line-2); background: #171613; color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.w-dlg::backdrop { background: rgba(5, 5, 4, .66); backdrop-filter: blur(3px); }
.w-dlg[open] { animation: rise .22s var(--ease); }
.w-head { display: flex; align-items: center; justify-content: space-between; }
.w-head h2 { font-size: 20px; font-weight: 800; }
.w-scope { margin: 8px 0 14px; font-size: 13px; color: var(--ink-2); }
.w-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.w-item { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(243, 240, 231, .03); text-align: left; text-decoration: none; font-weight: 600; }
.w-item:hover { border-color: var(--y); }
.w-item.busy { border-color: var(--y); background: var(--y-soft); }
.w-item.off { color: var(--ink-2); font-weight: 500; }
.w-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(243, 240, 231, .08); font-family: var(--mono); font-size: 13px; object-fit: contain; }
.w-mt { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.w-item.busy .w-mt { color: var(--y); }
.w-none { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.w-dl { margin: 0 0 14px; }
.w-dl div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.w-dl dt { color: var(--ink-3); }
.w-dl dd { margin: 0; overflow-wrap: anywhere; }
.w-dl dd.bad { color: var(--bad); }
.w-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.w-status { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.w-status:empty { display: none; }
.w-status.bad { color: var(--bad); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: #1c1b17; border: 1px solid rgba(255, 210, 63, .45); color: var(--ink); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); z-index: 40; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.toast.bad { border-color: rgba(255, 138, 118, .6); }

/* Shared value states */
.unknown { color: var(--ink-3) !important; }
.cta.sm { width: auto; min-height: 44px; padding: 0 22px; font-size: 15px; border-radius: 12px; flex: none; }
#c-grid text.thr { fill: var(--ok); }

/* Opening clock: four stations on one rail */
.clock { list-style: none; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--line-2); display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: ck; }
.clock li { position: relative; padding-top: 16px; display: grid; gap: 2px; min-width: 0; }
.clock li::before { content: ""; position: absolute; top: 4px; left: 0; right: -10px; height: 2px; background: var(--line-2); }
.clock li:last-child::before { right: 0; }
.clock li::after { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--ink-3); }
.clock li.done::before { background: rgba(255, 210, 63, .55); }
.clock li.done::after { background: var(--y); box-shadow: none; }
.clock li.skip::after { background: var(--ink-3); }
.clock li.cur::after { box-shadow: inset 0 0 0 2px var(--y), 0 0 0 4px rgba(255, 210, 63, .18); }
.ck { font-size: 12px; color: var(--ink-3); }
.cv { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.clock li.cur .cv { color: var(--y); }
.clock li.done .cv { color: var(--ink); }

/* 70 / 20 / 10 split */
.split { margin: 14px 0 16px; padding: 12px 16px 4px; border-radius: 14px; border: 1px dashed var(--line-2); }
.split-h { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.split-bar { display: grid; grid-template-columns: 7fr 2fr 1fr; gap: 3px; height: 8px; margin: 10px 0 2px; }
.split-bar i { border-radius: 3px; }
.split.off .split-bar { opacity: .3; }
.s-lp { background: var(--ink-2); }
.s-rw { background: var(--y); }
.s-tr { background: #6f6a5f; }
.split .detail { margin: 0; padding: 0; border: 0; }
.detail .k { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; }

/* Rewards */
.rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.tag-src { font-size: 12px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; }
.tag-src.y { color: var(--y); border-color: rgba(255, 210, 63, .5); }
.tag-src.bad { color: var(--bad); border-color: rgba(255, 138, 118, .5); }
.vault-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 10px; }
.v-k { font-size: 13px; color: var(--ink-2); }
.v-big { margin-top: 2px; }
.v-big .num { font-family: var(--sans); font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.02em; color: var(--y); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v-big.alt .num { color: var(--ink); }
.v-big .num.unknown, .v-mid .num.unknown { font-size: 22px; }
.v-next { font-size: 14px; color: var(--ink-2); }
.epoch { margin: 16px 0 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); }
.epoch .bar.thin { margin: 8px 0; }
.backlog { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.backlog .ghost { justify-self: start; }
.v-src { margin-top: 14px; }
.sc-tax { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }

.stake .state-msg { margin: 14px 0 0; }
/* minmax(0,1fr) + a zero flex-basis input: the input's intrinsic width must not widen the form past the panel */
.stake-form { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.stake-form > * { min-width: 0; }
.s-row { display: flex; gap: 8px; align-items: center; }
.s-row input { flex: 1 1 0; width: 0; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); font-family: var(--mono); font-size: 16px; }
.s-row input:focus-visible { outline: none; border-color: var(--y); }
.s-row input:disabled { opacity: .45; }
.ghost:disabled { opacity: .45; border-color: var(--line); color: var(--ink-2); }
.pos { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.pos li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 8px 6px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.pos li b { color: var(--ink); font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.pos li.act { border-color: rgba(255, 210, 63, .4); background: var(--y-soft); }
.pos li.pend { border-style: dashed; }
.pos li.wd { border-color: rgba(143, 227, 168, .45); }
.pos li.empty { color: var(--ink-3); }
.claim { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 210, 63, .38); background: linear-gradient(180deg, rgba(255, 210, 63, .1), rgba(255, 210, 63, .04)); }
.v-mid .num { font-family: var(--sans); font-size: 28px; font-weight: 800; color: var(--y); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#s-claim-note { margin-top: 8px; }
.ledger { margin-top: 18px; }
.ledger .lbl { margin-bottom: 8px; }
.table-wrap.short { max-height: 280px; margin: 0; }
.tiers.led td { color: var(--ink-2); }
.tiers.led td:not(:first-child), .tiers.led th.r { text-align: right; }
.tiers.led td:first-child { width: auto; }
.tiers.led td:last-child { color: var(--y); font-size: 14px; }

/* F04: grid/flex children may shrink below their content (tables, long wei values) instead of widening the page */
.mint-grid > *, .rw-grid > *, .sc-body > *, .pos li > span, .claim > div { min-width: 0; }
.stake > .row-between, .vault > .row-between { flex-wrap: wrap; row-gap: 4px; }
.detail dt { flex: 0 1 auto; }
.detail dd { min-width: 0; overflow-wrap: anywhere; }
.v-next, .v-src dd, #s-when, #s-claimed, #s-bal { overflow-wrap: anywhere; }

/* Responsive */
@media (max-width: 900px) {
  .mint-grid, .rw-grid { grid-template-columns: minmax(0, 1fr); }
  .sc-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top-in, .source-in, main { padding-left: 14px; padding-right: 14px; }
  .scenario { padding: 12px 14px; margin-bottom: 14px; }
  .sc-head .sc-note { flex-basis: 100%; order: 3; }
  .sc-body { gap: 12px; }
  .sc-shares { grid-template-columns: 1fr; }
  .sc-field { display: grid; grid-template-columns: auto 1fr; }
  .sc-field input { width: 100%; }
  .clock { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .clock li:nth-child(2)::before { right: 0; }
  .vault-nums { grid-template-columns: 1fr; gap: 10px; }
  .claim { flex-wrap: wrap; }
  .pos li { flex-wrap: wrap; }
  .tiers.led { font-size: 12px; }
  .top-in { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tabs a { flex: 1; justify-content: center; padding: 8px 0; }
  .w-open { margin-left: auto; padding: 0 12px; }
  .w-dlg { margin: auto auto 12px; max-height: calc(100vh - 24px); }
  .w-row { flex-wrap: wrap; }
  .source-in { flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; padding-bottom: 8px; }
  .pulse { white-space: normal; font-size: 12px; width: 100%; }
  .scenario { grid-template-columns: 1fr; }
  .sc-field input { width: 100%; }
  .sc-field { display: grid; grid-template-columns: auto 1fr; }
  main { padding-top: 16px; }
  .panel { padding: 18px 16px; border-radius: 16px; }
  .qty-amt { grid-template-columns: 1fr; }
  .chart svg { overflow: visible; }
  #c-grid text, #c-now text { font-size: 20px; }
  .rules div { grid-template-columns: 1fr; gap: 4px; }
  .tiers td, .tiers thead th { padding: 8px 10px; }
  .tiers td:first-child { width: 44px; }
  .tiers { font-size: 13px; }
  .head h1 { font-size: 24px; }
  .bg { inset: 30vh 0 0 0; height: 70vh; }
}
