/* Density pass (23 Oct 2026). Loaded last. One title per desk, one surface per card, one padding, tighter
   rhythm. Every control and every line of copy stays reachable; the only things removed from view are the
   second header each desk used to draw under its own bar and the practice form outside a replay. */

/* ---- the card is the frame: one title, one surface, one padding ---- */
.widget{border-color:var(--rule-2)}
.widget-bar{padding:4px 8px 4px 5px;background:color-mix(in srgb,var(--paper-2) 38%,transparent);border-bottom-color:var(--rule)}
.widget-bar h2{flex:0 1 auto;font:italic .98rem/1.2 var(--fell);color:var(--ink)}
.widget-badges{flex:1;display:flex;flex-wrap:wrap;gap:4px;min-width:0;margin-left:4px}
.widget-badges .src-badge{font-size:.6rem}
.widget-badges>span:not(.src-badge){font:500 .6rem/1 var(--sans);color:var(--ink-2);border:1px solid var(--rule);border-radius:999px;padding:3px 7px;min-width:1.4em;text-align:center}
/* the desk head's icon buttons (? ◧ ◨ ▾ ×) are not dimmed: at full --ink-3 they read 5.2:1 (light) / 5.6:1 (dark), the
   dimmed .72 they had read 2.9 / 3.5 */
.widget-actions{margin-left:auto}
.widget-body>:not(.chart-panel,.positions-panel){padding:12px 16px 14px!important;background:transparent!important}
.widget-body>.ticket{padding:14px 16px 16px!important}
.widget-body>.account-strip{padding:12px 16px!important}
.widget-body>:is(.sketch-card,.watchbook-card)::before,#outcome-sheet::before{display:none}
.desk-board{gap:12px}
.toolbox{margin:0 0 8px}

/* ---- the inner stamp: heading to screen readers, eyebrow text gone (its badges moved to the bar), guide folded ---- */
.widget-body :is(.rd-head,.hd-head,.lp-head,.ev-head,.flow-head,.outcome-heading,.market-audio-head,.studio-section-head)>div>:is(h2,h3),
.widget-body :is(.rd-head,.hd-head,.lp-head,.ev-head,.flow-head,.outcome-heading,.market-audio-head,.studio-section-head)>:is(h2,h3),
.widget-body .ticket-title h2{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.widget-body :is(.hd-eyebrow,.desk-eyebrow,.market-audio-eyebrow,.studio-eyebrow),.widget-body #market-audio-desk .market-audio-eyebrow{display:none}
.widget-body :is(.rd-head,.hd-head,.lp-head,.ev-head,.flow-head,.outcome-heading,.market-audio-head){margin:0 0 8px;min-height:0;align-items:center;justify-content:flex-start;gap:12px}
/* the title block is empty now (eyebrow hidden, heading demoted, guide folded): a head with nothing else goes away */
.widget-body :is(.rd-head,.hd-head,.lp-head,.ev-head,.flow-head,.outcome-heading,.market-audio-head)>div:first-child:not(:has(button,select,input,label,.seg)){display:none}
.widget-body :is(.rd-head,.hd-head,.lp-head,.ev-head,.flow-head,.outcome-heading,.market-audio-head):not(:has(> :nth-child(2))){display:none}
.widget-body .studio-section-head{margin-bottom:10px;min-height:0;justify-content:flex-start;gap:14px}
.widget-body .studio-section-head>div:first-child{display:none}
.widget-body .sketch-actions{flex-direction:row;align-items:center;flex-wrap:wrap;gap:14px}
.widget-body>.ticket{position:relative}
.widget-body .ticket-title{position:absolute;right:16px;top:13px;margin:0}
#open-trade-prompt{margin:2px 0 12px}
.desk-guide{margin:10px 0 0;border-top:1px solid var(--rule-2);padding-top:6px}
.desk-guide summary{cursor:pointer;list-style:none;font:italic .76rem/1.4 var(--fell);color:var(--ink-2);display:flex;align-items:center;gap:6px;min-height:28px}
.desk-guide summary::before{content:"+";font:500 .7rem var(--sans);width:12px;color:var(--ink-3)}
.desk-guide[open] summary::before{content:"–"}
.desk-guide summary::-webkit-details-marker{display:none}
.desk-guide>p,.desk-guide>.hd-guide,.desk-guide>.market-audio-copy,#market-audio-desk .desk-guide>.market-audio-copy{margin:6px 0 0;font-size:.66rem;line-height:1.5;color:var(--ink-2);max-width:62em}

/* ---- notes and footnotes: the same small voice, less air ---- */
.widget-body :is(.fine,.hd-note,.flow-note,.outcome-note,.outcome-foot,.watchbook-status,.sketch-foot p,.market-audio-status,.ticket-fine){font-size:.63rem;line-height:1.5;margin-top:6px}
.widget-body :is(.rd-foot,.lp-foot,.ev-foot){margin-top:8px}
#risk-desk,#evidence-desk{gap:8px}
#loupe-desk{gap:8px}

/* ---- a floor for the smallest type: nothing under 9.5px on grain ---- */
.terminal :is(.flow-receipt small,.flow-totals small,.flow-totals span,.flow-head>span,.rd-pace span,.studies-group b,.account-strip small,.hd-readout dt,.rd-grid dt,.ev-table th),#market-audio-desk .market-audio-status{font-size:.6rem}
.terminal .src-badge{font-size:.6rem}

/* ---- page chrome above the board ---- */
.terminal{padding-block:22px 24px}
.term-heading{margin-bottom:16px}
.terminal-tabs{margin-bottom:14px}
.notice{padding:8px 12px;margin-bottom:12px;font-size:.76rem}
.market-tape{padding:9px 14px;margin-bottom:12px}

/* ---- the chart: fewer rows above the plot ---- */
.chart-toolbar{min-height:0;padding:8px 16px}
.chart-studio-bar{padding:6px 16px}
.chart-tools{padding:4px 12px}
.chart-tools button{min-height:28px}
.chart-studio-caption{padding:2px 16px 6px!important}
.chart-studio-caption:not(:has(.chart-pick-mode)){display:none}
#chart-lab .chart-pick-mode{margin-left:auto}
.relief-controls{padding:6px 16px}
#chart-lab{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:6px 16px}
#chart-lab .replay-controls{margin-top:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.chart-foot{padding:6px 16px}
#practice-host[hidden]{display:none!important}
#practice-host:has(>.hunch-practice){padding:8px 16px 10px}
.hunch-practice summary{font:italic .9rem var(--fell)}
.hunch-practice p{font-size:.66rem;line-height:1.5;margin:4px 0 0}
.practice-fields{gap:8px;margin-top:8px}
.practice-fields input,.practice-fields select{padding:6px 8px;font-size:.72rem}
.practice-actions button{padding:6px 10px;min-height:28px}
.practice-journal{margin-top:8px}
#practice-journal-list{max-height:140px}

/* ---- the ticket: same controls, tighter rhythm ---- */
.account-mini{margin-bottom:10px}
.side-toggle{margin-bottom:12px}
.ticket-modes{margin:0 0 12px}
.label-row{margin-top:12px}
.leverage-range{margin:10px 0}
.ticket-summary{margin:14px 0 10px;gap:7px}
.ticket-help{min-height:18px;margin:8px 0 10px}
.ticket-fine{margin-top:8px}

/* ---- account and positions ---- */
.account-strip{gap:12px;margin:0}
.account-strip b{font-size:1.1rem}
.account-strip small{display:inline;margin-left:4px}
.positions-tabs button{padding:11px 0}
.positions-panel :is(th,td){padding:9px 16px}
.positions-panel:has(#activity-empty:not([hidden])) #activity-head{display:none}
.empty-state{padding:12px 16px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:left;flex-wrap:wrap}
.empty-seal{display:none}
.empty-state h3{font-size:1rem;margin:0}
.empty-state p{margin:0}
.account-meta{padding:6px 16px}
.watchbook-empty{min-height:0;padding:8px 0}

/* ---- canvases: a little shorter, the readings unchanged ---- */
#liq-canvas{height:260px}
#house-curve{height:190px}
#house-beam{height:110px}
#house-lean{height:80px}
#flow-delta-canvas{height:84px}
.lp-stage{height:clamp(320px,46vh,560px)}
@media(max-width:760px){#liq-canvas{height:240px}#house-curve{height:180px}}

/* ---- receipts: the left column truncates before it can run into the right one ---- */
.flow-receipt small{display:block;overflow:hidden;text-overflow:ellipsis;min-width:0}
.flow-receipt>div:last-child{flex-shrink:0}

/* ---- tablet: the chart and the ticket share the top row again (8 + 4), so the ticket is not left beside a hole ---- */
@media(max-width:1100px) and (min-width:851px){.widget[data-widget="chart"][data-span="8"]{grid-column:span 8}.widget[data-widget="ticket"][data-span="4"]{grid-column:span 4}}

/* ---- the chart's control strip (25 Oct): two rows on one surface, a label in the serif voice before each group, the
   drawing tools folded under a toggle, the zoom controls on the plot's own edge ---- */
.chart-panel{--strip:color-mix(in srgb,var(--paper-2) 42%,transparent)}
.chart-toolbar,.chart-studio-bar{background:var(--strip);border-bottom:0;padding:7px 14px;min-height:0;gap:8px 10px}
.chart-studio-bar{padding-top:0;padding-bottom:8px;border-bottom:1px solid var(--rule)}
.chart-studio-bar:has(+ .chart-tools:not([hidden])){border-bottom-color:transparent;padding-bottom:4px}
.strip-label{flex:0 0 auto;width:5.6em;font:italic .74rem/1 var(--fell);color:var(--ink-3);letter-spacing:.01em;user-select:none}
.chart-timeframes,.chart-looks{gap:1px!important;padding:2px;border:1px solid var(--rule);border-radius:999px;background:color-mix(in srgb,var(--paper) 55%,transparent)}
.chart-timeframes button,.timeframe-more,.chart-looks button{font:500 .66rem/1 var(--sans)!important;padding:5px 9px!important;min-height:24px;border-radius:999px}
.chart-timeframes button[aria-pressed=true],.timeframe-more.active,.chart-looks button[aria-pressed=true]{color:var(--paper)!important;background:var(--oxblood)}
.chart-looks button:not([aria-pressed=true]):hover,.chart-timeframes button:not([aria-pressed=true]):hover{color:var(--ink)}
/* at 1024 px the chart desk is ~620 px wide: the look pills tighten so draw and the screenshot button stay on their row */
@media(max-width:1100px){.chart-looks button{padding-inline:7px!important}}
.chart-toolbar .chart-badge{margin-left:auto}
.strip-toggle{margin-left:auto;font:500 .66rem/1 var(--sans);padding:5px 10px;min-height:24px;border:1px solid var(--rule);border-radius:999px;background:transparent;color:var(--ink-2);cursor:pointer;white-space:nowrap;transition:background .15s,color .15s,border-color .15s}
.strip-toggle[aria-expanded=true]{color:var(--paper);background:var(--ink);border-color:var(--ink)}
.strip-toggle span{margin-left:2px} /* the ✎ glyph at full ink: dimmed to .75 it read 4.3:1 */
.chart-shot{margin-left:0;width:26px;height:26px}
.chart-tools{background:var(--strip);border-bottom:1px solid var(--rule);padding:0 14px 8px;gap:4px 10px}
.chart-tools[hidden]{display:none!important}
.chart-tools button{min-width:26px;min-height:26px;padding:2px 6px;border-radius:999px}
.chart-tools button small{display:none}
.chart-tools button[aria-pressed=true]{background:var(--ink);color:var(--paper);border-color:var(--ink)}
/* the zoom controls: a third pill group at the right of row one, before the badge */
.chart-toolbar .zoom-tools{display:flex;align-items:center;gap:1px;padding:2px;margin-left:auto;border:1px solid var(--rule);border-radius:999px;background:color-mix(in srgb,var(--paper) 55%,transparent)}
.chart-toolbar .zoom-tools button{display:grid;place-items:center;min-width:24px;min-height:24px;padding:0 7px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--ink-3);font:400 .92rem/1 var(--sans);cursor:pointer}
.chart-toolbar .zoom-tools button:hover{color:var(--ink)}
.chart-toolbar .zoom-tools button[aria-pressed=true]{color:var(--paper);background:var(--ink)}
.chart-toolbar .zoom-tools button i{font-style:normal;font-size:.92rem;line-height:1}
.chart-toolbar .zoom-tools button small{display:none}
.chart-toolbar .zoom-tools #chart-log i,.chart-toolbar .zoom-tools #chart-reset i{font-size:.64rem;font-weight:500;letter-spacing:.02em}
.chart-toolbar .chart-badge{margin-left:0}
@media(max-width:680px){.strip-label{display:none}.chart-toolbar,.chart-studio-bar{padding-inline:10px}.chart-timeframes button,.timeframe-more,.chart-looks button{padding:5px 7px!important;font-size:.62rem!important}.chart-toolbar .zoom-tools{margin-left:0}}

/* ---- the glass: a sheet over the chart stage; ink in screen space ---- */
.chart-stage .glass-sheet{position:absolute;inset:0;z-index:5;pointer-events:none;display:block}
.chart-stage .glass-sheet.on{cursor:crosshair}
.chart-stage .glass-sheet.erase{cursor:cell}
.chart-stage.glass-on::after{content:"";position:absolute;inset:0;z-index:4;pointer-events:none;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--oxblood) 55%,transparent)}
.glass-tools{display:flex;align-items:center;gap:3px;flex-wrap:wrap;min-width:0;padding-left:10px;border-left:1px solid var(--rule)}
.glass-tools .glass-label{width:auto;margin-right:4px}
.glass-tools button{display:grid;place-items:center;min-width:26px;min-height:26px;padding:2px 6px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--ink-3);font:400 1rem/1 var(--sans);cursor:pointer}
.glass-tools button:hover{color:var(--ink);border-color:var(--rule)}
.glass-tools button[aria-pressed=true]{color:var(--paper);background:var(--ink);border-color:var(--ink)}
.glass-tools button i{font-style:normal;font-size:.95rem;line-height:1}
.glass-inks{display:inline-flex;align-items:center;gap:4px;padding:0 4px}
.glass-inks button{min-width:16px;min-height:16px;width:16px;height:16px;padding:0;border:1px solid var(--rule);border-radius:999px}
.glass-inks [data-glass-ink=ink]{background:var(--ink)}.glass-inks [data-glass-ink=oxblood]{background:var(--oxblood)}.glass-inks [data-glass-ink=ledger]{background:var(--ledger)}
.glass-inks button[aria-pressed=true]{box-shadow:0 0 0 2px var(--paper),0 0 0 3px var(--ink)}
/* a chosen swatch keeps its own ink: the pen's pressed style (.glass-tools button[aria-pressed=true], ink fill) must not paint it */
.glass-tools .glass-inks button[data-glass-ink=ink]{background:var(--ink)}.glass-tools .glass-inks button[data-glass-ink=oxblood]{background:var(--oxblood);border-color:var(--oxblood)}.glass-tools .glass-inks button[data-glass-ink=ledger]{background:var(--ledger);border-color:var(--ledger)}
@media(max-width:680px){.glass-tools{padding-left:0;border-left:0;flex-basis:100%}}

/* ---- the page pills wrap under the tabs on narrow pages: room below the active tab's underline (automation.css zeroes the row gap at 850 px; this loads last) ---- */
.terminal-tabs{row-gap:18px}
@media(max-width:850px){.terminal-tabs{row-gap:18px}}
.terminal-tabs>.tab-actions{padding-bottom:2px}

/* ---- selects: one treatment across the terminal (26 Oct 2026). Every select drops the platform arrow for one drawn
   chevron in the muted ink, a clear focus ring and a hit area of at least 30 px; the pickers that sit in a line of
   controls are pills, and the selects inside a form keep their field's box beside its inputs. Tokens only, so light and
   dark both follow. The ids in the selector outrank the desks' own select rules, which keep only their sizes. ---- */
:is(#terminal-main,#modal) select:not([multiple]){appearance:none;-webkit-appearance:none;min-height:30px;padding-right:28px;color:var(--ink);cursor:pointer;text-overflow:ellipsis;
  background-image:linear-gradient(45deg,transparent calc(50% - .75px),var(--chevron,var(--ink-3)) calc(50% - .75px),var(--chevron,var(--ink-3)) calc(50% + .75px),transparent calc(50% + .75px)),linear-gradient(-45deg,transparent calc(50% - .75px),var(--chevron,var(--ink-3)) calc(50% - .75px),var(--chevron,var(--ink-3)) calc(50% + .75px),transparent calc(50% + .75px));
  background-size:5px 5px,5px 5px;background-position:right 15px center,right 10px center;background-repeat:no-repeat;transition:border-color .12s,background-color .12s}
:is(#terminal-main,#modal) select:not([multiple]):hover:not(:disabled){border-color:var(--ink-3)}
:is(#terminal-main,#modal) select:not([multiple]):focus-visible{outline:2px solid var(--oxblood);outline-offset:2px}
:is(#terminal-main,#modal) select:not([multiple]):disabled{opacity:.5;cursor:default}
:is(#terminal-main,#modal) select option{background:var(--paper);color:var(--ink)}
/* the pickers in a line of controls: a pill */
:is(#terminal-main,#modal) :is(#outcome-position,#ec-position,#fuse-position,#chart-pick-destination,.toolbox-layouts,[data-audio-source],[data-atlas-metric],#replay-speed){border:1px solid var(--rule);border-radius:999px;background-color:var(--paper);padding:5px 28px 5px 12px;font:500 .66rem/1.2 var(--sans);color:var(--ink)}
#chart-pick-destination{max-width:150px}
.outcome-position-label{max-width:55%}
.outcome-position-label select{width:100%}
/* the quieter timeframes sit inside the timeframe pills: no frame of its own, the same chevron */
#terminal-main #timeframe-more{--chevron:currentColor;min-height:0;padding-right:20px!important;background-position:right 11px center,right 6px center}
@media(max-width:680px){#terminal-main #timeframe-more{padding-right:16px!important;background-position:right 8px center,right 3px center}}

/* ---- the market tape, tighter (26 Oct 2026). A desktop keeps its one line and loses a little air; a phone stacks three
   short rows instead of eight: the market and the deposit button, then mark, bid / ask and spread side by side, then the
   two open-interest bars side by side with thinner bars. ---- */
.market-tape{gap:10px 24px}
.market-oi-bars{gap:5px;padding-top:8px}
.oi-sides{gap:5px 24px}
.oi-bar{height:4px}
.funding-button{padding:6px 12px}
/* wider screens: each open-interest side reads on one line above its bar (the figures beside the share used) */
@media(min-width:681px){.oi-side{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:14px}.oi-head{grid-column:1}.oi-note{grid-column:2;grid-row:1;text-align:right}.oi-bar{grid-column:1/-1}}
@media(max-width:680px){
.market-tape{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 14px;padding:10px 12px}
.market-tape>.market-picker{order:1;margin:0 auto 0 0;gap:3px}
.market-picker button{padding:5px 10px 5px 5px}
.market-tape>.funding-button{order:2;align-self:center;width:auto;margin:0;padding:6px 10px;border:1px solid var(--oxblood);font-size:.64rem;text-align:center;white-space:nowrap}
.market-tape>.market-stat{order:3;flex:1 1 auto;gap:1px}
/* the mark's label lets its badge drop under it, so mark, bid / ask and spread share one line */
.market-tape>.market-stat:not(.stat-bbo,.stat-spread,.stat-vol,.stat-oi){flex-basis:84px;min-width:0}
.market-tape>.market-oi-bars{order:4;flex:1 0 100%;gap:4px;padding-top:7px}
.market-stat>span{display:flex;flex-wrap:wrap;align-items:center;gap:2px 4px}
.market-stat .src-badge{padding:1px 4px}
.market-stat b{font-size:.9rem}
.oi-sides{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px}
.oi-side{gap:3px}
.oi-bar{height:3px}
.oi-head{font-size:.62rem}
.oi-note{font-size:.6rem;line-height:1.35}
}

/* ---- the ticket's foot: the risk scale, the hint (only when it has something to say) and the order button each keep
   their own space, so the scale never touches the button when the hint is hidden ---- */
#order-form .risk-scale{margin-top:12px}
#order-form .ticket-help{min-height:0;margin:10px 0 0}
#order-form .order-action{margin-top:16px}

/* ---- your account: six figures, PAPER the last; a phone and a narrow card take two rows of three ---- */
.account-strip{grid-template-columns:repeat(6,minmax(0,1fr))}
.account-strip small.account-sub{display:block;margin:0;font-size:.6rem;opacity:.85;font-variant-numeric:tabular-nums}
@media(max-width:1000px){.account-strip{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:14px}.account-strip>div:nth-child(4){border-left:0;padding-left:0}}
@media(min-width:1001px){.widget[data-span="6"] .account-strip,.widget[data-span="4"] .account-strip,.widget[data-span="3"] .account-strip{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:14px}.widget:is([data-span="6"],[data-span="4"],[data-span="3"]) .account-strip>div:nth-child(4){border-left:0;padding-left:0}}

/* ---- the outcome sheet's settlement note: one plain line, the full note one press away ---- */
.outcome-note-fold{margin:10px 0 6px}
.outcome-note-fold summary{display:flex;align-items:baseline;gap:8px;min-height:24px;list-style:none;cursor:pointer;font-size:.66rem;line-height:1.5;color:var(--ink-2)}
.outcome-note-fold summary::-webkit-details-marker{display:none}
.outcome-note-fold summary::before{content:"+";flex:none;width:10px;font:500 .7rem var(--sans);color:var(--ink-3)}
.outcome-note-fold[open] summary::before{content:"–"}
.outcome-note-fold summary:focus-visible{outline:2px solid var(--oxblood);outline-offset:2px;border-radius:4px}
.outcome-note-more{margin-left:auto;flex:none;font-size:.6rem;color:var(--ink-3);text-decoration:underline;text-underline-offset:2px}
.outcome-note-fold[open] .outcome-note-more{display:none}
.outcome-note-fold[data-more=false] summary{cursor:default}
.outcome-note-fold[data-more=false] summary::before,.outcome-note-fold[data-more=false] .outcome-note-more,.outcome-note-fold[data-more=false]>.outcome-note{display:none}
.widget-body .outcome-note-fold>.outcome-note{margin:4px 0 0 18px}
/* phones: the timeframe row stays one line, every button visible (no hidden sideways scroll) */
@media(max-width:600px){.chart-timeframes{flex-wrap:nowrap!important;justify-content:space-between}.chart-timeframes button,.chart-timeframes .timeframe-more{padding:5px 5px!important;flex:0 0 auto;letter-spacing:-.01em}.chart-timeframes .timeframe-more{max-width:4.6em;padding-right:14px!important}}
