/* Poise
   A cast-iron shop balance on a marble counter, against a putty-pink shop wall. The scale stands under the two sides:
   the brass poise sits at the price of Yes, the beam tips to the side that leads, a notch on the beam marks where your
   position would be closed. The page takes its materials from the scale: marble-white panels, cast-iron rules and
   buttons, and the scale's one luxury, a thin gilt line inset along the iron. Big figures are set in a heavy slab like
   the lettering cast into old scales, everything you read or press in a plain American grotesque.
   Yes is leaf green, No raspberry, both as enamel on the pans' plates.
   Loaded after /styles.css, which gives the layout; this file only gives the look. The token names below are also
   read by app.js for the charts, so they stay six-digit hex colours. */
:root {
  --ink-0: #f1e8e3; --ink-1: #e9ddd7; --ink-2: #ddcec7; --ink-3: #bfaca4;
  --paper: #fbf8f6;
  --line: #1b1d22; --line-soft: #e2d6d0; --ink: #1b1d22;
  --fg: #1b1d22; --muted: #675d5a; --dim: #9a8e8a;
  --a: #357019; --a-soft: rgba(53, 112, 25, .1);
  --b: #ad2450; --b-soft: rgba(173, 36, 80, .1);
  --lev: #1b1d22; --lev-soft: rgba(27, 29, 34, .08);
  --up: #357019; --down: #ad2450; --down-soft: rgba(173, 36, 80, .08);
  --iron: #1b1d22; --iron-hi: #3d424b; --gilt: #c49a3e; --brass: #d4a84f;
  --display: "Bevan", "Rockwell", Georgia, serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --mono: "Libre Franklin", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Poise uses its grotesque */
  --addr: "Inconsolata", ui-monospace, Menlo, monospace;
  --edge: 1.5px solid var(--line);
  --hair: 1px solid var(--line-soft);
  --lining: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--gilt);
  --shadow: 0 1px 0 rgba(27, 29, 34, .05), 0 18px 32px -24px rgba(58, 30, 24, .55);
  --r: 3px;
  color-scheme: light;
}
body { background: var(--ink-0); color: var(--fg); font: 450 15px/1.5 var(--sans); }
::selection { background: #ead9a6; color: var(--fg); box-shadow: none; }

/* type: a cast slab for the big figures, plain grotesque for everything else, figures always lining and tabular */
h2, h3, .h { font: 700 13px/1.2 var(--sans); letter-spacing: 0; color: var(--fg); text-transform: none; }
h1 { font: 700 clamp(26px, 2.4vw, 36px)/1.12 var(--sans); letter-spacing: -.018em; text-transform: none; font-variant-numeric: lining-nums; }
.num, .sum-stats dd, .pos-grid dd, .tbl td.r, .kv dd { font-family: var(--sans); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.005em; }
.hint, .empty, .stage-empty, .empty-state p { font-family: var(--sans); color: var(--muted); }

/* the split-flap tiles become plain figures that settle into place when they change */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 700 var(--ff, 22px)/1 var(--sans); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.flaps > b.sp { width: .28em; } .flaps > b.pt { width: auto; }
.flaps > b.flip { animation: settle .34s cubic-bezier(.2, .9, .3, 1); }
@keyframes settle { 0% { opacity: 0; transform: translateY(-.12em); } 60% { opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: marble white over an iron rule, with the gilt line just above it */
.top { background: var(--paper); border-bottom: 2px solid var(--iron); box-shadow: inset 0 -4px 0 var(--paper), inset 0 -5px 0 var(--gilt); }
.logo { gap: 10px; padding-right: 24px; font: 400 25px/1 var(--display); letter-spacing: -.01em; color: var(--fg); }
.logo .mark { width: 40px; height: 40px; }
.tabs { gap: 2px; }
.tabs a { border-radius: 0; padding: 0 14px; font: 650 14.5px var(--sans); color: var(--muted); }
.tabs a:hover { background: var(--ink-0); color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); background: transparent; box-shadow: inset 0 -5px 0 var(--iron); }
.tabs b { font-family: var(--sans); font-weight: 800; color: var(--b); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 400 20px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.net { color: var(--muted); }

/* controls: iron edges; the main button is a piece of cast iron with the gilt line inset */
.btn { border: var(--edge); border-radius: var(--r); font: 650 14px var(--sans); background: var(--paper); color: var(--fg); box-shadow: inset 0 -2px 0 var(--ink-2); transition: transform .08s, box-shadow .08s, background-color .15s; }
.btn:hover:not(:disabled) { background: var(--ink-0); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--ink-2); }
.btn.primary { background: var(--iron); color: var(--paper); box-shadow: inset 0 1px 0 #4a505b, inset 0 -2px 0 #000; }
.btn.primary:hover:not(:disabled) { background: #2a2d34; }
.btn.cta { border: 1.5px solid #0b0c0e; border-radius: var(--r); min-height: 60px; font: 400 22px/1 var(--display); letter-spacing: .01em; color: var(--paper);
  background: linear-gradient(180deg, #41464f 0%, #23262c 42%, #15171b 100%);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0), inset 0 0 0 5px rgba(196, 154, 62, .9), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -4px 0 rgba(0, 0, 0, .4), 0 2px 0 #0b0c0e; }
.btn.cta:hover:not(:disabled) { filter: none; background: linear-gradient(180deg, #4a505a 0%, #2b2f36 42%, #1b1d22 100%); }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0), inset 0 0 0 5px rgba(196, 154, 62, .9), inset 0 -2px 0 rgba(0, 0, 0, .4), 0 0 0 #0b0c0e; }
.btn.cta:disabled { background: var(--ink-2); color: var(--dim); border-color: var(--ink-3); box-shadow: none; }
.btn.ghost { background: var(--paper); box-shadow: none; border-color: var(--ink-3); }
.btn.ghost:active:not(:disabled) { transform: none; }
.btn.small { box-shadow: none; border-width: 1px; }
.seg { border: var(--edge); border-radius: var(--r); padding: 2px; background: var(--paper); }
.seg button { border-radius: 2px; font: 650 13px var(--sans); }
.seg button[aria-pressed="true"] { background: var(--iron); color: var(--paper); box-shadow: none; }
input:not([type="range"]), select { background: var(--paper); border: 1px solid var(--ink-3); border-radius: var(--r); font-family: var(--sans); font-weight: 550; }
input:not([type="range"]):hover, select:hover { border-color: var(--fg); }
input:not([type="range"]):focus-visible, select:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--fg); }
.chips button { font: 650 13px var(--sans); border-radius: var(--r); border: 1px solid var(--ink-3); background: var(--paper); }
.chips button[aria-pressed="true"] { background: var(--iron); border-color: var(--iron); color: var(--paper); }

/* market list */
.mk { border-right: var(--edge); background: var(--paper); }
.mk-head { border-bottom: var(--hair); }
.mk-row { border-bottom: var(--hair); }
.mk-row:hover { background: var(--ink-0); }
.mk-row[aria-current="true"] { background: #f6efea; box-shadow: inset 4px 0 0 var(--iron), inset 5px 0 0 var(--paper), inset 6px 0 0 var(--gilt); }
.mk-q { font: 600 15px/1.3 var(--sans); letter-spacing: -.008em; }
.mk-meta { font: 550 12.5px var(--sans); color: var(--muted); }
.mk-px { font: 700 16px/1.15 var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.mk-px .pa { color: var(--a); } .mk-px .pb { color: var(--b); }
/* the split bar under each market: the two enamels side by side */
.mk-split { height: 5px; border-radius: 3px; background: var(--b); } .mk-split i { background: var(--a); border-radius: 3px 0 0 3px; box-shadow: 1.5px 0 0 var(--paper); }
.thumb { border-radius: 3px; }
.thumb.tile { font-family: var(--display); font-weight: 400; border: var(--edge); }
.legal { color: var(--muted); font: 450 12.5px/1.55 var(--sans); }

/* the two sides: marble cards; the one you picked takes its enamel colour */
.duel { gap: 12px; border: 0; background: transparent; box-shadow: none; }
.duel-side { border: var(--edge); border-radius: var(--r); background: var(--paper); padding: 16px 20px 18px; box-shadow: inset 0 -3px 0 var(--ink-2); transition: background-color .18s, color .18s, transform .08s; }
.duel-side:hover { background: #fffdfc; }
.duel-side:active { transform: translateY(1px); }
.duel-name { font: 750 15px var(--sans); }
.duel-side.a .duel-name { color: var(--a); } .duel-side.b .duel-name { color: var(--b); }
.duel-side.a[aria-pressed="true"] { background: var(--a); border-color: #1f4510; box-shadow: inset 0 0 0 3px var(--a), inset 0 0 0 4px rgba(251, 248, 246, .45), inset 0 -3px 0 rgba(0, 0, 0, .22); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #651230; box-shadow: inset 0 0 0 3px var(--b), inset 0 0 0 4px rgba(251, 248, 246, .45), inset 0 -3px 0 rgba(0, 0, 0, .22); }
.duel-side[aria-pressed="true"], .duel-side[aria-pressed="true"] .duel-name, .duel-side[aria-pressed="true"] .lev,
.duel-side[aria-pressed="true"] .duel-price.flaps > b { color: var(--paper); }
.duel-price.flaps { --ff: 46px; }
.duel-price.flaps > b { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; }
.duel-side .lev { font: 600 12.5px var(--sans); color: var(--muted); }
#st-cat { font: 750 12.5px var(--sans); color: var(--muted); box-shadow: none; }

/* the balance under the two sides, on its marble counter */
.cpz { margin-top: 14px; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px #d3c3bb, var(--shadow); background: #ebe0da; }
.cpz svg { display: block; width: 100%; height: auto; }
.cpz.wait { width: min(520px, 86vw); margin: 0 0 22px; }

.chart-panel, .stage-row, .more { border-top: var(--hair); }
.panel { border-radius: var(--r); }
.room-num strong { font: 400 30px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.meter { height: 6px; border-radius: 3px; background: var(--ink-2); } .meter i { background: var(--iron); border-radius: 3px; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.cta-bar { background: linear-gradient(rgba(251, 248, 246, 0), var(--paper) 24%); }
.side-pick { gap: 8px; border: 0; }
.side-pick button { border: var(--edge); border-radius: var(--r); padding: 10px 12px; background: var(--paper); }
.side-pick button span { font: 750 14px var(--sans); }
.side-pick button small { font: 700 19px var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.side-pick .a[aria-pressed="true"] { background: var(--a); border-color: #1f4510; color: var(--paper); }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #651230; color: var(--paper); }
/* the ticket's board is the scale's enamel plate: marble white, an iron edge, the gilt line inside */
.tboard { gap: 10px; padding: 16px 18px; border: var(--edge); border-radius: var(--r); background: var(--paper); box-shadow: var(--lining), 0 6px 12px -10px rgba(58, 30, 24, .5); }
.tboard span { font: 600 13px var(--sans); color: var(--muted); }
.tboard .flaps { --ff: 26px; }
.tboard .flaps.am > b, .flaps.am > b { color: var(--fg); }
#tk-margin { font: 700 26px var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.quick { gap: 6px; border: 0; }
.quick button { border: 1px solid var(--ink-3); border-radius: var(--r); font: 700 15px var(--sans); font-variant-numeric: lining-nums tabular-nums; background: var(--paper); }
.quick button:hover { border-color: var(--fg); background: var(--ink-0); }
.lev-head output { font: 400 40px/1 var(--display); letter-spacing: -.01em; color: var(--fg); font-variant-numeric: lining-nums; }
/* the leverage slider: the beam's brass strip, iron up to your leverage; the thumb is the brass poise */
#tk-lev::-webkit-slider-runnable-track { height: 9px; border-radius: 1px; border: 1px solid var(--line); background: linear-gradient(var(--iron), var(--iron)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 0 0 / calc(var(--m) * 100%) 100% no-repeat, linear-gradient(#f1dc9f, #c9a04a); }
#tk-lev::-moz-range-track { height: 9px; border-radius: 1px; border: 1px solid var(--line); background: linear-gradient(var(--iron), var(--iron)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 0 0 / calc(var(--m) * 100%) 100% no-repeat, linear-gradient(#f1dc9f, #c9a04a); }
#tk-lev::-webkit-slider-thumb { width: 18px; height: 30px; margin-top: -11.5px; background: linear-gradient(90deg, #6b4e18, #ecce80 30%, #c49840 58%, #674a15); border: 1.2px solid #3a2a0c; border-radius: 3px; box-shadow: inset 0 0 0 .5px rgba(255, 246, 216, .6), 0 2px 3px rgba(27, 29, 34, .35); clip-path: none; }
#tk-lev::-moz-range-thumb { width: 16px; height: 28px; background: linear-gradient(90deg, #6b4e18, #ecce80 30%, #c49840 58%, #674a15); border: 1.2px solid #3a2a0c; border-radius: 3px; box-shadow: 0 2px 3px rgba(27, 29, 34, .35); clip-path: none; }
.lev-ticks { font: 700 13px var(--sans); font-variant-numeric: lining-nums; } .lev-ticks span.off { color: var(--ink-3); }
.rw-track { height: 6px; border-radius: 3px; } .rw-fill { background: var(--ink-3); } .rw-now { background: var(--fg); }
.kv { border-top: var(--hair); } .kv > div { border-bottom: var(--hair); }
.err { border-left: 3px solid var(--down); background: var(--down-soft); border-radius: 2px; }

/* account pages */
.summary { border-bottom: 2px solid var(--iron); box-shadow: 0 -4px 0 var(--ink-0) inset, 0 -5px 0 var(--gilt) inset; }
.sum-main span { font: 650 13px var(--sans); color: var(--muted); }
.sum-main strong { font: 400 clamp(48px, 7vw, 96px)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.pos { background: var(--paper); border: var(--edge); border-radius: var(--r); box-shadow: inset 0 -3px 0 var(--ink-2); }
.pos-out { font: 750 12.5px var(--sans); }
.empty-state { border: 1.5px dashed var(--ink-3); border-radius: var(--r); background: var(--paper); }
.empty-state .es-mark { width: 60px; height: 60px; margin-bottom: 6px; }
.empty-state b { font: 400 24px var(--display); }
.tbl th { border-bottom: var(--edge); font: 650 12.5px var(--sans); color: var(--fg); }
.tbl td { border-bottom: var(--hair); }
.mid-num { font: 400 46px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.big-num { font-family: var(--display); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.addr { border: 1px solid var(--ink-3); border-radius: var(--r); background: var(--paper); font-family: var(--addr); font-size: 13px; }
.pick { border: var(--edge); border-radius: 6px; box-shadow: var(--lining), 0 30px 60px -20px rgba(58, 30, 24, .5); background: var(--paper); }
.pick::backdrop { background: rgba(27, 29, 34, .42); }
.pick-item { font: 650 18px/1.2 var(--sans); border-radius: var(--r); }
.pick-item:hover, .pick-item:focus-visible { background: var(--ink-0); color: var(--fg); }
.toast { background: var(--iron); color: var(--paper); border-left: 5px solid var(--gilt); border-radius: var(--r); font: 550 15px var(--sans); }

/* loading: the poise slides in from the No end and the beam comes level as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 400 23px var(--display); color: var(--fg); }
.stage-empty #load-count { font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; }
.ld-track { display: none; }
.sk { background: linear-gradient(90deg, var(--ink-1), var(--ink-2), var(--ink-1)); background-size: 200% 100%; border-radius: 2px; }

/* the pointer */
.cur-dot { background: var(--fg); }
.cur-box { border: 1.5px solid var(--fg); border-radius: var(--r); }
#cur.go .cur-box { border-color: var(--gilt); }

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 400 17px var(--display); color: var(--fg); box-shadow: none; }
.coin-ca { font: 500 13px var(--addr); color: var(--muted); }
.coin-ca:hover, .coin-pump:hover { background: var(--ink-0); color: var(--fg); }
.coin-pump { font: 650 13px var(--sans); color: var(--muted); }

@media (max-width: 760px) {
  .coin { border-top: var(--hair); }
  .tabs a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--iron); }
  .logo { font-size: 20px; padding-right: 12px; } .logo .mark { width: 32px; height: 32px; }
  .duel-price.flaps { --ff: 26px; }
  .tabs a { padding: 12px 14px; }
  .bal strong { font-size: 16px; } .bal span { font-size: 10.5px; }
  .acct .btn, .seg button { padding-left: 10px; padding-right: 10px; }
  .duel-side { padding: 13px 14px; }
  .cpz { margin-top: 10px; }
  h1 { font-size: 23px; }
}

/* the base layout sets labels in spaced capitals; Poise writes them as words */
h2, h3, .h, .tabs a, .net, .bal span, .seg button, .field label, .chips button, .stage-empty, .stage-empty p, #st-cat, .duel-name,
.side-pick button span, .sum-main span, .pos-out, .tbl th, .eyebrow, .pick-go, h1, .btn, .mk-meta, .duel-side .lev,
.tboard span, .empty-state b, .coin-pump {
  text-transform: none; letter-spacing: 0; }
.btn.cta { letter-spacing: .01em; }
.net, .stage-empty { font-family: var(--sans); font-weight: 600; }
.field label, .eyebrow, .pick-go { font: 650 13px var(--sans); }
@media (max-width: 760px) { .tabs a[aria-current="page"] { background: transparent; } }

/* Live mode: before a wallet is connected the main button reads "Connect a wallet to trade". In a wide display face
   that line is wider than a phone, so the button may wrap and the bar never grows past the screen. */
.cta-bar { grid-template-columns: minmax(0, 1fr); }
.cta-bar > * { min-width: 0; }
@media (max-width: 760px) { .cta-bar .btn { white-space: normal; text-wrap: balance; line-height: 1.15; } }

/* The main button reads as a sentence, never in capitals, and wraps rather than running out of its box (the
   "Connect a wallet to trade" line is wider than the ticket in the slab face). The bar behind it is solid, so a
   message above the button never sits on the figures scrolling under it. */
.btn.cta, .btn.cta:disabled { text-transform: none; letter-spacing: 0; white-space: normal; text-wrap: balance; line-height: 1.12; padding-top: 8px; padding-bottom: 8px; }
.btn.cta:disabled { color: var(--muted); }
.cta-bar { background: var(--paper); box-shadow: 0 -1px 0 var(--line-soft); }
