/* ==========================================================================
   KINGO — flight-deck console
   One instrument emits light (the Orbit / the live price); everything else is matte glass over the void.
   Type: Rajdhani for words, JetBrains Mono for numbers. Rhythm: 4px. Panels: 4px radius, corner brackets on
   instruments. Semantic light: cyan = telemetry / interactive, amber = attention, mint = long/profit, coral = short/loss.
   ========================================================================== */
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/rajdhani-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/rajdhani-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/rajdhani-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/rajdhani-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/jetbrains-mono-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --void: #04070e; --deck: #0a1020; --deck2: #0f1829; --deck3: #15213a; --deck4: #1b2a48;
  --line: #182640; --line2: #26395e; --line3: #35508a;
  --ink: #e8eefb; --ink2: #aab8d2; --dim: #6f809f; --dim2: #4d5c78;
  --cyan: #4fd8ff; --cyan2: #1fb6e6; --amber: #ffb547; --mint: #2ee6a6; --coral: #ff5c7a; --violet: #8f7bff;
  --cyan-bg: rgba(79,216,255,.11); --amber-bg: rgba(255,181,71,.13); --mint-bg: rgba(46,230,166,.12); --coral-bg: rgba(255,92,122,.12); --violet-bg: rgba(143,123,255,.14);
  --glow-cyan: 0 0 16px rgba(79,216,255,.35); --glow-mint: 0 0 10px rgba(46,230,166,.6); --glow-coral: 0 0 10px rgba(255,92,122,.6); --glow-amber: 0 0 10px rgba(255,181,71,.6);
  --r: 4px; --r2: 3px; --cut: 6px;
  --display: "Rajdhani", "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --font: var(--display);
  /* legacy aliases used by older rules / inline styles */
  --bg: var(--void); --bg1: var(--deck); --bg2: var(--deck2); --bg3: var(--deck3); --text: var(--ink); --text2: var(--ink2); --muted: var(--dim);
  --green: var(--mint); --red: var(--coral); --teal: var(--cyan); --blue: var(--cyan); --purple: var(--violet);
  --green-bg: var(--mint-bg); --red-bg: var(--coral-bg); --blue-bg: var(--cyan-bg); --teal-bg: var(--cyan-bg); --glow: var(--glow-cyan);
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line2) transparent; scrollbar-width: thin; }
body { margin: 0; background: var(--void); color: var(--ink); font: 500 14px/1.4 var(--display); overflow-x: hidden; letter-spacing: .01em; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.nebula { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(ellipse 55% 40% at 88% -8%, rgba(143,123,255,.17), transparent 62%),
  radial-gradient(ellipse 48% 38% at -4% 102%, rgba(79,216,255,.13), transparent 60%),
  radial-gradient(ellipse 40% 28% at 60% 112%, rgba(46,230,166,.06), transparent 60%); }
a { color: var(--cyan); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--dim); font-size: 12.5px; }
.mono { font-family: var(--mono); }
.pos { color: var(--mint); } .neg { color: var(--coral); } .warn { color: var(--amber); }
.grow { flex: 1 1 auto; min-width: 120px; }
.hint { color: var(--dim); font-size: 12px; margin: 6px 0 0; font-weight: 500; }
.sm { font-size: 12px; }
b, strong { font-weight: 700; }
code { font-family: var(--mono); font-size: .92em; }
::selection { background: rgba(79,216,255,.35); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button { font-family: var(--display); }

/* ---------- app bar: brand · status rail · nav ---------- */
.app-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: calc(48px + var(--sat)); padding: var(--sat) 14px 0; background: rgba(4,7,14,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2); }
/* tick ruler under the bar: minor every 8px, major every 48px */
.app-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 5px; pointer-events: none; opacity: .9;
  background: repeating-linear-gradient(90deg, var(--line3) 0 1px, transparent 1px 8px) bottom / 100% 2px no-repeat, repeating-linear-gradient(90deg, var(--line3) 0 1px, transparent 1px 48px) bottom / 100% 5px no-repeat; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; line-height: 1; }
.brand .orb { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--cyan) 45%, rgba(79,216,255,0) 72%); box-shadow: 0 0 12px rgba(79,216,255,.7); flex: none; }
.brand .orb.live { animation: orbPulse 2.4s ease-in-out infinite; }
.brand .sub { font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--dim); }
@keyframes orbPulse { 0%, 100% { box-shadow: 0 0 8px rgba(79,216,255,.55); } 50% { box-shadow: 0 0 18px rgba(79,216,255,1); } }
.rail { display: flex; align-items: stretch; gap: 0; min-width: 0; height: 30px; border: 1px solid var(--line2); border-radius: var(--r); background: rgba(10,16,32,.75); overflow: hidden; }
.rail .ro { display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; border-right: 1px solid var(--line2); font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--ink2); white-space: nowrap; line-height: 1; }
.rail .ro:last-child { border-right: 0; }
.rail .ro em { font-style: normal; color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .1em; }
.rail .ro .v { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.rail .ro.ok .v, .rail .ro.long .v { color: var(--mint); } .rail .ro.bad .v, .rail .ro.short .v { color: var(--coral); } .rail .ro.warn .v { color: var(--amber); }
.rail .ro .led { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.rail .ro.ok .led { background: var(--mint); box-shadow: var(--glow-mint); animation: ledPulse 2s infinite; } .rail .ro.bad .led { background: var(--coral); box-shadow: var(--glow-coral); } .rail .ro.warn .led { background: var(--amber); box-shadow: var(--glow-amber); }
@keyframes ledPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.rail .ro.clock { font-family: var(--mono); font-weight: 500; font-size: 12.5px; color: var(--ink2); }
.rail .ro.mock { color: var(--amber); background: var(--amber-bg); font-weight: 700; letter-spacing: .12em; font-size: 11px; }
.rail button.ro { background: transparent; border: 0; border-right: 1px solid var(--line2); cursor: pointer; color: var(--ink2); gap: 5px; }
.rail .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail button.ro .v:empty { display: none; }
.rail button.ro:hover { color: var(--cyan); background: var(--cyan-bg); }
.rail button.ro.on { color: var(--mint); } .rail button.ro.block { color: var(--coral); } .rail button.ro.accent { color: var(--cyan); }
.nav { margin-left: auto; display: flex; gap: 0; height: 100%; }
.nav button { background: transparent; color: var(--dim); border: 0; padding: 0 10px; cursor: pointer; font-size: 14.5px; font-weight: 600; letter-spacing: .06em; position: relative; height: 100%; }
.nav button:hover { color: var(--ink); }
.nav button.active { color: var(--ink); }
.nav button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.bottom-nav { display: none; }

main { padding: 10px 14px 72px; max-width: 1540px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }

/* ---------- panels ---------- */
.panel { position: relative; background: rgba(10,16,32,.86); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; backdrop-filter: blur(6px); }
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(79,216,255,.55), rgba(79,216,255,.08) 40%, transparent); pointer-events: none; border-radius: var(--r) var(--r) 0 0; }
/* instrument panels: faint dot grid + corner brackets (top-left painted, bottom-right ::after) */
.panel.hud { background-color: rgba(10,16,32,.9); background-image: linear-gradient(var(--cyan), var(--cyan)), linear-gradient(var(--cyan), var(--cyan)), radial-gradient(rgba(79,216,255,.07) 1px, transparent 1.2px); background-size: 13px 2px, 2px 13px, 22px 22px; background-position: 0 0, 0 0, 6px 6px; background-repeat: no-repeat, no-repeat, repeat; }
.panel.hud::after { content: ""; position: absolute; width: 12px; height: 12px; right: -1px; bottom: -1px; border: solid var(--cyan); border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; opacity: .85; pointer-events: none; }
details.panel > summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; letter-spacing: .04em; display: flex; align-items: baseline; gap: 8px; }
details.panel > summary::before { content: "▸"; color: var(--cyan); font-size: 12px; } details.panel[open] > summary::before { content: "▾"; }
details.panel > summary .muted { font-weight: 500; }
details.panel[open] > summary { margin-bottom: 10px; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin: -2px 0 10px; padding-bottom: 7px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .07em; color: var(--ink); }
.panel-head .muted { font-size: 12.5px; }
.panel-head .grow { flex: 1; }
h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ink2); letter-spacing: .06em; }

/* ---------- readouts (portfolio / backtest / paper KPIs) ---------- */
.readouts, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 10px; }
.ro-card { position: relative; background: rgba(10,16,32,.92); padding: 8px 10px 7px 13px; min-width: 0; }
.ro-card::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--line2); border-radius: 0 2px 2px 0; }
.ro-card.pos::before { background: var(--mint); box-shadow: var(--glow-mint); } .ro-card.neg::before { background: var(--coral); box-shadow: var(--glow-coral); } .ro-card.warn::before { background: var(--amber); box-shadow: var(--glow-amber); }
.ro-card .k { color: var(--dim); font-size: 11.5px; letter-spacing: .09em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-card .v { font: 600 16px/1.15 var(--mono); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.ro-card .v.pos { color: var(--mint); } .ro-card .v.neg { color: var(--coral); } .ro-card .v.warn { color: var(--amber); }
.ro-card .s { font-size: 11px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-weight: 500; }

/* ---------- hero: orbit + signal stream ---------- */
.hero { display: grid; grid-template-columns: minmax(330px, 380px) 1fr; gap: 10px; margin-bottom: 10px; align-items: stretch; }
/* the hero is a fixed-height instrument row: the signal stream scrolls inside instead of pushing the coin list off-screen */
.hero > .panel { max-height: clamp(380px, 70vh, 680px); overflow: auto; }
.orbit-panel { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.orbit-panel > * { flex: 0 0 auto; }   /* the capped panel scrolls; it never squashes the readout rows */
.orbit-panel .panel-head { flex-wrap: nowrap; }
.orbit-panel .panel-head #orbit-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#orbit-cd-head { white-space: nowrap; }
#orbit { width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 340px; display: block; margin: 0 auto; }
.orbit-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; margin: 2px 0 8px; }
.orbit-stats > span { display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; background: rgba(10,16,32,.9); min-width: 0; }
.orbit-stats > span.wide { grid-column: 1 / -1; padding: 4px 8px; }
.orbit-stats > span.wide em { color: var(--ink2); font-size: 11px; letter-spacing: .04em; }
.orbit-stats em { font-style: normal; color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orbit-stats b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orbit-stats b.sm { font-size: 11px; }
.orbit-stats b i { font-style: normal; color: var(--dim); font-size: 10.5px; font-weight: 500; }
.orbit-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 12px; color: var(--ink2); margin-top: 2px; }
.orbit-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.stream-panel { display: flex; flex-direction: column; min-height: 220px; min-width: 0; }
.stream-panel .stream { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* ---- Orbit: coin trend distribution (the dial's headline when every coin has its own setting) ---- */
.trend-strip { margin: 4px 0 6px; }
.trend-strip .bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(111,128,159,.22); }
.trend-strip .bar .l { background: linear-gradient(90deg, rgba(46,230,166,.55), var(--mint)); }
.trend-strip .bar .s { background: linear-gradient(90deg, var(--coral), rgba(255,92,122,.55)); }
.trend-strip .bar .n { background: rgba(111,128,159,.35); }
.trend-strip .legend { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.trend-strip .chip { font: 600 11.5px var(--display); letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; cursor: pointer; background: rgba(10,16,32,.9); border: 1px solid var(--line); color: var(--ink2); }
.trend-strip .chip.pos { color: var(--mint); border-color: rgba(46,230,166,.35); }
.trend-strip .chip.neg { color: var(--coral); border-color: rgba(255,92,122,.35); }
.trend-strip .chip.warn { color: var(--amber); border-color: rgba(255,181,71,.35); }
.trend-strip .chip:hover { border-color: var(--cyan); }
.trend-strip .chip.on { background: rgba(79,216,255,.14); border-color: var(--cyan); color: var(--ink); box-shadow: 0 0 0 1px rgba(79,216,255,.25) inset; }

/* ---- Orbit: the per-setting list, collapsed by default ---- */
.sets-box { border: 1px solid var(--line); border-radius: var(--r2); background: rgba(10,16,32,.6); margin-bottom: 6px; }
.sets-box.hidden { display: none; }
.sets-box > summary { cursor: pointer; padding: 6px 9px; font: 600 12px var(--display); letter-spacing: .04em; color: var(--ink2); list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sets-box > summary::-webkit-details-marker { display: none; }
.sets-box > summary::before { content: '▸'; color: var(--dim); font-size: 10px; }
.sets-box[open] > summary::before { content: '▾'; }
.sets-box > summary .muted { font-weight: 500; font-size: 11px; }
.sets-scroll { max-height: 230px; overflow: auto; border-top: 1px solid var(--line); }
.stream { display: flex; flex-direction: column; gap: 3px; overflow: auto; padding-right: 2px; }
.sig { flex: none; display: grid; grid-template-columns: 50px 96px 1fr auto; align-items: center; gap: 2px 10px; padding: 5px 10px 5px 9px; border-radius: var(--r2); background: rgba(15,24,41,.75); border-left: 2px solid var(--line2); font-size: 12.5px; min-height: 34px; }
.sig .t { font-family: var(--mono); color: var(--dim); font-size: 10.5px; line-height: 1.2; white-space: pre; }
.sig .sym { font-weight: 700; letter-spacing: .05em; cursor: pointer; font-size: 14px; }
.sig .sym .muted { font-weight: 500; margin-left: 5px; font-size: 11px; }
.sig .sym:hover { color: var(--cyan); }
.sig .what { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig .pl { font-family: var(--mono); font-weight: 600; white-space: nowrap; font-size: 12px; }
.sig.open-long { border-left-color: var(--mint); } .sig.open-short { border-left-color: var(--coral); } .sig.add { border-left-color: var(--amber); } .sig.win { border-left-color: var(--cyan); } .sig.loss { border-left-color: var(--coral); }
.sig.new { animation: sigIn 1.8s ease-out; }
@keyframes sigIn { 0% { background: rgba(79,216,255,.38); transform: translateX(-8px); } 100% { background: rgba(15,24,41,.75); transform: none; } }
.sig.replay { opacity: .78; }
.stream .empty { padding: 20px; }

/* ---------- toolbar / forms ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
input, select, textarea { background: rgba(8,13,26,.9); color: var(--ink); border: 1px solid var(--line2); border-radius: var(--r2); padding: 6px 9px; font: 500 14px var(--display); min-height: 32px; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(0,0,0,.35); }
input[type="number"], input[list], input[type="date"], input[type="password"], textarea { font-family: var(--mono); font-size: 12.5px; }
select { appearance: none; -webkit-appearance: none; padding-right: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 13px) 55%, calc(100% - 9px) 55%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
select option { background: var(--deck2); color: var(--ink); }
textarea { line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--dim2); }
input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; margin: 0 6px 0 0; accent-color: var(--cyan); vertical-align: middle; box-shadow: none; }
input[type="date"] { min-width: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(79,216,255,.18), inset 0 1px 0 rgba(0,0,0,.35); }
input:disabled, select:disabled { opacity: .5; }
label.check { display: inline-flex; align-items: center; gap: 2px; color: var(--ink2); font-size: 13px; cursor: pointer; white-space: nowrap; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--dim); min-width: 0; font-weight: 600; letter-spacing: .07em; }
.form-grid label.check { flex-direction: row; align-items: center; justify-content: flex-start; padding-top: 19px; font-size: 13px; color: var(--ink2); letter-spacing: .02em; }
.form-grid label > input, .form-grid label > select, .form-grid label > textarea { width: 100%; letter-spacing: 0; }
.form-grid label.check > input { width: auto; margin: 0 7px 0 0; flex: none; }
.form-grid .hint { margin: 0; letter-spacing: 0; font-weight: 500; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; grid-column: 1 / -1; flex-wrap: wrap; }
.form-actions.sticky { position: sticky; bottom: calc(10px + var(--sab)); background: rgba(4,7,14,.9); backdrop-filter: blur(10px); padding: 9px 12px; border: 1px solid var(--line2); border-radius: var(--r); z-index: 5; margin-top: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.btn { background: rgba(15,24,41,.85); color: var(--ink); border: 1px solid var(--line2); border-radius: var(--r2); padding: 0 12px; cursor: pointer; font: 600 13.5px var(--display); letter-spacing: .05em; white-space: nowrap; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .12s, color .12s, background .12s; }
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.primary { background: linear-gradient(180deg, #5fdcff, #1fb6e6); border-color: transparent; color: #03111a; font-weight: 700; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); border-radius: 0; }
.btn.primary:hover { color: #000; filter: brightness(1.08); }
.btn.danger { border-color: rgba(255,92,122,.55); color: var(--coral); } .btn.danger:hover { background: var(--coral-bg); border-color: var(--coral); color: var(--coral); }
.btn.icon { padding: 0 9px; min-height: 28px; }
.btn.xs { padding: 0 8px; min-height: 26px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); } .btn.ghost:hover { border-color: var(--line2); color: var(--cyan); }
.btn.toggle { color: var(--dim); } .btn.toggle.on { color: var(--cyan); border-color: rgba(79,216,255,.5); background: var(--cyan-bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.settings-grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr); gap: 10px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.settings-col .panel { margin-bottom: 10px; }
.progress { height: 5px; background: var(--deck3); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width .3s; box-shadow: 0 0 8px rgba(79,216,255,.5); }

/* switch */
.sw { position: relative; display: inline-block; width: 32px; height: 18px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; margin: 0; }
.sw i { position: absolute; inset: 0; background: var(--deck3); border: 1px solid var(--line2); border-radius: 999px; transition: .15s; cursor: pointer; }
.sw i::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: var(--dim); border-radius: 50%; transition: .15s; }
.sw input:checked + i { background: var(--mint-bg); border-color: var(--mint); }
.sw input:checked + i::after { transform: translateX(14px); background: var(--mint); box-shadow: var(--glow-mint); }
.sw.amber input:checked + i { background: var(--amber-bg); border-color: var(--amber); } .sw.amber input:checked + i::after { background: var(--amber); box-shadow: var(--glow-amber); }
.sw input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 560px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { position: sticky; top: 0; background: #0b1324; color: var(--dim); font-weight: 600; z-index: 1; font-size: 11.5px; letter-spacing: .08em; font-family: var(--display); border-bottom: 1px solid var(--line2); }
.table td { font-family: var(--mono); font-size: 12px; }
.table td.sym, .table td .sym, .table td.txt { font-family: var(--display); font-size: 13.5px; }
.table td.num, .table th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table th.num { font-family: var(--display); }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: rgba(79,216,255,.05); }
.table tbody tr:hover td { background: rgba(79,216,255,.035); }
.table tr.best td { background: rgba(46,230,166,.08); }
.table td .btn { font-family: var(--display); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; background: var(--deck3); color: var(--ink2); white-space: nowrap; font-family: var(--display); line-height: 1.5; vertical-align: middle; }
.badge.long { background: var(--mint-bg); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(46,230,166,.35); } .badge.short { background: var(--coral-bg); color: var(--coral); box-shadow: inset 0 0 0 1px rgba(255,92,122,.35); }
.badge.flat { background: var(--deck3); color: var(--dim); } .badge.amber { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(255,181,71,.35); } .badge.teal { background: var(--cyan-bg); color: var(--cyan); } .badge.off { background: rgba(255,255,255,.04); color: var(--dim); text-decoration: line-through; }

/* ---------- coin list (desktop table / mobile tiles) ---------- */
.coin-table .sym { font-weight: 700; font-family: var(--display); font-size: 14px; letter-spacing: .05em; }
.coin-table .sym .muted { font-weight: 500; margin-left: 5px; font-size: 11.5px; letter-spacing: .02em; }
.coin-table .sym.clickable:hover { color: var(--cyan); }
.coin-table td.ctl { white-space: nowrap; }
.coin-table .table th:first-child, .coin-table .table td:first-child { padding-left: 12px; }
canvas.spark { width: 96px; height: 24px; display: block; }
.coin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.coin-card { position: relative; background: rgba(10,16,32,.9); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px 7px; overflow: hidden; }
.coin-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--line2); }
.coin-card.long::before { background: var(--mint); box-shadow: var(--glow-mint); } .coin-card.short::before { background: var(--coral); box-shadow: var(--glow-coral); }
.coin-card canvas.spark { position: absolute; right: 0; top: 28px; width: 46%; height: 48px; opacity: .5; pointer-events: none; }
.coin-card .head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; position: relative; }
.coin-card .head b { font-size: 16px; font-family: var(--display); letter-spacing: .05em; }
.coin-card .head .muted { font-size: 11.5px; }
.coin-card .price { margin-left: auto; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.coin-card .rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; position: relative; }
.coin-card .rows .l { color: var(--dim); font-weight: 600; letter-spacing: .06em; font-size: 11px; align-self: center; }
.coin-card .rows .mono { font-size: 12px; }
.coin-card .foot { display: flex; align-items: center; gap: 10px; margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink2); position: relative; }
.coin-card .foot .btn { margin-left: auto; }
.live-price.up { color: var(--mint); } .live-price.down { color: var(--coral); }

/* ---------- chart ---------- */
.chart { height: 470px; width: 100%; border-radius: var(--r2); overflow: hidden; background: var(--deck); border: 1px solid var(--line); }
.chart.small { height: 200px; }
.chart.kpane { height: 128px; border-top: 0; border-radius: 0 0 var(--r2) var(--r2); }
.chart-stack { display: flex; flex-direction: column; min-width: 0; }
.chart-wrap { position: relative; }
.chart-wrap.main .chart { border-radius: var(--r2) var(--r2) 0 0; }
.chart-wrap.kwrap.hidden { display: none; }
.chart-stack:has(.kwrap.hidden) .main .chart { border-radius: var(--r2); }
.chart-legend { position: absolute; left: 8px; top: 6px; z-index: 3; pointer-events: none; font-size: 12px; color: var(--ink2); background: rgba(4,7,14,.72); padding: 3px 7px; border-radius: 3px; max-width: calc(100% - 100px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid rgba(38,57,94,.6); }
.chart-legend .mono { font-family: var(--mono); font-size: 11.5px; }
.chart-legend.klegend { top: 4px; font-size: 11.5px; }
.warn-text { color: var(--amber); }
.chart-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.chart-labels.hidden { display: none; }
.clabel { position: absolute; transform: translateX(-50%); font-size: 10.5px; line-height: 1.25; padding: 3px 7px; border-radius: 3px; color: #fff; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.14); }
.clabel::after { content: ''; position: absolute; left: 50%; margin-left: -5px; border: 5px solid transparent; }
.clabel.above::after { top: 100%; border-top-color: inherit; }
.clabel.below::after { bottom: 100%; border-bottom-color: inherit; }
.clabel .t { font-weight: 700; letter-spacing: .04em; font-family: var(--display); font-size: 12.5px; }
.clabel .d { opacity: .92; font-family: var(--mono); font-size: 10px; }
.clabel .d.x { opacity: .75; }
.clabel.compact { padding: 1px 5px; font-size: 10px; }
.clabel.open-long { background: #157a56; border-color: #2ee6a6; } .clabel.open-long::after { border-top-color: #157a56; border-bottom-color: #157a56; }
.clabel.open-short { background: #9a2a45; border-color: #ff5c7a; } .clabel.open-short::after { border-top-color: #9a2a45; border-bottom-color: #9a2a45; }
.clabel.add { background: #8a5a12; border-color: #ffb84d; } .clabel.add::after { border-top-color: #8a5a12; border-bottom-color: #8a5a12; }
.clabel.win { background: #16627f; border-color: #39d0ff; } .clabel.win::after { border-top-color: #16627f; border-bottom-color: #16627f; }
.clabel.loss { background: #5a2a3a; border-color: #ff5c7a; } .clabel.loss::after { border-top-color: #5a2a3a; border-bottom-color: #5a2a3a; }
.clabel.above::after { border-bottom-color: transparent !important; } .clabel.below::after { border-top-color: transparent !important; }

/* chart head = one instrument strip */
.chart-head { position: relative; display: flex; align-items: center; gap: 0; padding: 0; margin-bottom: 8px; background: rgba(10,16,32,.9); border: 1px solid var(--line2); border-radius: var(--r); min-height: 54px; overflow: hidden; }
.chart-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(79,216,255,.6), transparent 50%); }
.ch-seg { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-right: 1px solid var(--line); min-height: 54px; }
.ch-seg.chips-seg { flex: 1 1 0; min-width: 0; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ch-seg.chips-seg::-webkit-scrollbar { display: none; }
.ch-seg.tools-seg { border-right: 0; margin-left: auto; gap: 6px; padding-right: 10px; flex: none; }
.ch-sym { display: flex; flex-direction: column; gap: 3px; }
.ch-sym select { font-weight: 700; font-size: 16px; min-width: 150px; font-family: var(--display); letter-spacing: .06em; min-height: 30px; padding: 2px 26px 2px 9px; }
.ch-sym .sub { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink2); padding-left: 2px; }
.ch-tf { color: var(--ink2); font-size: 11.5px; white-space: nowrap; font-weight: 600; letter-spacing: .04em; }
.ch-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); white-space: nowrap; font-weight: 600; letter-spacing: .05em; }
.ch-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; }
.ch-live.ok i { background: var(--mint); animation: pulse 1.6s infinite; }
.ch-live.ok { color: var(--mint); } .ch-live.warn { color: var(--amber); } .ch-live.warn i { background: var(--amber); } .ch-live.bad { color: var(--coral); } .ch-live.bad i { background: var(--coral); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,230,166,.55); } 70% { box-shadow: 0 0 0 7px rgba(46,230,166,0); } 100% { box-shadow: 0 0 0 0 rgba(46,230,166,0); } }
.ch-price-wrap { display: flex; flex-direction: column; gap: 1px; min-width: 150px; }
.ch-price { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; transition: color .6s; text-shadow: 0 0 18px rgba(79,216,255,.25); }
.ch-price.up { color: var(--mint); animation: flashUp .7s; } .ch-price.down { color: var(--coral); animation: flashDown .7s; }
@keyframes flashUp { 0% { text-shadow: 0 0 22px rgba(46,230,166,.9); } 100% { text-shadow: 0 0 18px rgba(79,216,255,.25); } }
@keyframes flashDown { 0% { text-shadow: 0 0 22px rgba(255,92,122,.9); } 100% { text-shadow: 0 0 18px rgba(79,216,255,.25); } }
.ch-deltas { display: flex; gap: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.ch-delta { font-family: var(--mono); font-size: 11.5px; }
.chip { padding: 3px 9px; background: rgba(21,33,58,.7); border: 1px solid var(--line2); font-size: 12px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; color: var(--ink2); clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); flex: none; line-height: 1.35; }
.chip.ok, .chip.long { border-color: rgba(46,230,166,.6); color: var(--mint); background: rgba(46,230,166,.09); } .chip.bad, .chip.short { border-color: rgba(255,92,122,.6); color: var(--coral); background: rgba(255,92,122,.09); } .chip.warn { border-color: rgba(255,181,71,.6); color: var(--amber); background: rgba(255,181,71,.09); }
.chip.accent { border-color: rgba(79,216,255,.6); color: var(--cyan); }
.ch-chips .chip { font-family: var(--mono); font-weight: 500; font-size: 11.5px; }
.ch-kwrap { display: inline-flex; align-items: center; gap: 4px; flex: none; }
#ch-kgauge { width: 64px; height: 36px; display: block; }
.chart-key { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 6px 2px 10px; }
.chart-key i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; margin-right: 5px; vertical-align: middle; }
.chart-key .k-avg { border-color: var(--cyan); } .chart-key .k-next { border-color: var(--amber); border-top-style: dashed; } .chart-key .k-pend { border-color: var(--dim); border-top-style: dotted; }
.chart-key .k-be { border-color: var(--cyan); border-top-style: dotted; } .chart-key .k-k { border-color: var(--violet); } .chart-key .k-htf { border-color: var(--dim); border-top-style: dotted; }
.chart-key .k-long, .chart-key .k-short { width: 12px; height: 10px; border: 0; border-radius: 2px; }
.chart-key .k-long { background: rgba(46,230,166,.35); } .chart-key .k-short { background: rgba(255,92,122,.35); } tr.flash td { animation: rowFlash 2.5s; }
@keyframes rowFlash { 0% { background: rgba(79,216,255,.35); } 100% { background: transparent; } }
.chart-layout { display: grid; grid-template-columns: 1fr 312px; gap: 10px; margin-bottom: 10px; }
.pine-panel { background: rgba(10,16,32,.9); border: 1px solid var(--line); border-radius: var(--r); padding: 5px; font-size: 12.5px; align-self: start; position: relative; }
.pine-panel .row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 3px; margin-bottom: 2px; background: rgba(15,24,41,.8); }
.pine-panel .row .lbl { color: var(--dim); white-space: nowrap; font-weight: 600; letter-spacing: .04em; font-size: 12px; }
.pine-panel .row .val { font-family: var(--mono); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.pine-panel .row.head { background: #0b1324; font-weight: 700; font-family: var(--display); font-size: 13.5px; letter-spacing: .06em; border-bottom: 1px solid var(--line2); border-radius: 3px 3px 0 0; }
.pine-panel .row.head .val { font-size: 12.5px; }
.pine-panel .row.bull { background: rgba(46,230,166,.14); } .pine-panel .row.bear { background: rgba(255,92,122,.14); }
.pine-panel .row.accent { background: rgba(79,216,255,.13); }

/* ---------- optimizer ---------- */
.opt-section { margin-bottom: 12px; }
details.opt-section > summary { cursor: pointer; font-size: 13.5px; color: var(--ink2); font-weight: 700; margin-bottom: 8px; letter-spacing: .05em; list-style: none; }
details.opt-section > summary::before { content: "▸ "; color: var(--cyan); font-size: 11px; } details.opt-section[open] > summary::before { content: "▾ "; }
.chips-edit { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; min-height: 20px; }
.chips-edit .tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 10px; border-radius: 3px; background: var(--cyan-bg); border: 1px solid rgba(79,216,255,.4); font-size: 12px; font-family: var(--mono); }
.chips-edit .tag b { cursor: pointer; color: var(--dim); } .chips-edit .tag b:hover { color: var(--coral); }
.param-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.param-row { display: grid; grid-template-columns: 24px 1fr 1.2fr; align-items: center; gap: 8px; background: rgba(15,24,41,.8); padding: 5px 8px; border-radius: var(--r2); border: 1px solid var(--line); }
.param-row .lbl { font-size: 12.5px; line-height: 1.2; font-weight: 600; } .param-row .lbl .hint { display: block; margin-top: 1px; }
.param-row input[type="text"], .param-row input:not([type]) { min-height: 28px; padding: 3px 8px; font-family: var(--mono); font-size: 12px; }

/* ---------- telegram template editor ---------- */
.tpl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; max-height: 90px; overflow: auto; }
.tpl-tags button { background: var(--violet-bg); border: 1px solid rgba(143,123,255,.45); color: #cfc6ff; border-radius: 3px; padding: 1px 7px; font: 11.5px var(--mono); cursor: pointer; }
.tpl-tags button:hover { background: rgba(143,123,255,.3); }
.tpl-preview { background: #080d1a; border: 1px solid var(--line2); border-radius: var(--r2); padding: 10px 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; min-height: 60px; }
.tpl-preview code { background: rgba(79,216,255,.12); padding: 0 4px; border-radius: 3px; font-family: var(--mono); }
.tpl-preview.err { border-color: var(--coral); }
.tpl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-row textarea { min-height: 150px; resize: vertical; }
.shot-preview { max-width: 100%; border-radius: var(--r2); border: 1px solid var(--line2); display: block; margin-top: 8px; }

/* ---------- dialogs ---------- */
.dlg { border: 1px solid var(--line3); border-radius: var(--r); background: rgba(8,13,26,.97); color: var(--ink); padding: 0; width: min(760px, calc(100vw - 20px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(79,216,255,.12), var(--glow-cyan); }
.dlg::backdrop { background: rgba(2,4,9,.72); backdrop-filter: blur(3px); }
.dlg-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .dlg-head h3 { margin: 0; font-size: 17px; letter-spacing: .06em; }
.dlg-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.pk-list { overflow: auto; max-height: 48vh; border: 1px solid var(--line); border-radius: var(--r2); }
.pk-row { display: grid; grid-template-columns: 26px 1.2fr 1fr .8fr 1fr .6fr; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.pk-row:hover { background: rgba(79,216,255,.05); }
.pk-row.added { opacity: .55; }
.pk-row .num { font-family: var(--mono); text-align: right; font-size: 12px; }
.pk-row .vol { color: var(--dim); }
.pk-row b { font-size: 13.5px; letter-spacing: .04em; }

/* ---------- misc ---------- */
.log { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; max-height: 70vh; overflow: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
.log .error { color: var(--coral); } .log .warn { color: var(--amber); }
#toasts { position: fixed; right: 12px; bottom: calc(70px + var(--sab)); display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 24px); }
.toast { position: relative; background: rgba(8,13,26,.96); border: 1px solid var(--line3); padding: 9px 12px 9px 16px; border-radius: var(--r2); font-size: 13px; min-width: 240px; max-width: 400px; box-shadow: 0 8px 24px rgba(0,0,0,.5); white-space: pre-line; backdrop-filter: blur(8px); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%); }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cyan); box-shadow: var(--glow-cyan); }
.toast.ok::before { background: var(--mint); box-shadow: var(--glow-mint); } .toast.err::before { background: var(--coral); box-shadow: var(--glow-coral); } .toast.add::before { background: var(--amber); box-shadow: var(--glow-amber); }
.empty { color: var(--dim); padding: 22px; text-align: center; border: 1px dashed var(--line2); border-radius: var(--r); font-size: 13px; }

/* boot sequence: one orchestrated reveal */
.boot .panel, .boot .kpis, .boot .hero > *, .boot .chart-head { animation: bootIn .5s ease-out both; }
.boot .hero > *:nth-child(2) { animation-delay: .08s; } .boot .kpis { animation-delay: .16s; } .boot #coin-list .panel, .boot .coin-card { animation-delay: .24s; }
@keyframes bootIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- ticker tape ---- */
.tape { position: sticky; top: calc(48px + var(--sat)); z-index: 29; overflow: hidden; height: 24px; background: rgba(4,7,14,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tape-track { display: inline-flex; gap: 28px; white-space: nowrap; padding: 0 20px; height: 24px; align-items: center; animation: tapeScroll 60s linear infinite; will-change: transform; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tapeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tp { display: inline-flex; gap: 7px; align-items: baseline; font-size: 11.5px; color: var(--ink2); font-family: var(--mono); }
.tp b { font-family: var(--display); letter-spacing: .08em; color: var(--ink); font-size: 12.5px; }
.tp.long b { color: var(--mint); } .tp.short b { color: var(--coral); }
.tp .d { font-size: 10.5px; }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; overflow-x: auto; } }

/* ---- auto-scan ---- */
.ao-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 7px 10px; border-radius: var(--r2); background: rgba(15,24,41,.7); border: 1px solid var(--line); margin-bottom: 8px; }
.ao-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.ao-status .dot.ok { background: var(--mint); animation: pulse 1.6s infinite; } .ao-status .dot.warn { background: var(--amber); } .ao-status .dot.idle { background: var(--cyan); box-shadow: var(--glow-cyan); } .ao-status .dot.off { background: var(--dim); }

/* ---- better-settings banner ---- */
.better { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 12px; margin-bottom: 8px; border-radius: var(--r2); background: rgba(255,181,71,.09); border: 1px solid rgba(255,181,71,.5); font-size: 13px; }
.better .flash-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: var(--glow-amber); animation: pulse 1.6s infinite; }
.better .grow { flex: 1; }

/* ---- forecast ---- */
.side-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.forecast { margin: 0 0 10px; padding: 10px 12px; font-size: 12.5px; }
.forecast .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 8px; align-items: start; }
.fc { padding: 8px 10px; border-radius: var(--r2); background: rgba(15,24,41,.7); border: 1px solid var(--line); border-left: 2px solid var(--line2); }
.fc.warm { border-left-color: var(--amber); } .fc.hot { border-left-color: var(--coral); }
.fc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.fc-head b { font-family: var(--display); font-size: 14px; letter-spacing: .05em; margin-right: auto; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; margin: 4px 0 6px; }
.gauge { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--dim); }
.gauge .bar { height: 4px; border-radius: 2px; background: rgba(38,57,94,.9); overflow: hidden; }
.gauge .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 2px; box-shadow: 0 0 6px rgba(79,216,255,.5); }
.gauge .mono { font-size: 13px; font-weight: 600; color: var(--ink); }
.gauges.dim { opacity: .55; }
.conds { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 4px; }
.conds li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.conds li > span { font-weight: 700; text-align: center; }
.conds li.ok > span { color: var(--mint); } .conds li.no > span { color: var(--coral); } .conds li.na > span { color: var(--dim); }
.fc-text { color: var(--ink2); line-height: 1.45; display: grid; gap: 3px; font-size: 12.5px; }

/* ---- PWA / push panel ---- */
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.push-status { display: grid; gap: 4px; padding: 8px 10px; border-radius: var(--r2); background: rgba(15,24,41,.6); border: 1px solid var(--line2); font-size: 13px; }
.push-status .st { display: flex; gap: 8px; align-items: center; }
.push-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink2); flex: none; }
.push-status .dot.ok { background: var(--mint); box-shadow: var(--glow-mint); } .push-status .dot.bad { background: var(--coral); box-shadow: var(--glow-coral); } .push-status .dot.warn { background: var(--amber); }
.help { font-size: 13px; line-height: 1.5; padding: 8px 10px; border-radius: var(--r2); background: rgba(15,24,41,.5); border: 1px dashed var(--line2); margin: 6px 0 10px; }
.help h4 { margin: 6px 0 2px; font-size: 13px; }
.help ol, .help ul { margin: 2px 0 4px 18px; padding: 0; }
.help code { background: var(--void); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }
.help .url { font-weight: 700; color: var(--cyan); }
.sw-update { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 50; }
#push-panel, #tg-panel { grid-column: 1 / -1; }
#push-events { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 6px; }
#push-events label.check { padding-top: 0; }
@media (min-width: 900px) { #push-panel .help { columns: 2; column-gap: 24px; } #push-panel .help h4 { break-after: avoid; } #push-panel .help > div, #push-panel .help > ol { break-inside: avoid; } }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 4px 0 8px; }
.check-row label.check { padding-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .nav { display: none; }
  .app-bar { gap: 8px; padding-left: 10px; padding-right: 10px; height: auto; flex-wrap: wrap; padding-bottom: 6px; }
  .brand { font-size: 18px; height: 36px; } .brand .sub { display: none; }
  .rail { order: 3; flex: 0 0 100%; height: 26px; overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail .ro { padding: 0 9px; font-size: 12px; } .rail .ro .v { font-size: 11.5px; } .rail .ro.clock { display: none; }
  .rail button.ro.bell { margin-left: auto; }
  .tape { top: 0; position: relative; height: 22px; } .tape-track { height: 22px; gap: 18px; }
  main { padding: 8px 8px 84px; }
  .panel { padding: 9px 10px; margin-bottom: 8px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(7, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: rgba(4,7,14,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line2); padding: 4px 4px calc(5px + var(--sab)); z-index: 40; }
  .bottom-nav button { position: relative; background: transparent; border: 0; color: var(--dim); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 5px 2px 3px; border-radius: var(--r2); display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .bottom-nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav button.active { color: var(--cyan); }
  .bottom-nav button.active::before { content: ""; position: absolute; top: -5px; left: 22%; right: 22%; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); border-radius: 2px; }
  .hero { grid-template-columns: 1fr; gap: 8px; }
  .hero > .panel { max-height: none; overflow: visible; }
  .hero > .stream-panel { max-height: 62vh; overflow: auto; }
  #orbit { max-height: 262px; max-width: 262px; }
  .orbit-stats { grid-template-columns: repeat(3, 1fr); } .orbit-stats > span:nth-child(5) { display: none; }
  .stream { max-height: 240px; }
  .sig { grid-template-columns: 44px 1fr auto; min-height: 40px; }
  .sig .t { grid-row: 1 / 3; }
  .sig .what { grid-column: 2 / -1; grid-row: 2; }
  .sig .pl { grid-column: 3; grid-row: 1; }
  .readouts, .kpis { grid-template-columns: repeat(2, 1fr); margin-bottom: 8px; }
  .ro-card { padding: 7px 8px 6px 11px; } .ro-card .v { font-size: 15px; }
  .chart { height: 340px; }
  .chart.kpane { height: 100px; }
  .chart-layout { grid-template-columns: 1fr; gap: 8px; }
  .chart-head { flex-wrap: wrap; min-height: 0; }
  .ch-seg { min-height: 48px; padding: 5px 9px; }
  .ch-seg.sym-seg { flex: 1 1 auto; border-right: 0; }
  .ch-seg.price-seg { border-right: 0; }
  .ch-seg.chips-seg { flex: 0 0 100%; border-top: 1px solid var(--line); border-right: 0; min-height: 40px; padding: 4px 8px; }
  .ch-seg.tools-seg { flex: 0 0 100%; border-top: 1px solid var(--line); margin-left: 0; min-height: 40px; padding: 4px 8px; justify-content: space-between; }
  .ch-sym select { min-width: 118px; font-size: 14px; }
  .ch-price { font-size: 20px; }
  .ch-price-wrap { min-width: 0; align-items: flex-end; }
  .chart-legend.klegend { max-width: calc(100% - 70px); }
  .chart-legend { font-size: 10.5px; max-width: calc(100% - 90px); }
  .clabel { font-size: 10px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
  .form-grid label.check { padding-top: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .param-rows { grid-template-columns: 1fr; }
  .tpl-row { grid-template-columns: 1fr; }
  .pk-row { grid-template-columns: 26px 1.3fr 1fr .8fr; } .pk-row .vol, .pk-row .added-tag { display: none; }
  .form-actions.sticky { bottom: calc(58px + var(--sab)); }
  .table-wrap { max-height: none; }
  #toasts { bottom: calc(66px + var(--sab)); right: 8px; }
  .forecast { padding: 8px; }
}
@media (min-width: 761px) { .coin-cards { display: none; } }
@media (max-width: 760px) { .coin-table { display: none; } }
@media (max-width: 1500px) { .brand .sub { display: none; } }
@media (max-width: 1180px) and (min-width: 761px) { .rail .ro em { display: none; } .nav button { padding: 0 8px; font-size: 13.5px; } .rail .ro.clock { display: none; } }

/* ---- settings-change decision dialog / journal ---- */
.warn-box { padding: 8px 10px; border-radius: var(--r2); background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.45); font-size: 13px; }
.warn-box .table { font-size: 12px; } .warn-box .table th, .warn-box .table td { padding: 4px 6px; }
.btn.primary.danger-primary { background: linear-gradient(180deg, #ffc46b, #f29a2e); color: #1a0d00; }
.chg { display: inline-block; margin-right: 8px; white-space: nowrap; } .chg s { color: var(--dim); } .chg b { color: var(--cyan); }
#dlg-apply .dlg-body { gap: 12px; }
#open-table .sym .muted { font-weight: 500; margin-left: 5px; font-size: 11px; }

/* ---- Orbit: several confirmation settings in play ---- */
.orbit-sets .idx { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; font: 700 10px var(--mono); color: #04070e; background: var(--dim); margin-right: 6px; vertical-align: middle; }
.orbit-sets .idx.pos { background: var(--mint); box-shadow: var(--glow-mint); } .orbit-sets .idx.neg { background: var(--coral); box-shadow: var(--glow-coral); }
.ownk { font-style: normal; font-size: 7px; color: var(--dim); vertical-align: 3px; margin-left: 3px; }
.orbit-near { font-size: 11.5px; color: var(--amber); margin: -2px 0 6px; line-height: 1.4; }
.orbit-near b { font: 600 10.5px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin-right: 5px; }

/* ---- Orbit: one confirmation setting per two-line row (readable in a narrow column) ---- */
.set-row { padding: 5px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: rgba(79,216,255,.06); }
.set-row.on { background: rgba(79,216,255,.12); box-shadow: inset 2px 0 0 var(--cyan); }
.set-row .l1 { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.set-row .l1 .p { color: var(--ink); font-size: 12px; }
.set-row .l1 b { font-weight: 700; font-size: 11.5px; letter-spacing: .03em; white-space: nowrap; }
.set-row .l1 .dur { color: var(--dim); font-size: 11px; min-width: 52px; text-align: right; }
.set-row .l2 { display: flex; gap: 6px; align-items: baseline; margin: 2px 0 0 21px; font-size: 11px; color: var(--ink2); }
.set-row .l2 .coins { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.set-row .l2 .dot { color: var(--dim); }
.set-row .tag { font: 600 9.5px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.set-row .tag.warn { color: var(--amber); border-color: rgba(255,181,71,.4); }
.orbit-sets .idx, .set-row .idx { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; font: 700 10px var(--mono); color: #04070e; background: var(--dim); flex: 0 0 auto; }
.set-row .idx.pos { background: var(--mint); } .set-row .idx.neg { background: var(--coral); }
.tag-replay { font-style: normal; font: 600 9px var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; margin-left: 5px; vertical-align: 1px; }
.bt-pin { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink2); background: rgba(79,216,255,.1); border: 1px solid rgba(79,216,255,.35); border-radius: 999px; padding: 2px 6px 2px 10px; }
.bt-pin b { color: var(--cyan); font: 600 10.5px var(--display); letter-spacing: .06em; text-transform: uppercase; }

/* ---- settings: danger zone + system reset ---- */
.danger-zone { border-color: rgba(255,92,122,.4); }
.danger-zone .panel-head h3 { color: var(--coral); }
.dz-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.dz-row .sm { max-width: 760px; margin-top: 3px; }
.btn.danger { border-color: rgba(255,92,122,.5); color: var(--coral); }
.btn.danger:hover { background: rgba(255,92,122,.12); border-color: var(--coral); }
.reset-opts { display: flex; flex-direction: column; gap: 7px; }
.reset-opts .check { align-items: flex-start; white-space: normal; }
.reset-opts .check input { margin-top: 3px; }
#dlg-reset .dlg-body { gap: 12px; max-width: 640px; }
#rs-confirm { letter-spacing: .12em; text-transform: uppercase; }

/* ---- profit stop: bulk apply to every coin (Settings → Strateji) ---- */
.ps-bulk { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.ps-bulk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.tag-ps { font-size: 10px; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); opacity: .85; }
