/* DEPTHZEN — dark terminal theme. Restrained, dense, calm. */
:root {
  --bg: #07080a;
  --surface: #0c0e12;
  --raised: #12151a;
  --raised-2: #181c22;
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.11);
  --text: #ebe7df;
  --muted: #8b9099;
  --dim: #5c616b;
  --gold: #c8a85f;
  --gold-soft: rgba(200,168,95,0.14);
  --up: #2fbf8a;
  --down: #e5485b;
  --blue: #4f8cff;
  /* type scale */
  --fs-2xs: 10.5px; --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 21px;
  /* radius scale */
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;
  /* spacing rhythm (4-pt) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  /* motion language */
  --t-fast: .12s; --t-med: .22s; --t-slow: .32s;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;
  --tabs-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.22,1,.36,1);   /* weighted settle, never overshoots */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }
input { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- boot ceremony: emblem, skeleton candles, then the chart's own candles rise ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity var(--t-slow) var(--ease); }
.boot.done { opacity: 0; pointer-events: none; }
.boot-mark { display: grid; justify-items: center; gap: var(--s4); }
.boot-emblem .em-frame { stroke-dasharray: 162; stroke-dashoffset: 162; animation: draw .7s var(--ease) forwards; }
.boot-emblem .em-wicks, .boot-emblem .em-bodies { opacity: 0; animation: fadeUp var(--t-slow) .25s var(--ease) forwards; }
.boot-word { letter-spacing: .5em; font-weight: 600; font-size: var(--fs-sm); color: var(--text); padding-left: .5em; opacity: 0; animation: fadeUp var(--t-slow) .15s var(--ease) forwards; }
.boot-skel { display: flex; align-items: flex-end; gap: 5px; height: 34px; }
.boot-skel i { display: block; width: 5px; border-radius: 1px; background: var(--line-2); animation: skel 1.2s var(--ease) infinite alternate; }
.boot-skel i:nth-child(odd) { height: 14px; } .boot-skel i:nth-child(even) { height: 22px; }
.boot-skel i:nth-child(3n) { height: 30px; } .boot-skel i:nth-child(4n) { height: 18px; }
.boot-skel i:nth-child(2) { animation-delay: .06s } .boot-skel i:nth-child(3) { animation-delay: .12s } .boot-skel i:nth-child(4) { animation-delay: .18s }
.boot-skel i:nth-child(5) { animation-delay: .24s } .boot-skel i:nth-child(6) { animation-delay: .3s } .boot-skel i:nth-child(7) { animation-delay: .36s }
.boot-skel i:nth-child(8) { animation-delay: .42s } .boot-skel i:nth-child(9) { animation-delay: .48s } .boot-skel i:nth-child(10) { animation-delay: .54s }
.boot-skel i:nth-child(11) { animation-delay: .6s } .boot-skel i:nth-child(12) { animation-delay: .66s }
.boot-sub { font-size: var(--fs-2xs); color: var(--dim); letter-spacing: .14em; text-transform: uppercase; min-height: 1em; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes skel { from { opacity: .35; } to { opacity: 1; } }

/* ---------- layout ---------- */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr calc(var(--tabs-h) + var(--safe-b)); }
.rail { display: none; }
.main { position: relative; overflow: hidden; min-height: 0; }
.view { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; padding-top: var(--safe-t); }
.view.active { display: flex; animation: viewIn var(--t-med) var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: rgba(7,8,10,.96); padding-bottom: var(--safe-b); }
.nav-btn { display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--dim); font-size: var(--fs-2xs); letter-spacing: .02em; transition: color var(--t-fast) var(--ease); min-height: 48px; }
.nav-btn.active { color: var(--gold); }
.nav-btn svg { width: 21px; height: 21px; }

/* ---------- chart room ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.topbar .tf-bar { order: 3; flex-basis: 100%; }
.sym-btn { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: var(--r-sm); font-weight: 650; letter-spacing: .04em; font-size: var(--fs-lg); }
.sym-btn:active { background: var(--raised); }
.sym-btn .chev svg { width: 16px; height: 16px; color: var(--muted); }
.tf-bar { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tf-bar::-webkit-scrollbar { display: none; }
.tf-btn { padding: 6px 9px; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--muted); font-weight: 550; font-family: var(--mono); flex: 0 0 auto; }
.tf-btn.active { color: var(--text); background: var(--raised-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.demo-chip { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .12em; color: var(--gold); border: 1px solid rgba(200,168,95,.35); padding: 3px 7px; border-radius: var(--r-pill); white-space: nowrap; }

.chart-body { flex: 1; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; min-height: 0; }
.chart-col { min-height: 0; min-width: 0; position: relative; grid-row: 1; }
.chart-wrap { position: absolute; inset: 0; overflow: hidden; }
.chart-canvas { position: absolute; inset: 0; display: block; }
.toolbar { grid-row: 2; display: flex; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.toolbar::-webkit-scrollbar { display: none; }
.tool { flex: 0 0 auto; width: 40px; height: 38px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.tool:hover { color: var(--text); }
.tool.active { color: var(--gold); background: var(--gold-soft); }
.tool.on { color: var(--gold); }
.tool-sep { width: 1px; background: var(--line); margin: 6px 4px; flex: 0 0 auto; }
.side-watch { display: none; }

.legend { position: absolute; top: 8px; left: 10px; z-index: 2; pointer-events: none; font-size: var(--fs-xs); line-height: 1.55; max-width: calc(100% - 90px); }
.legend .l1 { color: var(--muted); letter-spacing: .02em; }
.legend .l1 b { color: var(--text); font-weight: 600; }
.legend .l2 { font-family: var(--mono); color: var(--muted); }
.legend .l2 span { white-space: nowrap; display: inline-block; }
.legend .l2 span { margin-right: 8px; }
.legend i { font-style: normal; }
.legend .l0 { display: none; font-family: var(--mono); gap: var(--s2); align-items: baseline; }
.legend .l0 .px { font-size: var(--fs-lg); font-weight: 600; letter-spacing: .01em; }
.legend .up { color: var(--up); } .legend .down { color: var(--down); }

.objbar { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 4px; padding: 5px; background: rgba(18,21,26,.96); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: popIn var(--t-fast) var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -4px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; }
.swatch.active { border-color: var(--text); }
.wbtn { width: 30px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); }
.wbtn.active { color: var(--text); background: var(--raised-2); }
.wbtn i { display: block; width: 14px; background: currentColor; border-radius: 2px; }
.obj-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; }
.obj-act { width: 32px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); }
.obj-act:hover { color: var(--text); }
.obj-act.on { color: var(--gold); }
.obj-act.danger:hover { color: var(--down); }
.obj-info { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); padding: 0 6px; white-space: nowrap; }

.tool-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(18,21,26,.94); border: 1px solid var(--line-2); padding: 7px 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; pointer-events: none; }
.market-state { position: absolute; top: 8px; right: 80px; z-index: 2; font-size: var(--fs-xs); color: var(--muted); background: var(--raised); border: 1px solid var(--line); padding: 4px 9px; border-radius: var(--r-pill); }
.reset-view { position: absolute; right: 78px; bottom: 34px; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(18,21,26,.92); border: 1px solid var(--line-2); color: var(--muted); }
.reset-view:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-md); padding: 11px 16px; font-weight: 600; font-size: var(--fs-md); transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 7px 11px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-gold { background: var(--gold); color: #17130a; }
.btn-gold:hover { background: #d4b46a; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--raised); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .i svg { width: 16px; height: 16px; }
.link { color: var(--gold); font-size: var(--fs-sm); padding: 4px 0; }

/* ---------- pages ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: .01em; }
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 24px; }

/* watchlist */
.wl-head, .wl-row { display: grid; grid-template-columns: 30px minmax(0,1.3fr) 84px minmax(0,1fr) minmax(0,1fr) 52px 64px; align-items: center; gap: 4px; padding: 0 12px 0 6px; }
.wl-head { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); height: 32px; border-bottom: 1px solid var(--line); }
.wl-head span { text-align: right; white-space: nowrap; } .wl-head span:nth-child(2) { text-align: left; }
.wl-row { height: 54px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast) var(--ease); }
.wl-row:hover { background: rgba(255,255,255,.02); }
.wl-row.current { background: var(--gold-soft); }
.wl-row .sym { font-weight: 650; letter-spacing: .03em; font-size: var(--fs-md); }
.wl-row .sym small { display: block; color: var(--dim); font-weight: 400; font-size: var(--fs-2xs); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row .num { text-align: right; font-size: var(--fs-sm); }
.wl-row .chg { text-align: right; font-family: var(--mono); font-size: var(--fs-sm); }
.up { color: var(--up); } .down { color: var(--down); }
.spark { display: block; width: 100%; height: 26px; }
.wl-head .c-spark { text-align: left; }
.star { width: 30px; height: 40px; display: grid; place-items: center; color: var(--dim); }
.star.on { color: var(--gold); }
.star svg { width: 16px; height: 16px; }
.wl-foot { padding: 12px 16px; color: var(--dim); font-size: var(--fs-xs); line-height: 1.5; }
.closed-tag { font-size: var(--fs-2xs); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

/* setups */
.feed { display: grid; gap: 12px; padding: 14px; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: border-color var(--t-fast) var(--ease); animation: fadeUp var(--t-slow) var(--ease); }
.card:hover { border-color: var(--line-2); }
.card img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg); border-bottom: 1px solid var(--line); }
.card-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.card-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-sm); }
.pill.long { color: var(--up); background: rgba(47,191,138,.12); }
.pill.short { color: var(--down); background: rgba(229,72,91,.12); }
.pill.tf { color: var(--muted); background: var(--raised-2); font-family: var(--mono); }
.card-sym { font-weight: 650; letter-spacing: .03em; font-size: var(--fs-lg); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { display: grid; gap: 2px; }
.kv label { font-size: var(--fs-2xs); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.kv span { font-family: var(--mono); font-size: var(--fs-sm); }
.card-note { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.card-meta { color: var(--dim); font-size: var(--fs-xs); }
.empty { padding: 56px 28px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.empty-emblem { opacity: .9; margin-bottom: var(--s1); }
.empty h2 { margin: 6px 0 0; font-size: var(--fs-xl); font-weight: 650; }
.empty p { margin: 0; color: var(--muted); max-width: 340px; line-height: 1.5; }

/* more / account / pro / connections */
.section { padding: 18px 16px 4px; }
.section h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin: 0 0 10px; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.panel + .panel { margin-top: 10px; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.row-line:last-child { border-bottom: 0; }
.row-line .k { color: var(--muted); }
.status { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .1em; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.status.ok { color: var(--up); background: rgba(47,191,138,.1); }
.status.staged { color: var(--gold); background: var(--gold-soft); }
.pro-hero { background: linear-gradient(180deg, rgba(200,168,95,.08), rgba(200,168,95,0) 70%), var(--surface); border: 1px solid rgba(200,168,95,.25); border-radius: var(--r-xl); padding: 20px 18px; }
.pro-hero h3 { margin: 8px 0 6px; font-size: var(--fs-2xl); letter-spacing: .02em; }
.pro-hero p { margin: 0; color: var(--muted); line-height: 1.5; font-size: var(--fs-md); }
.pro-mark { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: var(--fs-xs); letter-spacing: .2em; font-weight: 650; }
.pro-mark svg { width: 16px; height: 16px; }
.benefits { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.benefits li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: var(--fs-md); line-height: 1.45; }
.benefits li svg { width: 16px; height: 16px; color: var(--gold); margin-top: 2px; }
.benefits b { font-weight: 600; }
.benefits small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.conn { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); width: 100%; text-align: left; }
.conn + .conn { margin-top: 10px; }
.conn-logo { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--raised-2); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); letter-spacing: .04em; color: var(--text); border: 1px solid var(--line-2); }
.conn b { display: block; font-size: var(--fs-md); }
.conn small { color: var(--muted); font-size: var(--fs-sm); }
.fineprint { color: var(--dim); font-size: var(--fs-sm); line-height: 1.55; padding: 12px 16px; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; opacity: 0; transition: opacity var(--t-med) var(--ease); }
.scrim.open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-top: 1px solid var(--line-2); border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 88vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform var(--t-slow) var(--ease); padding-bottom: var(--safe-b); }
.sheet.open { transform: none; }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px; }
.sheet-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 650; }
.sheet-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.sheet-x:hover { background: var(--raised); color: var(--text); }
.sheet-body { overflow-y: auto; padding: 4px 16px 18px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: var(--fs-sm); color: var(--muted); }
.input { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 12px 12px; font-size: var(--fs-lg); outline: none; transition: border-color var(--t-fast) var(--ease); }
.input:focus { border-color: var(--gold); }
.input.code { font-family: var(--mono); letter-spacing: .5em; text-align: center; font-size: var(--fs-2xl); }
textarea.input { resize: vertical; min-height: 70px; font-size: var(--fs-lg); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line-2); font-weight: 600; color: var(--muted); }
.seg button.active.long { color: var(--up); border-color: rgba(47,191,138,.5); background: rgba(47,191,138,.08); }
.seg button.active.short { color: var(--down); border-color: rgba(229,72,91,.5); background: rgba(229,72,91,.08); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--down); font-size: var(--fs-sm); min-height: 18px; margin: 2px 0 6px; }
.note { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.device-code { border: 1px dashed rgba(200,168,95,.45); border-radius: var(--r-lg); padding: 12px; margin: 4px 0 14px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.device-code b { display: block; font-family: var(--mono); font-size: var(--fs-2xl); letter-spacing: .3em; color: var(--gold); margin-top: 4px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; margin: 6px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); margin: 1px 0 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: var(--fs-xs); margin: 16px 0 12px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social { display: grid; grid-template-columns: 1fr; gap: 8px; }
.social-tile { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; border-radius: var(--r-md); border: 1px solid var(--line-2); font-weight: 600; }
.social-tile:hover { background: var(--raised); }
.door-brand { display: grid; justify-items: center; gap: 6px; margin: 4px 0 18px; }
.door-brand .w { letter-spacing: .42em; font-weight: 600; font-size: var(--fs-sm); padding-left: .42em; }
.door-brand p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.sym-list .wl-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 64px; padding: 0 4px; }
.preview-img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); display: block; margin-bottom: 12px; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 66px); transform: translate(-50%, 10px); background: var(--raised-2); border: 1px solid var(--line-2); color: var(--text); padding: 10px 14px; border-radius: var(--r-lg); font-size: var(--fs-sm); z-index: 80; opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .topbar { flex-wrap: nowrap; padding: 8px 12px; min-height: 50px; }
  .topbar .tf-bar { order: 0; flex-basis: auto; }
  .app { grid-template-columns: 64px 1fr; grid-template-rows: 1fr; }
  .tabs { display: none; }
  .rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-right: 1px solid var(--line); background: var(--surface); }
  .rail-logo { margin-bottom: var(--s4); display: grid; place-items: center; height: 40px; }
  .rail .nav-btn { width: 52px; min-height: 52px; border-radius: var(--r-md); }
  .rail .nav-btn.active { background: var(--gold-soft); }
  .chart-body { grid-template-columns: 48px 1fr; grid-template-rows: 1fr; }
  .toolbar { grid-row: 1; grid-column: 1; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 8px 4px; overflow-y: auto; }
  .tool { width: 40px; height: 38px; }
  .tool-sep { width: auto; height: 1px; margin: 4px 6px; }
  .chart-col { grid-column: 2; }
  .toast { bottom: 28px; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; max-height: 84vh; border: 1px solid var(--line-2); border-radius: var(--r-xl); transform: translate(-50%, -46%); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); pointer-events: none; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet-grab { display: none; }
  .feed { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); padding: 18px; }
  .page-body > .section, .page-body > .fineprint { max-width: 720px; }
}
@media (min-width: 1200px) {
  .chart-body { grid-template-columns: 48px 1fr 380px; }
  .side-watch { display: flex; flex-direction: column; grid-column: 3; border-left: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
  .side-watch .wl-head, .side-watch .wl-row { grid-template-columns: 20px minmax(0,1fr) 40px 62px 62px 26px 48px; gap: 3px; padding: 0 10px 0 2px; }
  .side-watch .wl-row .num, .side-watch .wl-row .chg { font-size: var(--fs-xs); }
  .side-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
}
@media (max-width: 420px) {
  .wl-head, .wl-row { grid-template-columns: 22px minmax(0,1fr) 46px 62px 62px 30px 50px; gap: 4px; padding: 0 8px 0 2px; }
  .wl-row .sym small { display: none; }
  .wl-row .num, .wl-row .chg { font-size: var(--fs-xs); }
  .wl-row .sym { font-size: var(--fs-sm); }
}
@media (max-width: 899px) {
  .objbar { top: auto; bottom: 76px; }
  .legend .l0 { display: flex; }
  .legend:not(.tracking) .l2 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
