/* PIXA Markets. Dark first, light by the reader's own setting. The money is the colour; the interface stays quiet, with
   one accent for what's live and what's chosen. docs/DESIGN.md has the rules. */
:root {
  --canvas: #0b0b0c;
  --surface: #121214;
  --raised: #1a1a1d;
  --hover: #202024;
  --border: #26262b;
  --border-strong: #3a3a41;
  --ink: #f4f4f2;
  --ink-2: #b4b4ae;
  --ink-3: #7d7d77;
  --accent: #c6f24e;
  --accent-ink: #0b0b0c;
  --buy: #5fd08a;
  --sell: #ff7a70;
  /* Words on a Buy or a Sell: dark on the bright dark-page colours, white on the deep light-page ones. */
  --on-buy: #06140c;
  --on-sell: #1a0705;
  --danger: #ff7a70;
  --inverse: #0b0b0c;
  --bar: 52px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f7f7f4;
    --surface: #ffffff;
    --raised: #efefeb;
    --hover: #e7e7e2;
    --border: #e1e1db;
    --border-strong: #c6c6bf;
    --ink: #0b0b0c;
    --ink-2: #4b4b47;
    --ink-3: #777771;
    --accent: #4f7f00;
    --accent-ink: #ffffff;
    --buy: #137a43;
    --sell: #c23a2e;
    --on-buy: #ffffff;
    --on-sell: #ffffff;
    --danger: #c23a2e;
    --inverse: #f7f7f4;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.4 var(--sans); }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.glyph { display: block; flex-shrink: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eyebrow { font: 600 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }

/* ── The bar ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
.bar { height: var(--bar); display: flex; align-items: center; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--canvas); }
.brand { display: flex; align-items: center; text-decoration: none; white-space: nowrap; }
/* The logo: the market's name in the page's monospace, between a pink bracket and a lime cursor (docs/DESIGN.md). The
   bracket is three sides of a box and the cursor a block on the letters' baseline, both sized by the type, so it's the
   same at any size. The cursor blinks a few times as the page arrives, then rests. */
.wordmark { display: inline-flex; align-items: center; font: 600 15px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: var(--ink); }
.wordmark::before { content: ''; flex: none; box-sizing: border-box; width: 0.56em; height: 1.6em; margin-right: 0.46em; border: 0.2em solid #ff4f8b; border-right: 0; }
.wordmark::after { content: ''; flex: none; width: 0.5em; height: 0.52em; margin-left: 0.1em; transform: translateY(0.1em); background: var(--accent); animation: caret 1.1s steps(1) 4; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wordmark::after { animation: none; } }
.venues { display: flex; align-items: stretch; gap: 2px; height: 100%; }
.venues button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 12px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.venues button:hover { color: var(--ink); }
.venues button[aria-current='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.tag { font: 600 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--ink-3); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.live { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.live .num { color: var(--ink-3); }
.pulse { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-3); }
.live.on .pulse { background: var(--accent); }
.live.off .pulse { background: var(--danger); }
.live.beat .pulse { animation: beat 0.9s ease-out; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.wallets { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13px; white-space: nowrap; max-width: 180px; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover { background: var(--hover); }
.chip.empty { color: var(--ink-2); }

/* ── The screen: everything in view at once on a computer ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 276px minmax(0, 1fr) 372px; grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); height: calc(100dvh - var(--bar)); }
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.markets { grid-row: 1 / 3; border-right: 1px solid var(--border); }
.book { grid-column: 2; grid-row: 1; }
.activity { grid-column: 2; grid-row: 2; border-top: 1px solid var(--border); flex-direction: row; }
.ticket { grid-column: 3; grid-row: 1 / 3; border-left: 1px solid var(--border); background: var(--surface); }
.scroll { overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.panel-head { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-head .end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.panel-head .end.muted { color: var(--ink-3); font-size: 12px; }
/* A pool's activity: whether each swap bought the pool's token or sold it, in the book's two colours and in words. */
.did-buy { color: var(--buy); }
.did-sell { color: var(--sell); }

/* Markets: every venue and what it trades, down one side. */
.group { padding: 12px 8px 4px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 0 6px 8px; }
.group-head .end { margin-left: auto; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.state i { width: 6px; height: 6px; border-radius: 2px; background: var(--ink-3); }
.state.on i { background: var(--accent); }
.market { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.market:hover { background: var(--surface); }
.market[aria-current='true'] { background: var(--raised); }
.market[disabled] { cursor: default; opacity: 0.6; }
.market strong { display: block; font-weight: 600; }
.market small { display: block; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market .num { text-align: right; }
.market .num.two { align-items: flex-end; white-space: nowrap; }
.market .num em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.pair-coins { display: inline-flex; gap: 3px; align-items: center; }
.venue-sign { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--ink-2); }
/* What each coin is worth by its chain's witnesses: three figures on one line. */
.coin-prices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 6px; padding: 2px 8px 10px; }
.coin-prices button { display: grid; grid-template-columns: 16px auto; column-gap: 6px; align-items: center; justify-content: start; white-space: nowrap; text-align: left; background: none; border: 0; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; color: inherit; cursor: pointer; }
.coin-prices button:hover { background: var(--surface); }
.opens { cursor: pointer; }
.opens:hover b, .opens:focus-visible b { text-decoration: underline dotted; text-underline-offset: 3px; }
.worked-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.worked-head b { margin-left: auto; font: 650 20px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.worked-sub { font: 650 13px/1.3 var(--sans); color: var(--ink-2); margin-top: 4px; }
.sheet-body .note a { color: var(--ink); text-underline-offset: 2px; }
.coin-prices svg { grid-row: span 2; }
.coin-prices small { color: var(--ink-3); font-size: 10.5px; line-height: 1.2; letter-spacing: 0.04em; }
.coin-prices b { font: 600 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; }
.group-head .muted { font-size: 11.5px; }
.facts { margin-top: auto; padding: 12px 14px 14px; border-top: 1px solid var(--border); display: grid; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.facts a { color: var(--ink); text-underline-offset: 2px; }
.facts .row { display: flex; justify-content: space-between; gap: 10px; }
.facts .row span:first-child { color: var(--ink-3); }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* The book: who sells and who buys, side by side. */
.pair-head { min-height: 52px; gap: 18px; }
.pair-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
/* One row of figures: one that doesn't fit whole wraps out of sight, so none is ever cut through. */
.stats { display: flex; flex-wrap: wrap; column-gap: 22px; row-gap: 12px; height: 32px; min-width: 0; overflow: hidden; }
.stat { display: grid; gap: 1px; white-space: nowrap; height: 32px; align-content: center; }
.stat small { color: var(--ink-3); font-size: 11.5px; }
.stat b { font: 600 13.5px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.sides { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; flex: 1; }
/* A market's chart, in the book's place: the price and the choices over it, the drawing, and its key under it. */
.book-chart { margin-left: auto; flex-shrink: 0; }
.book-chart button { padding: 5px 12px; }
.chart-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px 4px; min-height: 46px; }
.chart-head .readout { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 13px; }
.chart-head .readout b { color: var(--ink); font: 600 16px/1.2 var(--mono); font-variant-numeric: tabular-nums; margin-right: 8px; }
.chart-head .readout small { font-size: 13px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; margin: 0; }
.chart-controls { display: flex; gap: 8px; flex-shrink: 0; }
.chart-controls .seg button { padding: 5px 10px; }
.chart-plot { flex: 1; min-height: 240px; position: relative; }
.chart-plot > svg { position: absolute; inset: 0; display: block; outline: none; touch-action: pan-y; }
.chart-plot.refreshing > svg { opacity: 0.55; }
.chart-plot svg text { font: 11px var(--mono); fill: var(--ink-3); }
.chart-plot svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-plot svg .vol { fill: var(--ink-3); opacity: 0.45; }
.chart-plot svg .price-line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-plot svg .price-line.soft { stroke: var(--ink-3); stroke-width: 1.5; }
.chart-plot svg .mark-buy { fill: var(--buy); stroke: var(--canvas); stroke-width: 2; paint-order: stroke; }
.chart-plot svg .mark-sell { fill: var(--sell); stroke: var(--canvas); stroke-width: 2; paint-order: stroke; }
.chart-plot svg .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-plot svg .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.chart-plot svg .hit { fill: transparent; }
.chart-plot svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 14px 12px; color: var(--ink-3); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .end { margin-left: auto; }
.chart-legend .key-line { width: 16px; height: 2px; border-radius: 2px; background: var(--ink-2); }
.chart-legend .key-line.soft { background: var(--ink-3); }
.chart-legend .key-buy { color: var(--buy); font-style: normal; font-size: 11px; }
.chart-legend .key-sell { color: var(--sell); font-style: normal; font-size: 11px; }
.side { display: flex; flex-direction: column; min-width: 0; min-height: 0; container: side / inline-size; }
.side + .side { border-left: 1px solid var(--border); }
.side-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px 8px; }
.side-head strong { font-weight: 650; }
.side-head small { color: var(--ink-3); }
.cols, .offer { display: grid; grid-template-columns: minmax(64px, 0.9fr) minmax(64px, 1fr) minmax(64px, 1fr) minmax(70px, 1.1fr); gap: 8px; align-items: center; padding: 0 14px; }
.cols { height: 26px; border-bottom: 1px solid var(--border); }
.cols span, .tape-cols span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cols span, .offer .num { text-align: right; }
.cols span:first-child, .offer .price { text-align: left; }
.offer { position: relative; width: 100%; height: 34px; border: 0; background: none; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.offer:hover { background: var(--surface); }
.offer[aria-current='true'] { background: var(--raised); box-shadow: inset 2px 0 0 var(--accent); }
.offer .depth { position: absolute; inset: 0 auto 0 0; pointer-events: none; opacity: 0.1; }
.asks .depth { background: var(--sell); }
.bids .depth { background: var(--buy); }
.asks .price { color: var(--sell); }
.bids .price { color: var(--buy); }
.offer .who { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.offer.own .who { color: var(--ink); font-weight: 600; }
.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.nothing { padding: 22px 14px; color: var(--ink-3); font-size: 13px; }
.nothing .link { color: var(--ink-2); font-weight: 600; }
.planned { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 32px; color: var(--ink-2); }
.planned .venue-sign { width: 44px; height: 44px; }
.planned strong { color: var(--ink); font-size: 17px; }
.planned p { max-width: 52ch; }
.expected { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 6px; }
.expected .chip { cursor: default; }
.expected .chip:hover { background: var(--surface); }
/* Reserves: what the escrow accounts hold against what they owe. */
.cover { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font-weight: 600; font-size: 12.5px; white-space: nowrap; border: 1px solid var(--border); color: var(--ink-2); }
.cover.yes { color: var(--buy); border-color: color-mix(in srgb, var(--buy) 40%, transparent); background: color-mix(in srgb, var(--buy) 10%, transparent); }
.cover.no { color: var(--sell); border-color: color-mix(in srgb, var(--sell) 50%, transparent); background: color-mix(in srgb, var(--sell) 12%, transparent); }
.cover.brief { height: 20px; padding: 0 7px 0 5px; font-size: 11.5px; }
.cover-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--ink-3); }
.cover-dot.yes { background: var(--buy); }
.cover-dot.no { background: var(--sell); }
.reserves { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 12px; }
/* The page scrolls, its parts never shrink: a table with overflow hidden has no least height of its own, so in a short
   window the money table was squeezed to two rows and HIVE and HBD were cut off. */
.reserves > * { flex-shrink: 0; }
.reserves-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.reserves-head .end { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.reserves-lede { max-width: 96ch; }
.reserve-table { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.reserve-cols, .reserve-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(6, minmax(86px, 1fr)) 118px; gap: 12px; align-items: center; padding: 0 14px; }
.reserve-cols { height: 30px; border-bottom: 1px solid var(--border); }
.reserve-cols span { text-align: right; white-space: nowrap; }
.reserve-cols span:first-child { text-align: left; }
.reserve-row { height: 44px; }
.reserve-row + .reserve-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.reserve-row .money { display: flex; align-items: center; gap: 8px; min-width: 0; }
.reserve-row .money small { color: var(--ink-3); white-space: nowrap; }
.reserve-row .cell { text-align: right; color: var(--ink-2); }
.reserve-row .cell.strong { color: var(--ink); font-weight: 600; }
.reserve-row .cell.bad, .reserve-card .bad { color: var(--sell); font-weight: 600; }
.reserve-row .verdict { display: flex; justify-content: flex-end; }
.reserve-row.is-short { background: color-mix(in srgb, var(--sell) 7%, transparent); }
.reserve-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.reserve-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 12px 14px; display: grid; gap: 7px; }
.reserve-card .card-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.reserve-card .card-head small { color: var(--ink-3); white-space: nowrap; }
.pool-card .card-head .pair { display: inline-flex; gap: 2px; }
.pool-card .card-head strong { white-space: nowrap; }
.pool-card .pool-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pool-card .pool-price small { color: var(--ink-3); white-space: nowrap; }
.pool-card .pool-price b { font-size: 18px; white-space: nowrap; }
.pool-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.pool-card .row span:first-child { color: var(--ink-3); }
.pool-card .ways { margin-top: 4px; }
.pool-card .note { margin: 0; }
/* A venue that's read and can be traded from here: its tag says so in the page's own accent, never grey. */
.tag.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pool-coins { display: inline-flex; gap: 2px; }
.pair-title .tag { margin-left: 4px; }
.pool-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 14px; border-bottom: 1px solid var(--border); min-height: 44px; }
.pool-pick { flex: 0 0 auto; }
.pool-holds { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; font-size: 13px; }
.pool-holds span { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.pool-holds small { color: var(--ink-3); font-size: 12px; }
.pool-holds b { font: 600 13.5px/1.2 var(--mono); }
.pool-holds i { font-style: normal; color: var(--ink-3); }
.pool-holds .read { color: var(--ink-3); font: 12px/1.2 var(--mono); }
.books { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 12px 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.books small { display: block; color: var(--ink-3); font-size: 11.5px; }
.books b { font: 600 17px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.books p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.held-coin { display: flex; align-items: center; gap: 8px; }
.held-coin strong { font-weight: 500; color: var(--ink-2); }
.mine-row b.num { font: 600 13.5px/1.2 var(--mono); white-space: nowrap; }
.note.pad { padding: 10px 14px; margin: 0; }
.leeway { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 12px; }
.leeway .seg { flex: 0 0 auto; padding: 2px; }
.leeway .seg button { padding: 4px 8px; font-size: 12px; }
.leeway small { white-space: nowrap; }
/* A price said both ways in a table: dollars, and under them the same in the market's own money. A row that carries
   two lines is a little taller than one that carries one. */
.two { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; min-width: 0; }
.two b { font-weight: inherit; }
.two i { font-style: normal; font-size: 11px; color: var(--ink-3); }
@media (min-width: 820px) {
  .side.usd .offer { height: 42px; }
  .half.usd .tape-row { height: 38px; }
}
/* A side's heading of a pool's book wraps what it says under its name where its column is narrow. */
.pool-side .side-head { display: flex; flex-wrap: wrap; row-gap: 2px; }
.reserve-card .card-head .end { margin-left: auto; font-size: 12px; white-space: nowrap; }
.reserve-card .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.reserve-card .row .num { color: var(--ink); }
.steps-list { list-style: none; counter-reset: step; display: grid; gap: 8px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--ink-2); font-size: 13px; }
.steps-list li::before { content: counter(step); font: 11px/18px var(--mono); color: var(--ink-3); text-align: center; border: 1px solid var(--border); border-radius: 50%; width: 18px; height: 18px; }
.venues .cover-dot { margin-left: 1px; }
.ledger { flex-shrink: 0; }
.ledger-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.4fr) minmax(110px, 1fr) minmax(140px, 1fr); gap: 12px; align-items: center; padding: 0 14px; height: 34px; font-size: 13px; }
.ledger-row + .ledger-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.ledger-row.eyebrow { height: 30px; font-size: 10.5px; }
.ledger-row .id, .ledger-row .who { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row .held { display: flex; align-items: center; justify-content: flex-end; gap: 7px; text-align: right; }
/* Nothing to trade: one panel in the room of the book, the tape and the ticket. */
.app.single #book { grid-column: 2 / -1; grid-row: 1 / -1; border-bottom: 0; }
.app.single #activity, .app.single #ticket-home { display: none; }

/* Activity: what just traded, and what's yours. */
.half { flex: 1; min-width: 0; display: flex; flex-direction: column; container: half / inline-size; }
.half:first-child { flex: 1.2; }
.half + .half { border-left: 1px solid var(--border); }
.feed-head { gap: 6px; }
.feed-head .end { min-width: 0; }
.provider-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.provider-table th, .provider-table td { padding: 6px 5px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--border); }
.provider-table :is(th, td):first-child { padding-left: 14px; text-align: left; }
.provider-table :is(th, td):last-child { padding-right: 14px; }
.provider-table thead th { position: sticky; top: 0; z-index: 1; background: var(--canvas); color: var(--ink-2); font-weight: 550; font-size: 11.5px; white-space: nowrap; }
.provider-table thead button { padding: 2px 0; background: none; border: 0; font: inherit; color: inherit; }
.provider-table thead button:hover, .provider-table thead button:focus-visible { text-decoration: underline; }
.provider-name { overflow-wrap: anywhere; text-align: left; }
.provider-table .num { font-variant-numeric: tabular-nums; }
.position-balance div { white-space: nowrap; }
.position-balance small, .position-percent { color: var(--ink-2); font-size: 10.5px; }
.position-percent { display: block; }
.position-sums b { overflow-wrap: anywhere; }
@container half (max-width: 370px) {
  .provider-table :is(th, td):first-child { padding-left: 8px; }
  .provider-table :is(th, td):last-child { padding-right: 8px; }
  .feed-head { padding-inline: 8px; }
  .feed-head .end.muted { font-size: 11px; }
}
.tape-row, .tape-cols { display: grid; grid-template-columns: 34px 48px 64px 62px 62px minmax(0, 1fr); gap: 8px; align-items: center; padding: 0 14px; }
.tape-row .side-word { font-weight: 600; font-size: 12.5px; }
.tape-cols span:nth-child(2) { text-align: left; }
.tape-cols { height: 26px; border-bottom: 1px solid var(--border); }
.tape-row { height: 30px; font-size: 13px; }
.tape-row .num, .tape-cols span { text-align: right; }
.tape-row .num:first-child, .tape-cols span:first-child { text-align: left; }
.tape-row .people { text-align: right; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.mine-row { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 13px; }
.mine-row > div:first-child { flex: 1; min-width: 0; }
.mine-row strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-row small { display: block; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-row small a { color: var(--ink-2); }
.mine-row .when { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.mini { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: none; font-weight: 600; font-size: 12px; white-space: nowrap; }
.mini:hover { background: var(--hover); }
.mini:disabled { opacity: 0.6; cursor: default; }
/* Show older under the bridge's crossings. */
.older-row { display: flex; justify-content: center; padding: 14px 0 6px; }
a.mini { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.working { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); animation: blink 1s steps(2) infinite; margin-right: 6px; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ── The ticket ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.ticket-body { display: flex; flex-direction: column; gap: 14px; padding: 14px; overflow-y: auto; min-height: 0; flex: 1; }
.seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--canvas); }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 8px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--inverse); }
.seg.way button[aria-pressed='true'].buy { background: var(--buy); color: var(--on-buy); }
.seg.way button[aria-pressed='true'].sell { background: var(--sell); color: var(--on-sell); }
.seg.small button { padding: 6px; font-size: 12.5px; }
.seg.which { margin-bottom: -4px; }
.picked { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.picked div { flex: 1; min-width: 0; }
.picked strong { display: block; font-weight: 600; }
.picked small { display: block; color: var(--ink-3); font-size: 12px; }
.field { display: grid; gap: 5px; align-content: start; }
.field label { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.box { display: flex; align-items: center; gap: 8px; background: var(--canvas); border: 1px solid var(--border); border-radius: 10px; padding: 0 8px 0 12px; min-height: 46px; }
.box:focus-within { border-color: var(--border-strong); }
.box.bad { border-color: var(--danger); }
.box input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: 0; font: 600 18px/1.2 var(--mono); font-variant-numeric: tabular-nums; padding: 8px 0; }
.box.text input { font: 500 15px/1.2 var(--sans); }
.unit { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.hint { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-3); font-size: 12px; min-height: 17px; }
.hint.bad { color: var(--danger); }
.hint button { background: none; border: 0; padding: 0; text-decoration: underline; font-weight: 600; color: var(--ink-2); }
.pair-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box.off { opacity: .55; }
.least summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); list-style: none; }
.least summary::-webkit-details-marker { display: none; }
.least summary span { text-decoration: underline; text-underline-offset: 2px; color: var(--ink-3); }
.least[open] summary { display: none; }
.sums { display: grid; gap: 7px; padding: 11px 12px; border-radius: 10px; background: var(--canvas); border: 1px solid var(--border); }
.line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.line span { color: var(--ink-2); }
.line b { font: 600 13.5px/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.total { padding-top: 7px; border-top: 1px solid var(--border); }
.line.total b { font-size: 16px; }
.to { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); min-height: 20px; }
.to b { color: var(--ink); font-weight: 600; }
.button, .quiet, .ghost { border: 1px solid transparent; border-radius: 10px; padding: 11px 14px; font-weight: 650; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.button { background: var(--ink); color: var(--inverse); }
/* A label that's longer than its button goes onto a second line, evenly, never off its edges. */
.button { white-space: normal; text-wrap: balance; text-align: center; line-height: 1.25; }
.button.buy { background: var(--buy); color: var(--on-buy); }
.button.sell { background: var(--sell); color: var(--on-sell); }
.button:hover { filter: brightness(1.06); }
.button:disabled { opacity: 0.35; cursor: default; filter: none; }
.quiet { background: var(--raised); border-color: var(--border); }
.quiet:hover { background: var(--hover); }
.ghost { background: none; color: var(--ink-2); padding: 8px; }
.ghost:hover { color: var(--ink); }
.note { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.copy { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--canvas); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; }
.copy:hover { background: var(--hover); }
.copy div { flex: 1; min-width: 0; }
.copy small { display: block; color: var(--ink-3); font-size: 11.5px; }
.copy strong { display: block; overflow-wrap: anywhere; font-weight: 600; }
.copy.memo strong { font: 500 12.5px/1.4 var(--mono); }
.copy .glyph { color: var(--ink-3); }
.ways { display: grid; gap: 8px; }
.result { display: grid; gap: 6px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--canvas); }
.result strong { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.result strong .working { margin-right: 0; }
/* What a trade takes, in three lines, at the foot of the ticket: there for whoever is new, out of the way of the form. */
.hint .make { margin-left: auto; white-space: nowrap; }
.box.kept { padding: 10px 12px; align-items: flex-start; }
.box .at { color: var(--ink-3); font-weight: 600; margin-right: -4px; }
.mini.strong.done { background: none; color: var(--buy); border-color: color-mix(in srgb, var(--buy) 45%, transparent); }
.hint button + .make { margin-left: 12px; }
.hint span + button { margin-left: auto; }
.box.kept strong { display: block; font-weight: 600; }
.box.kept small { display: block; color: var(--ink-2); font-size: 12.5px; }
.box.small { min-height: 28px; height: 28px; padding: 0 8px; border-radius: 8px; width: 132px; flex-shrink: 0; }
.box.small input { width: 100%; min-width: 0; background: none; border: 0; outline: 0; font: 500 13px/1.2 var(--sans); }
.mini.strong { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
.mini.strong:hover { background: var(--ink-2); }
.kept-row { background: color-mix(in srgb, var(--accent) 7%, transparent); flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 14px; }
.kept-row .send { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kept-row .send small { flex-shrink: 0; overflow: visible; }
.kept-row .box.small { flex: 1; width: auto; min-width: 0; }
/* Where someone is in a trade: stops along a dotted line. */
.track { list-style: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.track li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.track li + li::before { content: ''; width: 100%; min-width: 14px; height: 2px; background: repeating-linear-gradient(to right, var(--border-strong) 0 3px, transparent 3px 6px); }
.track li + li { flex: 1; }
.track .dot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--border-strong); display: grid; place-items: center; font: 600 10.5px/1 var(--mono); }
.track li.now { color: var(--ink); }
.track li.now .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.track li.done { color: var(--ink-2); }
.track li.done .dot { border-color: var(--buy); color: var(--buy); }
.track li.done + li::before { background: repeating-linear-gradient(to right, var(--buy) 0 3px, transparent 3px 6px); }
.track.progress { margin-bottom: 12px; }
.track.progress li.now .dot { background: none; border-color: var(--accent); animation: beat 1s steps(2) infinite; }
.track.progress.bad li.done .dot { border-color: var(--sell); color: var(--sell); }
@keyframes beat { 50% { background: var(--accent); } }
.ready { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 10px; border: 1px dashed var(--border-strong); background: none; color: var(--ink-2); font-size: 12.5px; }
.ready:hover { background: var(--hover); color: var(--ink); }
.report { display: grid; gap: 8px; }
.report textarea, .report input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--canvas); color: var(--ink); font: 500 14.5px/1.4 var(--sans); resize: vertical; }
.row-links { display: flex; gap: 12px; white-space: nowrap; }
.ticket-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.ticket-foot .more { justify-self: start; font-size: 12.5px; }
.ticket-foot ol { list-style: none; counter-reset: step; display: grid; gap: 6px; }
.ticket-foot li { counter-increment: step; display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.ticket-foot li::before { content: counter(step); font: 11px/18px var(--mono); color: var(--ink-3); text-align: center; border: 1px solid var(--border); border-radius: 50%; width: 18px; height: 18px; }

/* ── Sheets, toasts ───────────────────────────────────────────────────────────────────────────────────────────────── */
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 4px 18px; }
.sheet-head h2 { font: 650 16px/1.3 var(--sans); letter-spacing: -0.01em; }
.sheet-body { display: grid; gap: 14px; padding: 10px 18px 20px; overflow-y: auto; }
.sheet-body .ticket-body { padding: 0; overflow: visible; }
.icon { background: none; border: 0; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.icon:hover { background: var(--hover); }
.how { display: grid; gap: 12px; counter-reset: step; list-style: none; }
.how li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--ink-2); }
.how li::before { content: counter(step); width: 24px; height: 24px; border: 1px solid var(--border-strong); border-radius: 50%; font: 12px/22px var(--mono); text-align: center; color: var(--ink-3); }
.how li strong { color: var(--ink); display: block; }
.wallet-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.wallet-row > div { flex: 1; min-width: 0; }
.wallet-row strong { display: block; }
.wallet-row small { display: block; color: var(--ink-3); font-size: 12.5px; }
.wallet-row .mini { height: 30px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); background: var(--ink); color: var(--inverse); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 20; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } .flash, .live.beat .pulse, .working, .track.progress li.now .dot { animation: none; } }

/* ── A narrower computer: markets become a strip over the book ─────────────────────────────────────────────────────── */
.only-phone { display: none; }
/* A column that's short of room says less, and says it whole: the book drops the total (price times amount) before
   it would cut a name short, and the tape drops who traded. Each goes by its own width, whatever the window's. */
@media (min-width: 820px) {
  @container side (max-width: 369px) {
    .cols, .offer { grid-template-columns: minmax(60px, 0.8fr) minmax(64px, 1fr) minmax(118px, 1.5fr); }
    .cols span:nth-child(3), .offer .num:nth-child(4) { display: none; }
  }
  @container half (max-width: 439px) {
    .tape-cols, .tape-row { grid-template-columns: 34px 48px minmax(64px, 1fr) minmax(62px, 1fr) minmax(62px, 1fr); }
    .tape-cols span:nth-child(6), .tape-row .people { display: none; }
  }
}
/* A short window keeps the ticket to the trade itself. */
@media (max-height: 979px) { .ticket-foot { display: none; } }

@media (max-width: 1179px) {
  .app { grid-template-columns: minmax(0, 1fr) 348px; grid-template-rows: auto minmax(0, 1.1fr) minmax(0, 1fr); }
  .markets { grid-column: 1; grid-row: 1; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; align-items: center; overflow-x: auto; padding: 6px 8px; gap: 4px; }
  .markets .group { display: contents; }
  .markets .group-head, .markets .facts { display: none; }
  /* One row: each market by its own place (set on it), and the prices and reserves after them all. */
  .markets .coin-prices, .markets .reserves-market { order: 999; }
  .market { width: auto; flex-shrink: 0; padding: 6px 10px; }
  .coin-prices { display: flex; flex-shrink: 0; gap: 14px; padding: 6px 10px; align-items: center; }
  .market small, .market .num i { display: none; }
  .book { grid-column: 1; grid-row: 2; }
  .activity { grid-column: 1; grid-row: 3; }
  .ticket { grid-column: 2; grid-row: 1 / 4; }
  /* Less room: the tape says what traded and leaves out who, and the head keeps its five figures. */
  .app.single #book { grid-column: 1 / -1; grid-row: 2 / -1; }
  .reserve-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reserve-cards .reserve-card:last-child { grid-column: 1 / -1; }
  .reserve-cols, .reserve-row { grid-template-columns: minmax(112px, 1.2fr) repeat(6, minmax(62px, 1fr)) 100px; gap: 8px; }
  .reserves-head .end { display: none; }
  .live .words { display: none; }
  .stats { column-gap: 16px; }
  .markets { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
}

/* ── A phone: one calm column, one thing at a time ────────────────────────────────────────────────────────────────── */
@media (max-width: 819px) {
  :root { --bar: 50px; }
  body { font-size: 15px; }
  .bar { gap: 10px; padding: 0 12px; position: sticky; top: 0; z-index: 5; }
  .venues, .live .words { display: none; }
  .chip { height: 34px; }
  .app { display: block; height: auto; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .markets { padding: 10px 12px; gap: 8px; border-bottom: 0; scrollbar-width: none; }
  .market { border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px 7px 8px; gap: 8px; }
  .market[aria-current='true'] { border-color: var(--border-strong); }
  .market .num { display: none; }
  .ticket { display: none; }
  .only-phone { display: flex; }
  .pair-head { min-height: 0; padding: 4px 12px 12px; border-bottom: 0; gap: 14px; }
  .pair-title { display: none; }
  .stats { gap: 20px; width: 100%; }
  .stat:nth-child(n + 4) { display: none; }
  .chart-panel { flex: none; }
  .chart-plot { flex: none; height: 300px; min-height: 0; }
  .chart-head { padding: 6px 12px 4px; }
  /* On a phone the price and what it is are two lines, beside the choices, so neither is cut short. */
  .chart-head .readout { display: grid; white-space: normal; }
  .chart-head .readout small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chart-legend .end { margin-left: 0; width: 100%; }
  .sides { display: block; }
  .side, .half { display: none; border: 0 !important; }
  .side.show, .half.show { display: flex; }
  .side-head { display: none; }
  .cols, .offer, .tape-cols, .tape-row, .mine-row, .nothing { padding-left: 12px; padding-right: 12px; }
  .offer { height: 46px; grid-template-columns: minmax(70px, 1fr) minmax(70px, 1fr) minmax(0, 1.2fr); }
  .cols { grid-template-columns: minmax(70px, 1fr) minmax(70px, 1fr) minmax(0, 1.2fr); }
  .cols span:nth-child(3), .offer .num:nth-child(4) { display: none; }
  .pool-side.bids .cols { display: none; }
  .pool-side.bids .side-head { padding-top: 12px; }
  .activity { border-top: 0; display: block; }
  .tape-row { height: 40px; }
  .tape-cols, .tape-row { grid-template-columns: 36px 50px minmax(64px, 1fr) minmax(56px, 1fr) minmax(64px, 1fr); }
  .ticket-foot { display: none; }
  .tape-cols span:nth-child(6), .tape-row .people { display: none; }
  .mine-row { min-height: 52px; }
  .scroll { overflow: visible; }
  .reserves { padding: 10px 12px 20px; overflow: visible; }
  .reserves-head { flex-wrap: wrap; row-gap: 8px; }
  .reserve-cols { display: none; }
  .reserve-row { height: auto; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; }
  .reserve-row .money { grid-column: 1; }
  .reserve-row .verdict { grid-column: 2; grid-row: 1; }
  .reserve-row .cell { display: flex; justify-content: space-between; gap: 10px; text-align: left; }
  .reserve-row .cell::before { content: attr(data-label); font-family: var(--sans); font-weight: 400; color: var(--ink-3); }
  .reserve-cards { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 9px 14px; gap: 2px 12px; }
  .ledger-row.eyebrow { display: none; }
  .ledger-row .id, .ledger-row .who { font-size: 12px; }
  .app.single .planned { min-height: calc(100dvh - var(--bar) - 150px); }
  /* Solid, with a hairline over it: nothing shows through what's pressed at the foot. */
  .post-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--canvas); border-top: 1px solid var(--border); z-index: 4; }
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; border-bottom: 0; max-height: 92dvh; }
  .box input { font-size: 20px; }
  .box.text input { font-size: 16px; }
}

/* The page that shows the glyphs. */
.doc { overflow: auto; }
.sheet { max-width: 880px; margin: 0 auto; padding: 40px 20px 80px; display: grid; gap: 28px; }
.sheet h1 { font-size: 28px; letter-spacing: -0.02em; }
.sheet h2 { font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.lede { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: 13px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 12px; background: var(--surface); }
.swatch div { display: flex; align-items: flex-end; gap: 12px; min-height: 64px; color: var(--ink); }
.swatch figcaption { font: 12px/1 var(--mono); color: var(--ink-3); }

/* Something worth a second look before sending: said in the ticket, never by colour alone. */
.warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--ink); font-size: 12.5px; line-height: 1.4; }
.warn[hidden] { display: none; }
.warn svg { flex: none; margin-top: 2px; color: var(--danger); }
/* A sum's figure, and what it's worth to its left: under it, both to the right, where the line has no room for both.
   The figure comes first in the page (row-reverse), so the line's baseline is the figure's. Its label gives way first,
   down to its longest word; past that the figure's amount and its coin may take a line each. Nothing runs past the box. */
.line > span:first-child { flex: 0 6 auto; min-width: 0; }
.line .figure { display: inline-flex; flex: 0 1 auto; flex-direction: row-reverse; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; min-width: 0; text-align: right; }
.line .figure b { white-space: normal; overflow-wrap: break-word; min-width: 0; }
.line .figure small { color: var(--ink-3); font-size: 11.5px; font-weight: 400; white-space: nowrap; }
.line .figure small:empty { display: none; }
.sums > .line.total:first-child { padding-top: 0; border-top: 0; }
/* Your accounts: each chain's ways of connecting. */
.wallet { gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.wallet:last-child { border-bottom: 0; padding-bottom: 0; }
.key-field { display: grid; gap: 6px; }
/* Connecting an account: its name, then its key if they'd like to sign here, then Connect, with what's happening beside it. */
.connect { display: grid; gap: 12px; }
.connect .note { margin-top: 2px; }
.connect .optional { color: var(--ink-3); font-weight: 400; }
.connect-go { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.connect-go .hint { flex: 1; min-width: 0; margin: 0; }
.connect-go .hint:empty { display: none; }
.key-field .hint:empty { display: none; }
.key-field .box[hidden] { display: none; }
.or-name summary, .add-key summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; list-style: none; }
.or-name summary::-webkit-details-marker, .add-key summary::-webkit-details-marker { display: none; }
.or-name[open] summary, .add-key[open] summary { margin-bottom: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.or-name > * + *, .add-key > * + * { margin-top: 6px; }
.add-key { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; }
.keep-key summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; list-style: none; }
.keep-key summary::-webkit-details-marker { display: none; }
.keep-key[open] summary { margin-bottom: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.keep-key > * + * { margin-top: 6px; }
.keep-key .hint:empty { display: none; }
.add-key.unlock { display: grid; gap: 8px; }
.add-key.unlock strong { font-size: 13px; }
.add-key.unlock > * + * { margin-top: 0; }
.button .working { margin-right: 8px; }
@media (max-width: 819px) {
  .wordmark { font-size: 12.5px; letter-spacing: 0.08em; }
  /* The name stays whole; it's the accounts' names that give way, each to an ellipsis, so two long ones never push the
     bar past the screen (@greenmaster and @gr33nm4ster did, 22 November 2026). The full name is in each chip's label
     and at the head of Yours. */
  .brand { flex: none; }
  .wallets { min-width: 0; }
  .wallets .chip { min-width: 0; flex: 0 1 auto; }
  .chip span { min-width: 0; }
}
/* The left column never cuts off what it holds: on a short window its rows sit closer, and it scrolls if it must. */
@media (min-width: 820px) {
  .markets { overflow-y: auto; scrollbar-width: none; }
  .markets::-webkit-scrollbar { display: none; }
}
@media (min-width: 820px) and (max-height: 880px) {
  .market { padding-top: 5px; padding-bottom: 5px; }
  .group { padding-top: 8px; padding-bottom: 2px; }
  .facts { gap: 5px; padding-top: 9px; padding-bottom: 10px; }
}

/* ── Simple and Advanced ──────────────────────────────────────────────────────────────────────────────────────────── */
/* Which of the two the page is: one card to buy or sell PIXA (the front page), or everything (Advanced). */
.modes { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.modes a { padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 12.5px; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.modes a:hover { color: var(--ink); }
.modes a[aria-current='true'] { background: var(--ink); color: var(--inverse); }
.intro, .intro-more { display: none; }
body.simple .venues { display: none; }

/* Simple: the words and what keeps it safe on the left, the card on the right; on a phone, the card straight after the
   headline. Nothing else of the market is drawn. */
.app.simple { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto 1fr; grid-template-areas: 'intro ticket' 'more ticket'; column-gap: 72px; row-gap: 36px; align-content: start; max-width: 1120px; height: auto; min-height: calc(100dvh - var(--bar)); margin: 0 auto; padding: 32px 32px 56px; }
.app.simple .markets, .app.simple .book, .app.simple .activity { display: none; }
.app.simple .intro { display: block; grid-area: intro; padding-top: 36px; }
.app.simple .intro-more { display: grid; grid-area: more; align-content: start; gap: 30px; }
.app.simple .ticket { display: flex; grid-area: ticket; align-self: start; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.app.simple .ticket-body { padding: 20px; gap: 14px; overflow: visible; }
.intro h1 { font-size: 52px; line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 14px 0 16px; text-wrap: balance; }
.intro .lede { font-size: 17.5px; line-height: 1.5; color: var(--ink-2); max-width: 44ch; }
.assure { list-style: none; display: grid; gap: 16px; max-width: 52ch; }
.assure li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.assure strong { display: block; color: var(--ink); font-weight: 650; font-size: 14.5px; }
.assure a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.assure .sign-box { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong); display: grid; place-items: center; color: var(--ink-2); }
.intro-links { display: flex; gap: 8px 22px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.intro-links a { color: var(--ink); text-underline-offset: 3px; }
/* What's yours, kept short: the latest few, with the rest in Advanced. */
.simple-yours { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; max-width: 560px; }
.simple-yours .yours-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.simple-yours .scroll { overflow: visible; }
.simple-yours .mine-row:last-child { border-bottom: 0; }
/* The card's own parts: which money beside a field's name, the best price, and what follows the button. */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.seg.coins { padding: 2px; flex: none; }
.seg.coins button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; font-size: 12.5px; }
.picked strong .soft { font-weight: 500; }
.quiet-pick { align-items: flex-start; }
.quiet-pick .glyph { margin-top: 2px; color: var(--ink-2); }
.picked .own-price { flex: none; align-self: center; font-size: 12.5px; }
.pool-slot:empty { display: none; }
.pool-line { display: flex; gap: 8px; align-items: flex-start; padding: 10px 11px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--ink-2); }
.pool-line .glyph { margin-top: 2px; flex: none; }
.pool-line .link { font-size: 12px; }

/* The bar keeps to one line: with Advanced's venues in it, the chains' block numbers give way first (the dot stays),
   and on a narrower computer the switch shows only the way to the other form. */
@media (max-width: 1399px) { body.advanced .live .words { display: none; } }
@media (max-width: 1099px) {
  .modes { padding: 0; border: 0; background: none; }
  .modes a[aria-current='true'] { display: none; }
  .modes a { padding: 5px 8px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
  .chip { max-width: 150px; }
}
@media (max-width: 1099px) {
  .app.simple { grid-template-columns: minmax(0, 1fr) 400px; column-gap: 44px; padding: 52px 24px 48px; }
  .intro h1 { font-size: 42px; }
}
@media (max-width: 899px) {
  .app.simple { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'ticket' 'more'; row-gap: 26px; max-width: 560px; padding: 36px 20px 44px; }
  .app.simple .intro { padding-top: 0; }
}
@media (max-width: 819px) {
  .modes { display: none; }
  .app.simple { padding: 22px 12px calc(32px + env(safe-area-inset-bottom)); row-gap: 20px; }
  .app.simple .intro { padding: 0 4px; }
  .intro .eyebrow { display: none; }
  .intro h1 { font-size: 32px; margin: 0 0 8px; }
  .intro .lede { font-size: 15.5px; }
  .app.simple .ticket { border-radius: 16px; }
  .app.simple .ticket-body { padding: 16px 14px; }
  .app.simple .intro-more { gap: 24px; padding: 0 4px; }
  .simple-yours { margin: 0 -4px; }
}

/* Simple's Swap: what you get, the route it takes, and a run under way. */
.seg.routes button { font-size: 12.5px; }
.swap-get { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas); }
.swap-get > small:first-child { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.swap-get b { font: 650 22px/1.2 var(--mono); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.swap-get .worth { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.swap-get .each { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; }
.route { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0 2px; }
.route[hidden] { display: none; }
.route li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; font-size: 13px; }
.route .n { grid-row: 1 / 3; align-self: start; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border-strong); display: grid; place-items: center; font: 600 10.5px/1 var(--mono); color: var(--ink-3); }
.route .what { color: var(--ink); font-weight: 600; }
.route b { font: 600 13px/1.3 var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.route small { grid-column: 2 / -1; color: var(--ink-3); font-size: 11.5px; }
.run-head { display: grid; gap: 2px; }
.run-head strong { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 650; }
.run-head small { color: var(--ink-3); font-size: 12.5px; }
.run { list-style: none; display: grid; gap: 2px; margin: 0; padding: 0; }
.run-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink-3); }
.run-step .dot { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--border-strong); display: grid; place-items: center; font: 600 11px/1 var(--mono); }
.run-step .what { display: grid; gap: 1px; min-width: 0; }
.run-step strong { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.run-step small { font-size: 12px; overflow-wrap: anywhere; }
.run-step.now { background: var(--canvas); border: 1px solid var(--border); }
.run-step.now strong { color: var(--ink); }
.run-step.now .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.run-step.done .dot { border-color: var(--buy); color: var(--buy); }
.run-step.done strong { color: var(--ink-2); }
.run-step.failed .dot { border-color: var(--sell); color: var(--sell); background: none; }
.run-step .working { margin: 0; }
.step-words { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
/* What the pool trades, said first; where it's paid from and where it ends up, as two cards each with what's there. */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { display: grid; gap: 3px; text-align: left; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--border); background: var(--canvas); color: var(--ink-2); min-width: 0; }
.choice:hover { border-color: var(--border-strong); }
.choice[aria-checked='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.choice-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.choice-top strong { font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.choice-top b { margin-left: auto; font: 600 13px/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.choice small { color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }
.stranded { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px dashed var(--border-strong); border-radius: 11px; color: var(--ink-2); font-size: 12.5px; }
.stranded span { flex: 1; min-width: 0; }
.left-slot:empty { display: none; }

/* Simple's Swap, plain first: the steps listed before anything is typed, and the Hive Engine shortcuts behind a line. */
.route-box { display: grid; gap: 10px; }
.route-head { display: grid; gap: 1px; }
.route-head strong { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.route-head small { color: var(--ink-2); font-size: 12.5px; }
.shortcut { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.shortcut .link { color: var(--ink-2); font-size: 12.5px; }

/* A phone's book, a pool's (`phoneBook`) or the escrow's (`p2pPhoneBook`): the price over bids and asks side by side,
   each best first, prices at the middle and depth growing out from it; either opens on its own, the whole width, with
   every column. */
@media (max-width: 819px) {
  .phone-book { display: flex; flex-direction: column; }
  .pair-sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pair-sides .side.asks { border-left: 1px solid var(--border) !important; }
  .book-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
  .book-head strong { font-weight: 650; }
  .book-head svg { color: var(--ink-3); }
  .book-head:active { background: var(--surface); }
  .side.pair .cols, .side.opened .cols { display: grid; }
  .side.pair .cols, .side.pair .offer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 0 12px; }
  .side.pair .cols span, .side.pair .cols span:first-child { text-align: left; }
  .side.pair.bids .cols span:last-child, .side.pair.bids .offer .price { text-align: right; }
  .side.pair.bids .offer .price.two { align-items: flex-end; }
  .side.pair.bids .offer .size { text-align: left; }
  .side.pair.asks .cols span:last-child, .side.pair.asks .offer .size { text-align: right; }
  .side.pair.asks .offer .price { text-align: left; }
  .side.pair.bids .depth { left: auto; right: 0; }
  .side.opened .side-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding-top: 6px; }
  .side.opened .side-head small { grid-column: 1 / -1; grid-row: 2; }
  .side.pair .nothing { padding: 16px 12px; line-height: 1.5; }
  .more-row { width: 100%; height: 40px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
  .more-row:active { background: var(--surface); }
  /* Your own offer, where there's no Record column to say so. */
  .side.pair .offer.own .size::before { content: 'You '; font: 600 10.5px/1 var(--sans); letter-spacing: 0.02em; color: var(--ink-3); }
}

/* ── A market on a phone (`phonePool`, `phoneP2P`) ────────────────────────────────────────────────────────────────────
   Its price once, large, with the spread and the reference price; one row of tabs, words with a line under the one on
   show, that stays under the bar while the page scrolls (the book's panel gives way to the page so it can); what that
   tab shows; and Buy and Sell at the foot. */
@media (max-width: 819px) {
  #book { display: contents; }
  .phone-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: end; padding: 0 12px 9px; }
  .ph-main { display: grid; gap: 1px; min-width: 0; }
  .ph-price { font: 600 24px/1.15 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .ph-sub { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
  .ph-sub .num { font: 500 12.5px/1.3 var(--mono); color: var(--ink-2); }
  .ph-sub small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .ph-side { display: grid; gap: 3px; justify-items: end; padding-bottom: 1px; }
  .ph-side div { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
  .ph-side small { color: var(--ink-3); font-size: 11.5px; }
  .ph-side b { font: 600 12.5px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
  .ph-ref { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: baseline; gap: 6px; margin-top: 7px; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
  .ph-ref small { color: var(--ink-3); font-size: 12px; }
  .ph-ref b { font: 600 12px/1.2 var(--mono); color: var(--ink); }
  .ph-ref .glyph, .ph-ref svg { align-self: center; color: var(--ink-3); }
  .ph-more { grid-column: 1 / -1; margin: 5px 0 0; font-size: 12px; }
  .ph-more.bad { color: var(--sell); }
  .phone-tabs { display: flex; position: sticky; top: var(--bar); z-index: 3; background: var(--canvas); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0 4px; }
  .phone-tabs button { flex: 1; height: 40px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .phone-tabs button span { position: relative; display: inline-flex; align-items: center; height: 100%; }
  .phone-tabs button[aria-selected='true'] { color: var(--ink); }
  .phone-tabs button[aria-selected='true'] span::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--ink); }
  .phone-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 8px; }
  .trade-bar { gap: 8px; }
  .trade-bar > * { flex: 1; width: auto; min-width: 0; }
  .trade-bar .narrow { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }
  /* The tab already says what's shown: a list's own heading is left out, keeping whatever else its row holds. */
  .half > .panel-head > .eyebrow { display: none; }
  .half > .panel-head:not(:has(> :not(.eyebrow))) { display: none; }
  /* The pool's lists share a strip of text tabs above whichever list is open. */
  .seg.feed-tabs { gap: 18px; padding: 0; border: 0; background: none; }
  .seg.feed-tabs button { flex: none; padding: 6px 0; border-radius: 0; background: none; color: var(--ink-3); font-size: 13.5px; }
  .seg.feed-tabs button[aria-pressed='true'] { background: none; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
  /* A venue's chip in the row of markets: what's open doesn't need saying, only what isn't. */
  .markets .tag.live { display: none; }
}

/* A phone's book, tightened (the owner, 24 November 2026: "I think that this page could still be a little bit tighter
   ... if we had smaller size fonts, do you think we might be able to fit a little bit more information about the
   books?"): the row of markets, the sides' heads and their rows a size smaller, so a phone's screen holds eight of a
   pool's steps a side, or ten offers, with the price, the tabs and Buy and Sell, and nothing to scroll. */
@media (max-width: 819px) {
  .markets { padding: 6px 12px 8px; gap: 6px; }
  .market { padding: 4px 11px 4px 5px; gap: 7px; }
  .market strong { font-size: 14px; }
  .markets .venue-sign { width: 24px; height: 24px; border-radius: 7px; }
  .book-head { height: 32px; font-size: 14px; }
  .side.pair .cols, .side.opened .cols { height: 22px; }
  .side.pair .cols span, .side.opened .cols span { font-size: 9.5px; }
  .side.pair .offer, .side.opened .offer { height: 38px; font-size: 13.5px; }
  .side.pair .offer .two, .side.opened .offer .two { line-height: 1.1; }
  .side.pair .offer .two i, .side.opened .offer .two i { font-size: 10px; }
  .side.opened .offer .who { font-size: 12px; }
  .side.pair .nothing { padding: 12px; font-size: 12.5px; }
}

/* Closing an offer: what goes back, and one button that signs it. */
.sheet-body .close-lede { margin: 0; font-size: 15px; color: var(--ink); }
.sheet-body .close-lede ~ .note { margin: 0; }
