/* The dealer demo (/dealer-demo): a presentation room. The video is the stage; the worksheet beside it fills in as the demo asks its questions.
   Two ways to run it: on their own (default) and on a call (?present=1), where a rep shares this tab and drives it from the presenter notes window (?notes=1). */
:root {
  --ink: #0b0e14; --panel: #11151f; --panel-2: #151a26; --line: #232a3a;
  --gold: #c9a24b; --gold-hi: #e3c376; --text: #e8e6e0; --muted: #a2a8b3;
  --bad: #e39a8e; --good: #8fcba0;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 16px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: var(--gold-hi); }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 16px 40px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand { font: 700 12px/1 var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); text-decoration: none; padding: 10px 0; }
.top-r { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.eyebrow { font: 600 12px/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tb { min-height: 36px; padding: 0 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; font: 600 12px/1 var(--body); letter-spacing: .06em; cursor: pointer; }
.tb:hover { color: var(--gold-hi); border-color: var(--gold); }
.intro { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--gold); background: var(--panel); color: var(--muted); font-size: 14px; border-radius: 4px; }
.intro b { color: var(--text); font-weight: 600; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 920px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* the stage */
.player { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; container-type: inline-size; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.cap { position: absolute; left: 5%; right: 5%; bottom: 4%; text-align: center; pointer-events: none; }
.cap span { display: inline-block; background: rgba(0, 0, 0, .7); color: #fff; padding: .22em .6em; border-radius: 4px; font: 600 clamp(12px, 2.1cqw, 17px)/1.35 var(--body); white-space: pre-line; }
/* The personalised numbers sit in the band under the card's own text (the card ends near 50 percent of the frame, captions start near 84). */
.calc { position: absolute; left: 6%; right: 6%; top: 53%; background: rgba(8, 10, 15, .93); border: 1px solid var(--gold); border-radius: 6px; padding: clamp(6px, 1.4cqw, 12px) clamp(10px, 2.4cqw, 22px); text-align: center; }
.calc .n { font: 600 clamp(22px, 5.1cqw, 42px)/1.05 var(--display); font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi); }
.calc .s { font-size: clamp(12px, 2cqw, 17px); line-height: 1.35; color: var(--text); margin-top: 2px; }
.calc .t { font-size: clamp(11px, 1.6cqw, 14px); line-height: 1.35; color: var(--muted); margin-top: 4px; }
.calc .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.calc .cols .n { font-size: clamp(22px, 4.4cqw, 38px); }
.calc .cols .k { font: 700 clamp(9px, 1.5cqw, 12px)/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.calc.be { top: 40%; }
.calc .s.dup { display: none; }
@container (max-width: 520px) { .calc { left: 4%; right: 4%; } .calc .t:not(.keep), .cap.behind { display: none; } .calc .s.dup { display: block; } }
.badge { position: absolute; top: 3.5%; left: 3%; background: var(--gold); color: #17130a; font: 800 12px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; padding: 8px 12px; border-radius: 3px; }
.startbox { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: max-content; max-width: 92%; }
.bigplay { height: 56px; padding: 0 26px; background: rgba(11, 14, 20, .88); color: var(--gold-hi); border: 1px solid var(--gold); border-radius: 4px; font: 700 14px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; cursor: pointer; }
.bigplay:hover, .bigplay.alt { background: var(--gold); color: #17130a; }
.bigplay.alt:hover { background: var(--gold-hi); }
@container (max-width: 520px) { .bigplay { height: 46px; padding: 0 16px; font-size: 12px; letter-spacing: .12em; } }
.bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ib { min-width: 44px; height: 44px; padding: 0 12px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: 700 13px/1 var(--body); letter-spacing: .06em; cursor: pointer; }
.ib:hover { border-color: var(--gold); }
.ib[aria-pressed="true"] { color: var(--gold-hi); border-color: var(--gold); }
.time { font: 600 13px/1 var(--body); color: var(--muted); min-width: 92px; font-variant-numeric: tabular-nums; }
.track { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 6px; background: var(--line); border-radius: 3px; }
.track .fill { position: absolute; left: 0; top: 19px; height: 6px; width: 0; background: var(--gold); border-radius: 3px; }
.track .skip { position: absolute; top: 19px; height: 6px; background: repeating-linear-gradient(45deg, #0b0e14 0 3px, #232a3a 3px 6px); }
.track .dot { position: absolute; top: 14px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--gold); background: var(--ink); padding: 0; cursor: pointer; }
.track .dot.on { background: var(--gold); }
.under { margin-top: 14px; color: var(--muted); font-size: 13px; }
.chaps { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chaps button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font: 600 12px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: 10px 14px; min-height: 40px; cursor: pointer; }
.chaps button.now { color: var(--gold-hi); border-color: var(--gold); }

/* the worksheet side */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; }
@media (max-width: 920px) { .side { position: static; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.card.live { border-color: var(--gold); background: var(--panel-2); }
.card h2 { margin: 0 0 4px; font: 600 25px/1.15 var(--display); color: var(--text); text-wrap: balance; }
.card .eb { font: 700 11px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; display: block; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.f { margin: 12px 0; }
.f label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.f .in { display: flex; align-items: center; gap: 8px; }
.f .in span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.f input[type=text], .f input[type=number], .f input[type=url], .f input[type=email], .f input[type=tel], .f select { width: 100%; min-height: 46px; font: 400 16px var(--body); color: var(--text); background: #0e121b; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.f select { appearance: auto; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.f.bad input, .f.bad select { border-color: var(--bad); }
.err { color: var(--bad); font-size: 13px; margin-top: 4px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 14px 0; }
.chk input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { min-height: 46px; padding: 0 20px; border-radius: 6px; font: 700 15px/1 var(--body); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn.pri { background: var(--gold); color: #17130a; border: 1px solid var(--gold); }
.btn.pri:hover { background: var(--gold-hi); }
.btn.sec { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.sec:hover { border-color: var(--gold); }
.btn[disabled] { opacity: .6; cursor: default; }
.idle { color: var(--muted); font-size: 14px; }
.sheet .row { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sheet .row:last-of-type { border-bottom: 0; }
.sheet .v { color: var(--gold-hi); font-weight: 700; border-bottom: 1px solid var(--gold); padding: 0 .25em; font-variant-numeric: tabular-nums; }
.sheet .b { display: inline-block; min-width: 3.2em; border-bottom: 1px solid var(--line); color: transparent; user-select: none; }
.sheet .m { color: var(--muted); font-size: 13px; }
.sheet .acts { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.res { color: var(--good); font-weight: 700; margin: 0 0 6px; }
.bk { width: 100%; height: 720px; border: 0; border-radius: 6px; background: #fff; display: block; margin-top: 4px; }
.small { font-size: 13px; color: var(--muted); margin-top: 10px; }
details.tools { color: var(--muted); font-size: 13px; }
details.tools summary { cursor: pointer; padding: 8px 0; min-height: 40px; }
details.tools table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
details.tools td { border-top: 1px solid var(--line); padding: 5px 4px; }
.priv { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 560px) { .bar { flex-wrap: wrap; } .track { order: 9; flex-basis: 100%; } .time { min-width: 0; flex: 1; } .eyebrow { display: none; } }

/* presenter notes window (?notes=1) */
.notes { display: grid; gap: 14px; }
.notes .card h2 { font-size: 22px; }
.nrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.conn { font: 700 11px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--bad); }
.conn.ok { color: var(--good); }
.nctl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nctl .ib { width: 100%; }
.nctl .ib.wide { grid-column: span 2; }
.say { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: #0e121b; color: var(--text); font-size: 15px; border-radius: 0 4px 4px 0; }
.say b { color: var(--gold-hi); font-weight: 700; letter-spacing: .08em; font-size: 11px; text-transform: uppercase; display: block; margin-bottom: 2px; }
.tip { color: var(--muted); font-size: 14px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.warn { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.betab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 6px; }
.betab th, .betab td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.betab th { color: var(--muted); font-weight: 600; }
.kbd { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* the live market lookup inside the "Your market" question (api/market) */
.mk { margin: 14px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #0e121b; }
.mk > .btn { width: 100%; justify-content: center; }
.mk .priv { margin-top: 8px; }
.mkwait { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.mkres { margin-top: 12px; }
.mkh { font: 700 11px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 16px 0 6px; }
.mkres .mkh:first-child { margin-top: 0; }
.mkl b { display: block; color: var(--text); font-size: 15px; }
.mkl span { display: block; color: var(--muted); font-size: 13px; }
.mkn { font: 600 22px/1.25 var(--display); color: var(--gold-hi); margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; }
.mkn span { font: 500 14px var(--body); color: var(--muted); }
.mkt { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.mkt td { padding: 6px 4px; border-top: 1px solid var(--line); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt td:first-child { width: 34px; color: var(--muted); }
.mkt td:nth-child(3) { width: 52px; }
.mkt td:nth-child(4) { width: 58px; text-align: right; color: var(--muted); }
.mkt tr.you td { color: var(--gold-hi); font-weight: 700; }
.mkres p { font-size: 14px; color: var(--text); margin: 6px 0; }
.mkres p.small { color: var(--muted); font-size: 13px; }
.mkq { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--gold); background: #0b0f17; color: var(--muted); font-size: 13px; line-height: 1.45; border-radius: 0 4px 4px 0; }
.mkt td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.mkt td { vertical-align: top; }
.say .mkline { display: block; margin-top: 6px; }
