/* MarketCraft product surface (PROMPT-013): a live board, not a template. System fonts, native controls. */
:root {
  --bg: #f6f5f1; --ink: #17181a; --muted: #5d6066; --line: #d9d6cc; --panel: #ffffff;
  --yes: #0b7a3e; --yes-bg: #e3f4ea; --no: #b3261e; --no-bg: #fbe7e5; --warn: #8a5a00; --warn-bg: #fff3d6;
  --accent: #1f4fd1; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111214; --ink: #ecebe6; --muted: #a2a4a8; --line: #2c2e33; --panel: #191a1d;
    --yes: #5fd08f; --yes-bg: #13301f; --no: #ff8a80; --no-bg: #3a1614; --warn: #f2c46b; --warn-bg: #33280f; --accent: #8fb0ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--ink); letter-spacing: .01em; }
.mark { color: var(--yes); }
nav { display: flex; gap: .25rem; }
nav a { padding: .35rem .7rem; border-radius: 6px; text-decoration: none; color: var(--muted); }
nav a[aria-current="page"] { background: var(--ink); color: var(--panel); }
.identity { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.dev-flag { font: 600 .7rem/1 var(--mono); padding: .3rem .45rem; border-radius: 4px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.devbar { margin: 0; padding: .35rem 1rem; font-size: .8rem; background: var(--warn-bg); color: var(--warn); }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
h2 { font-size: 1.25rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.count { font: 600 .75rem var(--mono); color: var(--muted); }
.muted, .note { color: var(--muted); }
.note { font-size: .85rem; margin: .25rem 0 .75rem; }
.empty { color: var(--muted); padding: .75rem 0; }
.board { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .75rem; }
.market { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .85rem; }
.market-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.market h3 { margin: 0; font: 600 1rem var(--mono); overflow-wrap: anywhere; }
.pool { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .6rem 0; }
.pool-side { display: flex; justify-content: space-between; align-items: baseline; padding: .45rem .6rem; border-radius: 6px; }
.pool-yes { background: var(--yes-bg); color: var(--yes); }
.pool-no { background: var(--no-bg); color: var(--no); }
.pool-label { font-weight: 700; }
.pool-num { font: 600 1.1rem var(--mono); }
/* PROMPT-016 (G-5): the market price — the tote board's headline figure. */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .6rem 0 .2rem; }
.price-side { display: flex; justify-content: space-between; align-items: baseline; padding: .55rem .7rem; border-radius: 6px; border: 2px solid; }
.price-yes { border-color: var(--yes); color: var(--yes); }
.price-no { border-color: var(--no); color: var(--no); }
.price-label { font-weight: 700; }
.price-num { font: 700 1.5rem var(--mono); }
.price-note { color: var(--muted); font-size: .8rem; margin: 0 0 .4rem; }
.facts { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .82rem; color: var(--muted); margin: .25rem 0; }
.outcome { margin: .35rem 0 0; }
.state { display: inline-block; font: 600 .72rem/1 var(--mono); padding: .25rem .4rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.state-open, .state-live, .state-won, .state-fulfilled { border-color: var(--yes); color: var(--yes); }
.state-printed, .state-in_review, .state-owed, .state-closed, .state-resolved { border-color: var(--warn); color: var(--warn); }
.state-void, .state-voided, .state-lost, .state-released { color: var(--muted); }
.side { font-weight: 700; }
.side-yes { color: var(--yes); }
.side-no { color: var(--no); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); font-size: .88rem; }
th, td { text-align: left; padding: .4rem .55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: .78rem; }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.pid { font: .78rem var(--mono); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.acts { display: flex; gap: .3rem; }
form.builder, form.draft { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem .9rem; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .85rem; }
form .note { grid-column: 1 / -1; margin: 0; }
label { display: grid; gap: .2rem; font-size: .85rem; color: var(--muted); }
input, select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); min-width: 0; }
fieldset.sides { border: 0; padding: 0; margin: 0; display: flex; gap: .4rem; align-items: end; }
fieldset.sides legend { font-size: .85rem; color: var(--muted); padding: 0; margin-bottom: .2rem; }
.side-choice { display: flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border-radius: 6px; font-weight: 700; }
.side-choice.side-yes { background: var(--yes-bg); }
.side-choice.side-no { background: var(--no-bg); }
button { font: inherit; font-weight: 600; padding: .45rem .8rem; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--panel); cursor: pointer; }
button.danger { background: transparent; color: var(--no); border-color: var(--no); }
.acts button { padding: .25rem .5rem; font-size: .8rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ok, .alert, .unknown, .printed { border-radius: 8px; padding: .65rem .85rem; margin: .5rem 0 1rem; border: 1px solid; }
.ok { background: var(--yes-bg); border-color: var(--yes); }
.alert { background: var(--no-bg); border-color: var(--no); }
.unknown { background: var(--warn-bg); border-color: var(--warn); }
.printed { background: var(--panel); border-color: var(--warn); }
.printed h3 { margin-top: 0; }
.due strong { font-family: var(--mono); }
code { font: .8rem var(--mono); }
.attention { margin: 0; padding-left: 1.2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 600px) { .identity { margin-left: 0; width: 100%; } .identity select { flex: 1; } body { font-size: 14px; } }
/* PROMPT-015: a constrained value (reserve refuses, negative headroom, no usable bound account). */
.warn { color: var(--warn); font-weight: 600; }
/* PROMPT-015/016: the participant's payment-account status — a standing notice, not an outcome banner (QA-016 F-08). */
.binding-status { border-radius: 8px; padding: .5rem .75rem; margin: .5rem 0 1rem; border: 1px dashed; }
.binding-ok { border-color: var(--yes); background: var(--yes-bg); }
.binding-missing { border-color: var(--warn); background: var(--warn-bg); }
/*
 * PROMPT-022: the outcome board — one primitive for 2…32 outcomes. Dense tote-board rows (label · price · bar), not one
 * card per outcome; multi-column on wide screens, one column on phones, no horizontal overflow. Every state is said in
 * text (WINNER, "not available now", the checked radio), never by colour alone.
 */
.kind { margin: .3rem 0 .2rem; font-size: .85rem; color: var(--muted); }
.kind strong { color: var(--ink); }
.result { font-size: .95rem; }
.result strong { font-size: 1.05rem; }
.olist { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .3rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.market .olist { grid-template-columns: 1fr; }
.orow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label price" "bar bar"; align-items: baseline; gap: .1rem .6rem; padding: .4rem .6rem .35rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); min-width: 0; }
.orow .olabel { grid-area: label; font-weight: 600; overflow-wrap: break-word; word-break: normal; min-width: 0; }
.orow .oprice { grid-area: price; font: 700 1.05rem var(--mono); white-space: nowrap; }
.orow .oprice.none { color: var(--muted); font-weight: 400; }
.orow .obar { grid-area: bar; width: 100%; height: .3rem; }
.orow .oshares { font: .75rem var(--mono); color: var(--muted); justify-self: end; grid-column: 2; }
.orow .owin { font: 700 .7rem/1 var(--mono); padding: .2rem .35rem; border-radius: 4px; border: 1px solid var(--yes); color: var(--yes); justify-self: start; grid-column: 1; }
.orow.is-winner { border: 2px solid var(--yes); background: var(--yes-bg); }
meter.obar { appearance: none; -webkit-appearance: none; border: 0; background: var(--line); border-radius: 2px; }
meter.obar::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 2px; height: .3rem; }
meter.obar::-webkit-meter-optimum-value, meter.obar::-webkit-meter-suboptimum-value, meter.obar::-webkit-meter-even-less-good-value { background: var(--accent); border-radius: 2px; }
meter.obar::-moz-meter-bar { background: var(--accent); }
details.all-outcomes > summary { cursor: pointer; font-size: .85rem; color: var(--accent); padding: .2rem 0; }
details.all-outcomes .olist { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
/* The picker: native radios inside full-row labels (the whole row is the hit target; keyboard via the radio group). */
fieldset.outcomes { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.outcomes legend { font-size: .85rem; color: var(--muted); padding: 0; margin-bottom: .3rem; }
.pickable .orow { padding: 0; }
.ochoice { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio label price" "radio bar bar"; align-items: center; gap: .1rem .55rem; padding: .5rem .6rem; cursor: pointer; color: var(--ink); font-size: .95rem; min-height: 2.75rem; }
.ochoice input { grid-area: radio; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.ochoice .olabel { grid-area: label; }
.ochoice .oprice { grid-area: price; }
.ochoice .obar { grid-area: bar; }
.ochoice .ounavail { grid-column: 2 / -1; font-size: .75rem; color: var(--muted); }
.pickable .orow:has(input:checked) { border: 2px solid var(--accent); background: var(--panel); box-shadow: inset 4px 0 0 var(--accent); }
.pickable .orow:has(input:checked) .olabel::after { content: " — your pick"; font-weight: 400; font-size: .8rem; color: var(--accent); }
.pickable .orow.is-unavailable { opacity: .6; }
.pickable .orow.is-unavailable .ochoice { cursor: not-allowed; }
.pick-now { grid-column: 1 / -1; margin: 0; padding: .45rem .6rem; border-radius: 6px; background: var(--bg); border: 1px dashed var(--line); overflow-wrap: anywhere; }
.pick { font-weight: 700; overflow-wrap: break-word; }
.pick-unknown { font-weight: 400; color: var(--warn); }
.proposal-cat .pick { font-size: 1.05rem; }
form.builder-cat { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
label.wide { grid-column: 1 / -1; }
textarea { font: .85rem var(--mono); padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); width: 100%; resize: vertical; }
details.console-outcomes summary { cursor: pointer; }
details.console-outcomes ol { margin: .3rem 0 0; padding-left: 1.2rem; white-space: normal; font-size: .82rem; }
form.resolve, form.uphold { display: inline-flex; gap: .3rem; align-items: center; }
form.resolve select, form.uphold select { padding: .2rem .3rem; font-size: .8rem; max-width: 12rem; }
form.resolve button, form.uphold button { padding: .25rem .5rem; font-size: .8rem; }
.board { grid-auto-flow: row dense; }
@media (min-width: 900px) { .market-wide { grid-column: span 2; } .market-wide .olist { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); } }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } .ochoice { min-height: 3rem; } }
/* PROMPT-022 (QA-022 F-1, pre-existing): long unbroken ids (participant, ticket) wrap instead of widening the phone page. */
main p, main li, main dd { overflow-wrap: anywhere; }
.acts-cat { flex-wrap: wrap; white-space: normal; min-width: 15rem; }
/*
 * PROMPT-022-R1 (QA-022 L-3): console market rows wrap their cells instead of forcing the table wider than the page, so
 * every row's actions (binary acts, a categorical Resolve select) stay within view at desktop and tablet widths.
 */
tr[data-market] > td { white-space: normal; vertical-align: top; }
tr[data-market] > td.acts { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 9rem; }
tr[data-market] > td.acts-cat { min-width: 13rem; }
tr[data-market] form.resolve { flex-wrap: wrap; }
/*
 * PROMPT-023: the market question is the primary text of a market; the machine id stays visible as secondary identity.
 * Long questions (up to 200 code points) wrap naturally; a pre-PROMPT-023 market shows a muted, truthful fallback.
 */
.mtitle { display: grid; gap: .1rem; min-width: 0; }
.mtitle .question { margin: 0; font: 600 1.02rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-wrap: break-word; }
.mtitle .question.legacy { font-weight: 500; font-style: italic; color: var(--muted); font-size: .9rem; }
.mtitle .mid { font: .74rem var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.market .market-head { align-items: flex-start; }
.market .market-head .state { flex: none; }
td.mcell { white-space: normal; min-width: 11rem; max-width: 22rem; }
/* PROMPT-023-R1 (PROMPT-023-VERIFY M-1): the 11rem floor is for ticket / dispute tables only. In console market rows it
 * widened the table past its container at 820px and pushed row actions off-view (QA-022 R1 L-3). There a smaller floor
 * keeps the question readable while the PROMPT-022 state mix still fits at 820px; the question wraps (anywhere, if it
 * must) to the column the actions leave it. */
tr[data-market] > td.mcell { min-width: 6.5rem; }
td.mcell .question { font-size: .88rem; font-weight: 600; }
.builder-q { grid-column: 1 / -1; padding: .4rem .6rem; border-left: 3px solid var(--accent); background: var(--bg); }
.proposal .mtitle, .printed .mtitle { margin: -.2rem 0 .5rem; }
/*
 * PROMPT-024: the public Board — "what happens next?". The market is the content: question first, the canonical state
 * in text, MarketCraft's prices as the strongest figures, and a native button (a pick) as the way into a ticket on OPEN
 * markets. Typography, rules and numbers carry the design; no fake charts, no decoration. Wide screens get density.
 */
main:has(.board-page) { max-width: 1480px; }
.board-head { margin: .25rem 0 .6rem; padding-bottom: .6rem; border-bottom: 2px solid var(--ink); }
.board-head .kicker { margin: 0; font: 600 .74rem var(--mono); letter-spacing: .04em; color: var(--muted); }
.board-head h1 { margin: .1rem 0 .25rem; font: 800 clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem)/1.1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.01em; }
.board-head .lede { margin: 0; max-width: 62rem; font-size: .86rem; color: var(--muted); }
.board-filter { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 .2rem; }
.board-filter .fbtn { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: .3rem .65rem; font-size: .85rem; }
.board-filter .fbtn[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.board-filter .fbtn[aria-pressed="true"] .count { color: inherit; }
.board-sec { margin-top: .9rem; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .55rem; }
.sec-head h2 { margin: .2rem 0 .3rem; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; }
.sec-note { margin: 0; font-size: .8rem; color: var(--muted); }
.board-open { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.board-settled { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); align-items: start; }
.board-settled .market { background: transparent; }
.board .market { display: flex; flex-direction: column; gap: .3rem; padding: .65rem .75rem; border-radius: 6px; }
.board .market > * { margin-top: 0; margin-bottom: 0; }
.board .market .facts { margin-top: auto; padding-top: .3rem; border-top: 1px dashed var(--line); }
.board .market-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.mstate { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; flex: none; max-width: 45%; text-align: right; }
.sphrase { font-size: .7rem; color: var(--muted); line-height: 1.2; }
/* PROMPT-024 (QA-024 F-2): a long unbroken word in a valid question never sets a card's or a console column's minimum width. */
.mtitle .question { overflow-wrap: anywhere; }
.orow .olabel { overflow-wrap: anywhere; }
.facts .terms { color: var(--muted); opacity: .85; }
/* Binary price: the headline figures; on an OPEN market each side is the pick button. */
.board .price { margin: .1rem 0 0; }
.price.is-pickable .price-side { font: inherit; cursor: pointer; background: var(--panel); text-align: left; width: 100%; padding: .45rem .6rem; white-space: nowrap; min-width: 0; }
.board .price-side { gap: .6rem; white-space: nowrap; padding: .45rem .6rem; min-width: 0; }
.board-settled .price .price-num { font-size: 1.05rem; }
.board .price-num { font-size: clamp(1.1rem, .95rem + .4vw, 1.3rem); }
.price.is-pickable .price-yes:hover { background: var(--yes-bg); }
.price.is-pickable .price-no:hover { background: var(--no-bg); }
.board .pool { display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin: 0; font-size: .78rem; color: var(--muted); }
.board .pool .pool-side { display: inline-flex; gap: .3rem; padding: 0; background: none; }
.board .pool .pool-num { font: 600 .82rem var(--mono); }
/* Categorical: the outcome rows of an OPEN market are pick buttons (one per outcome; never one giant clickable card). */
.orow.is-pickable { padding: 0; }
.opick { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label price" "bar bar"; align-items: baseline; gap: .1rem .6rem; width: 100%; padding: .4rem .6rem .35rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-weight: 400; text-align: left; cursor: pointer; }
.opick:hover { background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }
.opick .olabel { grid-area: label; font-weight: 600; }
.opick .oprice { grid-area: price; font: 700 1.05rem var(--mono); }
.opick .obar { grid-area: bar; width: 100%; height: .3rem; }
.opick .oshares { font: .75rem var(--mono); color: var(--muted); justify-self: end; grid-column: 2; }
.board .orow { padding-top: .3rem; padding-bottom: .3rem; }
.board .olist { margin: 0; gap: .25rem; }
.board .kind { margin: 0; }
.from-board { border-left: 3px solid var(--accent); background: var(--panel); padding: .45rem .7rem; margin: .5rem 0; border-radius: 0 6px 6px 0; }
.from-board .mtitle { margin: .2rem 0; }
.builder-price { margin: .3rem 0 0; font-size: .85rem; }
@media (min-width: 1400px) { .board-open { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
@media (max-width: 600px) { .board-head h1 { font-size: 1.45rem; } .board-head .lede { font-size: .8rem; } .mstate { max-width: 50%; } }
/*
 * PROMPT-024-R1 (VERIFY L-1): a non-OPEN market's binary prices are read-only figures, not controls — no button border
 * or fill, so they never look clickable next to an OPEN market's pick buttons. Same values, same legibility.
 */
.board .price:not(.is-pickable) .price-side { border: 0; border-left: 3px solid; border-radius: 0; background: transparent; padding: .1rem .55rem; }
.board .price:not(.is-pickable) .price-yes { border-left-color: var(--yes); }
.board .price:not(.is-pickable) .price-no { border-left-color: var(--no); }
.stale-pick button { margin-left: .4rem; }

/* PROMPT-027: a card's latest activity — the latest trade's position, shares and price movement (in points). Direction
   is carried by the glyph and the signed text, never by colour alone; settled markets show it as quieter history. */
.activity { margin: 0 0 .5rem; font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.activity .act-tag { color: var(--muted); }
.activity .act-pos { font-weight: 700; }
.act-shares { font-variant-numeric: tabular-nums; }
.act-move { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-up { color: var(--yes); }
.act-down { color: var(--no); }
.act-flat { color: var(--muted); }
.act-none { color: var(--muted); }
.act-late { display: inline-block; margin-left: .25rem; padding: 0 .35rem; border: 1px solid var(--line); border-radius: 4px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.activity.act-hist { font-size: .8rem; color: var(--muted); }
.activity.act-hist .act-move, .activity.act-hist .side, .activity.act-hist .act-pos { color: var(--muted); font-weight: 600; }

/* PROMPT-034: the payout queue (host-neutral payment instructions; no action buttons) and the player's paid state. */
.payout-queue h4 { margin: .75rem 0 .25rem; font-size: .95rem; }
.payout-queue td.dest, .payout-queue .dest { font-family: var(--mono); overflow-wrap: anywhere; }
.settle { font-size: .85rem; color: var(--muted); margin-left: .35rem; }

/* ---------------------------------------------------------------------------------------------------------------
 * PROMPT-038: the public MarketCraft surface (docs/PUBLIC_WEB_EXPERIENCE.md §6). Evolves the tokens above; colour
 * encodes state and side only; numbers are tabular; system fonts, no web font (CSP has no font-src).
 * ------------------------------------------------------------------------------------------------------------- */
:root {
  --brand: #14532d; --brand-ink: #ffffff;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --radius: 10px; --w-page: 1120px; --w-text: 68ch;
  --t-display: clamp(2rem, 1.2rem + 3.6vw, 3.4rem); --t-h1: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); --t-h2: 1.3rem; --t-small: .85rem;
}
@media (prefers-color-scheme: dark) { :root { --brand: #4ade80; --brand-ink: #0b1a10; } }
html { scroll-behavior: auto; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { width: 100%; max-width: var(--w-page); flex: 1 0 auto; padding: var(--s5) var(--s4) var(--s7); }
main:focus { outline: none; }
.price-num, .pool-num, .oprice, .oshares, .count, .act-move, .act-shares, .h-price, td.num, .facts { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; padding: var(--s2) var(--s3); background: var(--ink); color: var(--panel); z-index: 10; }
.skip:focus { left: var(--s3); top: var(--s3); }

/* Header & navigation: three links, inline at every width (no hamburger). */
.top { gap: var(--s2) var(--s5); padding: var(--s3) var(--s4); }
.brand { display: inline-flex; align-items: center; gap: .4rem; font-size: 1.15rem; min-height: 44px; }
.mark { color: var(--brand); }
nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); }
nav a:hover { color: var(--ink); }

/* Buttons and calls to action (links styled as buttons stay links). */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s5); border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 1rem/1 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-secondary { background: transparent; border-color: var(--ink); }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0 0; }

/* Home. */
.hero { padding: var(--s6) 0 var(--s5); max-width: 46rem; }
.hero h1 { font-size: var(--t-display); line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: var(--w-text); margin: var(--s4) 0 0; }
.live, .steps, .trust { margin-top: var(--s6); }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); }
.step-list { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; grid-template-columns: 1fr; gap: var(--s3); }
.step-list li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.step-list h3 { margin: var(--s2) 0 var(--s1); font-size: 1.05rem; }
.step-list p { margin: 0; color: var(--muted); }
.step-n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: var(--panel); font: 700 .9rem var(--mono); }
.trust ul { padding-left: 1.2rem; margin: var(--s3) 0; max-width: var(--w-text); }
.trust li { margin: var(--s1) 0; }

/* Product states (empty, unavailable, denied, not found). */
.state-card { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: var(--s5); margin: var(--s4) 0; }
.state-card h2 { margin: 0 0 var(--s2); }
.state-card p { margin: var(--s2) 0 0; color: var(--muted); }
.diag { margin-top: var(--s3); font-size: var(--t-small); }
.notfound { padding: var(--s6) 0; }

/* Cards: the question leads; the whole card links to its page via the "Market details" link. */
.market { border-radius: var(--radius); }
.market .question { font: 600 1.05rem/1.3 system-ui, sans-serif; }
.mlink-row { margin: var(--s3) 0 0; }
.mlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.mlink:hover { text-decoration: underline; }

/* Pages: market detail and how it works. */
.page h1 { font-size: var(--t-h1); line-height: 1.15; margin: 0 0 var(--s2); }
.prose { max-width: var(--w-text); }
.prose section { margin-top: var(--s5); }
.prose p { line-height: 1.6; }
.crumb { margin: 0 0 var(--s3); }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.detail-head { display: flex; flex-direction: column; gap: var(--s2); }
.detail-head .mtitle h1 { overflow-wrap: anywhere; }
.state-text { font-weight: 600; margin: var(--s2) 0; }
.result-line { font-size: 1.1rem; margin: var(--s3) 0; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--s3); margin: var(--s4) 0; padding: 0; }
.facts-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.facts-grid dt { font-size: var(--t-small); color: var(--muted); }
.facts-grid dd { margin: var(--s1) 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail section { margin-top: var(--s5); }
.history { list-style: none; padding: 0; margin: var(--s3) 0; border-top: 1px solid var(--line); }
.hrow { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.h-tag { font: 600 .75rem var(--mono); color: var(--muted); min-width: 7rem; }
.h-what { overflow-wrap: anywhere; }
.trade-note { margin-top: var(--s5); }

/* Footer. */
.foot { border-top: 1px solid var(--line); background: var(--panel); padding: var(--s5) var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; font-size: var(--t-small); color: var(--muted); }
.foot p { margin: 0; }
.foot-wall { font-weight: 600; color: var(--ink); }

@media (min-width: 720px) {
  .step-list { grid-template-columns: repeat(2, 1fr); }
  main { padding: var(--s6) var(--s5) var(--s8); }
}
@media (min-width: 1080px) {
  .step-list { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
