:root{color-scheme:dark;--bg:#080e18;--panel:#101a29;--line:#243349;--text:#eaf0fb;--muted:#8fa2be;--green:#35ddae;--red:#ff7184;--blue:#76a7ff;--input:#0c1523;--notice:#172335;--notice-text:#bed0ee;--gold:#f6d47b;--buy-fill:#19493f;--sell-fill:#502633;--buy-large:#133c34;--sell-large:#40212d;--toast:#263b55}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px system-ui,sans-serif}header{max-width:1140px;margin:auto;padding:20px 18px;display:flex;gap:12px;align-items:center;border-bottom:1px solid var(--line)}header strong{letter-spacing:3px}small{display:block;color:var(--muted);font-size:12px}header small{font-size:9px;letter-spacing:2px;margin-top:3px}.icon{margin-left:auto;background:var(--panel);font-size:22px}main{max-width:1140px;margin:20px auto;padding:0 16px}h1{font-size:32px;margin:8px 0}h2{font-size:18px;margin:0 0 12px}h3{font-size:15px}p{line-height:1.6}.toolbar{display:flex;align-items:end;gap:12px;margin:14px 0}.toolbar label{flex:1}label{display:block;color:var(--muted);font-size:13px;margin-bottom:12px}input,select,button{font:inherit;min-height:48px;border-radius:10px;border:1px solid var(--line);padding:10px 12px;background:var(--input);color:var(--text)}input,select{width:100%;margin-top:6px}button{background:var(--green);color:#06271e;font-weight:700;cursor:pointer;min-width:48px}button:hover{filter:brightness(1.12)}button:disabled{opacity:.5}.secondary{background:var(--panel);color:var(--muted)}.toolbar button{margin-bottom:12px}.chips{display:flex;gap:8px;overflow:auto;margin:16px 0;padding-bottom:5px}.chips button{white-space:nowrap;background:var(--panel);color:var(--muted);min-height:42px;padding:8px 15px}.chips button.active{color:var(--green);border-color:var(--green)}.quote{display:flex;align-items:center;justify-content:space-between;margin:24px 0}.badge{border:1px solid var(--line);padding:8px;border-radius:20px;font-size:12px;color:var(--muted)}.badge.live{color:var(--green)}section[data-block]{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px;margin:16px 0}.sectionhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.sectionhead span{font-size:11px;color:var(--muted)}.sectionhead select{width:auto;max-width:65%;font-size:12px;margin:0 0 12px}canvas{display:block;width:100%;margin:8px 0 12px}.notice{background:var(--notice);border-left:3px solid var(--blue);padding:12px;font-size:12px;color:var(--notice-text)}.notice.warn{border-color:#e9b75f}.metrics{display:flex;gap:15px;flex-wrap:wrap;color:var(--muted);font-size:12px}.metrics b{color:var(--text)}.wall{border:1px solid var(--line);border-left:3px solid var(--green);border-radius:10px;padding:14px;margin-top:12px}.wall.sell{border-left-color:var(--red)}.walltitle{display:flex;justify-content:space-between;margin-bottom:10px;font-weight:700}.buytext{color:var(--green)}.selltext{color:var(--red)}.muted{color:var(--muted);font-size:12px}.scroll{overflow:auto;max-height:430px}table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px}th,td{text-align:right;border-bottom:1px solid var(--line);padding:10px 8px}th{color:var(--muted);font-size:11px}.imbbuy{background:var(--buy-fill);color:var(--green)}.imbsell{background:var(--sell-fill);color:var(--red)}.stack{outline:1px solid currentColor;outline-offset:-2px}.poc{color:var(--gold)}.book{display:grid;grid-template-columns:1fr 1fr;gap:18px;font-size:12px;font-variant-numeric:tabular-nums}.book p{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:5px 0;margin:0}.event{padding:10px 0;border-bottom:1px solid var(--line);font-size:12px}footer{color:var(--muted);font-size:12px;padding:20px 0}footer button{margin:10px 8px 0 0}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:16px;width:min(700px,96vw);max-height:92vh;padding:24px}dialog::backdrop{background:#000b}#fields{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.checks{display:grid;grid-template-columns:1fr 1fr}.check{display:flex;align-items:center;gap:12px;color:var(--text);min-height:44px}.check input{width:20px;min-height:20px;margin:0}hr{border:0;border-top:1px solid var(--line);margin:24px 0}#toast{position:fixed;bottom:20px;left:5%;right:5%;background:var(--toast);border:1px solid #718db0;border-radius:12px;padding:18px;z-index:10}#login{max-width:500px;margin:15vh auto}#login button{width:100%}[hidden]{display:none!important}@media(min-width:900px){#terminal{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}#terminal>.toolbar,#terminal>.quote,#terminal>.chips,#terminal>.notice,#terminal>footer,section[data-block=candles],section[data-block=heat]{grid-column:1/-1}}@media(max-width:450px){main{padding:0 10px}section[data-block]{padding:12px}#fields{gap:0 10px}h1{font-size:28px}.sectionhead span{max-width:45%;text-align:right}th,td{padding:9px 5px}.book{gap:8px;font-size:10px}}

.profile-toggle{margin:0 0 4px;font-size:13px}.profile-legend{margin-bottom:8px;font-size:11px}

/* Mobile chart + matched liquidity ladder */
.chips button{flex:0 0 auto}.chart-controls,.depth-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.chart-controls button{padding:8px 12px;min-height:42px}.chart-controls .check{margin:0;font-size:12px}.chart-help{line-height:1.5;margin-bottom:8px}.depth-controls label{flex:1;min-width:110px;margin:0}.depth-book{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.depth-book>div{min-width:0}.depth-totals{display:flex;flex-direction:column;gap:5px;padding:12px 4px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}.depth-totals strong{font-size:12px}.depth-totals span{font-size:14px;font-weight:700;color:var(--gold)}#bids .depth-totals strong{color:var(--green)}#asks .depth-totals strong{color:var(--red)}.depth-heading{font-size:10px;color:var(--muted);padding:10px 3px}.depth-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 3px;position:relative;overflow:hidden;width:100%;min-height:51px;padding:7px 5px;margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--text);font-variant-numeric:tabular-nums;text-align:left;font-weight:400}.depth-row>*{position:relative;z-index:1;min-width:0}.depth-row .depth-bar{position:absolute;right:0;top:0;bottom:0;z-index:0;background:rgba(53,221,174,.15)}.depth-row.sell .depth-bar{background:rgba(255,113,132,.15)}.depth-row.is-wall.buy{border-left:3px solid var(--green)}.depth-row.is-wall.sell{border-left:3px solid var(--red)}.depth-row.is-wall .depth-bar{background:rgba(53,221,174,.30)}.depth-row.is-wall.sell .depth-bar{background:rgba(255,113,132,.30)}.depth-price{font-size:12px;align-self:center}.depth-qty{font-size:12px;align-self:center}.depth-row small{grid-column:1/-1;font-size:10px;color:var(--muted)}.depth-empty{font-size:12px;color:var(--muted);padding:10px 3px}.depth-row:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}#depthMore{width:100%;margin-top:12px}#profileCoverage{margin-top:10px;line-height:1.5}#chartState{font-size:11px}#candles{touch-action:none;user-select:none;-webkit-user-select:none}
@media(min-width:900px){section[data-block=book]{grid-column:1/-1}.depth-price,.depth-qty{font-size:14px}.depth-book{gap:24px}}
#simpleSettings>label{margin:15px 0}#simpleSettings h3{margin:22px 0 12px;font-size:17px}#simpleSettings .check{margin:12px 0}#advancedSettings{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:18px 0;margin:22px 0}#advancedSettings summary{cursor:pointer;color:var(--blue);line-height:1.5}#advancedSettings #fields{margin-top:18px}.trade-tape{max-height:300px;overflow:auto;font-variant-numeric:tabular-nums}.tape-head,.tape-row{display:grid;grid-template-columns:.8fr 1.15fr 1fr 1fr;gap:4px;font-size:11px;text-align:right;padding:9px 2px;border-bottom:1px solid var(--line)}.tape-head{color:var(--muted)}.tape-row.buy{color:var(--green)}.tape-row.sell{color:var(--red)}.tape-row.buy.large{background:var(--buy-large);font-weight:700}.tape-row.sell.large{background:var(--sell-large);font-weight:700}

.depth-row{grid-template-columns:minmax(0,1fr) 24px auto;gap:2px}.depth-whale{font-size:21px;line-height:1.1;align-self:center;text-align:center}.depth-row.is-wall.buy{box-shadow:inset 0 0 0 1px rgba(53,221,174,.18)}.depth-row.is-wall.sell{box-shadow:inset 0 0 0 1px rgba(255,113,132,.18)}


.watch-item{display:flex;flex:0 0 auto;align-items:stretch}.chips .watch-item>button:first-child{border-radius:10px 0 0 10px}.chips .watch-remove{border-radius:0 10px 10px 0;border-left:0;color:var(--red);font-size:23px;line-height:1;min-width:44px;padding:6px 10px}.chips .watch-remove:focus-visible{outline:2px solid var(--red);outline-offset:2px}

:root[data-theme="light"]{color-scheme:light;--bg:#f0f4f9;--panel:#fff;--line:#cbd5e1;--text:#172438;--muted:#52657e;--green:#007d60;--red:#c52f4e;--blue:#285fbc;--input:#f7f9fc;--notice:#e4edf9;--notice-text:#28486f;--gold:#806000;--buy-fill:#d9f2e9;--sell-fill:#fbe1e7;--buy-large:#def5ec;--sell-large:#fbe5ea;--toast:#e8eff9}
a{color:var(--blue)}#themeToggle{margin-left:auto;font-size:12px;white-space:nowrap}#settingsBtn{margin-left:0}header{flex-wrap:wrap}fieldset{border:1px solid var(--line);border-radius:10px;min-width:0}

#volumeColorsDetails{border:1px solid var(--line);border-radius:10px;padding:12px;margin:8px 0 16px}#volumeColorsDetails summary{cursor:pointer;color:var(--blue)}#volumeColorFields{display:grid;grid-template-columns:1fr 1fr;gap:10px}#volumeColorFields h3{grid-column:1/-1}#volumeColorFields input[type=color]{padding:4px;min-height:44px}#volumeColorFields button{align-self:end}#volumeColorFields label{margin:0}

.ema-controls{display:flex;flex-wrap:wrap;gap:4px 16px;margin:10px 0}.ema-controls .check{margin:0;font-weight:600;font-size:12px}#emaSummary{margin:8px 0;gap:6px 14px;font-variant-numeric:tabular-nums}

#chartSettingsToggle{font-size:12px;min-height:42px;padding:8px 10px}#chartSettingsPanel{max-height:60vh;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:10px 0;padding:14px 0}#chartSettingsClose{width:100%;margin-top:12px}.chart-frames{margin:8px 0;gap:5px}.chart-frames button{min-width:40px;padding:8px 10px;font-size:12px}.chart-controls{margin:6px 0}.chart-controls button{min-height:38px}#chartState{margin-bottom:4px}

/* Fullscreen rules apply only while the chart is explicitly expanded. */
#marketChartSection.chart-expanded{position:fixed;inset:0;z-index:100;width:100%;height:100vh;height:100dvh;max-width:none;margin:0;border:0;border-radius:0;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));background:var(--panel);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
#marketChartSection.chart-expanded>:not(#candles):not(#chartTopBar):not(#drawingToolbar):not(#chartSettingsPanel){display:none!important}
#marketChartSection.chart-expanded #candles{flex:1 1 0%;min-height:80px;height:0!important;min-width:0;width:100%;margin:0}
#marketChartSection.chart-expanded .chart-controls{position:static;flex:0 0 auto;z-index:1;margin:2px 0}
#marketChartSection.chart-expanded .chart-controls>:not(#chartFullscreen):not(#drawingToggle){display:none!important}
#chartFullscreen{font-size:12px}

#structureSettings{margin:16px 0}#structureSettings small{line-height:1.5}#drawingToolbar{padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);margin:8px 0}.drawing-tools{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.drawing-tools button{min-height:38px;font-size:12px;padding:7px 9px}.drawing-tools button.active{border-color:var(--blue);color:var(--blue)}.drawing-tools label{margin:0;display:flex;align-items:center;gap:6px;font-size:11px}.drawing-tools input[type=color]{width:44px;min-height:38px;margin:0;padding:3px}.drawing-tools~small{font-size:10px;line-height:1.4;margin-top:5px}#drawingToggle{font-size:12px}#marketChartSection.chart-expanded #drawingToolbar:not([hidden]){position:static;flex:0 1 auto;min-height:0;max-height:35vh;overflow-y:auto;z-index:2;margin:4px 0}

#chartPairLabel{display:none}#marketChartSection.chart-expanded #chartHeader{flex:0 0 auto;gap:8px;min-width:0}#marketChartSection.chart-expanded #chartHeader h2{display:none}#marketChartSection.chart-expanded #chartPairLabel{display:block;flex:1;min-width:0;font-size:12px;font-weight:700;color:var(--text);overflow-wrap:anywhere;line-height:1.4}#marketChartSection.chart-expanded #chartSettingsToggle{font-size:11px;min-height:38px;padding:7px 9px}#marketChartSection.chart-expanded #frames{flex:0 0 auto;margin:4px 0;padding-bottom:2px}#marketChartSection.chart-expanded #chartSettingsPanel{flex:0 1 auto;min-height:0;max-height:35vh;margin:4px 0;padding:8px 0}

/* Compact controls keep the existing inputs and their stored state. */
#chartTopBar{min-width:0}#chartQuickToggles{display:flex;flex-wrap:wrap;align-content:start;gap:4px;margin:6px 0}#chartQuickToggles .quick-toggle{display:inline-flex;gap:5px;min-height:30px;margin:0;padding:3px 7px;border:1px solid var(--line);border-radius:7px;background:var(--input);color:var(--text);font-size:11px;white-space:nowrap;cursor:pointer}#chartQuickToggles input{width:15px;height:15px;min-height:15px;margin:0;accent-color:var(--green)}#chartQuickToggles .quick-toggle:has(input:checked){border-color:var(--green)}#chartQuickToggles .quick-toggle:focus-within{outline:2px solid var(--blue);outline-offset:1px}#chartTopBar #frames{gap:3px;margin:4px 0;padding-bottom:2px}#chartTopBar #frames button{min-width:30px;min-height:30px;font-size:11px;padding:5px 7px}#chartTopBar .chart-controls{gap:5px;margin:4px 0}#chartTopBar .chart-controls button{min-height:32px;padding:5px 8px;font-size:11px}#chartTopBar #chartSettingsToggle{min-height:32px;padding:5px 8px;font-size:11px}#marketChartSection.chart-expanded #chartTopBar{flex:0 0 auto}#marketChartSection.chart-expanded #chartQuickToggles{margin:3px 0}
@media(min-width:760px){#chartTopBar{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(0,1.15fr);grid-template-areas:"heading toggles" "frames toggles" "controls toggles";column-gap:12px;align-items:start}#chartTopBar #chartHeader{grid-area:heading}#chartTopBar #frames{grid-area:frames}#chartTopBar .chart-controls{grid-area:controls}#chartQuickToggles{grid-area:toggles;margin:0}#chartTopBar #chartPairLabel{font-size:11px}}
@media(max-height:440px) and (min-width:760px){#chartQuickToggles{max-height:110px;overflow-y:auto;overscroll-behavior:contain}#chartQuickToggles .quick-toggle{min-height:28px;padding:2px 6px;font-size:10px}}
