/* Plumb
   A brass plumb bob hangs from a slider on an oak straightedge across a limestone wall, under the two sides. The
   straightedge reads 0 to 100¢ and the slider sits at the price of Yes, so the line drops where the market says the
   truth is: blue chalk wash for Yes to the left, red chalk wash for No to the right, faint chalk lines where the
   price stood before, and an iron nail where your position would be closed.
   The page takes its materials from that wall: limestone for the ground, plaster white for every panel, soot ink for
   every edge, and lead for the buttons you press (plumbum, the metal the first bobs were cast in) with a snapped
   chalk line along their lower edge. Big figures in Young Serif, a heavy old-style cut like letters in stone;
   everything you read or press in Albert Sans. 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: #e6e1d6; --ink-1: #ddd7ca; --ink-2: #cfc7b7; --ink-3: #a69d8b;
  --paper: #faf8f3;
  --line: #1e1d1b; --line-soft: #e0dacd; --ink: #1e1d1b;
  --fg: #1e1d1b; --muted: #5f5950; --dim: #948c7f;
  --a: #2a5aa8; --a-soft: rgba(42, 90, 168, .1);
  --b: #b8432b; --b-soft: rgba(184, 67, 43, .1);
  --lev: #1e1d1b; --lev-soft: rgba(30, 29, 27, .08);
  --up: #2c7a45; --down: #b8372f; --down-soft: rgba(184, 55, 47, .08);
  --lead: #34373c; --lead-hi: #44484e; --lead-lo: #25272b; --brass: #b88a2c; --oak: #b98b52;
  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Albert Sans", "Helvetica Neue", Arial, sans-serif; /* the base layout sets small labels in --mono; Plumb uses its sans */
  --addr: "Fragment Mono", ui-monospace, Menlo, monospace;
  --edge: 1.5px solid var(--line);
  --hair: 1px solid var(--line-soft);
  /* the snapped chalk line: blue chalk on light ground, white chalk on lead */
  --chalk-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='6'%3E%3Cpath d='M0 3.2L40 2.8L80 3.4L120 2.9L160 3.1' fill='none' stroke='%232a5aa8' stroke-width='2.6' stroke-dasharray='34 2 18 1.5 50 3 22 2' opacity='.92'/%3E%3Cpath d='M0 4.2H160' stroke='%232a5aa8' stroke-width='.9' stroke-dasharray='3 4 1 6 2 3' opacity='.45'/%3E%3C/svg%3E");
  --chalk-w: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='6'%3E%3Cpath d='M0 3.2L40 2.8L80 3.4L120 2.9L160 3.1' fill='none' stroke='%23f3efe4' stroke-width='2.2' stroke-dasharray='34 2 18 1.5 50 3 22 2' opacity='.85'/%3E%3Cpath d='M0 4.2H160' stroke='%23f3efe4' stroke-width='.8' stroke-dasharray='3 4 1 6 2 3' opacity='.4'/%3E%3C/svg%3E");
  --shadow: 0 1px 0 rgba(30, 29, 27, .05), 0 18px 32px -24px rgba(60, 50, 30, .55);
  --r: 4px;
  color-scheme: light;
}
body { background: var(--ink-0); color: var(--fg); font: 450 15px/1.5 var(--sans); }
::selection { background: #c7d6f0; color: var(--fg); box-shadow: none; }

/* type: a heavy old-style serif for the big figures, a plain sans for everything else, figures always lining and tabular */
h2, h3, .h { font: 700 13.5px/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: -.02em; 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 drop into place when they change, like a bob settling */
.flaps { gap: 0; }
.flaps > b { width: auto; height: auto; min-width: 0; background: none; border-radius: 0; color: inherit; font: 400 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: drop .42s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes drop { 0% { opacity: 0; transform: translateY(-.18em); } 55% { opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flaps > b.flip { animation: none; } }

/* top bar: plaster over a soot rule */
.top { background: var(--paper); border-bottom: 2px solid var(--line); }
.logo { gap: 9px; padding-right: 24px; font: 400 29px/1 var(--display); letter-spacing: -.01em; color: var(--fg); }
.logo .mark { width: 38px; height: 38px; }
.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: var(--chalk-b) 0 calc(100% - 3px) / 160px 6px repeat-x; }
.tabs b { font-family: var(--sans); font-weight: 800; color: var(--a); }
.bal { border-left: var(--hair); }
.bal span { font: 600 12px var(--sans); color: var(--muted); }
.bal strong { font: 400 21px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.net { color: var(--muted); }

/* controls: soot edges; the buttons you press are lead with a snapped chalk line along the lower edge */
.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(--chalk-w) 0 calc(100% - 3px) / 160px 6px repeat-x, linear-gradient(180deg, var(--lead-hi), var(--lead) 60%, var(--lead-lo)); color: var(--paper); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); padding-bottom: 5px; }
.btn.primary:hover:not(:disabled) { background: var(--chalk-w) 0 calc(100% - 3px) / 160px 6px repeat-x, linear-gradient(180deg, #52565d, var(--lead-hi) 60%, var(--lead)); }
.btn.primary:active:not(:disabled) { box-shadow: none; }
.btn.cta { border: 1.5px solid var(--line); border-radius: var(--r); min-height: 60px; font: 400 23px/1 var(--display); letter-spacing: 0; color: var(--paper);
  background: var(--chalk-w) 0 calc(100% - 6px) / 160px 6px repeat-x, linear-gradient(180deg, #4b4f56 0%, var(--lead) 55%, #232529 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 2px 0 var(--line); }
.btn.cta:hover:not(:disabled) { filter: none; background: var(--chalk-w) 0 calc(100% - 6px) / 160px 6px repeat-x, linear-gradient(180deg, #595e66 0%, #40444a 55%, #2b2d31 100%); }
.btn.cta:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 var(--line); }
.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(--lead); 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(--a); outline-offset: 1px; border-color: var(--fg); box-shadow: none; }
:focus-visible { outline-color: var(--a); }
.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(--lead); border-color: var(--line); 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: #f3f0e8; }
.mk-row[aria-current="true"] { background: #efebe1; box-shadow: inset 4px 0 0 var(--brass); }
.mk-q { font: 600 15px/1.3 var(--sans); letter-spacing: -.01em; }
.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: blue chalk for Yes, red chalk for No, a hairline of plaster where they meet */
.mk-split { height: 5px; border-radius: 1px; background: var(--b); } .mk-split i { background: var(--a); border-radius: 1px 0 0 1px; 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: plaster cards; the one you picked takes its chalk 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: #fffefb; }
.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: #173a73; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.duel-side.b[aria-pressed="true"] { background: var(--b); border-color: #7a2816; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.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: -.01em; }
.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 wall with the plumb line under the two sides */
.pbz { margin-top: 14px; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1.5px var(--line), var(--shadow); background: #e4ded1; }
.pbz svg { display: block; width: 100%; height: auto; }
.pbz.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 31px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.meter { height: 6px; border-radius: 1px; background: var(--ink-2); } .meter i { background: var(--lead); border-radius: 1px; }

/* the ticket */
.ticket { background: var(--paper); border-left: var(--edge); }
.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: #173a73; color: var(--paper); }
.side-pick .b[aria-pressed="true"] { background: var(--b); border-color: #7a2816; color: var(--paper); }
/* the ticket's board: plaster with a soot edge, a brass rule along the top and the blue chalk line along the bottom */
.tboard { gap: 10px; padding: 18px 18px 20px; border: var(--edge); border-radius: var(--r); background: linear-gradient(180deg, #d9b26a, var(--brass) 60%, #8a6218) 0 0 / 100% 4px no-repeat, var(--chalk-b) 0 calc(100% - 4px) / 160px 6px repeat-x, var(--paper); box-shadow: 0 6px 12px -10px rgba(60, 50, 30, .55); }
.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: a lead rule filled up to your leverage; the thumb is the top of a brass bob with its string hole */
#tk-lev::-webkit-slider-runnable-track { height: 8px; border-radius: 2px; border: 1px solid var(--line); background: linear-gradient(var(--lead), var(--lead)) 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, #efebe2; }
#tk-lev::-moz-range-track { height: 8px; border-radius: 2px; border: 1px solid var(--line); background: linear-gradient(var(--lead), var(--lead)) 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, #efebe2; }
#tk-lev::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; border: 1px solid #5a3d0b; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #3d2a07 0 2.5px, transparent 3px), radial-gradient(circle at 36% 32%, #fff0c2 0, #e9c46f 30%, #c39434 62%, #7c5714 100%); box-shadow: 0 2px 3px rgba(30, 29, 27, .4); }
#tk-lev::-moz-range-thumb { width: 22px; height: 22px; border: 1px solid #5a3d0b; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #3d2a07 0 2.5px, transparent 3px), radial-gradient(circle at 36% 32%, #fff0c2 0, #e9c46f 30%, #c39434 62%, #7c5714 100%); box-shadow: 0 2px 3px rgba(30, 29, 27, .4); }
.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: 1px; } .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(--line); }
.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: -.015em; 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 25px 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: 0 30px 60px -20px rgba(60, 50, 30, .55); background: linear-gradient(180deg, #d9b26a, var(--brass) 60%, #8a6218) 0 0 / 100% 4px no-repeat, var(--paper); }
.pick::backdrop { background: rgba(30, 29, 27, .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(--fg); color: var(--paper); border-left: 5px solid var(--brass); border-radius: var(--r); font: 550 15px var(--sans); }

/* loading: the bob swings and comes to rest as the books come in */
.stage-empty .flaps { display: none; }
.stage-empty p:first-of-type { font: 400 24px 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(--brass); }

/* the coin in the top bar */
.coin > * { border-left: var(--hair); padding: 0 12px; }
.coin-tk { font: 400 18px var(--display); color: var(--fg); box-shadow: none; }
.coin-ca { font: 400 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); }
  .logo { font-size: 24px; padding-right: 12px; } .logo .mark { width: 30px; height: 30px; }
  .duel-price.flaps { --ff: 28px; }
  .tabs a { padding: 12px 14px; }
  .bal strong { font-size: 17px; } .bal span { font-size: 10.5px; }
  .acct .btn, .seg button { padding-left: 10px; padding-right: 10px; }
  .duel-side { padding: 13px 14px; }
  .pbz { margin-top: 10px; }
  h1 { font-size: 23px; }
}

/* the base layout sets labels in spaced capitals; Plumb 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; }
.net, .stage-empty { font-family: var(--sans); font-weight: 600; }
.field label, .eyebrow, .pick-go { font: 650 13px var(--sans); }

/* Live mode: before a wallet is connected the main button reads "Connect a wallet to trade". In the display face
   that line is wider than a phone, so the button may wrap and the bar never grows past the screen. The bar behind it
   is solid, so a message above the button never sits on the figures scrolling under it. */
.cta-bar { grid-template-columns: minmax(0, 1fr); background: var(--paper); box-shadow: 0 -1px 0 var(--line-soft); }
.cta-bar > * { min-width: 0; }
.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: 14px; }
.btn.cta:disabled { color: var(--muted); }
