/* Shared terminal system. Layout, typography and controls intentionally replace
   the former side-rail workbench; accounting and action contracts are unchanged. */
:root { --accent:#a85a00; --accent-soft:#fff2da; --up:#e60023; --down:#008000; --radius:2px; --radius-sm:2px; --tl-panel:#fff; --tl-head:#f4f4f4; --tl-number:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; }
html[data-theme="dark"] { --bg:#000; --bg-soft:#121212; --card:#090909; --tl-panel:#090909; --tl-head:#0e0e0e; --line:#1b1b1b; --line-strong:#2c2c2c; --ink:#ececea; --ink-2:#b3b3ac; --ink-3:#999991; --accent:#ffad21; --accent-soft:#2c210b; --mint:#00c900; --mint-soft:#102510; --up:#ff202f; --down:#00ff00; --up-soft:#2b1015; --down-soft:#0c250c; --warn:#ffad21; --warn-soft:#241b0c; }
html:not([data-theme="dark"]) .terminal-shell :is(.wb-position-list,.wb-position-table,.wb-trade-records) { --up:#e60023; --down:#008000; }
body { font-size:13px; line-height:1.5; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
button,input,select,textarea { accent-color:var(--accent); caret-color:var(--accent); }
::selection { background:var(--accent); color:var(--bg); }
:where(button,a,input,select,textarea,summary):focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:1px; }
.terminal-shell { min-height:100dvh; padding:0; }
.terminal-shell .wb-main,html[data-layout="desktop"] .terminal-shell .wb-main { margin:0; padding:0 12px 24px; min-width:0; }
.terminal-shell .wb-main> :not(.wb-toolbar) { max-width:none; }
.terminal-shell .wb-sidebar { display:none; }
.tl-header { background:var(--bg); border-bottom:1px solid var(--line-strong); }
.tl-header-main { display:flex; align-items:center; gap:16px; padding:7px 12px; min-height:52px; }
.tl-brand { display:flex; align-items:center; gap:8px; color:var(--ink); text-decoration:none; white-space:nowrap; flex-shrink:0; }
.tl-brand:hover { text-decoration:none; }
.tl-brand img { display:block; width:26px; height:26px; }
.tl-brand strong { font-size:13px; font-weight:650; }
.tl-brand>span { font:10px var(--tl-number); color:var(--ink-3); letter-spacing:.05em; }
.tl-command { display:flex; align-items:center; flex:1; min-width:80px; border:1px solid var(--line-strong); height:36px; }
.tl-command>.tl-command-prompt { display:grid; place-items:center; align-self:stretch; width:30px; flex:none; padding:0; color:var(--accent); }
.tl-command-prompt svg { display:block; width:14px; height:14px; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.terminal-shell .tl-command input#terminal-command { flex:1; width:0; height:100%; min-height:0; border:0; outline:0; box-shadow:none; padding:0 8px; background:transparent; }
.tl-command input { width:100%; min-width:0; min-height:0; height:34px; padding:0 10px; border:0; border-radius:0; background:transparent; font-size:12px; box-shadow:none; }
.tl-command input:focus { box-shadow:none; }
.tl-command:focus-within { border-color:var(--accent); }
.tl-command button { align-self:stretch; flex-shrink:0; white-space:nowrap; border:0; border-left:1px solid var(--line-strong); padding:0 15px; background:var(--accent); color:var(--bg); font-size:12px; font-weight:700; cursor:pointer; }
.tl-header-actions { display:flex; align-items:center; gap:5px; }
.tl-telemetry { display:flex; flex-direction:row; gap:18px; align-items:center; margin-left:auto; color:var(--ink-3); font-size:10px; white-space:nowrap; }
.tl-telemetry time,.tl-telemetry b { color:var(--ink-2); font:11px var(--tl-number); }
.tl-fps-readout { border:0; padding:4px 0; background:transparent; color:var(--ink-2); font:11px var(--tl-number); cursor:help; }
.tl-fps-readout[data-state="active"] { color:var(--accent); }
.tl-preview { color:var(--accent); white-space:nowrap; font-size:11px; padding:3px 7px; border:1px solid var(--line); }
.tl-icon-btn { position:relative; display:grid; place-items:center; width:34px; height:34px; border:1px solid transparent; background:transparent; color:var(--ink-2); cursor:pointer; }
.tl-icon-btn .ic { width:17px; height:17px; display:block; }
.tl-icon-btn svg { width:100%; height:100%; }
.tl-icon-btn:hover { border-color:var(--line-strong); color:var(--accent); }
.tl-settings-btn { background:var(--bg-soft); border-radius:6px; color:var(--ink); }
.tl-settings-btn:hover { background:var(--accent-soft); border-color:transparent; }
.tl-badge { position:absolute; right:0; top:0; font:9px var(--tl-number); color:var(--accent); }
.tl-header-nav { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 12px 7px; }
.terminal-shell .wb-nav { display:flex; flex-direction:row; gap:4px; flex:1; overflow-x:auto; padding:0; min-width:0; }
.terminal-shell .tl-header .wb-nav-button { width:auto; min-height:32px; flex-shrink:0; gap:6px; padding:5px 10px 5px 5px; border:1px solid var(--line); border-radius:0; font-size:12px; font-weight:500; white-space:nowrap; background:var(--tl-head); color:var(--ink-2); }
.terminal-shell .tl-header .wb-nav-button .lb { flex:none; }
.terminal-shell .tl-header .wb-nav-button>.ic { width:13px; height:13px; }
.tl-header .wb-nav-button kbd { display:grid; place-items:center; width:17px; height:17px; font:11px var(--tl-number); color:var(--accent); background:var(--accent-soft); }
.terminal-shell .tl-header .wb-nav-button.active { background:var(--accent); border-color:var(--accent); color:var(--bg); }
.tl-header .wb-nav-button.active kbd { background:var(--bg); color:var(--accent); }
.terminal-shell .tl-header .wb-nav-button:hover:not(.active) { color:var(--accent); border-color:var(--accent); }
.tl-header-quick .wb-quick-actions { flex-direction:row; padding:0; gap:5px; }
.terminal-shell .wb-icon-act { width:32px; height:32px; border-radius:0; border-color:var(--line-strong); color:var(--accent); }
.terminal-shell .wb-icon-act .ic { width:15px; height:15px; }
.tl-page-heading { display:flex; align-items:center; gap:14px; min-height:48px; margin:0; border-bottom:1px solid var(--line); }
.tl-page-heading h1 { font-size:14px; color:var(--accent); margin:0; font-weight:650; }
.tl-page-status { font-size:11px; color:var(--ink-3); }
.tl-dashboard { display:grid; gap:8px; padding-top:8px; }
.tl-metrics,.tl-secondary-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); border:1px solid var(--line); background:var(--tl-panel); }
.tl-metric { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:6px; min-width:0; min-height:88px; padding:12px 14px; background:transparent; border:0; border-right:1px solid var(--line); text-align:left; color:var(--ink); cursor:pointer; }
.tl-metric:last-child { border-right:0; }
.tl-metric:hover { background:var(--bg-soft); }
.tl-metric>span { font-size:11px; color:var(--ink-3); }
.tl-metric>strong { max-width:100%; font:600 23px/1.2 var(--tl-number); letter-spacing:-.03em; white-space:normal; overflow-wrap:anywhere; font-style:normal; }
.tl-metric>small { font-size:11px; color:var(--ink-2); line-height:1.5; }
.tl-secondary-metrics .tl-metric { min-height:80px; }
.tl-secondary-metrics .tl-metric>strong { font-size:20px; }
.tl-amber { color:var(--accent); }
.tl-trend-toolbar { display:flex; align-items:center; gap:12px; min-height:38px; }
.tl-trend-toolbar h2 { margin:0; font-size:13px; font-weight:600; }
.tl-trend-toolbar>span { color:var(--ink-3); font-size:11px; }
.tl-ranges { display:flex; gap:3px; margin-left:auto; }
.tl-ranges button { min-width:40px; min-height:30px; padding:4px 9px; border:1px solid var(--line); color:var(--ink-2); background:transparent; font-size:11px; cursor:pointer; }
.tl-ranges button.active { color:var(--accent); background:var(--accent-soft); border-color:var(--accent); }
.tl-ranges button:hover { border-color:var(--accent); }
.tl-trend-grid,.tl-lower-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.tl-panel { min-width:0; background:var(--tl-panel); border:1px solid var(--line); }
.tl-panel-head { min-height:32px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 10px; border-bottom:1px solid var(--line); background:var(--tl-head); }
.tl-panel-head :is(h2,h3) { margin:0; font-size:11px; font-weight:600; color:var(--accent); }
.tl-panel-head>span { font:10px var(--tl-number); color:var(--ink-3); }
.tl-trend .tl-panel-head { min-height:38px; }
.tl-range-menu { position:relative; margin-left:auto; color:var(--ink-2); }
.tl-range-menu summary { display:flex; align-items:center; justify-content:center; gap:5px; min-height:26px; padding:3px 6px; cursor:pointer; font:10px var(--tl-number); list-style:none; border-radius:3px; background:var(--bg-soft); }
.tl-range-menu summary::-webkit-details-marker { display:none; }
.tl-range-menu .ic { width:12px; height:12px; }
.tl-range-menu[open] summary,.tl-range-menu summary:hover { color:var(--accent); }
.tl-range-options { position:absolute; top:calc(100% + 5px); right:0; z-index:40; display:grid; width:84px; padding:4px; background:var(--card); border:1px solid var(--line-strong); box-shadow:0 6px 18px #0003; }
.tl-range-options button { min-height:32px; border:0; padding:5px; background:transparent; color:var(--ink-2); font-size:12px; cursor:pointer; }
.tl-range-options button:hover,.tl-range-options button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent); }
.tl-activity-tabs { display:flex; gap:12px; }
.tl-activity-tabs button { border:0; background:transparent; color:var(--ink-3); font-size:11px; padding:3px 0; cursor:pointer; }
.tl-activity-tabs button[aria-selected="true"] { color:var(--accent); }
.tl-activity-body { flex:1; display:flex; flex-direction:column; min-width:0; }
.tl-plan-preview { flex:1; display:flex; flex-direction:column; padding:3px 10px; }
.tl-plan-preview .tl-schedule-row { flex:1; padding:12px 2px; }
.terminal-shell .tl-lower-grid>.tl-panel { display:flex; flex-direction:column; align-self:stretch; height:auto; margin:0; }
.tl-holding-minis .tl-mini-grid { flex:1; grid-auto-rows:1fr; }
.tl-holding-minis .tl-mini-card { grid-template-rows:auto auto minmax(60px,1fr) auto; }
.tl-holding-minis .tl-mini-chart { height:auto; min-height:60px; }
.tl-holding-minis .tl-mini-chart svg { height:100%; max-height:90px; }
.tl-trend-readout { display:flex; align-items:baseline; gap:12px; padding:12px 14px 0; min-width:0; }
.tl-trend-readout strong { font:600 20px var(--tl-number); letter-spacing:-.03em; }
.tl-trend-readout>span { color:var(--ink-3); font-size:10px; }
.tl-trend-svg { width:100%; display:block; height:auto; aspect-ratio:440/214; touch-action:pan-y; }
.tl-axis { fill:var(--ink-3); font:9px var(--tl-number); }
.tl-data-line { fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
.tl-latest-dot { fill:currentColor; }
.tl-trend-cursor[hidden] { display:none; }
.tl-trend-cursor circle { fill:currentColor; stroke:var(--bg); stroke-width:1.5; }
.tl-cursor-line { stroke:currentColor; stroke-opacity:.3; stroke-width:.7; fill:none; }
.tl-table-wrap { overflow-x:auto; }
.tl-ledger-table { width:100%; border-collapse:collapse; table-layout:fixed; font:12px var(--tl-number); }
.tl-ledger-table th { color:var(--ink-3); font-size:10px; font-weight:400; padding:8px 10px; text-align:left; border-bottom:1px solid var(--line); }
.tl-ledger-table td { padding:8px 10px; border-bottom:1px solid var(--line); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tl-ledger-table th:first-child { width:62px; }
.tl-ledger-table th:nth-child(3) { width:58px; }
.tl-ledger-table th:last-child,.tl-ledger-table td:last-child { text-align:right; width:118px; }
.tl-ledger-table td button { color:var(--ink); background:none; border:0; padding:0; cursor:pointer; font:inherit; text-align:left; width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tl-ledger-table td button:hover { color:var(--accent); text-decoration:underline; }
.tl-trade-type { color:var(--ink-2); font-family:var(--font); font-size:11px; }
.tl-panel-link,.tl-text-action { display:flex; justify-content:space-between; gap:12px; color:var(--accent); background:none; border:0; cursor:pointer; font-size:11px; padding:0; }
.tl-panel-link { width:100%; min-height:38px; align-items:center; padding:8px 10px; }
.tl-panel-link:hover,.tl-text-action:hover { text-decoration:underline; }
.tl-allocation .wb-section { padding:0; margin:0; border:0; }
.tl-allocation .wb-section-head { display:none; }
.tl-allocation .seg { display:flex; padding:0 12px; }
.tl-allocation .seg button { min-height:34px; padding:5px; font-size:11px; }
.tl-allocation { display:flex; flex-direction:column; }
.tl-allocation .wb-section { flex:1; display:flex; flex-direction:column; }
.tl-allocation #wb-content-allocation { flex:1; display:flex; flex-direction:column; }
.tl-allocation .wb-allocation { flex:1; display:flex; align-items:center; justify-content:center; padding:12px; }
.tl-allocation .wb-allocation-open { display:flex; flex-direction:column; align-items:center; background:none; border:0; cursor:pointer; width:100%; }
.tl-allocation .wb-allocation .wb-dial { width:232px; height:232px; max-width:100%; }
.tl-allocation .wb-dial-value { font-family:var(--tl-number); }
.tl-allocation .wb-allocation-hint { font-size:11px; color:var(--ink-2); padding:0; }
.tl-allocation .wb-dial-segment { pointer-events:stroke; transition:opacity 160ms ease-out; }
.tl-allocation .wb-dial[data-inspecting] .wb-dial-segment { opacity:.3; }
.tl-allocation .wb-dial[data-inspecting] .wb-dial-segment.is-active { opacity:1; }
.tl-allocation .wb-dial text { pointer-events:none; }
.tl-signal-body { display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px; min-height:40px; }
.tl-metric .tl-signal-body strong { font:600 19px/1.2 var(--tl-number); white-space:nowrap; }
.tl-signal-body strong b { font-weight:600; }.tl-signal-body strong i { font-style:normal; color:var(--ink-3); padding:0 5px; font-size:12px; }
.tl-semi { width:72px; height:42px; flex-shrink:0; overflow:visible; }
.tl-mini-ring { width:40px; height:40px; flex-shrink:0; }
.tl-gauge-track { fill:none; stroke:var(--bg-soft); stroke-width:3; }
.tl-gauge-gain { fill:none; stroke:var(--up); stroke-width:3; stroke-linecap:butt; }.tl-gauge-loss { fill:none; stroke:var(--down); stroke-width:3; stroke-linecap:butt; }
.tl-confirmed-arc { fill:none; stroke:var(--accent); stroke-width:6; }
.tl-value-split .tl-signal-body { min-height:24px; }.tl-value-split .tl-signal-body strong { font-size:16px; }
.tl-split-bar { display:flex; width:100%; height:4px; background:var(--line-strong); }
.tl-split-bar>i { display:block; height:100%; }.tl-split-gain { background:var(--up); }.tl-split-loss { background:var(--down); }
.tl-value-split>small { display:flex; flex-wrap:wrap; gap:3px 10px; font-size:10px; }
.tl-insights { padding:0 12px; }
.tl-insights>button { width:100%; display:grid; grid-template-columns:6px minmax(0,1fr) auto; gap:10px; align-items:start; padding:16px 0; border:0; border-bottom:1px solid var(--line); background:none; color:var(--ink); cursor:pointer; text-align:left; }
.tl-insights>button:last-child { border-bottom:0; }
.tl-insights>button:hover b { color:var(--accent); }
.tl-insights b { font-size:12px; font-weight:500; }
.tl-insights small { display:block; color:var(--ink-3); font-size:11px; margin-top:5px; }
.tl-insights strong { font:11px var(--tl-number); white-space:nowrap; }
.tl-income { padding:4px 14px 10px; }
.tl-income>button { display:grid; grid-template-columns:1fr auto; gap:9px 16px; width:100%; padding:18px 0; border:0; background:none; text-align:left; color:var(--ink-2); cursor:pointer; }
.tl-income>button>span:first-child { font-size:12px; }
.tl-income strong { font:600 16px var(--tl-number); }
.tl-income-track { grid-column:1/-1; height:3px; background:var(--bg-soft); overflow:hidden; }
.tl-income-track i { display:block; width:100%; height:100%; background:currentColor; transform-origin:left; }
.tl-income>button:hover>span:first-child { color:var(--accent); }
.tl-flow-list { padding:2px 12px; }
.tl-flow-row { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:10px; width:100%; min-height:55px; padding:9px 0; border:0; background:none; color:var(--ink); text-align:left; cursor:pointer; }
.tl-flow-row+.tl-flow-row { border-top:1px solid var(--line); }
.tl-flow-side { display:grid; place-items:center; width:28px; height:28px; background:var(--bg-soft); color:var(--ink-3); border-radius:5px; }
.tl-flow-side.is-buy { color:var(--accent); background:var(--accent-soft); }
.tl-flow-side .ic { width:15px; height:15px; }
.tl-flow-asset { min-width:0; }.tl-flow-asset b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:500; }
.tl-flow-row small { display:block; margin-top:5px; color:var(--ink-3); font:10px var(--tl-number); }
.tl-flow-money { text-align:right; }.tl-flow-money strong { font:600 13px var(--tl-number); white-space:nowrap; }
.tl-flow-row:hover .tl-flow-asset b { color:var(--accent); }
.tl-mini-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:10px; }
.tl-mini-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px; min-width:0; padding:10px; background:var(--bg-soft); color:var(--ink); border:0; text-align:left; cursor:pointer; }
.tl-mini-name { grid-column:1/-1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--ink-2); }
.tl-mini-card>strong { font:600 16px var(--tl-number); min-width:0; overflow:hidden; text-overflow:ellipsis; }
.tl-mini-card>small { align-self:center; font:10px var(--tl-number); }
.tl-mini-chart { display:grid; align-items:center; grid-column:1/-1; height:60px; min-width:0; }
.tl-mini-chart svg { display:block; width:100%; height:60px; }
.tl-mini-chart path { stroke:currentColor; stroke-width:1.1; fill:none; }
.tl-mini-chart rect { fill:currentColor; }
.tl-mini-chart circle { fill:currentColor; }
.tl-mini-empty { color:var(--ink-3); font-size:10px; text-align:center; }
.tl-mini-state { grid-column:1/-1; color:var(--ink-3); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tl-mini-card:hover .tl-mini-name { color:var(--accent); }
.tl-tx-legend { display:flex; gap:12px; font-size:10px; color:var(--ink-3); }
.tl-tx-legend span:before { content:''; display:inline-block; width:5px; height:5px; margin-right:4px; background:var(--ink-3); }
.tl-tx-legend .is-buy:before { background:var(--accent); }.tl-tx-legend .is-sell:before { background:var(--ink-2); }
.tl-tx-chart { padding:8px 14px 0; display:flex; flex-direction:column; justify-content:center; flex:1; }
.tl-recent { display:flex; flex-direction:column; }
.tl-tx-lane { padding:8px 0; }
.tl-tx-scale { display:flex; justify-content:space-between; color:var(--ink-3); font:10px var(--tl-number); margin-bottom:2px; }
.tl-tx-columns { display:flex; gap:10px; align-items:stretch; border-bottom:1px solid var(--line); }
.tl-tx-column { position:relative; flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:7px; padding:18px 0 7px; background:none; border:0; color:var(--ink); cursor:pointer; }
.tl-tx-bar-space { display:flex; align-items:flex-end; justify-content:center; width:100%; height:72px; }
.tl-tx-bar { display:block; width:clamp(12px,60%,38px); background:var(--ink-3); min-height:1px; }
.tl-tx-bar.is-buy { background:var(--accent); }.tl-tx-bar.is-sell { background:var(--ink-2); }
.tl-tx-date { color:var(--ink-3); font:10px var(--tl-number); }
.tl-tx-value { position:absolute; top:0; opacity:0; font:10px var(--tl-number); pointer-events:none; white-space:nowrap; }
.tl-tx-column:hover .tl-tx-value,.tl-tx-column:focus-visible .tl-tx-value { opacity:1; }
.tl-tx-column:hover .tl-tx-bar { opacity:.75; }
.tl-tx-lane:only-child .tl-tx-bar-space { height:144px; }
.tl-dual-legend { display:flex; gap:12px; color:var(--ink-3); font-size:10px; }
.tl-dual-legend span:before { content:''; display:inline-block; width:5px; height:5px; margin-right:4px; background:var(--accent); }
.tl-dual-legend span:last-child:before { background:#9d83ea; }
.tl-activity-stack { display:flex; flex-direction:column; flex:1; padding:6px 12px 10px; }
.tl-activity-part { display:flex; flex-direction:column; flex:1; min-width:0; }
.tl-activity-part h3 { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0; padding:6px 0 0; font-size:11px; font-weight:500; color:var(--ink-2); }
.tl-activity-part h3 small,.tl-plan-unknown { color:var(--ink-3); font-size:10px; font-weight:400; }
.tl-activity-stack .tl-tx-chart { padding:3px 0; }
.tl-activity-stack .tl-tx-lane { padding:4px 0; }
.tl-activity-stack .tl-tx-lane .tl-tx-bar-space { height:52px; }
.tl-activity-future { border-top:1px solid var(--line); margin-top:6px; padding-top:4px; }
.tl-tx-bar.is-plan { background:#9d83ea; }
.tl-status-dot { width:5px; height:5px; margin-top:6px; background:var(--down); }
.tl-status-dot.warn { background:var(--warn); }.tl-status-dot.neutral { background:var(--ink-3); }
.tl-bottom-grid { display:grid; grid-template-columns:1fr; gap:8px; }
.tl-bottom-grid .tl-panel { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-bottom:0; }.tl-bottom-grid .tl-panel-head { grid-column:1/-1; background:transparent; }
.tl-bottom-grid .tl-panel>.tl-schedule-row { display:grid; grid-template-columns:minmax(0,1fr) auto; min-height:48px; }
.tl-schedule-row { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:56px; padding:10px 12px; border:0; border-bottom:1px solid var(--line); background:none; color:var(--ink); cursor:pointer; text-align:left; }
.tl-schedule-row:hover { background:var(--bg-soft); }.tl-schedule-row:last-child { border-bottom:0; }
.tl-schedule-row>span { min-width:0; }.tl-schedule-row b { display:block; font-size:12px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:30ch; }
.tl-schedule-row small { display:block; font-size:11px; color:var(--ink-3); margin-top:4px; }
.tl-schedule-row strong { font:12px var(--tl-number); white-space:nowrap; }
.tl-zero-axis { fill:none; stroke:var(--ink-3); stroke-width:.5; stroke-opacity:.3; }
/* All low-frequency pages inherit the same panel, field and table grammar. */
.terminal-shell :is(.card,.wb-section,.review-toolbar,.wb-trade-stats,.wb-trade-filters,.wb-position-toolbar) { border:1px solid var(--line); background:var(--tl-panel); border-radius:0; padding:14px; margin:8px 0; }
.terminal-shell .tl-allocation .wb-section { border:0; padding:0; margin:0; }
.terminal-shell .tl-allocation .wb-section-head { margin:0; }
.terminal-shell :is(.card-head h2,.wb-section h2) { font-size:13px; font-weight:600; color:var(--accent); }
.terminal-shell :is(.btn,.seg button,.wb-collapse,input,select,textarea,.entry-compose textarea,.mt-terminal,.mt-terminal button,.mt-terminal select,.advice-overview,.advice-card,.advice-notifications) { border-radius:1px; }
.terminal-shell .btn,.modal .btn,.wb-detail .btn { min-height:34px; font-size:12px; padding:6px 12px; border-radius:1px; }
.terminal-shell .btn.primary,.modal .btn.primary { background:var(--accent); border-color:var(--accent); color:var(--bg); }
.btn.primary { color:var(--bg); }
.terminal-shell .btn.primary:hover,.modal .btn.primary:hover { background:color-mix(in srgb,var(--accent) 88%,var(--ink)); }
.terminal-shell :is(input,select,textarea) { border-radius:1px; font-size:13px; background:var(--bg); }
.terminal-shell :is(small,.label,.sub,.hint,.hint-line,.tag,.chip,.plan-meta,.stale-hint,.field>label,.kv .k,.metric .foot,.name-cell .cd,table.data th) { font-size:12px; }
.terminal-shell table.data { font-size:13px; }
.terminal-shell table.data th { font-size:11px; padding:8px 10px; background:var(--tl-head); }
.terminal-shell table.data td { padding:10px; }
.terminal-shell .wb-position-table td strong { font:600 14px var(--tl-number); }
.terminal-shell .wb-position-table td small { font-size:11px; }
.terminal-shell .wb-position-table td:first-child { font-size:13px; }
.terminal-shell .table-wrap { margin:0; padding:0; }
.terminal-shell .wb-holding-search { margin:8px 0; }
.terminal-shell .wb-trade-record { padding:12px; border-radius:0; }
.terminal-shell .plan { border:1px solid var(--line); border-radius:0; padding:14px; gap:10px; }
.terminal-shell .plan-name { font-size:14px; }.terminal-shell .plan-stats .s .v { font:15px var(--tl-number); }
.terminal-shell .advice-workspace { max-width:none; }
.terminal-shell .advice-card,.terminal-shell .advice-overview,.terminal-shell .advice-notifications { border-radius:0; border-color:var(--line); background:var(--tl-panel); }
.terminal-shell .advice-intro h2,.terminal-shell .entry-intro h2 { font-size:23px; }
.terminal-shell .advice-card-head h2 { font-size:16px; }
.terminal-shell .advice-callout h3 { font-size:20px; }
.terminal-shell .advice-eyebrow { display:none; }
.terminal-shell .local-entry { max-width:none; gap:10px; }
.terminal-shell .entry-compose.card,.terminal-shell .entry-draft.card { border-radius:0; padding:18px; }
.terminal-shell .assistant-guide { gap:8px; margin-top:12px; }
.terminal-shell .assistant-guide details { border-radius:0; background:var(--tl-panel); }
.terminal-shell .assistant-guide summary { min-height:42px; padding:10px 12px; font-size:13px; background:var(--tl-head); }
.terminal-shell .assistant-guide details[open]>summary { border-bottom:1px solid var(--line); }
.terminal-shell .mt-terminal { border-radius:0; }.terminal-shell .mt-header { min-height:54px; padding:8px 12px; }
.terminal-shell .mt-terminal { --mt-up:var(--up); --mt-down:var(--down); }
.terminal-shell .mt-settings-body { border-radius:1px; }
.terminal-shell .review-page { padding-top:0; }.terminal-shell .review-summary strong { font-family:var(--tl-number); }
.terminal-shell .review-data-row { padding:14px 0; }
.modal,.wb-detail,.sheet,.login-card { border-radius:1px; background:var(--card); border-color:var(--line-strong); }
.modal-head,.wb-detail-header { background:var(--tl-head); border-bottom:1px solid var(--line); padding:16px 20px; }
.modal-head h3,.wb-detail-header h2 { font-size:18px; }
.modal :is(input,select,textarea) { border-radius:1px; background:var(--bg); }
.wb-detail-tabs button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); }
.login-card { border:1px solid var(--line); box-shadow:none; }
.login-title { color:var(--accent); }
@media(min-width:721px) { .terminal-shell .wb-mobile-nav { display:none; } }
@media(min-width:721px) {
  .terminal-shell .btn.sm { min-height:30px; padding:4px 9px; font-size:11px; }
  .terminal-shell .seg button { min-height:34px; padding:5px 10px; font-size:12px; }
  .terminal-shell .wb-tx-record { padding:9px 12px; }
  .terminal-shell .wb-tx-main { grid-template-columns:90px minmax(0,1fr) 95px 140px 56px; gap:12px; }
  .terminal-shell .wb-tx-main small { font-size:11px; }
  .terminal-shell .wb-tx-name strong { font-size:13px; }
  .terminal-shell .wb-tx-amount strong { font:600 17px var(--tl-number); }
  .terminal-shell .wb-tx-details { display:flex; flex-wrap:wrap; gap:3px 20px; padding-left:102px; margin:5px 0 0; font-size:11px; line-height:1.5; }
  .terminal-shell .wb-tx-note { margin:4px 0 0 102px; font-size:11px; }
  .terminal-shell .wb-trade-toolbar { padding:10px 0; }
  .terminal-shell .wb-trade-toolbar h2 { font-size:15px; }
  .terminal-shell .review-page { gap:8px; }
  .terminal-shell .review-contribution { padding:9px 0; gap:12px; }
  .terminal-shell .review-contribution>div { gap:3px; }
  .terminal-shell .review-contribution strong { font-size:13px; }
  .terminal-shell .review-contribution small { font-size:11px; line-height:1.5; }
  .terminal-shell .review-summary { margin:12px 0 10px; gap:16px; }
  .terminal-shell .review-summary strong { font-size:23px; }
  .terminal-shell .review-summary span,.terminal-shell .review-meta { font-size:12px; }
  .terminal-shell .review-budget { display:grid; grid-template-columns:minmax(260px,.9fr) minmax(0,1.5fr); column-gap:24px; align-items:start; }
  .terminal-shell .review-budget>.card-head { grid-column:1/-1; margin:0 0 8px; }
  .terminal-shell .review-budget-form { grid-column:1; grid-row:2; margin:0; gap:6px; }
  .terminal-shell .review-budget-form label { width:100%; font-size:12px; }
  .terminal-shell .review-budget-form input { width:145px; min-height:34px; padding:5px 8px; }
  .terminal-shell .review-budget>p { grid-column:1; margin:6px 0; font-size:11px; }
  .terminal-shell .review-budget-stats { grid-column:2; grid-row:2 / span 2; margin:0; gap:10px; }
  .terminal-shell .review-budget-stats>div { gap:6px; padding:8px 0; }
  .terminal-shell .review-budget-stats span { font-size:12px; }
  .terminal-shell .review-budget-stats strong { font:600 20px var(--tl-number); }
  .terminal-shell .review-budget-status { grid-column:1/-1; padding:7px 0; font-size:12px; }
  .terminal-shell .review-detail { grid-column:1/-1; }
  .terminal-shell .review-detail summary { min-height:32px; font-size:12px; }
  .terminal-shell .plan { gap:8px; padding:12px; }
  .terminal-shell .plan-stats { gap:8px; }
  .terminal-shell .plan-stats .s { padding:5px 0; }
  .terminal-shell .plan-meta { margin-top:2px; font-size:11px; }
}
@media(min-width:1700px) { .terminal-shell .wb-main { max-width:1920px; margin:0 auto; }.tl-metric>strong { font-size:27px; }.tl-trend-svg { max-height:300px; }.tl-lower-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1200px) and (min-width:721px) { .tl-brand>span { display:none; }.tl-metrics,.tl-secondary-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }.tl-metric:nth-child(3) { border-right:0; }.tl-metric:nth-child(-n+3) { border-bottom:1px solid var(--line); }.tl-trend-readout { flex-wrap:wrap; gap:2px 8px; }.tl-trend-readout strong { font-size:17px; }.tl-lower-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.tl-account { grid-column:1/-1; }.tl-insights { display:grid; grid-template-columns:1fr 1fr; column-gap:20px; } }
@media(max-width:720px) {
  body { font-size:14px; }
  .terminal-shell .wb-main,html[data-layout="desktop"] .terminal-shell .wb-main { padding:0 10px calc(90px + var(--sab)); }
  .tl-header-main { min-height:54px; flex-wrap:wrap; padding:8px 10px; gap:8px; }
  .tl-brand { gap:6px; }.tl-brand>span { display:none; }.tl-brand strong { font-size:13px; }
  .tl-header-actions { margin-left:auto; gap:2px; }.tl-icon-btn { width:36px; height:38px; }
  .tl-preview { font-size:10px; padding:2px 5px; }.tl-header-actions .tl-icon-btn[data-tab="settings"] { display:none; }
  .tl-page-heading { flex-wrap:wrap; padding:10px 0; row-gap:6px; }
  .tl-telemetry { flex-basis:100%; justify-content:space-between; gap:12px; font-size:10px; }
  .tl-command { order:3; flex-basis:100%; height:40px; }.tl-command input { height:38px; font-size:14px; }
  .tl-header-nav { display:none; }.tl-page-heading { min-height:46px; gap:8px; }.tl-page-status { font-size:10px; }.tl-page-currency { display:none; }
  .tl-metrics,.tl-secondary-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tl-metric { padding:12px; min-height:92px; border-bottom:1px solid var(--line); gap:7px; }
  .tl-metric:nth-child(2n) { border-right:0; }.tl-metric:nth-last-child(-n+2) { border-bottom:0; }
  .tl-metric>strong { font-size:22px; }.tl-metric>small,.tl-metric>span { font-size:12px; }
  .tl-secondary-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tl-secondary-metrics>.tl-metric:not(.tl-signal) { display:none; }
  .tl-secondary-metrics .tl-signal { border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
  .tl-secondary-metrics .tl-signal:nth-child(5) { border-right:0; }
  .tl-secondary-metrics .tl-signal:last-child { grid-column:1/-1; border:0; }
  .tl-bottom-grid .tl-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tl-trend-toolbar { flex-wrap:wrap; gap:6px; min-height:52px; }.tl-trend-toolbar>span { display:none; }
  .tl-ranges button { min-height:38px; padding:5px 8px; font-size:12px; min-width:38px; }
  .tl-trend-grid,.tl-lower-grid,.tl-bottom-grid { grid-template-columns:minmax(0,1fr); }
  .tl-panel-head { padding:9px 12px; min-height:38px; }.tl-panel-head :is(h2,h3) { font-size:12px; }.tl-panel-head>span { font-size:11px; }
  .tl-trend-readout strong { font-size:23px; }.tl-trend-readout>span { font-size:11px; }.tl-axis { font-size:11px; }
  .tl-trend-svg { max-height:250px; }.tl-allocation .wb-dial { width:200px; height:200px; }
  .tl-ledger-table { font-size:13px; }.tl-ledger-table td { padding:12px 10px; }.tl-panel-link { min-height:44px; font-size:13px; }
  .tl-insights b { font-size:14px; }.tl-insights small { font-size:12px; }.tl-insights strong { font-size:12px; }
  .terminal-shell .wb-mobile-nav { display:flex; background:var(--bg); border-top:1px solid var(--line-strong); }
  .terminal-shell .wb-mobile-nav .wb-nav-button { flex:1; width:20%; min-height:58px; font-size:12px; }
  .terminal-shell .wb-mobile-nav .wb-nav-button .lb { display:block; font-size:12px; }
  .terminal-shell .wb-mobile-nav .wb-nav-button.active { color:var(--accent); }
  .terminal-shell .btn,.modal .btn,.wb-detail .btn { min-height:44px; font-size:14px; }
  .terminal-shell :is(small,.label,.sub,.hint,.hint-line,.tag,.chip,.plan-meta,.stale-hint,.field>label,.kv .k,.metric .foot,.name-cell .cd) { font-size:13px; }
  .terminal-shell .sheet :is(.wb-icon-act,.sheet-item) { min-height:44px; }.terminal-shell .sheet .wb-quick-actions { flex-direction:row; }
  .terminal-shell .card { padding:12px; }.terminal-shell .advice-callout h3 { font-size:19px; }
}
@media(pointer:coarse) { .tl-icon-btn { min-height:44px; min-width:44px; }.tl-command { min-height:44px; }.tl-ranges button { min-height:44px; }.tl-header .wb-nav-button { min-height:44px; }.tl-header .wb-icon-act { min-height:44px; min-width:44px; } }
@media(pointer:coarse) { .tl-range-menu summary,.tl-activity-tabs button,.tl-range-options button { min-height:44px; }.tl-trend .tl-panel-head { min-height:58px; } }
@media(prefers-reduced-motion:reduce) { .tl-allocation .wb-dial-segment { transition:none; }.tl-allocation .wb-dial[data-inspecting] .wb-dial-segment.is-active { stroke-width:12; } }

/* Modules are separated by surface and spacing, not enclosing outlines.
   Input, action and keyboard-focus boundaries remain functional. */
.terminal-shell :is(.tl-metrics,.tl-secondary-metrics,.tl-metric,.tl-panel,.tl-panel-head,.card,.wb-section,.plan,.review-toolbar,.wb-trade-stats,.wb-trade-filters,.wb-position-toolbar,.advice-card,.advice-overview,.advice-notifications,.mt-terminal,.assistant-guide details) { border:0; box-shadow:none; }
.tl-allocation .wb-dial-track { stroke:transparent; }
.wb-map-wrap { flex:1; width:100%; display:flex; flex-direction:column; gap:8px; align-self:stretch; }
.wb-map { flex:1; position:relative; width:100%; min-height:248px; overflow:hidden; }
.wb-map-tile { position:absolute; display:block; padding:2px; margin:0; border:0; background:none; cursor:pointer; color:var(--ink); min-width:0; overflow:hidden; }
.wb-map-tile>span { display:flex; flex-direction:column; justify-content:center; gap:6px; width:100%; height:100%; padding:10px; overflow:hidden; background:color-mix(in srgb,var(--tile-tone) 25%,var(--tl-panel)); text-align:left; }
.wb-map-tile b { font-size:12px; font-weight:500; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.wb-map-tile strong { font:600 24px var(--tl-number); letter-spacing:-.02em; }
.wb-map-tile strong small { font-size:11px; margin-left:2px; color:var(--ink-2); }
.wb-map-tile.is-small>span { padding:5px; }.wb-map-tile.is-small b { font-size:10px; }
.wb-map-tile.is-short>span { flex-direction:row; align-items:center; justify-content:space-between; padding:6px; }
.wb-map-tile.is-short b { min-width:0; font-size:10px; }
.wb-map-tile.is-short strong { font-size:17px; flex-shrink:0; }
.wb-map-tile.is-tiny b { display:none; }
.wb-map-tile:hover>span,.wb-map-tile:focus-visible>span { background:color-mix(in srgb,var(--tile-tone) 40%,var(--tl-panel)); }
.wb-map-tile:focus-visible { outline-offset:-2px; }
.wb-map-readout { color:var(--ink-2); font:11px/1.5 var(--tl-number); min-height:32px; display:flex; align-items:center; }

.wb-map-touch-open { display:none; }
/* All tiles open the same detail. Touch gets one full-size equivalent target. */
@media(max-width:720px),(pointer:coarse) {
  .wb-map-touch-open { position:absolute; inset:0; z-index:1; display:block; width:100%; height:100%; min-height:44px; padding:0; border:0; background:transparent; color:var(--ink); cursor:pointer; }
  .wb-map-touch-open:focus-visible { outline-offset:-2px; }
}

/* Printing a saved dark theme must also work when the browser omits backgrounds. */
@media print {
  html,html[data-theme="dark"] { color-scheme:light; --bg:#fff; --bg-soft:#f5f5f5; --card:#fff; --tl-panel:#fff; --tl-head:#f4f4f4; --ink:#191919; --ink-2:#454545; --ink-3:#595959; --line:#d4d4d4; --line-strong:#aaa; --accent:#8c4b00; --accent-soft:#fff2da; --up:#b4001b; --down:#00692a; --up-soft:#fdeeee; --down-soft:#e9f7f0; --warn:#805000; --warn-soft:#fdf4e6; }
  .tl-header,.tl-page-heading .tl-telemetry,.tl-range-menu,.wb-map-readout { display:none; }
  .terminal-shell,.terminal-shell .wb-main { padding:0!important; min-height:0; }
  body { background:#fff; color:#191919; }
  html .login-err,html[data-theme="dark"] .login-err,html .banner.err,html[data-theme="dark"] .banner.err { color:#982e2e; }
  .tl-panel,.tl-metric { break-inside:avoid; }
}

/* Short compositor-friendly feedback. Never run a permanent repaint loop. */
@media(prefers-reduced-motion:no-preference) {
  [data-act="refresh"][aria-busy="true"] .ic { animation:spin .8s linear infinite; }
  .terminal-shell :is(.btn,.tl-icon-btn,.wb-nav-button,.tl-ranges button) { transition:transform 120ms cubic-bezier(.16,1,.3,1),opacity 120ms ease-out; }
  .terminal-shell :is(.btn,.tl-icon-btn,.wb-nav-button,.tl-ranges button):active { transform:translateY(1px); }
  @media(hover:hover) and (pointer:fine) { .terminal-shell .tl-settings-btn:hover .ic { transform:rotate(8deg); } }
  .tl-settings-btn .ic { transition:transform 160ms cubic-bezier(.16,1,.3,1); }
}
@media(prefers-reduced-motion:reduce) {
  .terminal-shell :is(.btn,.tl-icon-btn,.wb-nav-button,.tl-ranges button),.tl-settings-btn .ic { transition:none; }
  .sheet,.sheet-mask,.toast { animation:none; }
}
