/* Halden Terminal. Direction: DESIGN.md (monochrome, ENERGY 1 / RHYTHM 2 / MOTION 1).
   Mono is used for numbers, tickers and commands so columns align; words stay in Manrope.
   The single accent is inversion: the focused pane header and the last-price row are solid ink. */
#terminal{--tm-mono:var(--hx-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);--tm-line:var(--hl-grid,#16363D);--tm-ink:var(--hl-text,#E6F6F7);--tm-paper:var(--hl-bg,#04181B);--tm-panel:var(--hl-panel,#0A2429);--tm-dim:var(--hl-text-2,#93B6BC)}
#terminal-root{display:flex;flex-direction:column;gap:12px;min-width:0}
#terminal button,#terminal [role=option]{cursor:pointer}
#terminal button:disabled{cursor:not-allowed}

/* command line */
.tm-cmd{position:relative;border:1px solid var(--tm-ink);border-radius:6px;background:var(--tm-paper);padding:10px 12px 8px}
.tm-cmd-label{display:block;font-size:12px;font-weight:600;color:var(--tm-dim);margin-bottom:6px}
.tm-target{font-family:var(--tm-mono);font-weight:500}
.tm-cmd-row{display:flex;align-items:center;gap:10px}
.tm-prompt{font-family:var(--tm-mono);font-size:18px;font-weight:700}
.tm-input{flex:1;min-width:0;font:600 17px/1.2 var(--tm-mono);letter-spacing:.02em;text-transform:uppercase;border:0;background:transparent;color:var(--tm-ink);padding:8px 0;caret-color:var(--tm-ink)}
.tm-input::placeholder{color:var(--tm-dim);text-transform:none;font-weight:500}
.tm-input:focus-visible{outline:none}
.tm-cmd:focus-within{box-shadow:0 0 0 2px var(--tm-paper),0 0 0 4px var(--tm-ink)}
.tm-run{font:600 14px Manrope,system-ui,sans-serif;min-height:40px;padding:0 18px;border-radius:4px;border:1px solid var(--tm-ink);background:var(--tm-ink);color:var(--tm-paper)}
.tm-run:hover{background:transparent;color:var(--tm-ink)}
.tm-msg{min-height:18px;margin:6px 0 0;font-size:13px;color:var(--tm-dim)}
.tm-msg.bad{color:var(--tm-ink);font-weight:600}
.tm-msg.bad::before{content:'! ';font-family:var(--tm-mono)}
.tm-sugg{position:absolute;left:12px;right:12px;top:calc(100% - 22px);z-index:20;list-style:none;margin:0;padding:4px;border:1px solid var(--tm-ink);border-radius:4px;background:var(--tm-paper);max-height:320px;overflow:auto}
.tm-sugg li{display:flex;gap:14px;align-items:baseline;padding:8px 10px;border-radius:3px}
.tm-sugg li b{font-family:var(--tm-mono);min-width:8ch}
.tm-sugg li span{color:var(--tm-dim);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-sugg li:hover,.tm-sugg li[aria-selected=true]{background:var(--tm-ink);color:var(--tm-paper)}
.tm-sugg li:hover span,.tm-sugg li[aria-selected=true] span{color:inherit}

/* panes */
.tm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tm-pane{display:flex;flex-direction:column;min-width:0;height:460px;border:1px solid var(--tm-line);border-radius:6px;background:var(--tm-paper);overflow:hidden}
.tm-pane.is-focus{border-color:var(--tm-ink)}
.tm-ph{display:flex;align-items:center;gap:10px;padding:6px 8px;border-bottom:1px solid var(--tm-line);background:var(--tm-panel);min-height:44px}
.tm-pane.is-focus .tm-ph{background:var(--tm-ink);color:var(--tm-paper);border-color:var(--tm-ink)}
.tm-pfocus{font:700 13px var(--tm-mono);width:28px;height:28px;border-radius:3px;border:1px solid currentColor;background:transparent;color:inherit;flex:none}
.tm-pane.is-focus .tm-pfocus{background:var(--tm-paper);color:var(--tm-ink);border-color:var(--tm-paper)}
.tm-ptitle{margin:0;font-size:14px;font-weight:600;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-code{font-family:var(--tm-mono);font-weight:700}
.tm-sec{font-family:var(--tm-mono);font-weight:700;margin-left:4px}
.tm-pane.is-focus .tm-dim{color:inherit;opacity:.75}
.tm-ptools{flex:none}
.tm-ivs{display:flex;gap:4px}
.tm-chip{font:600 12px var(--tm-mono);min-width:38px;min-height:28px;border-radius:3px;border:1px solid currentColor;background:transparent;color:inherit;opacity:.8}
.tm-chip:hover{opacity:1}
.tm-pane .tm-chip[aria-pressed=true]{background:var(--tm-ink);color:var(--tm-paper);border-color:var(--tm-ink)}
.tm-pane.is-focus .tm-ph .tm-chip[aria-pressed=true]{background:var(--tm-paper);color:var(--tm-ink);border-color:var(--tm-paper)}
.tm-pbody{flex:1;min-height:0;overflow:auto;padding:10px 12px 12px;font-size:13px}

/* states */
.tm-state{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 4px;color:var(--tm-dim)}
.tm-state.is-bad{color:var(--tm-ink)}
.tm-state p{margin:0}
.tm-state[role=status]{flex-direction:row;align-items:center;font-family:var(--tm-mono);font-size:13px}
.tm-cursor{display:inline-block;width:.6em;height:1.1em;background:currentColor;animation:tm-blink 1s steps(1) infinite}
@keyframes tm-blink{50%{opacity:0}}
@media (prefers-reduced-motion:reduce){.tm-cursor{animation:none}}
.tm-btn{font:600 13px Manrope,system-ui,sans-serif;min-height:34px;padding:0 12px;border-radius:4px;border:1px solid var(--tm-ink);background:transparent;color:var(--tm-ink)}
.tm-btn:hover{background:var(--tm-ink);color:var(--tm-paper)}
.tm-btn-s{font-family:var(--tm-mono);font-size:12px;min-height:30px;white-space:nowrap}

/* text helpers */
.tm-mono,.tm-num{font-family:var(--tm-mono);font-variant-numeric:tabular-nums}
.tm-num{text-align:right;white-space:nowrap}
.tm-dim{color:var(--tm-dim)}
.tm-note{margin:0 0 8px;font-size:12px;line-height:1.5;color:var(--tm-dim)}
.tm-note:last-child{margin:10px 0 0}
.tm-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tm-tag{font:600 10px var(--tm-mono);border:1px solid currentColor;border-radius:2px;padding:0 3px;margin-left:4px;vertical-align:1px}
.tm-big{font-size:28px;font-weight:600;margin:2px 0}
.tm-kv{display:flex;flex-wrap:wrap;gap:6px 18px;margin:0 0 8px;font-size:13px}

/* tables */
.tm-scroll{overflow:auto;max-width:100%}
.tm-table{width:100%;border-collapse:collapse;font-size:12.5px}
.tm-table th,.tm-table td{padding:5px 8px;border-bottom:1px solid var(--tm-line);text-align:left;vertical-align:top}
.tm-table thead th{position:sticky;top:0;background:var(--tm-paper);font-size:11px;font-weight:700;color:var(--tm-dim);z-index:1}
.tm-table tbody th{font-weight:600}
.tm-table tr.is-off td,.tm-table tr.is-off th{color:var(--tm-dim)}
.tm-sortbtn{font:inherit;color:inherit;background:none;border:0;padding:2px 0;min-height:24px;white-space:nowrap}
.tm-sortbtn:hover{color:var(--tm-ink)}
.tm-symbtn{font:700 12.5px var(--tm-mono);background:none;border:0;padding:2px 4px;margin:-2px -4px;border-radius:2px;color:var(--tm-ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.tm-symbtn:hover{background:var(--tm-ink);color:var(--tm-paper);text-decoration:none}
.tm-mon td:nth-child(4){max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-mon th,.tm-mon td{padding-left:6px;padding-right:6px}

/* ladder */
.tm-ladder tr.is-last th,.tm-ladder tr.is-last td{background:var(--tm-ink);color:var(--tm-paper);font-weight:700}
.tm-ladder tr.is-naked th{text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
.tm-ladder tr.is-poc th,.tm-ladder tr.is-poc td.tm-num{font-weight:700}

/* description */
.tm-dl{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:2px 18px;margin:12px 0 0}
.tm-dl div{display:block;padding:6px 0;border-bottom:1px solid var(--tm-line);min-width:0}
.tm-dl dt{display:block;font-size:11px;font-weight:700;color:var(--tm-dim);margin:0}
.tm-dl dd{display:block;margin:2px 0 0;text-align:left;overflow-wrap:anywhere}
.tm-dl a{color:var(--tm-ink)}

/* chart */
.tm-chart{width:100%;height:auto;display:block;aspect-ratio:880/330}
.tm-gl{stroke:var(--tm-line);stroke-width:1}
.tm-ax{font:17px var(--tm-mono);fill:var(--tm-dim)}
.tm-up line{stroke:var(--tm-ink);stroke-width:1}
.tm-up rect{fill:var(--tm-paper);stroke:var(--tm-ink);stroke-width:1}
.tm-dn line{stroke:var(--tm-ink);stroke-width:1}
.tm-dn rect{fill:var(--tm-ink);stroke:var(--tm-ink);stroke-width:1}
.tm-vol{fill:var(--tm-dim);opacity:.45}
.tm-lastline{stroke:var(--tm-ink);stroke-width:1;stroke-dasharray:3 3}
.tm-lasttag{fill:var(--tm-ink)}
.tm-lasttxt{font:700 17px var(--tm-mono);fill:var(--tm-paper)}

/* zoom + per-candle volume blocks */
.tm-zoom{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 6px}
.tm-zoom .tm-chip{min-width:34px;color:var(--tm-ink)}
.tm-zoom .tm-chip:disabled{opacity:.35}
.tm-zoom span{margin-left:6px;font-size:11px}
.tm-chart{cursor:grab;touch-action:pan-y}
.tm-chart:active{cursor:grabbing}
.tm-chart:focus-visible{outline:2px solid var(--tm-ink);outline-offset:2px}
.tm-fp{fill:var(--tm-dim);opacity:.42}
.tm-fp.is-poc{fill:var(--tm-ink);opacity:.9}
.tm-fpn{font:600 12px var(--tm-mono);fill:var(--tm-ink)}
.tm-fpn.is-poc{fill:var(--tm-paper)}

/* drawing tools: ink strokes on the chart, the same single accent as the rest of the Terminal */
.tm-dtools{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 6px}
.tm-dtools .tm-chip{min-width:44px;padding:0 8px;font-family:Manrope,system-ui,sans-serif;color:var(--tm-ink)}
.tm-dtools .tm-chip:disabled{opacity:.35}
.tm-dtools span.tm-dim{margin-left:6px;font-size:11px}
.tm-dsep{width:1px;height:20px;background:var(--tm-line);margin:0 4px}
.tm-chart.is-drawing{cursor:crosshair;touch-action:none}
.tm-d{stroke:var(--tm-ink);stroke-width:2;fill:none}
.tm-dpt{fill:var(--tm-paper);stroke:var(--tm-ink);stroke-width:1.5}
.tm-drect{fill:var(--tm-ink);fill-opacity:.08;stroke:var(--tm-ink);stroke-width:1.5}
.tm-dpen{fill:none;stroke:var(--tm-ink);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.tm-dl-t{font:700 16px var(--tm-mono);fill:var(--tm-ink);paint-order:stroke;stroke:var(--tm-paper);stroke-width:4px}

/* top boards */
.tm-boards{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px 16px}
.tm-board h3{font-size:12px;font-weight:700;margin:0 0 6px;padding-bottom:4px;border-bottom:1px solid var(--tm-ink)}
.tm-board ol{margin:0;padding:0;list-style:none;counter-reset:r}
.tm-board li{display:grid;grid-template-columns:2ch minmax(0,1fr) 5ch auto;gap:6px;align-items:baseline;padding:4px 0;border-bottom:1px solid var(--tm-line);counter-increment:r}
.tm-board li::before{content:counter(r);font:11px var(--tm-mono);color:var(--tm-dim)}
.tm-board .tm-symbtn{justify-self:start;max-width:100%;overflow:hidden;text-overflow:ellipsis}

/* volume profile */
.tm-vpwrap{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:14px}
.tm-vp{list-style:none;margin:0;padding:0;font-size:11.5px}
.tm-vp li{display:grid;grid-template-columns:9ch minmax(0,1fr) 4ch;gap:8px;align-items:center;height:16px}
.tm-bar{display:block;height:9px;width:var(--w);min-width:1px;background:var(--tm-dim);opacity:.55}
.tm-vp li.is-poc .tm-bar{background:var(--tm-ink);opacity:1}
.tm-vp li.is-here{font-weight:700}
.tm-vp li.is-here .tm-bar{outline:1px solid var(--tm-ink);outline-offset:1px}

/* status */
.tm-status{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 18px;font:12px/1.6 var(--tm-mono);color:var(--tm-dim);border-top:1px solid var(--tm-line);padding-top:8px;margin:0}
.tm-status span{font:inherit;color:inherit}
.tm-keys kbd{font:600 11px var(--tm-mono);border:1px solid var(--tm-line);border-radius:2px;padding:0 4px;color:var(--tm-ink);background:none}

@media (max-width:1100px){.tm-grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:700px){
 #terminal>.heading{padding-top:30px}
 .tm-pane{height:auto;max-height:none}
 .tm-pbody{max-height:520px}
 .tm-hide-s,.tm-keys{display:none}
 .tm-pfocus,.tm-chip,.tm-run,.tm-btn{min-height:44px;min-width:44px}
 .tm-ph{flex-wrap:wrap}
 .tm-ptitle{flex-basis:calc(100% - 60px)}
 .tm-ptools{width:100%}
 .tm-ivs .tm-chip{flex:1}
 .tm-input{font-size:16px}
 .tm-vpwrap{grid-template-columns:minmax(0,1fr)}
 .tm-symbtn{min-height:32px;display:inline-flex;align-items:center}
}
