:root {
  color-scheme: dark;
  --bg: #05070b;
  --surface: #090d13;
  --surface-2: #0d121a;
  --surface-3: #121923;
  --border: #202936;
  --border-strong: #313d4e;
  --text: #f5f7fb;
  --soft: #9aa6b6;
  --muted: #657184;
  --gold: #f5c400;
  --gold-soft: rgba(245,196,0,.12);
  --green: #24c784;
  --red: #ef5350;
  --blue: #4da3ff;
  --shadow: 0 24px 70px rgba(0,0,0,.34);
  font-family: Inter, Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); }
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lab-shell { min-height: 100vh; }
.lab-topbar { position: sticky; top: 0; z-index: 60; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 64px; padding: 9px max(14px,env(safe-area-inset-left)); border-bottom: 1px solid var(--border); background: rgba(5,7,11,.96); backdrop-filter: blur(16px); }
.back-link { justify-self:start; display:inline-flex; align-items:center; gap:7px; min-height:40px; padding:0 8px; color:var(--soft); border-radius:10px; }
.back-link:hover,.back-link:focus-visible { color:var(--text); background:var(--surface-2); outline:none; }
.lab-brand { display:inline-flex; align-items:center; gap:10px; }
.lab-brand__mark { display:grid; place-items:center; width:38px; height:38px; border:1px solid #554b18; border-radius:11px; color:var(--gold); background:#15130a; }
.lab-brand__copy { display:flex; flex-direction:column; line-height:1.05; }
.lab-brand__copy strong { font-size:14px; letter-spacing:.04em; }
.lab-brand__copy small { margin-top:4px; color:var(--muted); font-size:9px; letter-spacing:.16em; text-transform:uppercase; }
.account-pill { justify-self:end; display:flex; align-items:center; gap:8px; max-width:220px; min-height:40px; padding:6px 10px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.account-pill__dot { width:8px; height:8px; flex:0 0 auto; border-radius:50%; background:var(--muted); box-shadow:0 0 0 4px rgba(101,113,132,.1); }
.account-pill[data-tone="online"] .account-pill__dot { background:var(--green); box-shadow:0 0 0 4px rgba(36,199,132,.1); }
.account-pill[data-tone="local"] .account-pill__dot { background:var(--gold); box-shadow:0 0 0 4px rgba(245,196,0,.1); }
.account-pill__copy { min-width:0; display:flex; flex-direction:column; line-height:1.1; }
.account-pill__copy strong,.account-pill__copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-pill__copy strong { font-size:10px; }
.account-pill__copy small { margin-top:3px; color:var(--muted); font-size:8px; }
.lab-main { width:min(1420px,calc(100% - 28px)); margin:0 auto; padding:22px 0 calc(30px + env(safe-area-inset-bottom)); }
.lab-hero { display:flex; align-items:end; justify-content:space-between; gap:24px; margin:0 0 16px; }
.eyebrow { margin:0 0 6px; color:var(--gold); font-size:9px; font-weight:850; letter-spacing:.17em; text-transform:uppercase; }
.lab-hero h1 { margin:0; max-width:720px; font-size:clamp(26px,3.6vw,44px); line-height:1.02; letter-spacing:-.045em; }
.lab-hero p:not(.eyebrow) { max-width:720px; margin:9px 0 0; color:var(--soft); font-size:12px; line-height:1.55; }
.hero-proof { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; max-width:430px; }
.hero-proof span { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 9px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--soft); font-size:9px; font-weight:750; }
.hero-proof i,.commandbar-dot { width:5px; height:5px; border-radius:50%; background:var(--gold); }
.terminal-card { position:relative; overflow:hidden; border:1px solid var(--border-strong); border-radius:17px; background:var(--surface); box-shadow:var(--shadow); }
.terminal-head { display:grid; grid-template-columns:minmax(0,1fr) auto 44px; align-items:center; gap:16px; min-height:72px; padding:11px 14px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.instrument-title { display:flex; align-items:center; gap:11px; min-width:0; }
.instrument-icon { display:grid; place-items:center; width:40px; height:40px; flex:0 0 auto; border:1px solid #584b14; border-radius:11px; background:#171309; color:var(--gold); font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:11px; font-weight:850; }
.instrument-title__line { display:flex; align-items:center; gap:8px; }
.instrument-title h2 { margin:0; font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:17px; letter-spacing:-.02em; }
.instrument-title p { margin:4px 0 0; color:var(--muted); font-size:9px; }
.live-badge { display:inline-flex; align-items:center; gap:5px; height:19px; padding:0 7px; border:1px solid #554913; border-radius:999px; background:#151208; color:var(--gold); font-size:7px; font-weight:900; letter-spacing:.09em; }
.live-badge i { width:5px; height:5px; border-radius:50%; background:var(--gold); animation:labPulse 1.8s ease-in-out infinite; }
.quote-block { text-align:right; }
.quote-block strong { display:block; font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:clamp(16px,2vw,22px); }
.quote-block span { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.icon-button { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--soft); cursor:pointer; }
.icon-button:hover,.icon-button:focus-visible,.icon-button.is-active { border-color:#6a5814; color:var(--gold); outline:none; }
.market-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; border-bottom:1px solid var(--border); background:#080c12; }
.asset-rail,.timeframe-rail { display:flex; align-items:center; gap:5px; overflow-x:auto; scrollbar-width:none; }
.asset-rail::-webkit-scrollbar,.timeframe-rail::-webkit-scrollbar,.drawing-toolbar::-webkit-scrollbar,.overlay-context::-webkit-scrollbar { display:none; }
.asset-chip,.timeframe-rail button { flex:0 0 auto; border:1px solid transparent; background:transparent; color:var(--muted); cursor:pointer; }
.asset-chip { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 9px; border-radius:9px; font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:9px; font-weight:850; }
.asset-chip span { display:grid; place-items:center; width:20px; height:20px; border-radius:6px; background:var(--surface-3); color:var(--soft); font-size:7px; }
.asset-chip:hover,.asset-chip:focus-visible,.asset-chip.is-active,.timeframe-rail button:hover,.timeframe-rail button:focus-visible,.timeframe-rail button.is-active { border-color:#51471e; background:#15130b; color:var(--gold); outline:none; }
.asset-chip.is-active span { background:var(--gold); color:#121006; }
.timeframe-rail button { min-width:32px; height:30px; padding:0 7px; border-radius:8px; font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:8px; font-weight:850; }
.workspace-commandbar { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:44px; padding:6px 10px; border-bottom:1px solid var(--border); background:#090e15; }
.commandbar-copy { min-width:0; display:flex; align-items:center; gap:7px; color:var(--soft); }
.commandbar-copy strong { font-size:9px; }
.commandbar-copy small { color:var(--muted); font-size:8px; }
.commandbar-actions { display:flex; align-items:center; gap:4px; }
.command-button { display:inline-flex; align-items:center; gap:5px; height:31px; padding:0 8px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.command-button svg { width:14px; height:14px; }
.command-button span { font-size:8px; font-weight:750; }
.command-button:hover,.command-button:focus-visible,.command-button.is-active { border-color:#4d4319; background:#15130b; color:var(--gold); outline:none; }
.command-button:disabled { opacity:.28; pointer-events:none; }
.chart-workspace { position:relative; display:grid; grid-template-columns:54px minmax(0,1fr); min-height:500px; background:#070b10; }
.drawing-toolbar { z-index:12; display:flex; flex-direction:column; align-items:stretch; gap:4px; padding:7px 6px; border-right:1px solid var(--border); background:#080c12; }
.drawing-toolbar button { display:grid; place-items:center; gap:2px; min-height:43px; padding:4px 2px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.drawing-toolbar button svg { width:16px; height:16px; }
.drawing-toolbar button span { font-size:6.5px; font-weight:850; }
.drawing-toolbar button:hover,.drawing-toolbar button:focus-visible,.drawing-toolbar button.is-active { border-color:#574b19; background:#17140a; color:var(--gold); outline:none; }
.drawing-toolbar .danger-tool:hover,.drawing-toolbar .danger-tool:focus-visible,.drawing-toolbar .danger-tool.is-confirm { border-color:rgba(239,83,80,.45); background:rgba(239,83,80,.08); color:#ff7774; }
.toolbar-separator { height:1px; margin:2px 4px; background:var(--border); }
.chart-stage { position:relative; min-width:0; min-height:500px; overflow:hidden; background:#070b10; isolation:isolate; }
.chart-mount { position:absolute; inset:0; z-index:2; }
.chart-watermark { pointer-events:none; position:absolute; z-index:3; inset:50% auto auto 50%; transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center; opacity:.075; white-space:nowrap; }
.chart-watermark strong { font-size:clamp(38px,7vw,88px); letter-spacing:-.06em; }
.chart-watermark span { margin-top:3px; color:var(--gold); font-size:8px; font-weight:900; letter-spacing:.25em; }
.chart-loading { position:absolute; z-index:30; inset:0; display:grid; place-content:center; justify-items:center; gap:7px; background:#070b10; transition:opacity .22s ease,visibility .22s ease; }
.chart-loading.is-hidden { opacity:0; visibility:hidden; pointer-events:none; }
.chart-loading>span { width:26px; height:26px; border:2px solid #3c3514; border-top-color:var(--gold); border-radius:50%; animation:labSpin .82s linear infinite; }
.chart-loading strong { margin-top:3px; font-size:11px; }
.chart-loading small { color:var(--muted); font-size:8px; }
.overlay-context { position:absolute; z-index:40; display:flex; align-items:center; gap:4px; max-width:calc(100% - 18px); min-height:42px; padding:5px; border:1px solid #3b4656; border-radius:11px; background:rgba(11,16,23,.98); box-shadow:0 14px 36px rgba(0,0,0,.38); backdrop-filter:blur(14px); transform:translate(-50%,-115%); overflow-x:auto; overscroll-behavior:contain; transition:opacity .14s ease,transform .14s ease; }
.overlay-context.is-hidden { opacity:0; visibility:hidden; pointer-events:none; transform:translate(-50%,-105%); }
.overlay-context__identity { display:flex; align-items:center; gap:6px; flex:0 0 auto; padding:0 4px; }
.overlay-context__identity>span { display:grid; place-items:center; width:24px; height:24px; border-radius:7px; background:#171309; color:var(--gold); font-size:12px; }
.overlay-context__identity strong { font-size:8px; white-space:nowrap; }
.context-divider { flex:0 0 1px; width:1px; height:24px; margin:0 2px; background:var(--border); }
.context-colors { display:flex; align-items:center; gap:4px; flex:0 0 auto; }
.context-colors button { width:19px; height:19px; padding:0; border:2px solid transparent; border-radius:50%; background:var(--swatch); cursor:pointer; box-shadow:inset 0 0 0 1px rgba(255,255,255,.12); }
.context-colors button[data-context-color="#f5c400"] { --swatch:#f5c400; }.context-colors button[data-context-color="#ffffff"] { --swatch:#ffffff; }.context-colors button[data-context-color="#24c784"] { --swatch:#24c784; }.context-colors button[data-context-color="#ef5350"] { --swatch:#ef5350; }.context-colors button[data-context-color="#4da3ff"] { --swatch:#4da3ff; }
.context-colors button.is-active { border-color:#fff; transform:scale(1.08); }
.context-action { display:grid; place-items:center; flex:0 0 30px; width:30px; height:30px; padding:0; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--soft); cursor:pointer; }
.context-action svg { width:15px; height:15px; }
.context-action:hover,.context-action:focus-visible,.context-action.is-active { border-color:#4f451b; background:#17140a; color:var(--gold); outline:none; }
.context-action--text { width:auto; min-width:35px; padding:0 7px; font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:8px; font-weight:850; }
.context-action--danger:hover,.context-action--danger:focus-visible { border-color:rgba(239,83,80,.45); background:rgba(239,83,80,.08); color:#ff7774; }
.objects-panel { position:absolute; z-index:45; top:8px; right:8px; bottom:8px; width:min(300px,calc(100% - 16px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid #344050; border-radius:13px; background:rgba(9,13,19,.985); box-shadow:0 20px 50px rgba(0,0,0,.45); backdrop-filter:blur(16px); transition:opacity .16s ease,transform .18s ease; }
.objects-panel.is-hidden { opacity:0; visibility:hidden; pointer-events:none; transform:translateX(10px); }
.objects-panel header { display:flex; align-items:center; justify-content:space-between; padding:11px 11px 9px; border-bottom:1px solid var(--border); }
.objects-panel header div { display:flex; flex-direction:column; }.objects-panel header span { color:var(--gold); font-size:7px; font-weight:850; letter-spacing:.15em; text-transform:uppercase; }.objects-panel header strong { margin-top:3px; font-size:11px; }.objects-panel header button { width:30px; height:30px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--soft); font-size:18px; cursor:pointer; }
.objects-panel__meta { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 11px; border-bottom:1px solid var(--border); }.objects-panel__meta span { font-size:8px; font-weight:750; }.objects-panel__meta small { color:var(--muted); font-size:7px; }
.objects-list { flex:1; overflow:auto; padding:7px; }
.object-row { display:grid; grid-template-columns:26px minmax(0,1fr) auto; align-items:center; gap:7px; min-height:44px; padding:6px; border:1px solid transparent; border-radius:9px; }.object-row:hover,.object-row.is-selected { border-color:#3d3618; background:#121108; }
.object-row__icon { display:grid; place-items:center; width:26px; height:26px; border-radius:7px; background:var(--surface-3); color:var(--gold); font-size:10px; }.object-row__copy { min-width:0; display:flex; flex-direction:column; }.object-row__copy strong { overflow:hidden; font-size:8px; text-overflow:ellipsis; white-space:nowrap; }.object-row__copy small { margin-top:2px; color:var(--muted); font-size:7px; }.object-row__actions { display:flex; gap:2px; }
.object-row__actions button { display:grid; place-items:center; width:27px; height:27px; padding:0; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; }.object-row__actions button svg { width:13px; height:13px; }.object-row__actions button:hover,.object-row__actions button.is-active { border-color:#4d4319; background:#17140a; color:var(--gold); }.object-row__actions button[data-object-action="delete"]:hover { border-color:rgba(239,83,80,.4); background:rgba(239,83,80,.08); color:#ff7774; }
.objects-empty { display:grid; place-content:center; min-height:160px; text-align:center; color:var(--muted); }.objects-empty strong { color:var(--soft); font-size:10px; }.objects-empty small { margin-top:5px; font-size:8px; }
.terminal-foot { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(230px,.8fr); align-items:center; gap:14px; min-height:58px; padding:8px 12px; border-top:1px solid var(--border); background:var(--surface-2); }
.terminal-status { display:flex; align-items:center; gap:9px; min-width:0; }.status-dot { width:8px; height:8px; flex:0 0 auto; border-radius:50%; background:var(--muted); box-shadow:0 0 0 4px rgba(101,113,132,.08); }.status-dot.is-saving { background:var(--gold); box-shadow:0 0 0 4px rgba(245,196,0,.08); }.status-dot.is-saved { background:var(--green); box-shadow:0 0 0 4px rgba(36,199,132,.08); }
.terminal-status div,.feed-note { display:flex; flex-direction:column; min-width:0; }.terminal-status strong,.feed-note strong { font-size:8px; }.terminal-status small,.feed-note small { margin-top:2px; overflow:hidden; color:var(--muted); font-size:7px; text-overflow:ellipsis; white-space:nowrap; }
.drawings-counter { display:flex; align-items:baseline; gap:4px; padding:6px 9px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }.drawings-counter span { color:var(--gold); font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:14px; font-weight:900; }.drawings-counter small { color:var(--muted); font-size:7px; }.feed-note { text-align:right; }
.feature-rail { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-top:10px; }.feature-rail article { display:flex; gap:10px; min-height:82px; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }.feature-rail article>span { color:var(--gold); font-family:"IBM Plex Mono","SFMono-Regular",Consolas,monospace; font-size:9px; font-weight:900; }.feature-rail strong { display:block; font-size:10px; }.feature-rail p { margin:5px 0 0; color:var(--muted); font-size:8px; line-height:1.45; }
.lab-disclaimer { margin:10px 0 0; color:#566173; font-size:8px; text-align:center; }
.toast { position:fixed; z-index:100; left:50%; bottom:calc(18px + env(safe-area-inset-bottom)); transform:translate(-50%,12px); max-width:min(420px,calc(100% - 28px)); padding:9px 12px; border:1px solid #4d4319; border-radius:10px; background:#111008; color:#f2e7a6; box-shadow:0 15px 38px rgba(0,0,0,.35); font-size:9px; opacity:0; visibility:hidden; pointer-events:none; transition:.18s ease; }.toast.is-visible { opacity:1; visibility:visible; transform:translate(-50%,0); }
@keyframes labSpin { to { transform:rotate(360deg); } } @keyframes labPulse { 0%,100% { opacity:.5; transform:scale(.82); } 50% { opacity:1; transform:scale(1.1); } }
@media (max-width:820px) {
  .lab-main { width:min(100% - 18px,720px); padding-top:14px; }.lab-hero { display:block; margin-bottom:12px; }.lab-hero h1 { font-size:29px; }.lab-hero p:not(.eyebrow) { margin-top:8px; font-size:11px; }.hero-proof { justify-content:flex-start; margin-top:10px; max-width:none; }
  .terminal-head { grid-template-columns:minmax(0,1fr) auto 40px; gap:8px; min-height:66px; padding:9px 10px; }.quote-block strong { font-size:15px; }.quote-block span { max-width:96px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .market-controls { display:block; padding:7px 8px; }.timeframe-rail { margin-top:6px; padding-top:6px; border-top:1px solid #17202b; }.workspace-commandbar { min-height:42px; padding:5px 7px; }.commandbar-copy small { display:none; }.command-button { width:34px; padding:0; justify-content:center; }.command-button span { display:none; }
  .chart-workspace { grid-template-columns:1fr; min-height:420px; }.chart-stage { min-height:370px; order:1; }.drawing-toolbar { order:2; flex-direction:row; align-items:center; gap:3px; min-width:0; padding:5px 6px; overflow-x:auto; border-top:1px solid var(--border); border-right:0; }.drawing-toolbar button { flex:0 0 43px; min-height:39px; }.drawing-toolbar button span { font-size:6px; }.toolbar-separator { flex:0 0 1px; width:1px; height:26px; margin:0 2px; }
  .overlay-context { max-width:calc(100% - 12px); min-height:40px; }.objects-panel { top:auto; left:6px; right:6px; bottom:6px; width:auto; max-height:72%; transform:translateY(10px); }.objects-panel.is-hidden { transform:translateY(12px); }
  .terminal-foot { grid-template-columns:minmax(0,1fr) auto; min-height:54px; gap:8px; padding:7px 9px; }.feed-note { display:none; }.feature-rail { grid-template-columns:1fr; }.feature-rail article { min-height:70px; }
}
@media (max-width:520px) {
  .lab-topbar { grid-template-columns:42px minmax(0,1fr) auto; min-height:62px; padding:8px 9px; }.back-link { width:40px; padding:0; justify-content:center; }.back-link span { display:none; }.lab-brand { justify-self:start; }.lab-brand__mark { width:36px; height:36px; }.lab-brand__copy strong { font-size:13px; }.account-pill { max-width:124px; min-height:38px; padding:5px 8px; }.account-pill__copy strong { font-size:9px; }.account-pill__copy small { font-size:7px; }
  .lab-main { width:calc(100% - 14px); padding-top:12px; }.eyebrow { font-size:8px; }.lab-hero h1 { font-size:27px; }.lab-hero p:not(.eyebrow) { font-size:10px; line-height:1.5; }.hero-proof span { height:26px; font-size:8px; }.terminal-card { border-radius:15px; }.instrument-icon { width:38px; height:38px; }.instrument-title h2 { font-size:16px; }.instrument-title p { font-size:8px; }.quote-block { display:none; }.terminal-head { grid-template-columns:minmax(0,1fr) 40px; }.workspace-commandbar { overflow-x:auto; }.commandbar-copy { flex:1 0 auto; }
  .chart-workspace { min-height:405px; }.chart-stage { min-height:352px; }.chart-watermark strong { font-size:44px; }.chart-watermark span { font-size:6px; letter-spacing:.18em; }.overlay-context__identity strong { display:none; }.context-colors button { width:18px; height:18px; }.context-action { flex-basis:29px; width:29px; height:29px; }.feature-rail p { font-size:7.5px; }
}
@media (max-width:390px) { .lab-hero h1 { font-size:25px; }.chart-workspace { min-height:385px; }.chart-stage { min-height:332px; }.hero-proof span:nth-child(2) { display:none; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; } }
