/* ================= themes =================
   Every theme sets the same tokens: surfaces, ink, chart chrome, the gain/loss
   pair (each validated colorblind-safe against that theme's own card colour),
   five decorative accents, status colours, fonts and corner radii.
   data-theme picks the theme; data-mode (dark|light) drives mode-level tweaks. */
:root { --font: system-ui, -apple-system, "Segoe UI", sans-serif; --font-display: var(--font); --radius: 14px; --radius-sm: 8px; --border-w: 1px; }

/* Dark Polar: gunmetal with neon accents (the original dark) */
:root, :root[data-theme="polar"] {
  color-scheme: dark;
  --page: #0d0f12; --side: #111317; --card: #171a1f; --card-2: #1e2228;
  --ink: #eef1f5; --ink-2: #b6bdc8; --muted: #7f8793; --grid: #23272e; --axis: #323843;
  --ring: rgba(255, 255, 255, 0.07); --wash: rgba(255, 255, 255, 0.045);
  --pos: #0ea5c6; --neg: #ef4b67;
  --accent: #fb923c; --accent-ink: #14171c; --hero: #21252d; --hero-2: #2b313b;
  --a1: #fb923c; --a2: #a78bfa; --a3: #facc15; --a4: #e879f9; --a5: #a3e635;
  --warn: #fab219; --crit: #ef5350;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 28px -14px rgba(0, 0, 0, 0.7);
}

/* Classic Light: a traditional, quiet light app */
:root[data-theme="classic"] {
  color-scheme: light;
  --page: #f4f5f7; --side: #ffffff; --card: #ffffff; --card-2: #f7f8fa;
  --ink: #111827; --ink-2: #4b5563; --muted: #6b7280; --grid: #eceef1; --axis: #d1d5db;
  --ring: rgba(17, 24, 39, 0.09); --wash: rgba(17, 24, 39, 0.04);
  --pos: #1d6fd1; --neg: #dc3d3d;
  --accent: #2563eb; --accent-ink: #ffffff; --hero: #ffffff; --hero-2: #f7f8fa;
  --a1: #2563eb; --a2: #7c3aed; --a3: #d97706; --a4: #db2777; --a5: #059669;
  --warn: #b7791f; --crit: #d03b3b;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 6px 18px -12px rgba(17, 24, 39, 0.18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --font-display: var(--font); --radius: 10px; --radius-sm: 7px;
}

/* Terminal: phosphor green on black, monospace, sharp corners */
:root[data-theme="terminal"] {
  color-scheme: dark;
  --page: #050805; --side: #070b07; --card: #0b100b; --card-2: #0f160f;
  --ink: #c3f7cf; --ink-2: #86d396; --muted: #4f8a5a; --grid: #12301a; --axis: #1d4a28;
  --ring: rgba(57, 255, 120, 0.18); --wash: rgba(57, 255, 120, 0.05);
  --pos: #0ba2c9; --neg: #f2546c;
  --accent: #39ff7a; --accent-ink: #021a08; --hero: #0b140b; --hero-2: #0f1a0f;
  --a1: #39ff7a; --a2: #ffb000; --a3: #00e5ff; --a4: #ff4fd8; --a5: #c6ff3d;
  --warn: #ffb000; --crit: #ff4d4d;
  --shadow: none;
  --font: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; --font-display: var(--font); --radius: 2px; --radius-sm: 2px;
}

/* Atelier: gallery paper, bold primaries, ink outlines and poster shadows */
:root[data-theme="atelier"] {
  color-scheme: light;
  --page: #f3ede2; --side: #ece4d6; --card: #fffdf8; --card-2: #f6f0e6;
  --ink: #141414; --ink-2: #3a3a3a; --muted: #77716a; --grid: #ebe3d6; --axis: #c9bda9;
  --ring: #141414; --wash: rgba(20, 20, 20, 0.05);
  --pos: #1f4fd8; --neg: #e2401f;
  --accent: #141414; --accent-ink: #f2b705; --hero: #f2b705; --hero-2: #f2b705;
  --a1: #f2b705; --a2: #5e35b1; --a3: #00897b; --a4: #c2185b; --a5: #7cb342;
  --warn: #c77c00; --crit: #c62828;
  --shadow: 4px 4px 0 #141414;
  --font: "DM Sans", system-ui, sans-serif; --font-display: "Fraunces", Georgia, serif; --radius: 6px; --radius-sm: 4px; --border-w: 2px;
}

/* Dojo Ink: sumi black, washi text, gold and vermilion like a scroll */
:root[data-theme="dojo"] {
  color-scheme: dark;
  --page: #12100d; --side: #16130f; --card: #1d1914; --card-2: #241f19;
  --ink: #f0e6d2; --ink-2: #cbbfa6; --muted: #8f8471; --grid: #2c261e; --axis: #3d352a;
  --ring: rgba(240, 230, 210, 0.09); --wash: rgba(240, 230, 210, 0.05);
  --pos: #3f92bf; --neg: #e35a43;
  --accent: #d4a24c; --accent-ink: #1a1408; --hero: #241d14; --hero-2: #2e2519;
  --a1: #d4a24c; --a2: #9d8fe0; --a3: #a8c46a; --a4: #e79fb5; --a5: #5fb38f;
  --warn: #e0a83a; --crit: #e2553e;
  --shadow: 0 1px 0 rgba(240, 230, 210, 0.03) inset, 0 12px 30px -16px rgba(0, 0, 0, 0.8);
  --font: "Zen Kaku Gothic New", system-ui, sans-serif; --font-display: "Shippori Mincho", "Hiragino Mincho ProN", Georgia, serif; --radius: 4px; --radius-sm: 3px;
}

/* Glass: frosted panes floating over slow colour blobs */
:root[data-theme="glass"] {
  color-scheme: dark;
  --page: #0b0f24; --side: rgba(255, 255, 255, 0.05); --card: rgba(255, 255, 255, 0.07); --card-2: rgba(255, 255, 255, 0.11);
  --solid: #1e2547;
  --ink: #f4f6ff; --ink-2: #c3c9e6; --muted: #8c93b8; --grid: rgba(255, 255, 255, 0.08); --axis: rgba(255, 255, 255, 0.16);
  --ring: rgba(255, 255, 255, 0.16); --wash: rgba(255, 255, 255, 0.07);
  --pos: #169ccc; --neg: #f0507a;
  --accent: #8b9cff; --accent-ink: #0b0f24; --hero: rgba(255, 255, 255, 0.1); --hero-2: rgba(255, 255, 255, 0.14);
  --a1: #8b9cff; --a2: #5eead4; --a3: #fbbf77; --a4: #f9a8d4; --a5: #c4b5fd;
  --warn: #fbbf24; --crit: #fb7185;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: "Sora", system-ui, sans-serif; --font-display: var(--font); --radius: 22px; --radius-sm: 12px;
}

/* Synthwave: 1986 at midnight, neon sun and a grid to the horizon */
:root[data-theme="synthwave"] {
  color-scheme: dark;
  --page: #120a24; --side: #150c2b; --card: #1b1033; --card-2: #24163f;
  --ink: #fbeaff; --ink-2: #d2b8ec; --muted: #9a7fbf; --grid: #2c1d4a; --axis: #45306b;
  --ring: rgba(255, 79, 216, 0.22); --wash: rgba(255, 79, 216, 0.07);
  --pos: #0fa6c4; --neg: #f03c8c;
  --accent: #ff4fd8; --accent-ink: #1a0626; --hero: #22123e; --hero-2: #2c1850;
  --a1: #ff4fd8; --a2: #22e5ff; --a3: #ffd23f; --a4: #ff8a3d; --a5: #9d7bff;
  --warn: #ffd23f; --crit: #ff3b6b;
  --shadow: 0 0 0 1px rgba(255, 79, 216, 0.08), 0 16px 40px -18px rgba(255, 79, 216, 0.35);
  --font: "Space Grotesk", system-ui, sans-serif; --font-display: "Orbitron", "Space Grotesk", sans-serif; --radius: 6px; --radius-sm: 4px;
}

/* Broadsheet: the morning paper, column rules and serif ink */
:root[data-theme="broadsheet"] {
  color-scheme: light;
  --page: #f1ece0; --side: #ebe5d6; --card: #f7f3e8; --card-2: #eee8da;
  --ink: #1a1a1a; --ink-2: #3d3a35; --muted: #77716a; --grid: #e2dccd; --axis: #b9b1a0;
  --ring: rgba(26, 26, 26, 0.22); --wash: rgba(26, 26, 26, 0.05);
  --pos: #1f5fa8; --neg: #b8322a;
  --accent: #1a1a1a; --accent-ink: #f7f3e8; --hero: #f7f3e8; --hero-2: #eee8da;
  --a1: #1a1a1a; --a2: #b8322a; --a3: #1f5fa8; --a4: #7a6a4f; --a5: #4f6b4a;
  --warn: #a86b00; --crit: #b8322a;
  --shadow: none;
  --font: "Newsreader", Georgia, serif; --font-display: "Playfair Display", Georgia, serif; --radius: 0px; --radius-sm: 0px;
}

/* Deep Sea: the abyss at midnight, bioluminescent drift and a jellyfish */
:root[data-theme="deepsea"] {
  color-scheme: dark;
  --page: #020a17; --side: rgba(4, 22, 40, 0.7); --card: rgba(6, 28, 50, 0.55); --card-2: rgba(10, 40, 68, 0.6);
  --solid: #08223d;
  --ink: #e4fbff; --ink-2: #a8d8e8; --muted: #6a9db3; --grid: rgba(120, 220, 255, 0.09); --axis: rgba(120, 220, 255, 0.18);
  --ring: rgba(94, 234, 255, 0.18); --wash: rgba(94, 234, 255, 0.06);
  --pos: #2cc4f0; --neg: #ff6f91;
  --accent: #5ef2d6; --accent-ink: #021a1a; --hero: rgba(10, 44, 74, 0.85); --hero-2: rgba(14, 56, 92, 0.85);
  --a1: #5ef2d6; --a2: #b48cff; --a3: #ffd36e; --a4: #ff8ad8; --a5: #7cc8ff;
  --warn: #ffd36e; --crit: #ff5c7a;
  --shadow: 0 0 0 1px rgba(94, 234, 255, 0.06), 0 18px 44px -20px rgba(0, 200, 255, 0.35);
  --font: "Lexend", system-ui, sans-serif; --font-display: "Righteous", "Lexend", sans-serif; --radius: 18px; --radius-sm: 10px;
}

/* Blueprint: an engineering drawing, white linework on cyanotype blue */
:root[data-theme="blueprint"] {
  color-scheme: dark;
  --page: #0d3a72; --side: #0b3366; --card: rgba(255, 255, 255, 0.045); --card-2: rgba(255, 255, 255, 0.08);
  --solid: #124682;
  --ink: #f2f8ff; --ink-2: #c4daf5; --muted: #8fb1da; --grid: rgba(255, 255, 255, 0.12); --axis: rgba(255, 255, 255, 0.3);
  --ring: rgba(242, 248, 255, 0.55); --wash: rgba(255, 255, 255, 0.07);
  --pos: #6fe3ff; --neg: #ffa07a;
  --accent: #fff27a; --accent-ink: #0d3a72; --hero: rgba(255, 255, 255, 0.06); --hero-2: rgba(255, 255, 255, 0.1);
  --a1: #fff27a; --a2: #6fe3ff; --a3: #ffffff; --a4: #ffa07a; --a5: #b8f28a;
  --warn: #fff27a; --crit: #ff8f8f;
  --shadow: none;
  --font: "IBM Plex Mono", ui-monospace, monospace; --font-display: "Architects Daughter", "Comic Sans MS", cursive; --radius: 2px; --radius-sm: 2px; --border-w: 1.5px;
}

/* Notebook: ballpoint on ruled paper, doodles in the margins */
:root[data-theme="notebook"] {
  color-scheme: light;
  --page: #fbf8ee; --side: #f4efe0; --card: #fffefa; --card-2: #faf6ea;
  --ink: #233457; --ink-2: #3f5079; --muted: #7d88a0; --grid: #e7e3d6; --axis: #c9c3b0;
  --ring: #233457; --wash: rgba(35, 52, 87, 0.05);
  --pos: #1f6fd1; --neg: #d6383a;
  --accent: #233457; --accent-ink: #fffefa; --hero: #fffefa; --hero-2: #faf6ea;
  --a1: #f2c230; --a2: #d6383a; --a3: #1f6fd1; --a4: #2f9e5b; --a5: #9b59b6;
  --warn: #b77a00; --crit: #d6383a;
  --shadow: 3px 4px 0 rgba(35, 52, 87, 0.22);
  --font: "Patrick Hand", "Comic Sans MS", cursive; --font-display: "Caveat", "Patrick Hand", cursive; --radius: 6px; --radius-sm: 4px; --border-w: 2px;
}

/* Comic Book: halftone dots, ink outlines, POW! */
:root[data-theme="comic"] {
  color-scheme: light;
  --page: #fff3c4; --side: #fffaf0; --card: #ffffff; --card-2: #fff8e1;
  --ink: #111111; --ink-2: #2c2c2c; --muted: #5f5a4e; --grid: #f1e6c4; --axis: #111111;
  --ring: #111111; --wash: rgba(17, 17, 17, 0.06);
  --pos: #1462ff; --neg: #ff2424;
  --accent: #ffd400; --accent-ink: #111111; --hero: #ffffff; --hero-2: #fff8e1;
  --a1: #ffd400; --a2: #ff2424; --a3: #1462ff; --a4: #00b85c; --a5: #ff7ac8;
  --warn: #c98200; --crit: #ff2424;
  --shadow: 5px 5px 0 #111111;
  --font: "Comic Neue", "Comic Sans MS", cursive; --font-display: "Bangers", Impact, sans-serif; --radius: 4px; --radius-sm: 3px; --border-w: 3px;
}

/* Groovy: 1973, a sunburst in mustard, rust and avocado */
:root[data-theme="groovy"] {
  color-scheme: light;
  --page: #f4dfae; --side: #edd39c; --card: #fff3d6; --card-2: #fbe8c0;
  --ink: #4a230b; --ink-2: #6e3d1c; --muted: #9a6e48; --grid: #f0d9a9; --axis: #c9a172;
  --ring: #6e3d1c; --wash: rgba(110, 61, 28, 0.07);
  --pos: #1d7387; --neg: #cc3d1f;
  --accent: #e8742c; --accent-ink: #fff3d6; --hero: #fff3d6; --hero-2: #fbe8c0;
  --a1: #e8742c; --a2: #d9a521; --a3: #7b8f2e; --a4: #b8432b; --a5: #1d7387;
  --warn: #b5790b; --crit: #cc3d1f;
  --shadow: 0 6px 0 rgba(110, 61, 28, 0.18);
  --font: "Fredoka", ui-rounded, system-ui, sans-serif; --font-display: "Shrikhand", Georgia, serif; --radius: 30px; --radius-sm: 16px; --border-w: 3px;
}

/* Beige Box: a 90s desktop, bevelled grey windows on teal */
:root[data-theme="beige"] {
  color-scheme: light;
  --page: #008080; --side: #c0c0c0; --card: #c0c0c0; --card-2: #d4d0c8;
  --ink: #000000; --ink-2: #1f1f1f; --muted: #4a4a4a; --grid: #a8a8a8; --axis: #6f6f6f;
  --ring: #808080; --wash: rgba(0, 0, 0, 0.06);
  --pos: #0047c8; --neg: #c8102e;
  --accent: #000080; --accent-ink: #ffffff; --hero: #c0c0c0; --hero-2: #d4d0c8;
  --a1: #000080; --a2: #800080; --a3: #008000; --a4: #808000; --a5: #c8102e;
  --warn: #806000; --crit: #c8102e;
  --shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080, inset 2px 2px 0 #dfdfdf, inset -2px -2px 0 #404040;
  --font: Tahoma, Verdana, "Segoe UI", sans-serif; --font-display: "Silkscreen", Tahoma, sans-serif; --radius: 0px; --radius-sm: 0px; --border-w: 0px;
}

/* Waves: a quiet shore at dawn, slow swells along the bottom of the screen */
:root[data-theme="waves"] {
  color-scheme: light;
  --page: #eef4f2; --side: rgba(250, 253, 252, 0.55); --card: rgba(252, 254, 253, 0.6); --card-2: rgba(243, 249, 247, 0.72);
  --ink: #213d47; --ink-2: #4a6670; --muted: #82999f; --grid: #e2ece9; --axis: #c8d8d4;
  --ring: rgba(33, 61, 71, 0.1); --wash: rgba(58, 154, 154, 0.06);
  --pos: #2a7db6; --neg: #cf5f4f;
  --accent: #3a9a9a; --accent-ink: #ffffff; --hero: rgba(252, 254, 253, 0.85); --hero-2: rgba(243, 249, 247, 0.9);
  --a1: #3a9a9a; --a2: #8fb7c8; --a3: #d9b57d; --a4: #c99595; --a5: #86b59c;
  --warn: #b98a3c; --crit: #cf5f4f;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 14px 34px -22px rgba(33, 61, 71, 0.35);
  --font: "Nunito", ui-rounded, system-ui, sans-serif; --font-display: "Shippori Mincho", Georgia, serif; --radius: 18px; --radius-sm: 11px;
}

/* Void: ultra minimal tech. Near-black, hairlines, white ink, one blue, monospace headings */
:root[data-theme="void"] {
  color-scheme: dark;
  --page: #0a0b0e; --side: #0c0d11; --card: #111216; --card-2: #16181d;
  --ink: #f2f3f5; --ink-2: #a9adb6; --muted: #6c717b; --grid: #1b1d23; --axis: #2a2d35;
  --ring: rgba(255, 255, 255, 0.085); --wash: rgba(255, 255, 255, 0.04);
  --pos: #1a9dd0; --neg: #ef4b67;
  --accent: #f2f3f5; --accent-ink: #0a0b0e; --hero: #121318; --hero-2: #191b21;
  --a1: #1a9dd0; --a2: #9aa0aa; --a3: #d4d6db; --a4: #7c838f; --a5: #1a9dd0;
  --warn: #e3b25a; --crit: #ef5350;
  --shadow: none;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --font-display: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; --radius: 4px; --radius-sm: 3px;
}

/* Gallery: abstract digital. Pure white, a drifting node network, grey ink, spaced capitals, circuit traces */
:root[data-theme="gallery"] {
  color-scheme: light;
  --page: #fcfcfc; --side: rgba(255, 255, 255, 0.78); --card: rgba(255, 255, 255, 0.86); --card-2: #f5f5f5;
  --ink: #2a2a2a; --ink-2: #555555; --muted: #8e8e8e; --grid: #ededed; --axis: #d4d4d4;
  --ring: rgba(0, 0, 0, 0.1); --wash: rgba(0, 0, 0, 0.035);
  --pos: #1f5fa8; --neg: #c8402c;
  --accent: #4a4a4a; --accent-ink: #ffffff; --hero: #ffffff; --hero-2: #f5f5f5;
  --a1: #4a4a4a; --a2: #7a7a7a; --a3: #a3a3a3; --a4: #5e5e5e; --a5: #8e8e8e;
  --warn: #a8690f; --crit: #c8402c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 14px 34px -24px rgba(0, 0, 0, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --font-display: "Archivo", "Inter", system-ui, sans-serif; --radius: 2px; --radius-sm: 2px;
}

/* Void Light: Void in chrome and graphite on white. Shares Void's effects ([data-void]) */
:root[data-theme="lumen"] {
  color-scheme: light;
  --page: #f3f4f6; --side: #eceef1; --card: #fbfbfc; --card-2: #f1f2f4;
  --ink: #0c0d10; --ink-2: #4a4e57; --muted: #858a94; --grid: #e4e6ea; --axis: #cdd0d6;
  --ring: rgba(12, 13, 16, 0.1); --wash: rgba(12, 13, 16, 0.04);
  --pos: #1677a6; --neg: #d23a55;
  --accent: #16181d; --accent-ink: #ffffff; --hero: #fbfbfc; --hero-2: #f1f2f4;
  --a1: #1677a6; --a2: #6b707a; --a3: #2a2d33; --a4: #9aa0aa; --a5: #1677a6;
  --warn: #b0730f; --crit: #d23a55;
  --shadow: none;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --font-display: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; --radius: 4px; --radius-sm: 3px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--ink); background: color-mix(in srgb, var(--neg) 16%, transparent); border-left: 3px solid var(--neg); padding: 6px 10px; border-radius: 6px; }
code { font-size: .92em; background: var(--wash); padding: 1px 5px; border-radius: 4px; }
svg { flex: none; }

/* ---- app shell ---- */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; background: var(--side); border-right: 1px solid var(--ring); overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; padding: 0 6px; }
.logo b { font-weight: 800; color: var(--accent); }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px -8px color-mix(in srgb, var(--a1) 70%, transparent); }
.lg-beam { fill: #fb923c; } .lg-beam2 { fill: #fdba74; }
.lg-wick-up, .lg-wick-dn { stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: .85; }
.lg-up { fill: #22d3ee; } .lg-dn { fill: #fb7185; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.nav button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.nav button:hover { background: var(--wash); color: var(--ink); }
.nav button[aria-current="page"] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); font-weight: 550; }
.side-section { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.side-text { margin: 0; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }

.main { min-width: 0; padding: 22px 26px 56px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.head p { margin: 2px 0 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
/* the range and trade count, small, under the filters */
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.head .range-text { margin: 0; font-size: 11.5px; text-align: right; }
@media (max-width: 860px) { .head-right { align-items: flex-start; } .filters { justify-content: flex-start; } .head .range-text { text-align: left; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ring); background: var(--card); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13.5px; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.btn:hover { background: var(--card-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: none; }
.btn.block { width: 100%; }
.small-btn { padding: 3px 9px; font-size: 12.5px; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 5px 8px; color: var(--ink-2); border-radius: 6px; }
.icon-btn:hover { background: var(--wash); color: var(--ink); }
select, input[type="date"] { border: 1px solid var(--ring); background: var(--card); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; }
input[type="date"] { color-scheme: inherit; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; background: var(--grid); }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.alert { margin-bottom: 14px; padding: 10px 14px; border-radius: 8px; border-left: 3px solid var(--neg); background: var(--card); cursor: pointer; font-size: 13.5px; }

/* ---- cards & grid ---- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: start; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--ring); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.grid > .card { align-self: stretch; }
.card h2 { font-size: 15px; font-weight: 600; }
.card h3 { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 16px 0 2px; }
.sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.center { text-align: center; }
.kicker { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.center .kicker { justify-content: center; }
.kicker.spaced { margin-top: 14px; }
.big { display: flex; align-items: center; gap: 8px; font-size: 38px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.mark-glyph { font-size: 16px; }
.mark-glyph.pos { color: var(--pos); } .mark-glyph.neg { color: var(--neg); }
.mid-value { font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; white-space: nowrap; }
.small-value { font-size: 17px; font-weight: 600; margin-top: 2px; }
.center .mid-value { margin-top: -18px; }
.info { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--axis); background: none; color: var(--muted); font-size: 10px; line-height: 14px; padding: 0; cursor: help; text-transform: none; }
.setup { max-width: 680px; margin: 48px auto; }
.setup h1 { font-size: 20px; margin-bottom: 12px; }
.setup ol { padding-left: 20px; } .setup li { margin: 6px 0; }
.callout { padding: 10px 14px; border-radius: 8px; background: var(--wash); color: var(--ink-2); }
.callout:empty { display: none; }

/* gauge, split bar, sparkline */
.gauge-wrap { display: flex; justify-content: center; margin-top: 6px; }
.gauge { fill: none; stroke-linecap: butt; }
.gauge.pos { stroke: var(--pos); } .gauge.neg { stroke: var(--neg); } .gauge.mid { stroke: var(--muted); } .gauge.muted { stroke: var(--grid); }
.split { display: flex; gap: 2px; height: 12px; margin: 14px 0 10px; }
.split i { display: block; min-width: 4px; }
.split i.pos { background: var(--pos); border-radius: 6px 0 0 6px; }
.split i.neg { background: var(--neg); border-radius: 0 6px 6px 0; }
.split-legend { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.split-legend b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.key.pos { background: var(--pos); } .key.neg { background: var(--neg); }
.spark { margin-top: 10px; height: 40px; }

/* streaks */
.streak-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.streak-table th, .streak-table td { padding: 7px 0; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
.streak-table thead th { font-weight: 500; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 0; }
.streak-table tbody th { text-align: left; font-weight: 400; color: var(--ink-2); }
.streak-table td { font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 12px; }
.streak-table tr:last-child th, .streak-table tr:last-child td { border-bottom: 0; }
.streak-table .glyph { font-size: 10px; margin-right: 5px; vertical-align: 1px; }
.streak-table .glyph.pos { color: var(--pos); } .streak-table .glyph.neg { color: var(--neg); }
.streak-note { margin: 6px 0 0; }
.equity-note { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--grid); }

/* radar */
.radar-ring { fill: none; stroke: var(--grid); stroke-width: 1; }
.radar-shape { fill: color-mix(in srgb, var(--pos) 22%, transparent); stroke: var(--pos); stroke-width: 2; stroke-linejoin: round; }
.radar-score { fill: var(--ink); font-size: 26px; font-weight: 650; paint-order: stroke; stroke: var(--card); stroke-width: 6px; stroke-linejoin: round; }

/* ---- calendar ---- */
.calendar-card { display: flex; flex-direction: column; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav h2 { font-size: 17px; min-width: 150px; text-align: center; }
.cal-stats { display: flex; gap: 2px; margin: 0; background: var(--card-2); border: 1px solid var(--ring); border-radius: 10px; padding: 6px 4px; }
.cal-stats div { padding: 0 12px; text-align: center; }
.cal-stats div + div { border-left: 1px solid var(--ring); }
.cal-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); gap: 6px; }
.cal-dow { font-size: 11.5px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.cal-day { position: relative; min-height: 74px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--ring); padding: 7px 8px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; cursor: default; }
button.cal-day { cursor: pointer; }
button.cal-day:hover, button.cal-day:focus-visible { outline: 1px solid var(--axis); outline-offset: 0; }
.cal-day.out { opacity: .35; }
.cal-day.today .cal-date { color: var(--ink); font-weight: 700; }
.cal-day.today::after { content: ''; position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); }
.cal-date { font-size: 12px; color: var(--muted); }
.cal-pnl { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-n { font-size: 11.5px; color: var(--muted); }
.cal-pnl.short { display: none; }
.cal-day.pos, .cal-day.neg { border-top-width: 3px; }
.cal-day.pos { background: color-mix(in srgb, var(--pos) var(--tint, 14%), var(--card-2)); border-top-color: var(--pos); }
.cal-day.neg { background: color-mix(in srgb, var(--neg) var(--tint, 14%), var(--card-2)); border-top-color: var(--neg); }
.cal-day.week { background: var(--card); border-style: dashed; }
.cal-day.week.pos, .cal-day.week.neg { border-style: solid; }
.cal-day.week .cal-date { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }

/* ---- heatmap & hour strip ---- */
.heatmap { display: grid; grid-template-columns: 30px 1fr; gap: 4px 6px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.heat-months { display: grid; gap: 3px; }
.heat-rows { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat-dows { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; align-items: center; }
.heat-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat-grid i { aspect-ratio: 1; border-radius: 3px; display: block; min-width: 0; }
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.heat-legend span { margin: 0 3px; }
.heat-none { background: var(--wash); }
.heat-zero { background: var(--axis); }
.heat-pos-1 { background: color-mix(in srgb, var(--pos) 30%, var(--card)); }
.heat-pos-2 { background: color-mix(in srgb, var(--pos) 52%, var(--card)); }
.heat-pos-3 { background: color-mix(in srgb, var(--pos) 76%, var(--card)); }
.heat-pos-4 { background: var(--pos); }
.heat-neg-1 { background: color-mix(in srgb, var(--neg) 30%, var(--card)); }
.heat-neg-2 { background: color-mix(in srgb, var(--neg) 52%, var(--card)); }
.heat-neg-3 { background: color-mix(in srgb, var(--neg) 76%, var(--card)); }
.heat-neg-4 { background: var(--neg); }
.hour-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 22px; margin-top: 16px; }
.hour-strip i { display: block; border-radius: 3px; }
.hour-strip i:first-child { border-radius: 6px 3px 3px 6px; } .hour-strip i:last-child { border-radius: 3px 6px 6px 3px; }
.hour-strip i.best { outline: 2px solid var(--ink); outline-offset: 1px; }
.hour-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 5px; }

/* key-value lists */
.kv { margin: 8px 0 0; display: grid; grid-template-columns: 1fr auto; }
.kv dt, .kv dd { padding: 7px 0; border-bottom: 1px solid var(--grid); margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dd small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.insights { margin: 8px 0 0; padding-left: 16px; }
.insights li { margin: 6px 0; color: var(--ink-2); }

/* ---- charts ---- */
.chart { margin-top: 10px; width: 100%; min-height: 30px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .label { fill: var(--ink-2); font-size: 12px; }
.chart .value { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.pos { stroke: var(--pos); } .line.neg { stroke: var(--neg); }
.area.pos { fill: var(--pos); opacity: .12; } .area.neg { fill: var(--neg); opacity: .12; }
.dot { stroke: var(--card); stroke-width: 2; }
.dot.pos { fill: var(--pos); } .dot.neg { fill: var(--neg); }
.chart .hair { stroke: var(--axis); stroke-width: 1; }
.chart .bar.pos { fill: var(--pos); } .chart .bar.neg { fill: var(--neg); }
.chart .mark { outline: none; cursor: default; }
.chart .mark:hover .bar, .chart .mark:focus-visible .bar { filter: brightness(1.18); }
.chart .mark:focus-visible rect { fill: var(--wash); }
.empty { color: var(--muted); font-size: 13.5px; margin: 14px 0; }
#report.refreshing .grid { opacity: .55; transition: opacity .2s; }

.tip { position: absolute; z-index: 40; pointer-events: none; background: var(--card-2); border: 1px solid var(--ring); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); padding: 8px 10px; font-size: 12.5px; min-width: 120px; max-width: 280px; }
.tip-title { color: var(--muted); margin-bottom: 4px; }
/* the app-wide hover tooltip (tips.js): a popover, so it sits above dialogs; plain text, line breaks kept */
.tip.tip-text[popover] { position: fixed; inset: auto; margin: 0; color: var(--ink-2, var(--ink)); white-space: normal; line-height: 1.45; max-width: 360px; min-width: 0; overflow: visible; padding: 9px 11px; }
.tip.tip-text:popover-open { animation: tipIn .08s ease-out; }
@keyframes tipIn { from { opacity: 0; } to { opacity: 1; } }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-row span { color: var(--ink-2); }
.tip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--muted); flex: 0 0 12px; }
.tip-key.pos, .tip-key.line { background: var(--pos); } .tip-key.neg { background: var(--neg); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
table.data thead th { font-weight: 500; color: var(--muted); border-bottom-color: var(--axis); font-size: 12px; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--wash); }
table.data tr.liq td:nth-child(2) { font-weight: 600; }
table.compact { margin-top: 10px; }
table.compact tbody th { font-weight: 400; color: var(--ink-2); }
.sort { border: 0; background: none; padding: 0; cursor: pointer; font-weight: inherit; color: inherit; }
.sort:hover { color: var(--ink); }
.arrow { color: var(--muted); }
td .pill { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
td .pill.pos { background: var(--pos); } td .pill.neg { background: var(--neg); }
.more { margin-top: 12px; }
.footnote { margin-top: 22px; font-size: 12px; color: var(--muted); max-width: 860px; }

/* ---- dialogs ---- */
.dlg { border: 1px solid var(--ring); border-radius: 14px; background: var(--card); color: var(--ink); padding: 20px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.dlg.wide { width: min(980px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(3, 6, 12, .6); backdrop-filter: blur(2px); }
.dlg h2 { font-size: 17px; margin-bottom: 10px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; }
.presets { display: flex; flex-direction: column; margin: 0 -8px 12px; }
.presets button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 8px; border-radius: 8px; cursor: pointer; }
.presets button:hover { background: var(--wash); }
.presets button .check { width: 16px; font-weight: 800; color: var(--ink); }
.custom { border-top: 1px solid var(--ring); padding-top: 12px; }
.dates { display: flex; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 150px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.quick button { border: 1px solid var(--ring); background: var(--card-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.quick button:hover { background: var(--wash); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1240px) {
  .c2 { grid-column: span 4; } .c3 { grid-column: span 6; } .c4 { grid-column: span 6; }
  .c8, .stack.c4 { grid-column: span 12; }
  .stack.c4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c6 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ring); }
  .nav { flex-direction: row; }
  .side-section { flex-direction: row; align-items: center; padding: 0; flex-wrap: wrap; }
  .side-label, #coverage { display: none; }
  .btn.block { width: auto; }
  .side-foot { margin-top: 0; margin-left: auto; }
  .main { padding: 16px 16px 48px; }
  .c2, .c3, .c4 { grid-column: span 6; }
  .stack.c4 { grid-template-columns: 1fr; }
  .calendar { gap: 3px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day { min-height: 54px; padding: 5px; border-radius: 7px; }
  .cal-day.week, .cal-dow.week { display: none; }
  .cal-pnl { display: none; }
  .cal-pnl.short { display: block; font-size: 11.5px; overflow: visible; }
  .cal-n { display: none; }
  .cal-stats div { padding: 0 8px; }
  .big { font-size: 32px; }
}
@media (max-width: 520px) {
  .c2, .c3, .c4 { grid-column: span 12; }
  .center .mid-value { margin-top: -14px; }
}

/* ================= motion & glow =================
   Everything here is decoration: it never carries meaning on its own, and
   prefers-reduced-motion turns all of it off (see the end of this file). */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }


/* cards: rise in once, lift a touch on hover */
.intro .grid > .card, .intro .stack > .card, .intro .head { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card { transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 22%, var(--ring)); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent), 0 10px 40px -12px color-mix(in srgb, var(--accent) 28%, transparent); }

.mark-glyph { filter: drop-shadow(0 0 6px currentColor); }

/* nav: the current view gets a soft accent edge */
.nav button[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent), 0 0 18px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn.primary { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 6px 22px -8px var(--accent); }

/* lines draw in and glow faintly; areas fade up */
.line.glow.pos { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--pos) 55%, transparent)); }
.line.glow.neg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--neg) 55%, transparent)); }
.line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fade-in { animation: fade .9s ease .35s both; }
@keyframes fade { from { opacity: 0; } }
.pop-late { animation: pop .4s var(--ease) 1.1s both; }
@keyframes pop { from { opacity: 0; transform: scale(.2); } }
.dot { transform-box: fill-box; transform-origin: center; }
/* the latest point breathes */
.pulse-ring { fill: none; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out 1.4s infinite; opacity: 0; }
.pulse-ring.pos { stroke: var(--pos); } .pulse-ring.neg { stroke: var(--neg); }
@keyframes ring { 0% { opacity: .7; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(3.2); } }

/* bars grow from the baseline (origin set inline) */
.grow-y { transform-box: view-box; animation: growY .65s var(--ease) both; }
.grow-x { transform-box: view-box; animation: growX .65s var(--ease) both; }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes growX { from { transform: scaleX(0); } }

/* gauge sweeps, radar opens out */
.gauge.sweep { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s var(--ease) .1s forwards; }
.gauge.pos { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pos) 45%, transparent)); }
.gauge.neg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--neg) 40%, transparent)); }
.bloom { animation: bloom .8s var(--ease) .15s both; }
@keyframes bloom { from { opacity: 0; transform: scale(.15); } }
.radar-shape { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--pos) 40%, transparent)); }
.split i { transform-origin: left; animation: growX .7s var(--ease) both; }
.split i.neg { transform-origin: right; animation-delay: .1s; }

/* calendar: cells settle in when the month changes; colored days glow on hover */
.cal-in .cal-day:not(.week) { animation: rise .45s var(--ease) both; animation-delay: calc(var(--d, 0) * 12ms); }
.cal-day.pos:hover, .cal-day.neg:hover { box-shadow: 0 0 22px -6px var(--edge); }
.cal-day.pos { --edge: var(--pos); } .cal-day.neg { --edge: var(--neg); }
button.cal-day { transition: transform .2s var(--ease), box-shadow .2s; }
button.cal-day:hover { transform: translateY(-2px); }

/* the best day of the month: a star beside the date, nothing else */
.best-star { color: var(--pos); font-size: 12px; line-height: 1; }

/* heatmap & hour strip: colored cells glow on hover */
.heat-grid i, .hour-strip i { transition: transform .15s var(--ease), box-shadow .15s; }
.heat-grid i[class*="heat-pos"]:hover, .hour-strip i[class*="heat-pos"]:hover { transform: scale(1.35); box-shadow: 0 0 10px var(--pos); position: relative; z-index: 1; }
.heat-grid i[class*="heat-neg"]:hover, .hour-strip i[class*="heat-neg"]:hover { transform: scale(1.35); box-shadow: 0 0 10px var(--neg); position: relative; z-index: 1; }
.hour-strip i.best { box-shadow: 0 0 14px -1px var(--pos); }

/* dialogs ease in */
.dlg[open] { animation: dlgIn .28s var(--ease); }
.dlg[open]::backdrop { animation: fade .28s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.progress > div { box-shadow: 0 0 12px var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .line.draw, .gauge.sweep { stroke-dashoffset: 0; }
}


/* ---- compact stat row ---- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 12px 14px; }
.stat.col { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.stat-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stat .kicker { white-space: nowrap; letter-spacing: .04em; font-size: 11px; }
.stat-value { display: flex; align-items: center; gap: 5px; font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; }
.stat .muted.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.stat-viz { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.spark-viz { width: 72px; height: 40px; }
.stat .split { margin: 2px 0 0; height: 8px; }
.stat .split-legend { flex-direction: row; justify-content: space-between; gap: 8px; font-size: 11.5px; white-space: nowrap; }
.chip { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); background: var(--wash); border-radius: 999px; padding: 0 7px; line-height: 16px; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 4px; }
.chips .chip.pos { background: color-mix(in srgb, var(--pos) 22%, transparent); color: var(--ink); }
.chips .chip.neg { background: color-mix(in srgb, var(--neg) 22%, transparent); color: var(--ink); }
.chips .chip.mid { background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--ink); }
.info { width: 15px; height: 15px; line-height: 13px; font-size: 9.5px; font-weight: 700; }
.kicker .chip { margin-left: 2px; }
@keyframes ringIn { from { stroke-dasharray: 0 var(--C); } }

/* score */
.score-foot { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--grid); padding-top: 12px; margin-top: 4px; }
.score-value { font-size: 28px; font-weight: 650; line-height: 1.1; }
.score-meter { flex: 1; }
.meter-track { position: relative; height: 8px; border-radius: 4px; background: var(--grid); }
.meter-fill { height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; animation: growX .9s var(--ease) both; }
.meter-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); animation: fade .5s ease .7s both; }
.meter-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* scatter */
.dot.hot { r: 6; stroke-width: 2.5; }
.pop-in { animation: pop .45s var(--ease) both; }

@media (max-width: 1240px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .streak-table th, .streak-table td { white-space: normal; font-size: 12.5px; }
  .streak-table td { padding-left: 8px; }
}


/* ================= Perp Dojo color ================= */
/* every card can carry an accent: a top edge and a dot before its title */
.card { --a: var(--accent); }
#view-analytics > .card, #view-trades > .card { box-shadow: var(--shadow), inset 0 3px 0 color-mix(in srgb, var(--a) 85%, transparent); }
#view-analytics > .card:nth-child(5n+1) { --a: var(--a1); } #view-analytics > .card:nth-child(5n+2) { --a: var(--a2); }
#view-analytics > .card:nth-child(5n+3) { --a: var(--a3); } #view-analytics > .card:nth-child(5n+4) { --a: var(--a4); }
#view-analytics > .card:nth-child(5n) { --a: var(--a5); } #view-trades > .card { --a: var(--a2); }
.card.accented, .stat { box-shadow: var(--shadow), inset 0 3px 0 color-mix(in srgb, var(--a) 85%, transparent); }
.card.accented > .kicker::before, .card.accented > .card-row > .kicker::before, .stat .kicker::before {
  content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--a); flex: none; box-shadow: 0 0 8px color-mix(in srgb, var(--a) 60%, transparent); }
.card.accented:hover, .stat:hover { border-color: color-mix(in srgb, var(--a) 35%, var(--ring)); box-shadow: var(--shadow), inset 0 3px 0 var(--a), 0 14px 38px -16px color-mix(in srgb, var(--a) 55%, transparent); }

/* the headline tile: solid violet */
.stat.hero { --a: var(--a1); background: var(--hero); border-color: color-mix(in srgb, var(--a1) 35%, transparent); color: #fff;
  box-shadow: var(--shadow), inset 0 3px 0 var(--a1); }
.stat.hero:hover { border-color: color-mix(in srgb, var(--a1) 55%, transparent); box-shadow: inset 0 3px 0 var(--a1), 0 18px 42px -16px color-mix(in srgb, var(--a1) 80%, transparent); }
.stat.hero .kicker, .stat.hero .muted { color: rgba(255, 255, 255, .72); }
.stat.hero .kicker::before { background: var(--a1); }
.stat.hero .info { border-color: rgba(255, 255, 255, .45); color: #fff; }
.stat.hero .mark-glyph { color: #fff !important; filter: none; }
.line.hero { stroke: var(--a1); } .area.hero { fill: var(--a1); opacity: .18; }
.line.glow.hero { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--a1) 70%, transparent)); }

/* single-series lines (cumulative P&L) wear the accent */
.line.accent { stroke: var(--accent); } .area.accent { fill: var(--accent); opacity: .13; }
.dot.accent { fill: var(--accent); } .pulse-ring.accent { stroke: var(--accent); }
.line.glow.accent { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 60%, transparent)); }
.tip-key.line, .tip-key.accent { background: var(--accent); }
.cum-card .chart { margin-top: 6px; }

/* chips and meter pick up the palette */
.meter-fill { background: var(--a, var(--accent)); }
.meter-dot { background: var(--a, var(--accent)); }
.nav button[aria-current="page"] { background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
:root[data-mode="light"] .side { border-right-color: rgba(91, 33, 182, .12); }

/* radar wears its card's accent; it shows a score, not gains or losses */
.radar-shape { fill: color-mix(in srgb, var(--a, var(--accent)) 24%, transparent); stroke: var(--a, var(--accent)); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--a, var(--accent)) 45%, transparent)); }
.radar-dot { fill: var(--a, var(--accent)); }

/* calendar: short, wide cells (date and trade count on top, P&L beneath) */
.calendar { grid-template-rows: auto; grid-auto-rows: 56px; gap: 5px; }
.cal-day { min-height: 0; padding: 6px 9px; justify-content: space-between; border-radius: 9px; }
.cal-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.cal-dl { display: inline-flex; align-items: center; gap: 4px; }
.cal-top .cal-n { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-day.week .cal-pnl { font-size: 14px; }
.cal-pnl { font-size: 15px; line-height: 1.1; }
.cal-day.pos, .cal-day.neg { border-top-width: 2px; }
@media (max-width: 860px) { .calendar { grid-auto-rows: 48px; } .cal-top .cal-n { display: none; } }

/* neon charts: rounded arcs on a dark track, a soft halo under signed lines */
.gauge { stroke-linecap: round; }
.gauge.track { stroke: var(--grid); }
.gauge.pos { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--pos) 65%, transparent)); }
.gauge.neg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--neg) 60%, transparent)); }
.line-halo { stroke-width: 7; opacity: .35; filter: blur(5px); }
.area-signed { opacity: 1; }
.stem { stroke-width: 2.5; stroke-linecap: round; transform-box: view-box; }
.stem.pos { stroke: color-mix(in srgb, var(--pos) 70%, transparent); } .stem.neg { stroke: color-mix(in srgb, var(--neg) 70%, transparent); }
.lolli { stroke: var(--card); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.lolli.pos { fill: var(--pos); filter: drop-shadow(0 0 6px var(--pos)); } .lolli.neg { fill: var(--neg); filter: drop-shadow(0 0 6px var(--neg)); }
.lolli.zero { fill: var(--axis); }

/* LED meter */
.leds { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.leds i { height: 12px; border-radius: 3px; background: var(--grid); display: block; }
.leds i.on { background: var(--a, var(--accent)); box-shadow: 0 0 8px color-mix(in srgb, var(--a, var(--accent)) 70%, transparent); animation: fade .4s ease both; }
.meter-ticks { margin-top: 6px; }

/* strongest heat cells glow */
.heat-pos-4 { box-shadow: 0 0 8px color-mix(in srgb, var(--pos) 70%, transparent); }
.heat-neg-4 { box-shadow: 0 0 8px color-mix(in srgb, var(--neg) 65%, transparent); }
.heat-card .heat-grid i { border-radius: 4px; }



/* ---- warnings: one thin line under the stats ---- */
.warnings { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; min-height: 32px; padding: 5px 14px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--ring); font-size: 12.5px; }
.warnings.clear { background: transparent; border-style: dashed; }
.warn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; outline: none; cursor: default; }
.warn-icon { display: inline-flex; width: 15px; height: 15px; }
.warn-icon svg { width: 15px; height: 15px; }
.warn.warning .warn-icon { color: var(--warn); }
.warn.critical .warn-icon { color: var(--crit); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--crit) 60%, transparent)); }
.warn-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.warn.warning .warn-label { color: var(--warn); }
.warn.critical .warn-label { color: var(--crit); }
.warn-text { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn + .warn::before, .warn + .warn-more::before { content: ''; width: 1px; height: 14px; background: var(--axis); margin-right: 12px; }
.warn:focus-visible { outline: 1px solid var(--axis); outline-offset: 3px; border-radius: 4px; }
.warn-more { color: var(--muted); display: inline-flex; align-items: center; cursor: default; }
.warn-ok { color: var(--muted); }
@media (max-width: 860px) { .warn + .warn::before, .warn + .warn-more::before { display: none; } .warn-text { white-space: normal; } }

/* light mode: a softer Net P&L tile, pale orange with dark text */
:root[data-mode="light"] .stat.hero { background: color-mix(in srgb, var(--a1) 8%, #ffffff); color: var(--ink);
  border-color: color-mix(in srgb, var(--a1) 30%, transparent); box-shadow: var(--shadow), inset 0 3px 0 var(--a1); }
:root[data-mode="light"] .stat.hero .kicker, :root[data-mode="light"] .stat.hero .muted { color: var(--ink-2); }
:root[data-mode="light"] .stat.hero .info { border-color: var(--axis); color: var(--muted); }
:root[data-mode="light"] .stat.hero .mark-glyph { color: var(--ink) !important; }

/* ================= journal ================= */
.jr-cal-head { margin-bottom: 8px; }
.jr-cal-head h2 { font-size: 15px; min-width: 130px; }
.jr-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.jr-calendar .cal-dow { font-size: 10.5px; }
.jr-day { position: relative; height: 38px; border-radius: 8px; border: 1px solid var(--ring); background: var(--card-2); color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
button.jr-day { cursor: pointer; transition: transform .15s var(--ease), border-color .15s; }
button.jr-day:hover { border-color: var(--axis); transform: translateY(-1px); }
.jr-day.out { opacity: .4; }
.jr-day.pos { background: color-mix(in srgb, var(--pos) var(--tint, 18%), var(--card-2)); color: var(--ink); }
.jr-day.neg { background: color-mix(in srgb, var(--neg) var(--tint, 18%), var(--card-2)); color: var(--ink); }
.jr-day.today { font-weight: 700; color: var(--ink); }
.jr-day.on { outline: 2px solid var(--a1); outline-offset: 1px; box-shadow: 0 0 14px -2px color-mix(in srgb, var(--a1) 70%, transparent); color: var(--ink); font-weight: 700; }
.jr-dot { position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 6px var(--a1); }
.jr-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.jr-legend .jr-dot { position: static; display: inline-block; margin: 0 4px 1px 0; vertical-align: middle; }

.jr-recent { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.jr-recent-item { width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.jr-recent-item:hover { background: var(--wash); }
.jr-recent-item.on { border-color: color-mix(in srgb, var(--a1) 45%, transparent); background: color-mix(in srgb, var(--a1) 8%, transparent); }
.jr-recent-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.jr-recent-head b { font-weight: 600; }
.jr-recent-pnl { font-variant-numeric: tabular-nums; color: var(--muted); }
.jr-recent-pnl.pos, .jr-recent-pnl.neg { color: var(--ink); }
.jr-recent-pnl.pos::before, .jr-recent-pnl.neg::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.jr-recent-pnl.pos::before { background: var(--pos); } .jr-recent-pnl.neg::before { background: var(--neg); }
.jr-recent-text { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.jr-editor { display: flex; flex-direction: column; gap: 12px; }
.jr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.jr-head h2 { font-size: 20px; margin-top: 2px; }
.jr-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.jr-stats { align-self: flex-start; flex-wrap: wrap; }
table.compact-rows th, table.compact-rows td { padding: 6px 8px; }
.jr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jr-field.grow { flex: 1; }
.jr-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
#jrText { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--ring); border-radius: 10px; background: var(--card-2); color: var(--ink);
  padding: 12px 14px; font: inherit; font-size: 14.5px; line-height: 1.6; outline: none; transition: border-color .15s, box-shadow .15s; }
#jrText:focus { border-color: color-mix(in srgb, var(--a1) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 16%, transparent); }
.jr-rating { display: flex; gap: 5px; }
.jr-pip { width: 32px; height: 28px; border-radius: 7px; border: 1px solid var(--ring); background: var(--card-2); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.jr-pip:hover { border-color: var(--axis); color: var(--ink); }
.jr-pip.on { background: var(--a1); border-color: transparent; color: var(--accent-ink); box-shadow: 0 0 12px -2px color-mix(in srgb, var(--a1) 70%, transparent); }
.jr-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 1px solid var(--ring); border-radius: 10px; background: var(--card-2); padding: 5px 8px; min-height: 38px; }
.jr-tags > span { display: contents; }
.jr-tags input { flex: 1; min-width: 140px; border: 0; background: none; outline: none; font: inherit; font-size: 13px; color: var(--ink); padding: 3px 2px; }
.jr-tag { border: 0; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: color-mix(in srgb, var(--a2) 22%, transparent); color: var(--ink); }
.jr-tag:hover { text-decoration: line-through; }
.jr-saved { margin: 0; }
.jr-mark { color: var(--a1); font-size: 11px; line-height: 1; }
@media (max-width: 1240px) { #view-journal .stack.c4 { grid-column: span 12; display: grid; grid-template-columns: 1fr 1fr; } #view-journal .c8 { grid-column: span 12; } }
@media (max-width: 860px) { #view-journal .stack.c4 { grid-template-columns: 1fr; } }

/* stat cards: title and value sit at the top; the visual stays centred on the right */
.stat-text { align-self: start; }

/* the accent dot before a card's title pulses while you hover the card */
@keyframes dotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px color-mix(in srgb, var(--a) 60%, transparent), 0 0 0 0 color-mix(in srgb, var(--a) 55%, transparent); }
  50% { transform: scale(1.25); box-shadow: 0 0 10px color-mix(in srgb, var(--a) 80%, transparent), 0 0 0 5px color-mix(in srgb, var(--a) 0%, transparent); }
}
.card.accented:hover > .kicker::before, .card.accented:hover > .card-row > .kicker::before, .stat:hover .kicker::before,
#view-analytics > .card:hover .kicker::before { animation: dotPulse 1.1s ease-in-out infinite; }

/* server copy controls */
.side-label-gap { margin-top: 10px; }
.side-pair { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.side-pair .btn.block { width: auto; }
.save-btn { position: relative; }
.save-btn.unsaved::after { content: ''; position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 8px var(--a1); }
.pw-input { width: 100%; border: 1px solid var(--ring); background: var(--card-2); border-radius: 8px; padding: 9px 11px; font: inherit; color: var(--ink); margin-top: 6px; }
.pw-input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
@media (max-width: 860px) { .side-label-gap, #serverState { display: none; } }

/* Net P&L: the equity curve fills the card behind the text */
.stat.hero { position: relative; overflow: hidden; isolation: isolate; grid-template-columns: minmax(0, 1fr); min-height: 88px; }
.stat.hero .stat-text { position: relative; z-index: 1; }
.net-bg { position: absolute; left: 0; right: 0; bottom: 0; height: 68%; z-index: 0; pointer-events: none; }
.net-bg svg { display: block; width: 100%; height: 100%; }
.spark-stop { stop-color: var(--a1); }
.spark-line { stroke-width: 2; opacity: .9; }
.spark-fill { opacity: 1; }
/* text stays crisp where the curve runs under it: a soft halo in the card's own color */
.stat.hero .stat-text > * { text-shadow: 0 0 3px var(--hero), 0 0 8px var(--hero), 0 0 14px var(--hero); }
:root[data-mode="light"] .stat.hero .stat-text > * { --halo: color-mix(in srgb, var(--a1) 8%, #ffffff); text-shadow: 0 0 3px var(--halo), 0 0 8px var(--halo), 0 0 14px var(--halo); }

/* show / hide balance */
.eye-btn { display: inline-flex; padding: 4px; margin: -4px -6px 0 0; color: var(--muted); }
.eye-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.eye-btn:hover, .eye-btn[aria-pressed="true"] { color: var(--ink); }

/* ================= playbook ================= */
.pb-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pb-item { width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 9px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.pb-item:hover { background: var(--wash); }
.pb-item.on { border-color: color-mix(in srgb, var(--a4) 45%, transparent); background: color-mix(in srgb, var(--a4) 8%, transparent); }
.pb-item b { font-weight: 600; font-size: 14px; }
.pb-item-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pb-item-text { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-tag.static { cursor: default; font-size: 11px; padding: 1px 7px; }
.jr-tag.static:hover { text-decoration: none; }
.pb-editor { min-height: 420px; }
.pb-empty { max-width: 520px; margin: 40px auto; text-align: center; }
.pb-empty h2 { font-size: 18px; margin-bottom: 8px; }
.pb-form { display: flex; flex-direction: column; gap: 14px; }
.pb-head { display: flex; align-items: center; gap: 10px; }
.pb-name { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--grid); background: none; font: inherit; font-size: 22px; font-weight: 650; color: var(--ink); padding: 4px 0 6px; outline: none; }
.pb-name:focus { border-bottom-color: var(--a4); }
.pb-name::placeholder { color: var(--muted); font-weight: 500; }
.pb-text { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--ring); border-radius: 10px; background: var(--card-2); color: var(--ink);
  padding: 11px 13px; font: inherit; font-size: 14px; line-height: 1.6; outline: none; transition: border-color .15s, box-shadow .15s; }
.pb-text:focus { border-color: color-mix(in srgb, var(--a4) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a4) 15%, transparent); }
.pb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pb-dot.pos { background: var(--pos); } .pb-dot.neg { background: var(--neg); }
.btn.danger:hover { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
@media (max-width: 1240px) { #view-playbook .c4, #view-playbook .c8 { grid-column: span 12; } }
@media (max-width: 860px) { .pb-two { grid-template-columns: 1fr; } }

/* ================= Saturday banner ================= */
.sat-banner { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; padding: 18px 22px; border-radius: 14px;
  background: color-mix(in srgb, var(--crit) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--crit) 55%, transparent);
  box-shadow: inset 4px 0 0 var(--crit), 0 12px 34px -18px color-mix(in srgb, var(--crit) 80%, transparent); }
.sat-banner svg { width: 34px; height: 34px; flex: none; fill: none; stroke: var(--crit); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--crit) 60%, transparent)); }
.sat-banner strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.sat-banner span { display: block; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 860px) { .sat-banner { padding: 14px 16px; } .sat-banner strong { font-size: 17px; } }
#view-playbook > .c4 { align-self: start; }
.sat-banner > div { flex: 1; min-width: 0; }
.sat-banner + .sat-banner { margin-top: -6px; }
.banner-btn { flex: none; border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.banner-btn:hover { background: color-mix(in srgb, var(--crit) 12%, var(--card)); }
@media (max-width: 860px) { .sat-banner { flex-wrap: wrap; } }

/* strategy labels */
.strategy-cell { padding-top: 4px !important; padding-bottom: 4px !important; }
.strategy-select { font: inherit; font-size: 12.5px; padding: 3px 24px 3px 8px; border-radius: 7px; border: 1px solid var(--ring); background-color: var(--card-2); color: var(--muted); max-width: 170px; }
.strategy-select.set { color: var(--ink); border-color: color-mix(in srgb, var(--a4) 45%, transparent); background-color: color-mix(in srgb, var(--a4) 10%, var(--card-2)); }
.strategy-select:disabled { opacity: .6; }
.pb-item-stats { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pb-item-stats.pos::before, .pb-item-stats.neg::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pb-item-stats.pos::before { background: var(--pos); } .pb-item-stats.neg::before { background: var(--neg); }
/* the trades table carries 12 columns: tighter cells so it fits the card */
#tradeTable th, #tradeTable td, #jrTrades th, #jrTrades td { padding-left: 7px; padding-right: 7px; }

/* ================= entry wizard ================= */
.c5 { grid-column: span 5; } .c7 { grid-column: span 7; }
.wz-title { font-size: 20px; margin: 4px 0 14px; }
.wz-checks { display: flex; flex-direction: column; gap: 10px; }
.wz-check { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--ring);
  background: var(--card-2); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.wz-check:hover { border-color: var(--axis); }
.wz-check input { position: absolute; opacity: 0; pointer-events: none; }
.wz-box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--axis); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.wz-box::after { content: ''; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .15s var(--ease); }
.wz-check input:checked ~ .wz-box { background: var(--a2); border-color: var(--a2); box-shadow: 0 0 12px -2px color-mix(in srgb, var(--a2) 70%, transparent); }
.wz-check input:checked ~ .wz-box::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.wz-check:has(input:checked) { border-color: color-mix(in srgb, var(--a2) 55%, transparent); background: color-mix(in srgb, var(--a2) 9%, var(--card-2)); }
.wz-check input:focus-visible ~ .wz-box { outline: 2px solid var(--a2); outline-offset: 2px; }
.wz-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wz-text b { font-size: 16px; font-weight: 600; }
.wz-text small { color: var(--muted); font-size: 12.5px; }
.wz-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--ring); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.wz-tag.plus { color: var(--ink); text-transform: none; font-size: 12px; }
.wz-check.required .wz-tag { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }

.wz-result { display: flex; flex-direction: column; gap: 4px; align-self: stretch; transition: border-color .25s, box-shadow .25s; }
.wz-verdict { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 10px; }
.wz-amount { font-size: 54px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wz-pct { color: var(--ink-2); font-size: 15px; }
.wz-result.go { border-color: color-mix(in srgb, var(--pos) 50%, transparent); box-shadow: var(--shadow), inset 0 3px 0 var(--pos); }
.wz-result.go .wz-verdict { color: var(--pos); }
.wz-result.go.plus { box-shadow: var(--shadow), inset 0 3px 0 var(--pos), 0 14px 40px -20px color-mix(in srgb, var(--pos) 80%, transparent); }
.wz-result.no { border-color: color-mix(in srgb, var(--crit) 55%, transparent); background: color-mix(in srgb, var(--crit) 8%, var(--card)); box-shadow: var(--shadow), inset 0 3px 0 var(--crit); }
.wz-result.no .wz-verdict { color: var(--crit); font-size: 22px; letter-spacing: .04em; }
.wz-result.no .wz-amount { color: var(--muted); }
.wz-breakdown { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--grid); }
.wz-breakdown li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.wz-breakdown li span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--axis); }
.wz-breakdown li.yes span::before { background: var(--pos); } .wz-breakdown li.no span::before { background: var(--crit); }
.wz-breakdown li.off { color: var(--muted); }
.wz-breakdown b { font-variant-numeric: tabular-nums; }
.wz-equity { margin-top: 10px; }
.wz-manual { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.wz-manual input { flex: 1; border: 1px solid var(--ring); background: var(--card-2); border-radius: 8px; padding: 7px 10px; font: inherit; color: var(--ink); }
.wz-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wz-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.wz-note svg { width: 15px; height: 15px; color: var(--warn); flex: none; }
@media (max-width: 1240px) { #view-wizard .c7, #view-wizard .c5 { grid-column: span 12; } }

/* ================= Today: check-in + quick journal ================= */
.today-card { display: flex; flex-direction: column; gap: 10px; transition: border-color .3s, box-shadow .3s; }
.today-head { display: flex; align-items: center; gap: 12px; }
.today-head .kicker { flex: 1; }
.today-status { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 2px 10px; border-radius: 999px; background: var(--wash); white-space: nowrap; }
.today-card.done .today-status { color: var(--ink); background: color-mix(in srgb, var(--a5) 22%, transparent); box-shadow: 0 0 12px -3px var(--a5); }
.today-card.done { border-color: color-mix(in srgb, var(--a5) 40%, var(--ring)); }
.today-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.today-sub { margin-bottom: 8px; }
.pledges { display: flex; flex-wrap: wrap; gap: 8px; }
.pledge { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--axis); background: var(--card-2); color: var(--ink-2); border-radius: 999px;
  padding: 7px 14px 7px 8px; font: inherit; font-size: 13.5px; cursor: pointer; transition: background .18s, border-color .18s, color .18s, transform .12s var(--ease), box-shadow .18s; }
.pledge:hover { border-color: var(--a5); color: var(--ink); }
.pledge:active { transform: scale(.97); }
.pledge-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--axis); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.pledge.on { border-style: solid; border-color: color-mix(in srgb, var(--a5) 70%, transparent); background: color-mix(in srgb, var(--a5) 16%, var(--card-2)); color: var(--ink); box-shadow: 0 0 14px -6px var(--a5); }
.pledge.on .pledge-mark { background: var(--a5); border-color: var(--a5); color: #14171c; animation: pop .3s var(--ease); }
.pledge:focus-visible { outline: 2px solid var(--a5); outline-offset: 2px; }
.today-note { display: flex; flex-direction: column; gap: 6px; }
#tdText { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--ring); border-radius: 10px; background: var(--card-2); color: var(--ink);
  padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.55; outline: none; transition: border-color .15s, box-shadow .15s; }
#tdText:focus { border-color: color-mix(in srgb, var(--a5) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a5) 15%, transparent); }
.today-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jr-checkin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jr-checkin:empty { display: none; }
.jr-pledge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--a5) 16%, transparent); color: var(--ink); }
@media (max-width: 860px) { .today-body { grid-template-columns: 1fr; } }

/* folded Today card: one line once checked in */
.today-toggle { display: inline-flex; padding: 4px; color: var(--muted); }
.today-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.today-card.collapsed .today-toggle svg { transform: rotate(180deg); }
.today-card.collapsed { padding-top: 10px; padding-bottom: 10px; gap: 0; }
.today-head { cursor: pointer; user-select: none; } .today-head:hover .today-toggle { color: var(--ink); }
.today-card.collapsed .today-body { display: none; }
.today-card .today-head .kicker { flex: 0 0 auto; }
.today-peek { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.today-card:not(.collapsed) .today-peek { display: none; }
.today-card:not(.collapsed) .today-head .kicker { flex: 1; }
/* a quieter "checked in" badge */
.today-status { font-size: 11px; font-weight: 600; padding: 1px 8px; line-height: 18px; }
.today-card.done .today-status { box-shadow: 0 0 8px -4px var(--a5); }


/* an unfinished check-in: an amber outline (it breathes; see checkinBreathe below) */
.today-card.pending { --a: var(--a2); --ring-c: var(--a2); position: relative; isolation: isolate;
  border-color: color-mix(in srgb, var(--ring-c) 35%, transparent);
  box-shadow: var(--shadow), inset 0 3px 0 color-mix(in srgb, var(--ring-c) 80%, transparent), 0 0 18px -6px color-mix(in srgb, var(--ring-c) 60%, transparent); }
:root[data-mode="light"] .today-card.pending { --ring-c: #7c3aed; }
.today-card.pending .today-status { color: #160d2e; background: var(--ring-c); font-weight: 700; }
:root[data-mode="light"] .today-card.pending .today-status { color: #fff; background: #6d28d9; }
.today-card.pending .pledge:not(.on) { border-color: color-mix(in srgb, var(--ring-c) 65%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .today-card.pending { box-shadow: var(--shadow), inset 0 3px 0 var(--ring-c), 0 0 0 3px color-mix(in srgb, var(--ring-c) 70%, transparent); }
}

/* the journal box is part of the check-in until something's written */
.today-card.pending .today-note.todo #tdText { border: 1.5px dashed color-mix(in srgb, var(--ring-c) 75%, transparent); }

/* an unfinished check-in breathes slowly: outline and glow swell and settle */
.today-card.pending { animation: checkinBreathe 3.6s ease-in-out infinite; }
@keyframes checkinBreathe {
  0%, 100% { border-color: color-mix(in srgb, var(--ring-c) 35%, transparent);
    box-shadow: var(--shadow), inset 0 3px 0 color-mix(in srgb, var(--ring-c) 80%, transparent), 0 0 10px -6px color-mix(in srgb, var(--ring-c) 50%, transparent); }
  50% { border-color: color-mix(in srgb, var(--ring-c) 90%, transparent);
    box-shadow: var(--shadow), inset 0 3px 0 var(--ring-c), 0 0 0 2px color-mix(in srgb, var(--ring-c) 45%, transparent), 0 0 30px 2px color-mix(in srgb, var(--ring-c) 45%, transparent); }
}

/* ---- pinned stats row ---- */
.stats-sentinel { height: 1px; margin-bottom: -15px; }
.stats { position: sticky; top: 0; z-index: 8; padding: 8px 0; margin: -8px 0; background: transparent; transition: box-shadow .2s, background-color .2s; }
/* only once it's stuck to the top does the row get a backdrop, so patterned and gradient pages show through it otherwise */
.stats.stuck { background: color-mix(in srgb, var(--page) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 18px -14px rgba(0, 0, 0, .55); }
.stats.stuck .stat { padding-top: 9px; padding-bottom: 9px; }

/* ---- status bar ---- */
.main { padding-bottom: 52px; }
.status-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 28px; display: flex; align-items: center; gap: 18px;
  padding: 0 18px; font-size: 12px; color: var(--ink-2); background: color-mix(in srgb, var(--side) 92%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--ring); font-variant-numeric: tabular-nums; }
.sb-conn { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; white-space: nowrap; }
.sb-conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sb-conn.live { color: #16a34a; } .sb-conn.live i { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livePing 2s ease-out infinite; }
:root[data-mode="dark"] .sb-conn.live { color: #4ade80; }
.sb-conn.down { color: var(--crit); } .sb-conn.down i { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
@keyframes livePing { 70%, 100% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }
.sb-stats { display: flex; gap: 16px; min-width: 0; overflow: hidden; white-space: nowrap; }
.sb-stats span { color: var(--muted); } .sb-stats b { color: var(--ink); font-weight: 600; margin-left: 5px; }
.sb-stats .pos::before, .sb-stats .neg::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 4px 1px 5px; vertical-align: middle; }
.sb-stats .pos::before { background: var(--pos); } .sb-stats .neg::before { background: var(--neg); }
@media (max-width: 860px) { .sb-stats span:nth-child(n+4) { display: none; } }
.side { height: calc(100vh - 28px); }
@media (max-width: 860px) { .side { height: auto; } }

/* ---- data controls in the footer ---- */
.sb-data { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.sb-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sb-coverage { margin-right: 4px; color: var(--ink-2); }
.sb-sync, .sb-server { margin-left: 4px; }
.sb-sync:empty, .sb-server:empty { display: none; }
.sb-sep { width: 1px; height: 14px; background: var(--axis); margin: 0 8px; }
.sb-icon { position: relative; display: inline-grid; place-items: center; width: 24px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; padding: 0; }
.sb-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sb-icon:hover { background: var(--wash); color: var(--ink); }
.sb-icon:disabled { opacity: .4; cursor: default; }
.sb-eye { margin-left: -4px; width: 22px; }
.sb-eye svg { width: 14px; height: 14px; }
#pullBtn { color: var(--accent); }
.sb-icon.save-btn.unsaved::after { top: 2px; right: 2px; width: 6px; height: 6px; }
#syncBtn:disabled svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1599px) { .sb-coverage { display: none; } }
@media (max-width: 1100px) { .sb-server { display: none; } }
@media (max-width: 860px) { .sb-sync { max-width: 120px; } }
/* phones: the tab row scrolls sideways; the Today header wraps */
@media (max-width: 860px) {
  .side { min-width: 0; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: none; }
  .today-head { flex-wrap: wrap; row-gap: 6px; }
}
@media (max-width: 520px) {
  .sb-stats span:nth-child(n+2), .sb-sync { display: none; }
  .today-head .kicker { white-space: nowrap; }
}

/* ---- 4H close countdown ---- */
.sb-4h { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; transition: background .3s, color .3s; outline: none; }
.sb-4h svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sb-4h span { color: var(--muted); }
.sb-4h b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 52px; }
.sb-4h:focus-visible { outline: 1px solid var(--axis); }
/* 30 minutes out: amber */
.sb-4h.soon { background: var(--warn); color: #1b1300; box-shadow: 0 0 12px -2px color-mix(in srgb, var(--warn) 80%, transparent); }
.sb-4h.soon span, .sb-4h.soon b { color: #1b1300; }
:root[data-mode="light"] .sb-4h.soon { background: #d97706; color: #fff; }
:root[data-mode="light"] .sb-4h.soon span, :root[data-mode="light"] .sb-4h.soon b { color: #fff; }
/* the last 5 minutes: hot orange-red */
.sb-4h.now { background: #ea580c; color: #fff; box-shadow: 0 0 14px -1px rgba(234, 88, 12, .85); }
.sb-4h.now span, .sb-4h.now b { color: #fff; }
.sb-stats .sb-hit b { color: var(--crit); }

/* ---- weekly review ---- */
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rv-head h2 { font-size: 18px; min-width: 220px; text-align: center; }
.rv-stats { flex-wrap: wrap; align-self: flex-start; display: inline-flex; }
.rv-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.rv-rules li { display: grid; grid-template-columns: 22px 1fr; gap: 0 10px; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.rv-rules li:last-child { border-bottom: 0; }
.rv-mark { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.rv-rules li.ok .rv-mark { background: color-mix(in srgb, var(--a5) 25%, transparent); color: var(--ink); }
.rv-rules li.bad .rv-mark { background: color-mix(in srgb, var(--crit) 22%, transparent); color: var(--crit); }
.rv-rules li.na .rv-mark { background: var(--wash); color: var(--muted); }
.rv-rule { font-weight: 600; font-size: 13.5px; }
.rv-detail { font-size: 12.5px; color: var(--muted); }
.rv-rules li.bad .rv-detail { color: var(--ink-2); }
#rvText { min-height: 140px; }
#rvStrats caption { text-align: left; padding: 8px 0; }
@media (max-width: 1240px) { #view-review .c8, #view-review .c4, #view-review .c6 { grid-column: span 12; } }
.sb-sync, .sb-server { max-width: 150px; }
/* narrower windows: keep Today, Net P&L, Win rate and Equity; the save icon's dot and tooltip carry the server state */
@media (max-width: 1399px) { .sb-stats span:nth-child(4), .sb-stats span:nth-child(5), .sb-server { display: none; } }

/* ---- sidebar exports ---- */
.side-exports { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.side-exports .side-label { margin-bottom: 2px; }
.side-btn { display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px; }
.side-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.side-btn:hover { background: var(--wash); color: var(--ink); }
.side-exports + .side-foot { margin-top: 10px; }
@media (max-width: 860px) { .side-exports { margin-top: 0; flex-direction: row; } .side-exports .side-label { display: none; } }
.print-head { display: none; }


/* ================= PDF review (public/report.js) =================
   A4 portrait. While printing, the app is hidden and only the report shows. */
@page { size: A4 portrait; margin: 12mm 12mm 14mm; }
.rp[hidden] { display: none !important; }
body.printing .app, body.printing .status-bar, body.printing .tip { display: none !important; }
body.printing { background: var(--page); }
.rp { width: 714px; margin: 0 auto; padding: 4px 0 20px; color: var(--ink); font-size: 12.5px; line-height: 1.55; }
.rp-cover { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 18px 20px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--ring); box-shadow: inset 0 3px 0 var(--a1); }
.rp-brand { display: flex; align-items: center; gap: 14px; }
.rp-brand img { border-radius: 11px; }
.rp-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--a1); font-weight: 700; }
.rp-cover h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.rp-meta { text-align: right; color: var(--ink-2); font-size: 11.5px; line-height: 1.6; }
.rp-meta div:first-child { color: var(--ink); font-weight: 650; font-size: 13px; }
.rp-verdict { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--ring); background: var(--card); font-size: 13.5px; }
.rp-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.rp-verdict.good .rp-badge { background: color-mix(in srgb, var(--pos) 22%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--pos); }
.rp-verdict.mixed .rp-badge { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--warn); }
.rp-verdict.poor .rp-badge { background: color-mix(in srgb, var(--neg) 22%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--neg); }
.rp-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 4px; }
.rp-bigitem { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--ring); }
.rp-bigitem span { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-bigitem b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.rp-bigitem.pos { box-shadow: inset 0 3px 0 var(--pos); } .rp-bigitem.neg { box-shadow: inset 0 3px 0 var(--neg); }
.rp-section { margin-top: 18px; padding: 16px 20px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--ring); box-shadow: inset 0 3px 0 var(--a); }
.rp-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; break-after: avoid; }
.rp-num { font-size: 12px; font-weight: 800; color: var(--a); font-variant-numeric: tabular-nums; }
.rp-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.rp-h3 { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.rp-p { margin: 8px 0; color: var(--ink); max-width: 66ch; }
.rp-fig { margin: 10px 0 6px; break-inside: avoid; }
.rp-fig figcaption { font-size: 11px; color: var(--muted); margin-top: 3px; font-style: italic; }
.rp-chart { width: 100%; }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; break-inside: avoid; }
.rp-kv { display: grid; grid-template-columns: 150px 1fr; margin: 4px 0 0; }
.rp-kv dt, .rp-kv dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.rp-kv dt { color: var(--ink-2); }
.rp-kv dd { display: flex; gap: 14px; align-items: baseline; }
.rp-kv dd b { min-width: 130px; font-variant-numeric: tabular-nums; }
.rp-kv dd span { color: var(--muted); font-size: 12px; }
.rp-kv > :nth-last-child(-n+2) { border-bottom: 0; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; break-inside: avoid; }
.rp-table th, .rp-table td { padding: 5px 6px; border-bottom: 1px solid var(--grid); text-align: left; }
.rp-table th { color: var(--muted); font-weight: 500; font-size: 11px; }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-rules { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; break-inside: avoid; }
.rp-rules li { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; }
.rp-rules li span:last-child { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.rp-mark { grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.rp-rules .ok .rp-mark { background: color-mix(in srgb, var(--a5) 25%, transparent); }
.rp-rules .bad .rp-mark { background: color-mix(in srgb, var(--crit) 22%, transparent); color: var(--crit); }
.rp-rules .na .rp-mark { background: var(--wash); color: var(--muted); }
.rp-recs { margin: 6px 0 0; padding-left: 0; list-style: none; counter-reset: rec; }
.rp-recs li { counter-increment: rec; position: relative; padding: 9px 0 9px 38px; border-bottom: 1px solid var(--grid); break-inside: avoid; }
.rp-recs li:last-child { border-bottom: 0; }
.rp-recs li::before { content: counter(rec); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; color: var(--accent-ink); background: var(--a1); }
.rp-recs b { display: block; font-size: 13.5px; }
.rp-recs span { color: var(--ink-2); }
.rp-quote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--a5); background: var(--card-2); border-radius: 0 10px 10px 0; break-inside: avoid; }
.rp-qhead { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.rp-quote p { margin: 4px 0 0; white-space: pre-wrap; font-style: italic; color: var(--ink-2); }
.rp-foot { color: var(--muted); font-size: 10.5px; margin-top: 14px; }
.rp .chart .tick, .rp .tick { font-size: 10px; }
.rp .rp-chart svg { display: block; overflow: visible; }
.rp .grid { stroke: var(--grid); } .rp .baseline { stroke: var(--axis); } .rp .tick { fill: var(--muted); } .rp .label { fill: var(--ink-2); font-size: 11px; } .rp .value { fill: var(--muted); font-size: 10.5px; }
.rp .bar.pos { fill: var(--pos); } .rp .bar.neg { fill: var(--neg); }
@media print {
  html, body { background: var(--page) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .line.draw, .gauge.sweep { stroke-dashoffset: 0 !important; }
  body:not(.printing) .app, body:not(.printing) .status-bar { display: none; }
  .rp-section { break-inside: auto; }
}

/* ================= theme structure: fonts, corners, borders ================= */
h1, h2, .mid-value, .stat-value, .big, .wz-amount, .score-value, .logo span, .sat-banner strong, .wz-title, .pb-name,
.rp-cover h1, .rp-h h2, .rp-bigitem b, .head h1, .cal-nav h2, .jr-head h2, .rv-head h2 { font-family: var(--font-display); }
.card, .stat, .rp-section, .rp-cover, .rp-verdict, .rp-bigitem, .dlg, .sat-banner, .warnings, .wz-check { border-radius: var(--radius); border-width: var(--border-w); }
.btn, select, input[type="date"], .cal-day, .jr-day, .seg, .sb-icon, .side-btn, .nav button, #jrText, #tdText, .pb-text, .jr-tags, .pw-input,
.cal-stats, .wz-manual input, .jr-pip, .leds i, .heat-grid i, .hour-strip i, .logo-mark { border-radius: var(--radius-sm); }

/* ---- Terminal ---- */
[data-theme="terminal"] body { text-shadow: 0 0 6px rgba(57, 255, 120, 0.16); letter-spacing: -0.01em; }
[data-theme="terminal"] .card, [data-theme="terminal"] .stat { border-color: rgba(57, 255, 120, 0.22); }
[data-theme="terminal"] .pledge, [data-theme="terminal"] .chip, [data-theme="terminal"] .badge, [data-theme="terminal"] .today-status,
[data-theme="terminal"] .wz-tag, [data-theme="terminal"] .jr-tag, [data-theme="terminal"] .sb-4h, [data-theme="terminal"] .rp-badge,
[data-theme="terminal"] .kicker::before, [data-theme="terminal"] .pledge-mark, [data-theme="terminal"] .wz-box, [data-theme="terminal"] .rv-mark { border-radius: 0 !important; }
[data-theme="terminal"] .head h1::before { content: '> '; color: var(--accent); }
[data-theme="terminal"] .head h1::after { content: '█'; margin-left: 6px; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
[data-theme="terminal"] body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px); }
[data-theme="terminal"] .nav button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; text-shadow: none; }
[data-theme="terminal"] .btn.primary { text-shadow: none; }

/* ---- Atelier ---- */
[data-theme="atelier"] .card, [data-theme="atelier"] .stat, [data-theme="atelier"] .rp-section, [data-theme="atelier"] .rp-cover,
[data-theme="atelier"] .rp-bigitem, [data-theme="atelier"] .rp-verdict, [data-theme="atelier"] .sat-banner, [data-theme="atelier"] .warnings {
  border: 2px solid #141414; box-shadow: 4px 4px 0 #141414; }
[data-theme="atelier"] .card.accented, [data-theme="atelier"] .stat, [data-theme="atelier"] .rp-section { box-shadow: 4px 4px 0 #141414, inset 0 6px 0 var(--a); }
[data-theme="atelier"] .card.accented:hover, [data-theme="atelier"] .stat:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #141414, inset 0 6px 0 var(--a); border-color: #141414; }
[data-theme="atelier"] .head h1 { font-style: italic; font-weight: 800; font-size: 34px; letter-spacing: -0.03em; }
[data-theme="atelier"] .kicker { color: #141414; font-weight: 700; letter-spacing: 0.1em; }
[data-theme="atelier"] .kicker::before { border-radius: 0 !important; width: 10px; height: 10px; box-shadow: none !important; }
[data-theme="atelier"] .stat.hero { background: #f2b705 !important; color: #141414; border-color: #141414; box-shadow: 4px 4px 0 #141414 !important; }
[data-theme="atelier"] .stat.hero .kicker, [data-theme="atelier"] .stat.hero .muted { color: #141414 !important; }
:root[data-theme="atelier"] .stat.hero .stat-text > * { --halo: #f2b705; }
[data-theme="atelier"] .stat.hero .spark-fill { opacity: .3; }
[data-theme="atelier"] .nav button[aria-current="page"] { background: #f2b705; color: #141414; box-shadow: 3px 3px 0 #141414; border: 2px solid #141414; }
[data-theme="atelier"] .btn { border: 2px solid #141414; box-shadow: 2px 2px 0 #141414; }
[data-theme="atelier"] .btn.primary { background: #141414; color: #f2b705; }
[data-theme="atelier"] .wz-amount, [data-theme="atelier"] .stat-value, [data-theme="atelier"] .mid-value { font-weight: 800; letter-spacing: -0.02em; }

/* ---- Dojo Ink ---- */
[data-theme="dojo"] .head h1 { font-weight: 800; letter-spacing: 0.02em; }
[data-theme="dojo"] .kicker { letter-spacing: 0.14em; }
[data-theme="dojo"] .card.accented, [data-theme="dojo"] .stat { box-shadow: var(--shadow), inset 0 2px 0 color-mix(in srgb, var(--a) 85%, transparent); }
[data-theme="dojo"] .stat.hero { border-color: color-mix(in srgb, var(--a1) 45%, transparent); }

/* ---- Cream Pastel ---- */

@media print { [data-theme="terminal"] body::after { display: none; } [data-theme="terminal"] .head h1::after { display: none; } }
@media (prefers-reduced-motion: reduce) { [data-theme="terminal"] .head h1::after { animation: none; } }

/* ================= theme picker ================= */
.theme-wrap { position: relative; }
.theme-menu { position: fixed; z-index: 2147483000; width: 250px; padding: 6px; background: var(--card); border: 1px solid var(--ring);
  border-radius: var(--radius); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5); display: none; }
.theme-menu.open { display: block; animation: dlgIn .2s var(--ease); }
.theme-opt { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; text-align: left; }
.theme-opt:hover { background: var(--wash); }
.theme-opt[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.theme-sw { display: grid; grid-template-columns: repeat(4, 9px); height: 22px; border-radius: 5px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.35); }
.theme-sw i { display: block; }
.theme-name { flex: 1; }
.theme-name small { display: block; color: var(--muted); font-size: 11px; }
.theme-check { width: 14px; font-weight: 800; color: var(--accent); }
.theme-opt[aria-checked="false"] .theme-check { visibility: hidden; }
.theme-opt .theme-name { font-family: var(--font); }
.theme-opt[data-theme="terminal"] .theme-name { font-family: "JetBrains Mono", monospace; }
.theme-opt[data-theme="atelier"] .theme-name { font-family: "Fraunces", serif; font-style: italic; font-weight: 700; }
.theme-opt[data-theme="dojo"] .theme-name { font-family: "Shippori Mincho", serif; font-weight: 700; }
.theme-opt.theme-opt[data-theme="classic"] .theme-name { font-family: "Inter", sans-serif; }
@media print { .theme-menu { display: none !important; } }

/* ---- Glass ---- */

[data-theme="glass"] body::before { content: ''; position: fixed; inset: -10vmax; z-index: -1; pointer-events: none; filter: blur(60px) saturate(1.2);
  background:
    radial-gradient(28vmax 28vmax at 18% 22%, rgba(124, 92, 255, 0.55), transparent 70%),
    radial-gradient(26vmax 26vmax at 82% 18%, rgba(34, 211, 238, 0.38), transparent 70%),
    radial-gradient(30vmax 30vmax at 70% 82%, rgba(244, 114, 182, 0.40), transparent 70%),
    radial-gradient(22vmax 22vmax at 25% 85%, rgba(251, 191, 119, 0.30), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(3vmax, -2vmax, 0) rotate(8deg) scale(1.06); } }
[data-theme="glass"] .card, [data-theme="glass"] .stat, [data-theme="glass"] .side, [data-theme="glass"] .status-bar, [data-theme="glass"] .warnings,
[data-theme="glass"] .sat-banner, [data-theme="glass"] .btn, [data-theme="glass"] select, [data-theme="glass"] input[type="date"] {
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
[data-theme="glass"] .card, [data-theme="glass"] .stat { border-color: rgba(255, 255, 255, 0.16); border-top-color: rgba(255, 255, 255, 0.3); }
[data-theme="glass"] .card.accented, [data-theme="glass"] .stat { box-shadow: var(--shadow); }
[data-theme="glass"] .card.accented:hover, [data-theme="glass"] .stat:hover { box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--a) 40%, transparent), 0 18px 50px -18px color-mix(in srgb, var(--a) 60%, transparent); }
[data-theme="glass"] .stat.hero { background: linear-gradient(135deg, rgba(139, 156, 255, 0.28), rgba(244, 114, 182, 0.16)); border-color: rgba(255, 255, 255, 0.28); }
[data-theme="glass"] .stat.hero .stat-text > * { --hero: #2a2f63; }
[data-theme="glass"] .side { border-right-color: rgba(255, 255, 255, 0.1); }
[data-theme="glass"] .status-bar { background: rgba(11, 15, 36, 0.55); }
[data-theme="glass"] .nav button[aria-current="page"] { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
[data-theme="glass"] .btn.primary { background: rgba(139, 156, 255, 0.85); }
[data-theme="glass"] .dlg, [data-theme="glass"] .tip, [data-theme="glass"] .theme-menu { background: rgba(30, 37, 71, 0.82); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
[data-theme="glass"] select option { background: var(--solid); }

/* ---- Synthwave ---- */
/* own stacking context for the sunset, kept above the page so the theme menu inside it is never covered */
[data-theme="synthwave"] .side { isolation: isolate; z-index: 30; }
@media (max-width: 860px) { [data-theme="synthwave"] .side { position: relative; overflow: hidden; } [data-theme="synthwave"] .side::before { display: none; } }
[data-theme="synthwave"] .side::before { content: ''; position: absolute; left: 50%; bottom: 235px; width: 132px; height: 132px; margin-left: -66px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: linear-gradient(#ffd23f 10%, #ff8a3d 45%, #ff4fd8 85%); box-shadow: 0 0 60px -6px rgba(255, 79, 216, 0.55);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 45% 50%, #000 50% 60%, transparent 60% 66%, #000 66% 73%, transparent 73% 80%, #000 80% 86%, transparent 86%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 45% 50%, #000 50% 60%, transparent 60% 66%, #000 66% 73%, transparent 73% 80%, #000 80% 86%, transparent 86%); }
[data-theme="synthwave"] .side::after { content: ''; position: absolute; left: -60%; right: -60%; bottom: 0; height: 120px; z-index: -1; opacity: .7; pointer-events: none;
  background-color: #150c2b; background-image: linear-gradient(rgba(255, 79, 216, 0.55) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 79, 216, 0.55) 2px, transparent 2px);
  background-size: 40px 26px; transform: perspective(160px) rotateX(58deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent); mask-image: linear-gradient(to top, #000 30%, transparent);
  animation: gridRun 2.4s linear infinite; }
[data-theme="synthwave"] .side-foot, [data-theme="synthwave"] .side-exports { position: relative; }
@keyframes gridRun { to { background-position: 0 26px; } }
[data-theme="synthwave"] .card, [data-theme="synthwave"] .stat { background: rgba(27, 16, 51, 0.88); }
[data-theme="synthwave"] .head h1 { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: #fff;
  text-shadow: 0 0 6px #ff4fd8, 0 0 18px #ff4fd8, 0 0 36px rgba(255, 79, 216, 0.6); }
[data-theme="synthwave"] .logo span { font-family: "Orbitron", sans-serif; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
[data-theme="synthwave"] .logo b { color: #22e5ff; text-shadow: 0 0 10px #22e5ff; }
/* Orbitron for words; its stylised 7s stay out of the numbers */
[data-theme="synthwave"] .stat-value, [data-theme="synthwave"] .mid-value, [data-theme="synthwave"] .big, [data-theme="synthwave"] .wz-amount, [data-theme="synthwave"] .score-value, [data-theme="synthwave"] .rp-bigitem b { font-family: var(--font); font-weight: 700; }
[data-theme="synthwave"] .card h2 { letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; }
[data-theme="synthwave"] .card.accented, [data-theme="synthwave"] .stat { box-shadow: var(--shadow), inset 0 2px 0 var(--a), 0 -6px 18px -12px var(--a); }
[data-theme="synthwave"] .nav button[aria-current="page"] { background: linear-gradient(90deg, rgba(255, 79, 216, 0.3), rgba(34, 229, 255, 0.12)); box-shadow: inset 2px 0 0 #ff4fd8, 0 0 20px -6px #ff4fd8; }
[data-theme="synthwave"] .btn.primary { background: linear-gradient(90deg, #ff4fd8, #9d7bff); color: #fff; }

/* ---- Broadsheet ---- */
[data-theme="broadsheet"] body { background-image: radial-gradient(rgba(26, 26, 26, 0.035) 1px, transparent 1px); background-size: 3px 3px; }
[data-theme="broadsheet"] .logo span { font-family: "UnifrakturMaguntia", "Old English Text MT", serif; font-size: 25px; font-weight: 400; letter-spacing: 0; }
[data-theme="broadsheet"] .logo b { color: var(--ink); font-weight: 400; }
[data-theme="broadsheet"] .head { border-bottom: 3px double var(--ink); padding-bottom: 10px; }
[data-theme="broadsheet"] .head h1 { font-size: 40px; font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
[data-theme="broadsheet"] .card, [data-theme="broadsheet"] .stat { border: 0; border-top: 2px solid var(--ink); background: transparent; box-shadow: none !important; padding-left: 4px; padding-right: 4px; }
[data-theme="broadsheet"] .stat { border-top-width: 4px; }
[data-theme="broadsheet"] .stat + .stat { border-left: 1px solid var(--ring); padding-left: 14px; }
[data-theme="broadsheet"] .card.accented:hover, [data-theme="broadsheet"] .stat:hover { transform: none; border-color: var(--ink); }
[data-theme="broadsheet"] .stat.hero { background: transparent !important; color: var(--ink); }
[data-theme="broadsheet"] .stat.hero .stat-text > * { --halo: #f1ece0; }
[data-theme="broadsheet"] .kicker { font-family: var(--font); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.1em; font-size: 13px; color: var(--ink-2); font-weight: 600; }
[data-theme="broadsheet"] .kicker::before { display: none !important; }
[data-theme="broadsheet"] .card h2 { font-family: var(--font-display); font-size: 19px; font-weight: 800; font-style: italic; }
[data-theme="broadsheet"] .stat-value, [data-theme="broadsheet"] .mid-value, [data-theme="broadsheet"] .big { font-weight: 800; }
[data-theme="broadsheet"] .nav button[aria-current="page"] { background: var(--ink); color: var(--card); box-shadow: none; }
[data-theme="broadsheet"] .side { border-right: 3px double var(--ink); }
[data-theme="broadsheet"] .warnings { background: transparent; border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-style: italic; }
[data-theme="broadsheet"] .btn { border-color: var(--ink); }
[data-theme="broadsheet"] .cal-day, [data-theme="broadsheet"] select { background: transparent; }

/* new themes: motion and print */
@media (prefers-reduced-motion: reduce) {
  [data-theme="glass"] body::before, [data-theme="synthwave"] .side::after { animation: none; }
}
@media print {
  [data-theme="glass"] body::before { display: none; }
  [data-theme="glass"] body.printing { background: #161b3a; }
}
.theme-menu.open { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; overflow-y: auto; }
@media (max-width: 520px) { .theme-menu.open { grid-template-columns: 1fr; } }
.theme-opt[data-theme="glass"] .theme-name { font-family: "Sora", sans-serif; }
.theme-opt[data-theme="synthwave"] .theme-name { font-family: "Orbitron", sans-serif; font-weight: 700; letter-spacing: .04em; }
.theme-opt[data-theme="broadsheet"] .theme-name { font-family: "Playfair Display", serif; font-weight: 800; }
.theme-opt[data-theme] .theme-name small { font-family: var(--font); font-style: normal; font-weight: 400; letter-spacing: 0; font-size: 11px; }
/* the page colour lives on <html> so the fixed backdrops (z-index -1) show through <body> */
[data-theme="glass"] body { background-color: transparent; }
:root[data-theme="broadsheet"] .stat.hero .stat-text > * { --halo: #f1ece0; }
[data-theme="broadsheet"] .stat.hero .spark-fill { opacity: .22; }
[data-theme="broadsheet"] .stat.hero .spark-line { opacity: .35; }
[data-theme="broadsheet"] .stat-value, [data-theme="broadsheet"] .mid-value, [data-theme="broadsheet"] .big, [data-theme="broadsheet"] .wz-amount, [data-theme="broadsheet"] .score-value { font-variant-numeric: lining-nums tabular-nums; }
[data-theme="synthwave"] .side-foot { text-shadow: 0 0 4px #150c2b, 0 0 8px #150c2b; }

/* ================= Reports tab: the written review, on screen ================= */
.rp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-bar .cal-nav { display: flex; align-items: center; gap: 8px; }
.rp-bar select { font-weight: 600; min-width: 200px; }
.rp-bar .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.rp-screen { width: auto; max-width: none; margin: 0; padding: 0 0 8px; font-size: 13.5px; }
.rp-screen .rp-p { max-width: 78ch; }
.rp-sofar { margin: 12px 0 0; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--ink);
  background: color-mix(in srgb, var(--a3) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--a3) 40%, var(--ring)); }
.rp-sofar b { color: var(--ink); }
@media (max-width: 860px) {
  .rp-screen .rp-cover { flex-direction: column; align-items: flex-start; }
  .rp-screen .rp-meta { text-align: left; }
  .rp-screen .rp-big { grid-template-columns: repeat(2, 1fr); }
  .rp-screen .rp-two, .rp-screen .rp-rules { grid-template-columns: 1fr; }
  .rp-screen .rp-kv { grid-template-columns: 110px 1fr; }
  .rp-screen .rp-kv dd { flex-direction: column; gap: 2px; }
  .rp-screen .rp-kv dd b { min-width: 0; }
  .rp-bar select { min-width: 0; flex: 1; }
}

/* ---- analytics: timing, hold time, costs ---- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.section-head h2 { font-size: 19px; }
.seg { display: inline-flex; border: 1px solid var(--ring); border-radius: 9px; padding: 2px; background: var(--card-2); gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button:hover:not(:disabled) { color: var(--ink); background: var(--wash); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--ring); }
.seg button:disabled { opacity: .4; cursor: default; }
.seg.small button { padding: 3px 9px; font-size: 12.5px; }

.open-grid { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.open-grid i { display: block; height: 22px; border-radius: 3px; transition: transform .15s var(--ease), box-shadow .15s; }
.open-grid i[tabindex]:hover, .open-grid i[tabindex]:focus-visible { transform: scale(1.25); position: relative; z-index: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.og-day { align-self: center; }
.og-hour { white-space: nowrap; overflow: visible; }
.open-windows { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.windows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.windows li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--ring); border-radius: var(--radius-sm); }
.windows li small { grid-column: 1 / -1; font-size: 12px; }
.windows li .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.windows li.muted { display: block; }

.hold-head { flex-wrap: wrap; }
.hold-stats { display: flex; gap: 10px; margin: 0; flex-wrap: wrap; }
.hold-stats > div { background: var(--card-2); border: 1px solid var(--ring); border-radius: 10px; padding: 8px 14px; min-width: 120px; }
.hold-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hold-stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hold-stats small { display: block; font-size: 12px; color: var(--muted); max-width: 240px; }
.hold-best { border-color: color-mix(in srgb, var(--pos) 45%, var(--ring)) !important; }
#holdTable, #sessionTable { margin-top: 12px; }

.cost-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin: 14px 0 0; }
.cost-stats > div { background: var(--card-2); border: 1px solid var(--ring); border-radius: 10px; padding: 10px 14px; }
.cost-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cost-stats dd { margin: 2px 0 2px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cost-stats small { font-size: 12px; line-height: 1.35; display: block; }
.cost-stats dd.pos, .hold-stats dd.pos, .replay-stats dd.pos { color: var(--pos); }
.cost-stats dd.neg, .replay-stats dd.neg { color: var(--neg); }

/* ---- trade replay ---- */
table.data tr.replayable { cursor: pointer; }
table.data tr.replayable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.replay-dlg { width: min(1100px, calc(100vw - 32px)); }
/* ===== the replay window: solid in every theme ======================
   Its own opaque tokens, made from the theme's colours: the base is the theme's card where that's
   solid, or the page tinted with ink where the theme's cards are see-through. */
.replay-dlg {
  --rp-base: var(--card);
  --rp-panel: color-mix(in srgb, var(--ink) 4%, var(--rp-base));
  --rp-panel-2: color-mix(in srgb, var(--ink) 7%, var(--rp-base));
  --rp-line: color-mix(in srgb, var(--ink) 13%, var(--rp-base));
  --rp-line-2: color-mix(in srgb, var(--ink) 8%, var(--rp-base));
  --rp-ink-3: color-mix(in srgb, var(--muted) 70%, var(--rp-base));
}
:is([data-theme="glass"], [data-theme="deepsea"], [data-theme="blueprint"], [data-theme="waves"]) .replay-dlg {
  --rp-base: color-mix(in srgb, var(--ink) 5%, var(--page));
}
[data-theme] .dlg.replay-dlg { background: var(--rp-base); border: 1px solid var(--rp-line); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 24px 70px -20px rgb(0 0 0 / .55); }
.dlg.replay-dlg::backdrop { background: var(--page); backdrop-filter: none; }
.replay-dlg .replay-stats > div { background: var(--rp-panel); border-color: var(--rp-line-2); }
.replay-dlg .replay-chart { border: 1px solid var(--rp-line); border-radius: 10px; background: var(--rp-base); }
.replay-dlg .dlg-head { padding-bottom: 8px; border-bottom: 1px solid var(--rp-line-2); }

/* the guide */
.replay-guide { margin: 4px 0 12px; display: grid; gap: 8px; }
.replay-guide[hidden], .replay-stats[hidden], .rp-head[hidden] { display: none; }
.replay-guide b { font-variant-numeric: tabular-nums; font-weight: 700; }

/* header: this grade + tags' record */
.rg-hist { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--rp-line); background: var(--rp-panel); }
.rg-hist-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.rg-hist-head .kicker { flex: none; cursor: help; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 0; }
.rg-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; color: var(--ink-2);
  background: var(--rp-base); border: 1px solid var(--rp-line); }
.rg-tag.good { color: var(--ink); border-color: color-mix(in srgb, var(--pos) 55%, var(--rp-base)); background: color-mix(in srgb, var(--pos) 10%, var(--rp-base)); }
.rg-tag.warn { color: var(--ink); border-color: color-mix(in srgb, #e8955a 60%, var(--rp-base)); background: color-mix(in srgb, #e8955a 11%, var(--rp-base)); }
.rg-proj { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; cursor: help; white-space: nowrap; background: var(--rp-base); border: 1px solid var(--rp-line); color: var(--ink-2); }
.rg-proj.hi { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 60%, var(--rp-base)); }
.rg-proj.mid { color: var(--ink); }
.rg-hist-rows { display: grid; gap: 6px; margin-top: 8px; }
.rg-hrow { display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(70px, 1.4fr) repeat(4, minmax(58px, auto)); align-items: center; gap: 12px; }
.rg-hlab { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.rg-hbar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--rp-line-2); gap: 2px; }
.rg-hbar i { display: block; min-width: 3px; }
.rg-hbar .rg-w { background: var(--pos); }
.rg-hbar .rg-b { background: color-mix(in srgb, var(--muted) 75%, var(--rp-base)); }
.rg-hbar .rg-l { background: color-mix(in srgb, var(--neg) 80%, var(--rp-base)); }
.rg-hst { display: grid; line-height: 1.15; }
.rg-hst small { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.rg-hst b { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.rg-hst b.pos { color: var(--pos); } .rg-hst b.neg { color: var(--neg); }
.rg-hrow.thin .rg-hst b { color: var(--ink-2); }
.rg-hrow.thin .rg-hst b.pos { color: color-mix(in srgb, var(--pos) 70%, var(--rp-base)); } .rg-hrow.thin .rg-hst b.neg { color: color-mix(in srgb, var(--neg) 70%, var(--rp-base)); }
.rg-hnote { margin: 5px 0 0; }

/* Entry → Trade management → Exit */
.rg-flow { display: grid; gap: 20px; }
/* the stripe is an inset shadow so the card can let its connector hang below it */
.rg-sec { --sec: var(--muted); position: relative; padding: 8px 12px 9px 14px; background: var(--rp-panel); border: 1px solid var(--rp-line); border-radius: 10px; box-shadow: inset 3px 0 0 var(--sec); }
.rg-entry { --sec: var(--accent); --next: #8b7cf6; } .rg-manage { --sec: #8b7cf6; --next: var(--pos); } .rg-exit { --sec: var(--pos); }
.rg-exit.st-neg { --sec: var(--neg); }
.rg-flow:has(.rg-exit.st-neg) .rg-manage { --next: var(--neg); }
.rg-flow:has(.rg-manage.st-skip) .rg-entry, .rg-flow:has(.rg-exit.st-skip) .rg-manage { --next: var(--rp-line); }
/* Entry → Trade management → Exit: a line and arrowhead from each card's number down to the next card's,
   fading from one card's colour into the next */
.rg-sec:not(:last-child)::after { content: ''; position: absolute; left: 17px; bottom: -20px; width: 12px; height: 20px; pointer-events: none;
  background: linear-gradient(var(--sec), var(--next, var(--sec)));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20'%3E%3Cpath d='M6 1v16' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M1.8 12.6 6 17.4l4.2-4.8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20'%3E%3Cpath d='M6 1v16' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M1.8 12.6 6 17.4l4.2-4.8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 20px no-repeat; }
.rg-sec.st-skip { --sec: var(--rp-line); --next: var(--rp-line); background: var(--rp-base); }
.rg-sec.st-skip .rg-fig, .rg-sec.st-skip li { color: var(--muted); }
.rg-sec-head { display: flex; align-items: center; gap: 7px; }
.rg-n { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; flex: none;
  color: var(--sec); background: var(--rp-base); border: 1px solid color-mix(in srgb, var(--sec) 60%, var(--rp-base)); }
.rg-sec-t { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.rg-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: var(--ink-2); background: var(--rp-base); border: 1px solid var(--rp-line); }
.st-done .rg-badge, .st-wait .rg-badge { color: var(--ink); border-color: color-mix(in srgb, var(--sec) 60%, var(--rp-base)); }
.rg-exit.st-pos .rg-badge { color: #fff; background: var(--pos); border-color: var(--pos); }
.rg-exit.st-neg .rg-badge { color: #fff; background: var(--neg); border-color: var(--neg); }
.rg-fig { margin-top: 5px; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rg-sub { font-weight: 500; color: var(--muted); }
.rg-sec ol { margin: 7px 0 0; padding: 7px 0 0; border-top: 1px solid var(--rp-line-2); list-style: none; display: grid; gap: 4px; }
.rg-sec li { position: relative; padding-left: 12px; line-height: 1.4; font-size: 12.5px; color: var(--ink-2); }
.rg-sec li b { color: var(--ink); }
.rg-sec li::before { content: ''; position: absolute; left: 0; top: .58em; width: 4px; height: 4px; border-radius: 1px; background: var(--sec); }
.rg-outcome { margin: 8px 0 0; padding: 6px 9px; border-radius: 7px; font-weight: 650; font-size: 12.5px; color: var(--ink); background: var(--rp-base); border: 1px solid var(--rp-line); }
.rg-outcome.pos { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 55%, var(--rp-base)); background: color-mix(in srgb, var(--pos) 7%, var(--rp-base)); }
.rg-outcome.neg { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 55%, var(--rp-base)); background: color-mix(in srgb, var(--neg) 7%, var(--rp-base)); }
.rg-context { margin: 0 2px; font-size: 11.5px; line-height: 1.4; }

/* a signal: the header with its record, then the guide on the left and the chart on the right, sized to the window */
.replay-dlg.has-guide { width: min(1720px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; padding: 12px 16px; }
.replay-dlg.has-guide[open] { display: flex; flex-direction: column; overflow: hidden; }
/* from the Monitoring tab: a touch smaller, the board still showing around it */
.replay-dlg.has-guide.compact { width: min(1560px, calc(100vw - 80px)); height: calc(100vh - 80px); }
.replay-dlg.has-guide .dlg-head { margin-bottom: 8px; flex: none; }
.replay-dlg.has-guide .dlg-head h2 { font-size: 15px; }
.replay-dlg.has-guide .rp-head { flex: none; margin-bottom: 10px; }
.replay-dlg.has-guide .rp-head .rg-hist { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 6px 18px; align-items: center; }
.replay-dlg.has-guide .rg-hist-rows { margin-top: 0; grid-template-columns: 1fr 1fr; gap: 0; }
.replay-dlg.has-guide .rg-hrow { grid-template-columns: minmax(92px, 1.1fr) minmax(46px, 1fr) repeat(4, auto); gap: 10px; }
.replay-dlg.has-guide .rg-hrow + .rg-hrow { border-left: 1px solid var(--rp-line); padding-left: 14px; margin-left: 14px; }
.replay-dlg.has-guide .rg-hlab { font-size: 12px; line-height: 1.2; }
.replay-dlg.has-guide .rp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 14px; }
.replay-dlg.has-guide .rp-side { min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.replay-dlg.has-guide .rp-main { min-height: 0; display: flex; flex-direction: column; }
.replay-dlg.has-guide .replay-bar { margin-bottom: 6px; }
.replay-dlg.has-guide .replay-chart { flex: 1; min-height: 300px; height: auto; }
.replay-dlg.has-guide #rpNote { margin-top: 5px; font-size: 11.5px; line-height: 1.35; }
.replay-dlg.has-guide .replay-guide { margin: 0; }
@media (max-width: 1100px) {
  .replay-dlg.has-guide .rp-head .rg-hist { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .replay-dlg.has-guide { height: auto; }
  .replay-dlg.has-guide[open] { display: block; overflow: auto; }
  .replay-dlg.has-guide .rp-body { grid-template-columns: 1fr; }
  .replay-dlg.has-guide .rg-hist-rows { grid-template-columns: 1fr; gap: 6px; }
  .replay-dlg.has-guide .rg-hrow + .rg-hrow { border-left: 0; padding-left: 0; margin-left: 0; }
  .replay-dlg.has-guide .replay-chart { height: min(460px, 55vh); flex: none; }
  .rg-hrow { grid-template-columns: repeat(4, 1fr); }
  .rg-hlab, .rg-hbar { grid-column: 1 / -1; }
}


.replay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.replay-stats > div { background: var(--card-2); border: 1px solid var(--ring); border-radius: 9px; padding: 7px 11px; }
.replay-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.replay-stats dd { margin: 1px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
/* the trade guide: see the replay window block below */

.replay-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.replay-nav { display: flex; gap: 6px; align-items: center; }
#rpCount { margin-right: 6px; font-variant-numeric: tabular-nums; }
.replay-chart { height: min(460px, 55vh); border: 1px solid var(--ring); border-radius: var(--radius-sm); overflow: hidden; }
#rpNote { margin: 8px 0 0; }

@media (max-width: 860px) {
  .open-grid { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .open-grid i { height: 16px; }
  .og-hour { font-size: 9px; }
  .open-windows { grid-template-columns: 1fr; }
}
.replay-chart { position: relative; }
.replay-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 1px; padding: 7px 10px; background: var(--card); border: 1px solid var(--ring); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: 12.5px; white-space: nowrap; }
.replay-tip span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.replay-tip span + b { margin-top: 5px; }

/* ---- dashboard timing cards ---- */
.more-link { font-size: 12.5px; color: var(--ink-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.more-link::after { content: ' →'; }
.more-link:hover { background: var(--wash); color: var(--ink); }
.dash-timing .mid-value { font-size: 22px; }
.dash-timing .mid-value.pos { color: var(--pos); }
.dash-timing .chart { margin-top: 10px; }
.open-grid.mini { grid-template-columns: 18px repeat(24, minmax(0, 1fr)); gap: 2px; margin-top: 12px; font-size: 10px; }
.open-grid.mini i { height: 12px; border-radius: 2px; }
.open-grid.mini .og-hour { font-size: 9.5px; }
.avoid { margin-top: 10px; }
.avoid b { font-weight: 600; }
.avoid b.neg { color: var(--neg); }
.chart .bar.best { stroke: var(--ink); stroke-width: 1.5; }

/* ---- open positions ---- */
.pos-card .kicker { gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 0 color-mix(in srgb, var(--pos) 60%, transparent); animation: livePulse 2.4s ease-out infinite; }
.live-dot.busy { background: var(--muted); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pos) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.pos-count { color: var(--ink-2); }
.pos-head-right { display: flex; align-items: center; gap: 10px; }
.pos-total b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pos-total b.pos, .pos-pnl b.pos { color: var(--pos); } .pos-total b.neg, .pos-pnl b.neg { color: var(--neg); }
.pos-list { display: grid; gap: 8px; margin-top: 10px; }
.pos-none { margin: 4px 0 0; }
.pos-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(100px, .9fr) repeat(2, minmax(120px, 1fr)); gap: 14px; align-items: center; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--ring); border-radius: var(--radius-sm); }
.pos-notes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 10px; margin-top: -2px; }
.pos-note { --c: var(--muted); position: relative; overflow: hidden; font-size: 11.5px; line-height: 1.4; padding: 6px 10px 6px 14px; border-radius: 10px; color: var(--ink-2);
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--ring)); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 12px -8px color-mix(in srgb, var(--c) 45%, transparent); backdrop-filter: blur(6px); }
.pos-note::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); }
.pos-note.pos { --c: #22c55e; }
.pos-note.t-bias { --c: #3b82f6; } .pos-note.t-plan { --c: #14b8a6; } .pos-note.t-time { --c: #22c55e; } .pos-note.t-week { --c: #a855f7; } .pos-note.t-btc { --c: #f97316; } .pos-note.t-size { --c: #ef4444; }
.pos-note.warn { --c: var(--warn); color: var(--ink); }
.pos-note.muted { color: var(--muted); }
@media (max-width: 560px) { .pos-note { white-space: normal; } }
/* every hint fits two lines; the full text is in its tooltip */
.pos-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.pos-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pos-name b, .pos-name .pos-ticker { font-size: 15px; }
.pos-name small { flex-basis: 100%; font-size: 12px; }
.pos-side { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.pos-side.long { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.pos-side.short { background: color-mix(in srgb, var(--neg) 18%, transparent); color: var(--neg); }
.pos-pnl { display: flex; flex-direction: column; }
.pos-pnl b { font-size: 18px; font-variant-numeric: tabular-nums; }
.pos-pnl small { font-size: 12px; }
.pos-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.pos-cell .kicker { font-size: 10.5px; }
.pos-cell .num { font-variant-numeric: tabular-nums; }
.pos-cell small { font-size: 11.5px; }
.pos-cell .warn, .pos-cell small.warn { color: var(--warn); }
.pos-cell .danger { color: var(--neg); font-weight: 600; }
.pos-cell .pos { color: var(--pos); }
.liq-bar { display: block; height: 4px; border-radius: 2px; margin-top: 3px; background: var(--grid); position: relative; overflow: hidden; }
.liq-bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 2px; background: var(--pos); }
.liq-bar.warn::after { background: var(--warn); }
.liq-bar.danger::after { background: var(--neg); }
@media (max-width: 1240px) { .pos-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; } .pos-row .pos-cell:nth-of-type(n) { min-width: 0; } }
@media (max-width: 860px) { .pos-row { grid-template-columns: 1fr 1fr; } .pos-head-right { flex-wrap: wrap; justify-content: flex-end; } }
.pos-card.accented > .card-row > .kicker::before { display: none; }
.pos-card .kicker { white-space: nowrap; }
.replay-nav[hidden] { display: none; }
.pos-total b.masked, .pos-pnl b.masked { color: var(--ink-2); letter-spacing: .04em; }

/* ---- trade notes and tags ---- */
.tag-chip { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 1.5; padding: 0 7px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card-2); color: var(--ink-2); white-space: nowrap; }
.tag-chip.mistake { border-color: color-mix(in srgb, var(--neg) 35%, transparent); background: color-mix(in srgb, var(--neg) 12%, var(--card-2)); color: var(--ink); }
.tag-chip.good { border-color: color-mix(in srgb, var(--pos) 35%, transparent); background: color-mix(in srgb, var(--pos) 12%, var(--card-2)); color: var(--ink); }
.tag-chip.custom { border-color: color-mix(in srgb, var(--a2) 35%, transparent); background: color-mix(in srgb, var(--a2) 10%, var(--card-2)); color: var(--ink); }
button.tag-chip { cursor: pointer; font: inherit; font-size: 12.5px; padding: 3px 10px; opacity: .55; }
button.tag-chip:hover { opacity: .85; }
button.tag-chip.on { opacity: 1; font-weight: 600; box-shadow: 0 0 0 1px currentColor inset; }
button.tag-chip.mistake.on { background: color-mix(in srgb, var(--neg) 26%, var(--card-2)); }
button.tag-chip.good.on { background: color-mix(in srgb, var(--pos) 26%, var(--card-2)); }
button.tag-chip.custom.on { background: color-mix(in srgb, var(--a2) 24%, var(--card-2)); }
.trade-notes { margin-top: 14px; border-top: 1px solid var(--ring); padding-top: 12px; }
.trade-notes[hidden] { display: none; }
.tn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tn-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.tn-add { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--ring); background: none; width: 140px; }
.tn-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--ring); background: var(--card-2); color: var(--ink); resize: vertical; }
.tags-cell { white-space: nowrap; }
.tags-cell > * + * { margin-left: 4px; }
.note-mark { color: var(--ink-2); font-size: 13px; }
.trades-tools { display: flex; gap: 8px; align-items: center; }

/* ---- recap ---- */
.recap-card[hidden] { display: none; }
.recap-title { font-size: 18px; margin: 2px 0 0; }
.recap-title .pos { color: var(--pos); } .recap-title .neg { color: var(--neg); }
.recap-head-right { display: flex; align-items: center; gap: 6px; }
.recap-body[hidden] { display: none; }
.recap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 12px 0 14px; }
.recap-stats > div { background: var(--card-2); border: 1px solid var(--ring); border-radius: 9px; padding: 7px 11px; }
.recap-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.recap-stats dd { margin: 1px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.recap-stats dd.pos { color: var(--pos); } .recap-stats dd.neg { color: var(--neg); }
.recap-cols { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 20px; }
.recap-rules { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.recap-rules li { display: grid; grid-template-columns: 18px 1fr; gap: 0 6px; font-size: 13px; }
.recap-rules li small { grid-column: 2; font-size: 12px; }
.recap-rules i { font-style: normal; font-weight: 700; }
.recap-rules .ok i { color: var(--pos); } .recap-rules .bad i { color: var(--neg); } .recap-rules .na i { color: var(--muted); }
.recap-journal { margin: 8px 0 8px; padding: 6px 10px; border-left: 3px solid var(--a2); background: var(--card-2); border-radius: 0 6px 6px 0; font-size: 13px; white-space: pre-wrap; }
.recap-trades { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.recap-trade { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; text-align: left; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink); cursor: pointer; }
.recap-trade:hover, .recap-trade:focus-visible { background: var(--wash); border-color: var(--ring); }
.rt-pnl { font-weight: 600; font-variant-numeric: tabular-nums; }
.rt-pnl.pos { color: var(--pos); } .rt-pnl.neg { color: var(--neg); }
.rt-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rt-note { font-size: 12px; color: var(--ink-2); flex-basis: 100%; }
.recap-tips { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.45; }
@media (max-width: 1240px) { .recap-cols { grid-template-columns: 1fr 1fr; } .recap-cols > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 860px) { .recap-cols { grid-template-columns: 1fr; } .trades-tools { flex-wrap: wrap; justify-content: flex-end; } }

/* collapsed recap: one line, the same height as the collapsed check-in */
.recap-card.collapsed { padding-top: 10px; padding-bottom: 10px; }
.recap-card.collapsed .recap-head { align-items: center; cursor: pointer; }
.recap-card.collapsed .recap-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.recap-card.collapsed .recap-title { font-size: 13px; font-weight: 600; margin: 0; white-space: nowrap; }
.recap-card.collapsed .today-toggle svg { transform: rotate(180deg); }
.recap-card.collapsed #rcJournal { display: none; }
.recap-card:not(.collapsed) #rcPeek { display: none; }
.recap-head-left .kicker { flex: 0 0 auto; }

/* ---- SFP scanner (beta) ---- */
.sfp-status { margin-top: 10px; min-height: 1em; }
.sfp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.sfp-summary .card { padding: 12px 14px; }
.sfp-summary dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sfp-summary dd { margin: 2px 0 2px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sfp-summary small { font-size: 12px; }
td.side-short, span.side-short { color: var(--neg); font-weight: 600; }
td.side-long, span.side-long { color: var(--pos); font-weight: 600; }
.trades-tools label.check { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
td.counter { color: var(--warn); }

/* ---- NY bias: a pill beside the page title ---- */
.head-title { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.bias-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 12px; border: 1px solid var(--ring); border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 12.5px; max-width: 100%; }
.bias-pill[hidden] { display: none; }
.bias-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.bias-badge { font-weight: 700; font-size: 12.5px; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.bias-badge.pos { color: var(--pos); background: color-mix(in srgb, var(--pos) 16%, transparent); }
.bias-badge.neg { color: var(--neg); background: color-mix(in srgb, var(--neg) 16%, transparent); }
.bias-badge.mid { color: var(--muted); background: var(--wash); }
.bias-badge.pending { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  color: color-mix(in srgb, var(--warn) 85%, var(--ink)); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.bias-badge.pending::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--warn) 22%, transparent), transparent); animation: biasSweep 2.4s ease-in-out infinite; }
.bias-spin { width: 9px; height: 9px; flex: none; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-top-color: var(--warn); animation: biasSpin 0.9s linear infinite; }
@keyframes biasSpin { to { transform: rotate(360deg); } }
@keyframes biasSweep { 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .bias-spin { animation: none; } .bias-badge.pending::after { display: none; } }
.bias-detail { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bias-live { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-2); }
.bias-live:empty { display: none; }
.bias-live .live-dot { display: inline-block; }
.bias-live b.pos { color: var(--pos); } .bias-live b.neg { color: var(--neg); }
.bias-hist { display: inline-flex; align-items: center; gap: 3px; }
.bias-dot { font-style: normal; font-size: 10px; line-height: 1; cursor: default; }
.bias-dot.pos { color: var(--pos); } .bias-dot.neg { color: var(--neg); } .bias-dot.mid { color: var(--muted); }
/* the session that sets the current bias */
.bias-dot.current { padding: 2px 3px; border-radius: 5px; background: color-mix(in srgb, currentColor 14%, transparent); text-shadow: 0 0 6px color-mix(in srgb, currentColor 70%, transparent); box-shadow: 0 0 6px -2px color-mix(in srgb, currentColor 50%, transparent); }
@media (max-width: 560px) { .bias-hist, .bias-live { display: none; } }


/* ---- signals: dashboard widget and tab ---- */
.sig-head-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sig-card { display: flex; flex-direction: column; }
.sig-grid { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; margin-top: 12px; }
#posCard[hidden] ~ #sigCard .sig-grid, .sig-card.c12 .sig-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.sig-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 132px; text-align: left; font: inherit; font-size: 13px; padding: 10px 11px; border: 1px solid var(--ring); border-radius: 12px; background: var(--card-2); color: var(--ink); cursor: pointer; transition: border-color .2s, transform .2s var(--ease); min-width: 0; overflow: hidden; }
.sig-tile:hover, .sig-tile:focus-visible { border-color: color-mix(in srgb, var(--a) 45%, var(--ring)); transform: translateY(-1px); }
.sig-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.sig-top b { font-size: 14px; white-space: nowrap; }
.sig-top b.pos { color: var(--pos); } .sig-top b.neg { color: var(--neg); }
.sig-tags { font-size: 12px; cursor: help; }
.sig-top { flex-wrap: nowrap; min-width: 0; } .sig-top .sig-grade { flex: none; }
.sig-coin { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: 14.5px; white-space: nowrap; margin-top: -2px; min-width: 0; }
.sig-coin b { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sig-target { flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sig-target i { font-style: normal; font-size: 9.5px; margin-right: 2px; vertical-align: 1px; } .sig-coin.pos { color: var(--pos); } .sig-coin.neg { color: var(--neg); }
.sig-top .sig-trend-top { margin-left: auto; flex: none; font-size: 10px; padding: 1px 6px; }
.sig-top .sig-tags + .sig-trend-top { margin-left: 4px; } .sig-top .sig-tags { margin-left: auto; }
.sig-tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--side, var(--ring)); opacity: .85; }
.sig-tile.long { --side: var(--pos); } .sig-tile.short { --side: var(--neg); }
.sig-mid { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 9px; background: color-mix(in srgb, var(--rc, var(--muted)) 9%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc, var(--muted)) 18%, transparent); }
.sig-mid:has(.sig-res.pos) { --rc: var(--pos); } .sig-mid:has(.sig-res.neg) { --rc: var(--neg); }
.sig-bar { position: relative; height: 5px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--neg) 18%, var(--wash)) 0 var(--z, 30%), color-mix(in srgb, var(--pos) 14%, var(--wash)) var(--z, 30%)); }
.sig-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; } .sig-bar i.pos { background: var(--pos); } .sig-bar i.neg { background: var(--neg); }
.sig-bar b { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.sig-mid .sig-res { font-size: 22px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sig-mid .sig-res:not(.pos):not(.neg) { color: var(--muted); }
.sig-mid .muted, .sig-bot .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-bot { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sig-bot .muted { font-size: 11px; }
.sig-golden { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; color: color-mix(in srgb, #d99a1e 65%, var(--ink)); background: color-mix(in srgb, #f5b942 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f5b942 45%, transparent); }
.sig-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 210px; }
.sig-btcrsi { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.sig-shape { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; color: color-mix(in srgb, #a855f7 70%, var(--ink)); background: color-mix(in srgb, #a855f7 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #a855f7 38%, transparent); }
.sig-shape.wick { background: color-mix(in srgb, #a855f7 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #a855f7 60%, transparent); }
.sig-btcrsi.cool { color: color-mix(in srgb, #0ea5e9 70%, var(--ink)); background: color-mix(in srgb, #38bdf8 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #38bdf8 45%, transparent); }
.sig-btcrsi.deep, .sig-btcrsi.chase { color: color-mix(in srgb, #ea580c 70%, var(--ink)); background: color-mix(in srgb, #fb923c 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #fb923c 40%, transparent); }
.sig-grade { --gold: #f5b942; --gold-2: #ffe08a; --green: #22c55e; --bronze: #cd7f32; position: relative; overflow: hidden; display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  padding: 0 8px; border-radius: 999px; white-space: nowrap; line-height: 18px; align-self: center; background: var(--wash); color: var(--muted); }
/* C: bronze · B: the win color, solid · B+: sky blue with a sheen · A: green with a sheen · A+: gold with a glow, a star and a sheen */
.sig-grade.g-cplusplus { color: #fff; background: linear-gradient(135deg, #f4b183, #e8955a 50%, #b8622c); box-shadow: 0 0 0 1px color-mix(in srgb, #e8955a 60%, #fff), 0 2px 8px -2px color-mix(in srgb, #e8955a 60%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .2); }
.sig-grade.g-c { color: #fff3e6; background: linear-gradient(135deg, #e0a06a, var(--bronze) 50%, #9a5a24);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bronze) 60%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .2); }
.sig-grade.g-b { color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--pos) 92%, #fff), color-mix(in srgb, var(--pos) 70%, #0f766e));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pos) 50%, transparent), 0 2px 8px -2px color-mix(in srgb, var(--pos) 60%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .15); }
.sig-grade.g-bplus { color: #fff; background: linear-gradient(135deg, #7dd3fc, #0ea5e9 50%, #0369a1);
  box-shadow: 0 0 0 1px color-mix(in srgb, #0ea5e9 60%, #fff), 0 2px 10px -2px color-mix(in srgb, #0ea5e9 70%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .2); }
.sig-grade.g-a { color: #fff; background: linear-gradient(135deg, #4ade80, var(--green) 45%, #15803d);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 60%, #fff), 0 2px 10px -2px color-mix(in srgb, var(--green) 70%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .2); }
.sig-grade.g-aplusplus { color: #4a3000; background: linear-gradient(135deg, var(--gold-2), var(--gold) 45%, #e0901f);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 70%, #fff), 0 0 12px -1px color-mix(in srgb, var(--gold) 75%, transparent); text-shadow: 0 1px 0 rgb(255 255 255 / .35); }
/* the sheen: a light band that sweeps across now and then (cards only, not every table row) */
.sig-tile .sig-grade.g-a::after, .sig-tile .sig-grade.g-aplusplus::after, .grade-card.g-aplusplus dt::after, .grade-card.g-a dt::after,
.grade-check .sig-grade.g-a::after, .grade-check .sig-grade.g-aplusplus::after, .sig-tile .sig-grade.g-bplus::after, .grade-check .sig-grade.g-bplus::after {
  content: ''; position: absolute; inset: -2px; transform: translateX(-120%) skewX(-20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .75), transparent); animation: gradeShine 3.2s ease-in-out infinite; }
.sig-tile .sig-grade.g-aplusplus::after { animation-duration: 2.4s; }
.sig-tile .sig-grade.g-aplusplus { animation: gradeGlow 2.4s ease-in-out infinite; }
@keyframes gradeShine { 0%, 55% { transform: translateX(-120%) skewX(-20deg); } 80%, 100% { transform: translateX(120%) skewX(-20deg); } }
@keyframes gradeGlow { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 70%, #fff), 0 0 18px 1px color-mix(in srgb, var(--gold) 85%, transparent); } }
/* the whole card picks up the grade's color */
.sig-tile.tile-g-aplusplus { border-color: color-mix(in srgb, #f5b942 65%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #f5b942 14%, var(--card-2)), var(--card-2) 60%); box-shadow: 0 0 16px -6px color-mix(in srgb, #f5b942 80%, transparent); }
.sig-tile.tile-g-a { border-color: color-mix(in srgb, #22c55e 50%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #22c55e 10%, var(--card-2)), var(--card-2) 60%); box-shadow: 0 0 14px -8px #22c55e; }
.sig-tile.tile-g-bplus { border-color: color-mix(in srgb, #0ea5e9 45%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #0ea5e9 9%, var(--card-2)), var(--card-2) 60%); }
.sig-tile.tile-g-b { border-color: color-mix(in srgb, var(--pos) 35%, var(--ring)); }
.sig-tile.tile-g-cplusplus { border-color: color-mix(in srgb, #e8955a 45%, var(--ring)); }
.sig-tile.tile-g-c { border-color: color-mix(in srgb, #cd7f32 30%, var(--ring)); }
/* Signals tab: grade checkboxes and per-grade summary cards */
.grade-checks { display: flex; gap: 4px; align-items: center; padding: 3px 6px; border: 1px solid var(--ring); border-radius: 999px; background: var(--card); }
.grade-all { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 9px; margin-right: 2px; border: 1px solid var(--ring); border-radius: 999px; background: var(--card-2, var(--card)); color: inherit; cursor: pointer; }
.grade-all:hover { border-color: var(--a1, var(--accent)); }
.grade-all:focus-visible { outline: 2px solid color-mix(in srgb, var(--a1, var(--accent)) 50%, transparent); }
.grade-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 4px; border-radius: 999px; }
.grade-check input { margin: 0; accent-color: var(--a1, var(--accent)); cursor: pointer; }
.grade-check input:not(:checked) + .sig-grade { filter: grayscale(1); opacity: .45; }
.wrong-check { padding: 5px 10px; border: 1px solid var(--ring); background: var(--card); font-size: 12px; white-space: nowrap; }
.wrong-check input:not(:checked) + span { opacity: .7; }
.grade-check:focus-within { outline: 2px solid color-mix(in srgb, var(--a1, var(--accent)) 50%, transparent); }
.grade-card { position: relative; overflow: hidden; }
.grade-card.off { opacity: .5; }
.grade-card.g-aplusplus { border-color: color-mix(in srgb, #f5b942 60%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #f5b942 12%, var(--card)), var(--card) 65%); }
.grade-card.g-aplusplus dt { position: relative; overflow: hidden; display: inline-block; color: #a8730a; font-weight: 700; }
.grade-card.g-a { border-color: color-mix(in srgb, #22c55e 45%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #22c55e 9%, var(--card)), var(--card) 65%); }
.grade-card.g-a dt { position: relative; overflow: hidden; display: inline-block; color: #16a34a; font-weight: 700; }
.grade-card.g-bplus { border-color: color-mix(in srgb, #0ea5e9 45%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #0ea5e9 8%, var(--card)), var(--card) 65%); }
.grade-card.g-bplus dt { color: #0284c7; font-weight: 700; }
.grade-card.g-b { border-color: color-mix(in srgb, var(--pos) 35%, var(--ring)); }
.grade-card.g-b dt { color: var(--pos); font-weight: 700; }
.grade-card.g-cplusplus { border-color: color-mix(in srgb, #e8955a 45%, var(--ring)); }
.grade-card.g-cplusplus dt { color: #c46f34; font-weight: 700; }
.grade-card.g-c { border-color: color-mix(in srgb, #cd7f32 35%, var(--ring)); }
.grade-card.g-c dt { color: #b06a2a; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .sig-grade::after, .grade-card dt::after { display: none; } .sig-tile .sig-grade.g-aplusplus { animation: none; } }
.sig-res { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.sig-res.pos { color: var(--pos); } .sig-res.neg { color: var(--neg); }
.sig-trend { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; background: var(--wash); color: var(--muted); }
.sig-trend.aligned { color: var(--pos); background: color-mix(in srgb, var(--pos) 14%, transparent); }
.sig-trend.counter { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.sig-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sig-more { position: relative; }
.sig-filt-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }
.sig-filt-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sig-filt-btn b { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 10.5px; background: var(--a1, var(--accent)); color: #fff; }
.sig-filt-btn[aria-expanded="true"] { border-color: var(--a1, var(--accent)); }
.sig-filt-panel { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 260px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--ring); border-radius: 12px; background: var(--card); box-shadow: 0 12px 32px -12px rgb(0 0 0 / .35); }
.sig-filt-panel[hidden] { display: none; }
.sig-filt-panel > label:not(.grade-check) { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sig-filt-panel select { width: 100%; }
.sig-filt-panel .wrong-check { justify-self: start; }
.sig-filt-reset { justify-self: end; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sig-filt-reset:hover { color: var(--ink); }
.sig-filt-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sig-filt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--a1, var(--accent)) 40%, var(--ring)); background: color-mix(in srgb, var(--a1, var(--accent)) 10%, var(--card)); color: var(--ink); }
.sig-filt-chip i { font-style: normal; width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; opacity: .6; }
.sig-filt-chip:hover i { opacity: 1; background: color-mix(in srgb, var(--a1, var(--accent)) 20%, transparent); }
#sigSummary small b.pos { color: var(--pos); } #sigSummary small b.neg { color: var(--neg); }
@media (max-width: 560px) { .sig-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .sig-head-right .muted { display: none; } .sig-top .muted { display: none; } .sig-tile { padding: 8px 9px; } }

/* open positions at half width, beside the latest signals: one row per position */
@media (min-width: 1241px) {
  .pos-card.c6 .pos-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 12px; }
}
.grid > .pos-card.c6, .grid > .sig-card.c6 { min-width: 0; }

/* ---- signals loading ---- */
.sig-results { gap: inherit; }
.sig-results[hidden], .sig-loader[hidden] { display: none; }
.sig-loader { margin-top: 14px; display: grid; gap: 12px; }
.sig-loader-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sig-loader-head .muted { margin-left: auto; font-variant-numeric: tabular-nums; }
.sig-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--a) 25%, transparent); border-top-color: var(--a); animation: sigSpin .8s linear infinite; }
.sig-loader-bar { height: 6px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.sig-loader-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--a1), var(--a3), var(--a5)); background-size: 200% 100%; transition: width .35s var(--ease); animation: sigFlow 2.4s linear infinite; }
.sig-loader-pairs { display: flex; flex-wrap: wrap; gap: 6px; }
.sig-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card-2); color: var(--muted); transition: color .3s, background-color .3s, border-color .3s; }
.sig-chip.wait { animation: sigBreathe 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * 40ms); }
.sig-chip.ok { color: var(--a); border-color: color-mix(in srgb, var(--a) 45%, var(--ring)); background: color-mix(in srgb, var(--a) 12%, var(--card-2)); animation: sigPop .35s var(--ease); }
.sig-chip.ok::before { content: '✓ '; }
.sig-chip.err { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, var(--ring)); }
.sig-reveal > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--n, 0) * 60ms); }
.sig-reveal > :nth-child(2) { --n: 1; }
/* dashboard tiles: shimmer while loading, then rise in */
.sig-skel { cursor: default; gap: 8px; }
.sig-skel i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--wash) 25%, color-mix(in srgb, var(--a) 14%, var(--wash)) 50%, var(--wash) 75%); background-size: 200% 100%; animation: sigShimmer 1.3s linear infinite; animation-delay: calc(var(--i) * 120ms); }
.sig-skel i.w60 { width: 60%; } .sig-skel i.w80 { width: 80%; } .sig-skel i.w40 { width: 40%; }
.sig-in { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes sigSpin { to { transform: rotate(360deg); } }
@keyframes sigFlow { to { background-position: -200% 0; } }
@keyframes sigBreathe { 50% { opacity: .45; } }
@keyframes sigPop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes sigShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sig-spinner, .sig-loader-bar i, .sig-chip, .sig-skel i, .sig-in, .sig-reveal > * { animation: none; } }
/* no open positions: the latest signals take the whole row */
.pos-card[hidden] { display: none; }
.pos-card[hidden] + .sig-card { grid-column: span 12; }
.pos-card[hidden] + .sig-card .sig-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1240px) { .pos-card[hidden] + .sig-card .sig-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pos-card[hidden] + .sig-card .sig-grid { grid-template-columns: 1fr; } }
.pos-card[hidden] + .sig-card .sig-top .muted { display: none; }
#sigSummary dd.pos { color: var(--pos); } #sigSummary dd.neg { color: var(--neg); }

/* today's playbook */
.day-playbook { --pb: var(--a2, var(--accent)); padding: 12px 16px; border: 1px solid var(--ring); border-left: 3px solid var(--pb); border-radius: 12px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--pb) 9%, var(--card)), var(--card) 55%); box-shadow: var(--shadow); }
.day-playbook[hidden] { display: none; }
.day-playbook.pb-strong { --pb: #22c55e; } .day-playbook.pb-mixed { --pb: var(--warn); } .day-playbook.pb-weak { --pb: var(--neg); }
.pb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; }
.pb-icon { color: var(--pb); font-size: 12px; }
.pb-verdict { font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; color: var(--pb); background: color-mix(in srgb, var(--pb) 14%, transparent); }
.pb-stat { margin-left: auto; }
.pb-slots { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 9px; }
.pb-slots-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: 2px; }
.pb-slot { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--ring); background: var(--card); }
.pb-slot b { font-variant-numeric: tabular-nums; }
.pb-slot.prime { border-color: color-mix(in srgb, #22c55e 55%, var(--ring)); background: color-mix(in srgb, #22c55e 12%, var(--card)); } .pb-slot.prime span { color: #16a34a; font-weight: 700; }
.pb-slot.ok span { color: var(--pos); font-weight: 600; }
:root[data-mode="dark"] .pb-slot.prime span { color: #4ade80; }
.pb-slot.weak span { color: var(--neg); font-weight: 600; }
.pb-slot.caution { border-style: dashed; border-color: color-mix(in srgb, var(--warn) 55%, var(--ring)); } .pb-slot.caution span { color: var(--warn); font-weight: 700; }
.pb-slot.past { opacity: .45; }
.pb-slots-sep { font-size: 11px; color: var(--muted); }
.pb-slot.late { border-style: dashed; background: transparent; } .pb-slot.late span { color: var(--muted); font-weight: 600; }
.pb-slot.late.off { opacity: .6; }
.pb-left { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pb-slot.next .pb-left { color: var(--ink); font-weight: 600; }
.pos-count.full { color: var(--warn); font-weight: 700; }
.pos-risk { color: var(--ink); }
.pos-total { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 10px; }
.pos-total-group { white-space: nowrap; }
.pb-slot.next { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pb) 45%, transparent); }
.pb-rules { margin-top: 8px; font-size: 13px; }
.pb-rules summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; width: fit-content; }
.pb-rules summary { margin-top: 2px; }
/* the rules, short */
.pb-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; margin-top: 8px; }
.pb-g { display: grid; grid-template-columns: 20px auto; column-gap: 6px; align-items: baseline; font-size: 12.5px; line-height: 1.4; }
.pb-g-i { grid-row: 1 / span 2; grid-column: 1; font-size: 14px; }
.pb-g b, .pb-g span:last-child { grid-column: 2; }
.pb-g b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pb-g span:last-child { color: var(--ink-2); }
.pb-slot.late.caution { border-color: color-mix(in srgb, var(--warn) 55%, var(--ring)); } .pb-slot.late.caution span { color: var(--warn); }
@media (max-width: 860px) { .pb-guide { grid-template-columns: 1fr; } .pb-stat { margin-left: 0; flex-basis: 100%; } .pb-line { flex-basis: 100%; } }

/* ---- Deep Sea ---- */
[data-theme="deepsea"] body { background-color: transparent; }
[data-theme="deepsea"] body::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    conic-gradient(from 160deg at 50% -20%, transparent 0deg, rgba(120, 200, 255, 0.10) 8deg, transparent 16deg, rgba(120, 200, 255, 0.07) 26deg, transparent 34deg, rgba(120, 200, 255, 0.09) 44deg, transparent 52deg),
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(40, 130, 220, 0.35), transparent 70%),
    linear-gradient(#04203f, #020a17 60%, #01050c);
  animation: sway 18s ease-in-out infinite alternate; }
@keyframes sway { to { transform: skewX(-3deg) translateX(1.5vw); } }
/* drifting plankton, glowing as it rises */
[data-theme="deepsea"] body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .9;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(120, 255, 235, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 70% 60%, rgba(150, 200, 255, 0.8), transparent),
    radial-gradient(2.5px 2.5px at 40% 80%, rgba(255, 140, 230, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, rgba(120, 255, 235, 0.8), transparent),
    radial-gradient(3px 3px at 10% 70%, rgba(180, 140, 255, 0.55), transparent);
  background-size: 310px 420px, 260px 340px, 430px 520px, 200px 300px, 520px 640px;
  animation: plankton 40s linear infinite; }
@keyframes plankton { to { background-position: 30px -420px, -20px -340px, 40px -520px, 0 -300px, -30px -640px; } }
[data-theme="deepsea"] .card, [data-theme="deepsea"] .stat, [data-theme="deepsea"] .side, [data-theme="deepsea"] .warnings, [data-theme="deepsea"] .status-bar {
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
[data-theme="deepsea"] .card, [data-theme="deepsea"] .stat { border-color: rgba(94, 234, 255, 0.16); }
[data-theme="deepsea"] .card.accented:hover, [data-theme="deepsea"] .stat:hover { box-shadow: var(--shadow), 0 0 26px -6px color-mix(in srgb, var(--a) 70%, transparent); }
[data-theme="deepsea"] .head h1 { color: #e4fbff; text-shadow: 0 0 18px rgba(94, 242, 214, 0.55), 0 0 2px rgba(94, 242, 214, 0.8); letter-spacing: 0.02em; }
[data-theme="deepsea"] .nav button[aria-current="page"] { background: rgba(94, 242, 214, 0.14); box-shadow: inset 2px 0 0 #5ef2d6, 0 0 18px -6px #5ef2d6; }
[data-theme="deepsea"] .btn.primary { background: linear-gradient(90deg, #5ef2d6, #7cc8ff); color: #021a1a; }
[data-theme="deepsea"] .side::after { content: '🪼'; position: absolute; right: 18px; bottom: 120px; font-size: 26px; opacity: .8; filter: drop-shadow(0 0 10px rgba(255, 138, 216, 0.8)); animation: jelly 7s ease-in-out infinite; pointer-events: none; }
@keyframes jelly { 50% { transform: translateY(-34px) scaleY(1.08); } }
[data-theme="deepsea"] .dlg, [data-theme="deepsea"] .tip, [data-theme="deepsea"] .theme-menu { background: rgba(6, 28, 50, 0.94); }
[data-theme="deepsea"] select option { background: var(--solid); }

/* ---- Blueprint ---- */
[data-theme="blueprint"] body { background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-attachment: fixed; }
[data-theme="blueprint"] .card, [data-theme="blueprint"] .stat { border: 1.5px solid rgba(242, 248, 255, 0.75); box-shadow: none; outline: 1px dashed rgba(242, 248, 255, 0.22); outline-offset: 5px; }
[data-theme="blueprint"] .card.accented:hover, [data-theme="blueprint"] .stat:hover { outline-color: var(--accent); }
[data-theme="blueprint"] .head h1 { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.04em; text-transform: uppercase; }
[data-theme="blueprint"] .head h1::after { content: 'Sheet 1 of 1 · scale 1:1'; display: block; font: 600 10px/1.4 var(--font); letter-spacing: 0.18em; color: var(--muted); }
[data-theme="blueprint"] .card h2, [data-theme="blueprint"] .card > .card-row > .kicker, [data-theme="blueprint"] .stat .kicker { font-family: var(--font-display); letter-spacing: 0.06em; }
[data-theme="blueprint"] .stat-value, [data-theme="blueprint"] .mid-value, [data-theme="blueprint"] .big { font-family: var(--font); }
[data-theme="blueprint"] .nav button[aria-current="page"] { background: transparent; box-shadow: none; outline: 1.5px solid var(--accent); outline-offset: -1.5px; color: var(--accent); }
[data-theme="blueprint"] .btn { border-style: dashed; }
[data-theme="blueprint"] .btn.primary { background: var(--accent); color: var(--accent-ink); border-style: solid; }
[data-theme="blueprint"] .side { border-right: 1.5px solid rgba(242, 248, 255, 0.6); }
[data-theme="blueprint"] .dlg, [data-theme="blueprint"] .tip, [data-theme="blueprint"] .theme-menu { background: #0f427e; }
[data-theme="blueprint"] select option { background: var(--solid); }

/* ---- Notebook ---- */
[data-theme="notebook"] body { background-color: var(--page); background-image:
    linear-gradient(90deg, transparent 58px, rgba(214, 56, 58, 0.45) 58px, rgba(214, 56, 58, 0.45) 60px, transparent 60px),
    repeating-linear-gradient(transparent 0 27px, rgba(31, 111, 209, 0.16) 27px 28px); background-attachment: fixed; }
[data-theme="notebook"] .card, [data-theme="notebook"] .stat, [data-theme="notebook"] .warnings {
  border: 2px solid var(--ink); border-radius: 14px 4px 12px 6px / 6px 12px 4px 14px; }
[data-theme="notebook"] .stat:nth-child(odd) { transform: rotate(-0.5deg); }
[data-theme="notebook"] .stat:nth-child(even) { transform: rotate(0.4deg); }
[data-theme="notebook"] .card.accented:hover, [data-theme="notebook"] .stat:hover { transform: rotate(0deg) translateY(-2px); }
[data-theme="notebook"] .head h1 { font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1;
  background: linear-gradient(transparent 58%, rgba(255, 226, 64, 0.75) 58%, rgba(255, 226, 64, 0.75) 92%, transparent 92%); padding: 0 6px; }
[data-theme="notebook"] .card h2, [data-theme="notebook"] .card > .card-row > .kicker, [data-theme="notebook"] .stat .kicker { font-family: var(--font-display); font-size: 20px; letter-spacing: 0; text-transform: none; }
[data-theme="notebook"] .kicker::before { border-radius: 50% !important; }
[data-theme="notebook"] .stat-value, [data-theme="notebook"] .mid-value, [data-theme="notebook"] .big { font-family: var(--font); }
[data-theme="notebook"] .nav button[aria-current="page"] { background: transparent; box-shadow: none; color: var(--ink);
  background-image: linear-gradient(transparent 55%, rgba(255, 226, 64, 0.8) 55%, rgba(255, 226, 64, 0.8) 90%, transparent 90%); }
[data-theme="notebook"] .nav button[aria-current="page"]::before { content: '→'; margin-right: -4px; }
[data-theme="notebook"] .btn { border: 2px solid var(--ink); border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px; }
[data-theme="notebook"] .side { border-right: 2px dashed rgba(35, 52, 87, 0.35); }
[data-theme="notebook"] .logo span::after { content: ' ✎'; color: var(--a2); }

@media (prefers-reduced-motion: reduce) {
  [data-theme="deepsea"] body::before, [data-theme="deepsea"] body::after, [data-theme="deepsea"] .side::after { animation: none; }
}
@media print {
  [data-theme="deepsea"] body::before, [data-theme="deepsea"] body::after { display: none; }
}
.theme-opt[data-theme="deepsea"] .theme-name { font-family: "Righteous", sans-serif; }
.theme-opt[data-theme="blueprint"] .theme-name { font-family: "Architects Daughter", cursive; font-weight: 700; }
.theme-opt[data-theme="notebook"] .theme-name { font-family: "Caveat", cursive; font-size: 18px; font-weight: 700; }

/* ---- Comic Book ---- */
[data-theme="comic"] body { background-image: radial-gradient(rgba(255, 60, 120, 0.22) 1.6px, transparent 1.8px); background-size: 11px 11px; background-attachment: fixed; }
[data-theme="comic"] .card, [data-theme="comic"] .stat, [data-theme="comic"] .warnings { border: 3px solid #111; box-shadow: 5px 5px 0 #111 !important; }
[data-theme="comic"] .stat:nth-child(3n+1) { transform: rotate(-0.8deg); } [data-theme="comic"] .stat:nth-child(3n+2) { transform: rotate(0.6deg); }
[data-theme="comic"] .card.accented:hover, [data-theme="comic"] .stat:hover { transform: rotate(0deg) translate(-2px, -2px); box-shadow: 7px 7px 0 #111 !important; }
[data-theme="comic"] .head h1 { font-family: var(--font-display); font-size: 44px; letter-spacing: 0.04em; color: #ffd400; -webkit-text-stroke: 2px #111; text-shadow: 4px 4px 0 #ff2424; transform: rotate(-2deg); }
[data-theme="comic"] .head-title { position: relative; isolation: isolate; }
[data-theme="comic"] .head-title h1 { position: relative; z-index: 1; }
[data-theme="comic"] .head-title::before { content: 'POW!'; order: 3; flex: none; margin-left: 4px; display: grid; place-items: center; width: 84px; height: 62px;
  font: 17px/1 "Bangers", Impact, sans-serif; color: #111; background: #ff7ac8; transform: rotate(-14deg); animation: pow 2.6s ease-in-out infinite;
  clip-path: polygon(50% 0, 61% 30%, 98% 18%, 72% 45%, 100% 70%, 62% 64%, 55% 100%, 42% 68%, 4% 88%, 28% 56%, 0 30%, 38% 34%); padding-left: 2px; }
@keyframes pow { 0%, 80%, 100% { transform: rotate(-14deg) scale(1); } 88% { transform: rotate(-8deg) scale(1.18); } }
[data-theme="comic"] .card h2, [data-theme="comic"] .card > .card-row > .kicker, [data-theme="comic"] .stat .kicker { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.06em; color: #111; }
[data-theme="comic"] .stat-value, [data-theme="comic"] .mid-value, [data-theme="comic"] .big { font-family: var(--font-display); letter-spacing: 0.03em; }
[data-theme="comic"] .nav button[aria-current="page"] { background: #ffd400; color: #111; border: 3px solid #111; box-shadow: 3px 3px 0 #111; }
[data-theme="comic"] .btn { border: 3px solid #111; box-shadow: 3px 3px 0 #111; font-weight: 700; }
[data-theme="comic"] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }
[data-theme="comic"] .btn.primary { background: #ff2424; color: #fff; }
[data-theme="comic"] .side { border-right: 3px solid #111; }

/* ---- Groovy ---- */
[data-theme="groovy"] body { background-color: var(--page); background-image:
    repeating-conic-gradient(from 0deg at 50% 120%, rgba(232, 116, 44, 0.16) 0deg 6deg, transparent 6deg 12deg),
    radial-gradient(circle at 50% 120%, rgba(217, 165, 33, 0.35) 0 22%, transparent 22.2%); background-attachment: fixed; }
[data-theme="groovy"] .card, [data-theme="groovy"] .stat, [data-theme="groovy"] .warnings { border: 3px solid var(--ring); }
[data-theme="groovy"] .head h1 { font-family: var(--font-display); font-size: 40px; font-weight: 400; color: #e8742c;
  text-shadow: 3px 3px 0 #d9a521, 6px 6px 0 #7b8f2e, 9px 9px 0 #4a230b; letter-spacing: 0.01em; }
[data-theme="groovy"] .card h2, [data-theme="groovy"] .card > .card-row > .kicker, [data-theme="groovy"] .stat .kicker { font-family: var(--font-display); font-size: 16px; text-transform: none; letter-spacing: 0.01em; color: var(--ink); }
[data-theme="groovy"] .stat-value, [data-theme="groovy"] .mid-value, [data-theme="groovy"] .big { font-family: var(--font-display); font-weight: 400; }
[data-theme="groovy"] .nav button[aria-current="page"] { background: #d9a521; color: #4a230b; border-radius: 999px; box-shadow: inset 0 0 0 3px #4a230b; }
[data-theme="groovy"] .btn { border-radius: 999px; border: 3px solid var(--ring); }
[data-theme="groovy"] .btn.primary { background: #e8742c; color: #fff3d6; }
[data-theme="groovy"] .side { border-right: 0; background-image: repeating-linear-gradient(90deg, transparent 0 calc(100% - 30px), #e8742c calc(100% - 30px) calc(100% - 22px), #d9a521 calc(100% - 22px) calc(100% - 14px), #7b8f2e calc(100% - 14px) calc(100% - 6px), transparent calc(100% - 6px)); }

/* ---- Beige Box ---- */
[data-theme="beige"] body { font-size: 13px; }
[data-theme="beige"] .card, [data-theme="beige"] .stat, [data-theme="beige"] .warnings, [data-theme="beige"] .dlg, [data-theme="beige"] .theme-menu {
  border: 0; border-radius: 0; box-shadow: var(--shadow) !important; }
/* every card heading becomes a window title bar */
[data-theme="beige"] .card > .kicker, [data-theme="beige"] .card > .card-row > .kicker, [data-theme="beige"] .stat .kicker {
  background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font-weight: 700; padding: 2px 6px; letter-spacing: 0.02em; text-transform: none; font-size: 12px; }
[data-theme="beige"] .card > .card-row > .kicker::after, [data-theme="beige"] .card > .kicker::after { content: '_ □ ×'; margin-left: auto; padding-left: 14px; letter-spacing: 3px; font-family: var(--font); }
[data-theme="beige"] .kicker::before { display: none !important; }
[data-theme="beige"] .head h1 { font-family: var(--font-display); color: #fff; font-size: 30px; text-shadow: 2px 2px 0 #000; }
[data-theme="beige"] .head .range-text, [data-theme="beige"] .head .muted { color: #e0ffff; }
[data-theme="beige"] .side { box-shadow: inset -2px 0 0 #404040, inset -3px 0 0 #808080; border-right: 0; }
[data-theme="beige"] .nav button[aria-current="page"] { background: #000080; color: #fff; box-shadow: none; border-radius: 0; }
[data-theme="beige"] .btn, [data-theme="beige"] select, [data-theme="beige"] input { border: 0 !important; border-radius: 0 !important; background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040, inset 2px 2px 0 #dfdfdf, inset -2px -2px 0 #808080 !important; }
[data-theme="beige"] .btn:active { box-shadow: inset 1px 1px 0 #404040, inset -1px -1px 0 #fff !important; }
[data-theme="beige"] .stat.hero { background: #c0c0c0; color: #000; }
[data-theme="beige"] .status-bar { background: #c0c0c0; box-shadow: inset 0 2px 0 #fff; color: #000; }
[data-theme="beige"] .logo span { font-family: var(--font-display); font-size: 13px; }
[data-theme="beige"] .stat-value, [data-theme="beige"] .mid-value, [data-theme="beige"] .big, [data-theme="beige"] .wz-amount, [data-theme="beige"] .score-value { font-family: var(--font); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { [data-theme="comic"] .head-title::before { animation: none; } }
.theme-opt[data-theme="comic"] .theme-name { font-family: "Bangers", sans-serif; font-size: 15px; letter-spacing: .04em; }
.theme-opt[data-theme="groovy"] .theme-name { font-family: "Shrikhand", serif; }
.theme-opt[data-theme="beige"] .theme-name { font-family: "Silkscreen", sans-serif; font-size: 12px; }

/* ---- Deep Sea: sea life layer (app.js adds .sea-life with creatures and bubbles) ---- */
.sea-life { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sea-life .swim { position: absolute; left: 0; font-size: var(--size, 28px); opacity: var(--o, .85); will-change: transform;
  filter: drop-shadow(0 0 8px var(--glow, rgba(94, 242, 214, 0.55))) saturate(1.1);
  animation: swim var(--dur, 40s) linear var(--delay, 0s) infinite; }
.sea-life .swim > span { display: inline-block; animation: bob var(--bob, 4s) ease-in-out infinite; }
.sea-life .swim.rtl { animation-name: swim-rtl; }
.sea-life .swim.rtl > span { transform: scaleX(-1); }
@keyframes swim { from { transform: translateX(-12vw); } to { transform: translateX(112vw); } }
@keyframes swim-rtl { from { transform: translateX(112vw); } to { transform: translateX(-12vw); } }
@keyframes bob { 50% { translate: 0 calc(var(--amp, 14px) * -1); } }
.sea-life .rtl > span { animation-name: bob; }
.sea-life .floor { position: absolute; bottom: -4px; font-size: var(--size, 34px); opacity: .7; filter: drop-shadow(0 0 10px rgba(255, 138, 216, 0.4)); transform-origin: bottom center; animation: kelp var(--dur, 6s) ease-in-out infinite alternate; }
@keyframes kelp { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.sea-life.front { z-index: 40; }
.sea-life.front .bubble { opacity: .55; }
.sea-life .bubble { position: absolute; bottom: -30px; width: var(--d, 10px); height: var(--d, 10px); border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.9) 0 12%, rgba(180, 240, 255, 0.25) 13% 55%, rgba(180, 240, 255, 0.05) 70%);
  box-shadow: inset 0 0 0 1px rgba(200, 245, 255, 0.55), 0 0 8px rgba(120, 220, 255, 0.35);
  animation: bubble var(--dur, 14s) linear var(--delay, 0s) infinite; }
@keyframes bubble { 0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: .9; } 50% { transform: translate(var(--sway, 14px), -55vh); } 100% { transform: translate(calc(var(--sway, 14px) * -1), -110vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sea-life .swim, .sea-life .swim > span, .sea-life .bubble, .sea-life .floor { animation: none; } .sea-life .bubble { display: none; } }
@media print { .sea-life { display: none; } }

/* ---- Waves ---- */
[data-theme="waves"] body { background-color: transparent; }
/* the sky: dawn light fading down into sea-glass */
[data-theme="waves"] body::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse 70% 45% at 78% 6%, rgba(255, 226, 196, 0.75), transparent 70%),
    linear-gradient(#f6f1ea 0%, #eef4f2 45%, #dfeeed 100%); }
/* three swells, each drifting at its own pace, breathing up and down */
[data-theme="waves"] body::after { content: ''; position: fixed; left: -5vw; right: -5vw; bottom: -12px; height: 48vh; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%271600%27%20height=%27200%27%20viewBox=%270%200%201600%20200%27%3E%3Cpath%20fill=%27%23a9d3d4%27%20d=%27M0%2070%20C%20200%2024%20400%20116%20800%2070%20S%201400%2024%201600%2070%20V200%20H0Z%27/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%271600%27%20height=%27200%27%20viewBox=%270%200%201600%20200%27%3E%3Cpath%20fill=%27%237fbcc0%27%20d=%27M0%2095%20C%20200%2043%20400%20147%20800%2095%20S%201400%2043%201600%2095%20V200%20H0Z%27/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%271600%27%20height=%27200%27%20viewBox=%270%200%201600%20200%27%3E%3Cpath%20fill=%27%234f9aa3%27%20d=%27M0%20125%20C%20200%2085%20400%20165%20800%20125%20S%201400%2085%201600%20125%20V200%20H0Z%27/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%271600%27%20height=%27200%27%20viewBox=%270%200%201600%20200%27%3E%3Cpath%20fill=%27%232f7c88%27%20d=%27M0%20150%20C%20200%20120%20400%20180%20800%20150%20S%201400%20120%201600%20150%20V200%20H0Z%27/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 1600px 84%, 1250px 68%, 980px 52%, 760px 36%; background-position: 0 100%, 0 100%, 0 100%, 0 100%;
  animation: swell 24s linear infinite, breathe 5.5s ease-in-out infinite alternate; }
@keyframes swell { to { background-position: 1600px 100%, -1250px 100%, 980px 100%, -760px 100%; } }
@keyframes breathe { from { transform: translateY(0) skewX(0deg); } to { transform: translateY(16px) skewX(-1.5deg); } }
[data-theme="waves"] .card, [data-theme="waves"] .stat, [data-theme="waves"] .side, [data-theme="waves"] .warnings, [data-theme="waves"] .status-bar {
  -webkit-backdrop-filter: blur(3px) saturate(1.1); backdrop-filter: blur(3px) saturate(1.1); }
[data-theme="waves"] .card, [data-theme="waves"] .stat { border-color: rgba(255, 255, 255, 0.85); }
[data-theme="waves"] .card.accented, [data-theme="waves"] .stat { box-shadow: var(--shadow); }
[data-theme="waves"] .card.accented:hover, [data-theme="waves"] .stat:hover { transform: none; box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--a) 30%, transparent); }
[data-theme="waves"] .head h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em; color: #213d47; }
[data-theme="waves"] .card h2 { font-family: var(--font-display); font-weight: 700; }
[data-theme="waves"] .kicker { letter-spacing: 0.12em; }
[data-theme="waves"] .nav button[aria-current="page"] { background: rgba(58, 154, 154, 0.12); color: #1f6f70; box-shadow: inset 2px 0 0 #3a9a9a; }
[data-theme="waves"] .btn.primary { background: #3a9a9a; color: #fff; }
[data-theme="waves"] .logo span::after { content: ' 〜'; color: var(--accent); font-weight: 400; }
@media (prefers-reduced-motion: reduce) { [data-theme="waves"] body::after { animation: none; } }
@media print { [data-theme="waves"] body::before, [data-theme="waves"] body::after { display: none; } }
.theme-opt[data-theme="waves"] .theme-name { font-family: "Shippori Mincho", serif; font-weight: 700; }

/* ---- Waves: sun, rays and seagulls (app.js adds .shore-life) ---- */
.shore-life { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.shore-life .sun { position: absolute; right: 31vw; top: -46px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, #fff6df 0 38%, #ffe2b0 52%, rgba(255, 214, 160, 0.4) 64%, transparent 72%); filter: blur(1px); animation: sunGlow 8s ease-in-out infinite alternate; }
@keyframes sunGlow { to { transform: scale(1.08); filter: blur(2px); } }
.shore-life .rays { position: absolute; right: calc(31vw + 75px); top: 29px; width: 260vmax; height: 260vmax; translate: 50% -50%; opacity: .8;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 170, 0.7) 0deg 4deg, transparent 4deg 13deg);
  -webkit-mask: radial-gradient(circle, #000 0 10%, rgba(0, 0, 0, 0.55) 24%, transparent 46%); mask: radial-gradient(circle, #000 0 10%, rgba(0, 0, 0, 0.55) 24%, transparent 46%);
  animation: rays 120s linear infinite; }
@keyframes rays { to { rotate: 360deg; } }
.shore-life.front { z-index: 40; }
.shore-life .gull { position: absolute; left: 0; width: var(--w, 40px); color: var(--c, #33505a); opacity: var(--o, .75);
  animation: glide var(--dur, 40s) linear var(--delay, 0s) infinite; }
.shore-life .gull.rtl { animation-name: glide-rtl; }
.shore-life .gull svg { display: block; width: 100%; overflow: visible; animation: flap var(--flap, .9s) ease-in-out infinite alternate, soar var(--soar, 6s) ease-in-out infinite; }
.shore-life .gull path { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes glide { from { transform: translateX(-8vw); } to { transform: translateX(108vw); } }
@keyframes glide-rtl { from { transform: translateX(108vw) scaleX(-1); } to { transform: translateX(-8vw) scaleX(-1); } }
@keyframes flap { from { scale: 1 1; } to { scale: 1 .35; } }
@keyframes soar { 50% { translate: 0 -22px; } }
@media (prefers-reduced-motion: reduce) { .shore-life *, .shore-life svg { animation: none !important; } [data-theme="waves"] body::after { animation: none; } }
@media print { .shore-life { display: none; } }


/* Analytics: the six 4h closes */
.close-table tr.in-hours td:first-child { font-weight: 700; }
.close-verdict { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.close-verdict.pos { color: #fff; background: #22a35a; } .close-verdict.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.close-verdict.neg { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); } .close-verdict.muted { color: var(--muted); background: var(--wash); }
.close-sub { font-size: 14px; margin: 16px 0 8px; }
.close-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); gap: 4px; }
.cg-day, .cg-hour { font-size: 11.5px; color: var(--muted); display: grid; place-items: center; }
.cg-hour { justify-content: start; font-variant-numeric: tabular-nums; }
.cg-cell { display: grid; place-items: center; padding: 6px 2px; border-radius: var(--radius-sm); background: var(--wash); min-height: 42px; font-variant-numeric: tabular-nums; }
.cg-cell b { font-size: 13px; } .cg-cell small { font-size: 10.5px; color: var(--muted); }
.cg-cell.pos { background: color-mix(in srgb, var(--pos) calc(var(--k) * 55% + 6%), transparent); }
.cg-cell.neg { background: color-mix(in srgb, var(--neg) calc(var(--k) * 55% + 6%), transparent); }
.cg-cell.thin { opacity: .5; }
.close-note { margin: 10px 0 0; }


/* ================= Strategy tab ================= */
.st-page { --st-up: var(--pos); --st-down: var(--neg); }
.st-page .card h2 { font-size: 18px; font-family: var(--font-display); margin: 2px 0 10px; }
.st-page h3 { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 6px 0 6px; }
.st-page p { line-height: 1.6; color: var(--ink-2); margin: 8px 0; }
.st-page b { color: var(--ink); }
.st-sec { scroll-margin-top: 16px; }
/* hero */
.st-hero { padding: 26px 28px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--a2) 16%, transparent), transparent 55%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--a1) 12%, transparent), transparent 60%), var(--card); }
.st-hero h2 { font-size: clamp(22px, 3vw, 30px) !important; line-height: 1.15; max-width: 22ch; }
.st-lede { font-size: 15px; max-width: 78ch; }
.st-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 16px; }
.st-kpis > div { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--wash); border: 1px solid var(--ring); }
.st-kpis b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.st-kpis span { font-size: 12px; color: var(--muted); }
.st-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.st-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card-2); color: var(--ink-2); font-size: 12.5px; text-decoration: none; transition: border-color .2s, color .2s; }
.st-toc a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--ring)); }
.st-toc a i { font-style: normal; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
/* figures */
.st-fig { margin: 6px 0 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--ring); }
.st-scroll { overflow-x: auto; }
.st-svg { display: block; width: 100%; max-width: 900px; margin: 0 auto; height: auto; font-family: var(--font); }
.st-cap { max-width: 900px; margin: 4px auto 6px !important; font-size: 13px; text-align: center; }
.st-scroll .st-svg { min-width: 620px; }
.st-figcard { padding: 10px; }
.st-figcard .st-fig { margin: 0; border: 0; }
.st-up line, .st-up rect { stroke: var(--st-up); fill: var(--st-up); } .st-up line { stroke-width: 1.5; }
.st-down line, .st-down rect { stroke: var(--st-down); fill: var(--st-down); } .st-down line { stroke-width: 1.5; }
.st-fade { opacity: .35; }
.st-level { stroke: var(--a3); stroke-width: 1.6; stroke-dasharray: 6 4; }
.st-level-2 { stroke: var(--pos); }
.st-risk { fill: color-mix(in srgb, var(--neg) 16%, transparent); }
.st-reward { fill: color-mix(in srgb, var(--pos) 14%, transparent); }
.st-dot { fill: var(--a3); } .st-dot.pos { fill: var(--pos); }
.st-note { font-size: 11.5px; fill: var(--ink-2); } .st-note.neg { fill: var(--neg); }
.st-em { font-weight: 700; fill: var(--ink); }
.st-tag { font-size: 12px; font-weight: 700; fill: var(--ink); } .st-tag.neg { fill: var(--neg); } .st-tag.pos { fill: var(--pos); }
.st-zone { font-size: 15px; font-weight: 800; fill: var(--ink); opacity: .75; }
.st-brace, .st-span { fill: none; stroke: var(--muted); stroke-width: 1.2; }
.st-span { stroke-dasharray: 2 3; }
.st-grid { stroke: var(--grid); stroke-width: 1; } .st-grid.neg { stroke: color-mix(in srgb, var(--neg) 50%, transparent); } .st-grid.pos { stroke: color-mix(in srgb, var(--pos) 60%, transparent); }
.st-stop { fill: none; stroke: var(--neg); stroke-width: 2; stroke-dasharray: 5 4; }
.st-price { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.st-add circle { fill: var(--a1); stroke: var(--card-2); stroke-width: 2; }
.st-add-t { font-size: 12px; font-weight: 700; fill: var(--ink); }
/* the grade tree */
.st-node rect { fill: var(--card); stroke: var(--axis); stroke-width: 1.2; }
.st-node text { font-size: 12px; fill: var(--ink); font-weight: 600; }
.st-node.start rect { fill: color-mix(in srgb, var(--accent) 16%, var(--card)); stroke: var(--accent); }
.st-node.small text { font-size: 10.5px; }
.st-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; marker-end: url(#stArrow); }
.st-arrowhead { fill: var(--muted); }
.st-edge-t { font-size: 10.5px; font-weight: 700; fill: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.st-edge-t.yes { fill: var(--pos); } .st-edge-t.no { fill: var(--neg); }
.st-leaf rect { stroke-width: 1.6; }
.st-leaf-g { font-size: 15px; font-weight: 800; } .st-leaf-s { font-size: 10.5px; fill: var(--ink-2); }
.st-leaf.g-aplusplus rect { fill: color-mix(in srgb, #f5b942 22%, var(--card)); stroke: #f5b942; } .st-leaf.g-aplusplus .st-leaf-g { fill: #d99a1a; }
.st-leaf.g-a rect { fill: color-mix(in srgb, #22c55e 18%, var(--card)); stroke: #22c55e; } .st-leaf.g-a .st-leaf-g { fill: #16a34a; }
.st-leaf.g-bplus rect { fill: color-mix(in srgb, #0ea5e9 18%, var(--card)); stroke: #0ea5e9; } .st-leaf.g-bplus .st-leaf-g { fill: #0284c7; }
.st-leaf.g-b rect { fill: color-mix(in srgb, var(--pos) 12%, var(--card)); stroke: var(--pos); } .st-leaf.g-b .st-leaf-g { fill: var(--pos); }
.st-leaf.g-cplusplus rect { fill: color-mix(in srgb, #e8955a 16%, var(--card)); stroke: #e8955a; } .st-leaf.g-cplusplus .st-leaf-g { fill: #c46f34; }
.st-leaf.g-c rect { fill: color-mix(in srgb, #cd7f32 16%, var(--card)); stroke: #cd7f32; } .st-leaf.g-c .st-leaf-g { fill: #b06a2a; }
/* text blocks */
.st-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.st-list { margin: 6px 0; padding-left: 18px; color: var(--ink-2); line-height: 1.6; }
.st-list li { margin: 4px 0; }
.st-list li::marker { color: var(--accent); }
.st-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-pill { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--ring); background: var(--card-2); border-top: 3px solid var(--ink-2); }
.st-pill.neg { border-top-color: var(--neg); } .st-pill.pos { border-top-color: var(--pos); }
.st-pill > b { display: block; margin-bottom: 4px; }
.st-pill span { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.st-defs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.st-defs > div { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--wash); border: 1px solid var(--ring); }
.st-defs b { display: block; margin-bottom: 4px; font-size: 13px; }
.st-defs span { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.st-matrix th { font-size: 11.5px; white-space: normal; }
.st-matrix td { text-align: center; } .st-matrix td:first-child, .st-matrix th:first-child { text-align: left; }
.st-matrix td:last-child { white-space: nowrap; }
/* grade cards */
.st-grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.st-grade { --g: var(--ring); padding: 14px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--g) 50%, var(--ring)); background: linear-gradient(165deg, color-mix(in srgb, var(--g) 10%, var(--card)), var(--card) 60%); }
.st-grade.g-aplusplus { --g: #f5b942; } .st-grade.g-a { --g: #22c55e; } .st-grade.g-bplus { --g: #0ea5e9; } .st-grade.g-b { --g: var(--pos); } .st-grade.g-c { --g: #cd7f32; } .st-grade.g-cplusplus { --g: #e8955a; }
.st-grade header { display: flex; align-items: center; gap: 10px; }
.st-grade header .sig-grade { font-size: 14px; line-height: 24px; padding: 0 11px; }
.st-grade h3 { margin: 0; font-size: 15px; }
.st-grade > p { font-size: 13px; }
.st-grade-cols { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.st-checks { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.st-checks li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; color: var(--ink-2); }
.st-checks i { font-style: normal; font-weight: 800; width: 14px; text-align: center; flex: none; }
.st-checks i.yes { color: var(--pos); } .st-checks i.no { color: var(--neg); } .st-checks i.any { color: var(--muted); }
.st-or { margin: 4px 0 !important; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) !important; }
.st-stats { margin: 0; display: grid; gap: 6px; min-width: 128px; }
.st-stats div { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--wash); }
.st-stats dt { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }
.st-stats dd { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.35; }
.st-how { font-size: 13px; margin: 12px 0 0 !important; padding-top: 10px; border-top: 1px dashed var(--ring); }
/* the week */
.st-wk-wrap { overflow-x: auto; margin: 10px 0 8px; }
.st-wk { display: grid; grid-template-columns: 52px repeat(6, minmax(96px, 1fr)); gap: 5px; min-width: 640px; }
.st-wk-h { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; padding: 4px 0; }
.st-wk-h small { display: block; font-weight: 500; font-size: 10px; color: var(--muted); }
.st-wk-d { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: grid; align-items: center; }
.st-wk-gap { margin-left: 10px; }
.st-wk-c { padding: 7px 8px; border-radius: var(--radius-sm); border: 1px solid var(--ring); background: var(--card-2); min-height: 52px; }
.st-wk-c b { display: block; font-size: 12px; }
.st-wk-c span { font-size: 10.5px; color: var(--ink-2); line-height: 1.3; display: block; }
.st-wk-c.prime { background: color-mix(in srgb, #22c55e 22%, var(--card-2)); border-color: color-mix(in srgb, #22c55e 55%, var(--ring)); }
.st-wk-c.ok { background: color-mix(in srgb, #22c55e 9%, var(--card-2)); }
.st-wk-c.weak { background: color-mix(in srgb, var(--warn) 12%, var(--card-2)); }
.st-wk-c.caution { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 9%, var(--card-2)) 0 8px, var(--card-2) 8px 16px); border-color: color-mix(in srgb, var(--warn) 45%, var(--ring)); }
.st-wk-c.night { border-style: solid; }
.st-wk-c.night.mid { background: color-mix(in srgb, #6366f1 16%, var(--card-2)); border-color: color-mix(in srgb, #6366f1 50%, var(--ring)); }
.st-wk-c.night.four { background: color-mix(in srgb, #a855f7 13%, var(--card-2)); border-color: color-mix(in srgb, #a855f7 45%, var(--ring)); }
.st-wk-c.off { background: transparent; opacity: .45; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.st-legend span { padding: 1px 8px; border-radius: 6px; border: 1px solid var(--ring); color: var(--ink); font-weight: 600; }
.st-legend .prime { background: color-mix(in srgb, #22c55e 22%, var(--card-2)); } .st-legend .ok { background: color-mix(in srgb, #22c55e 9%, var(--card-2)); }
.st-legend .weak { background: color-mix(in srgb, var(--warn) 12%, var(--card-2)); } .st-legend .caution { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 14%, var(--card-2)) 0 6px, var(--card-2) 6px 12px); } .st-legend .mid { background: color-mix(in srgb, #6366f1 16%, var(--card-2)); } .st-legend .four { background: color-mix(in srgb, #a855f7 13%, var(--card-2)); } .st-legend .off { opacity: .5; }
/* risk & scaling */
.st-risk-t td:not(:first-child) { font-variant-numeric: tabular-nums; }
.st-steps { margin: 8px 0; padding: 0; list-style: none; counter-reset: st; }
.st-steps li { counter-increment: st; position: relative; padding: 8px 0 8px 40px; color: var(--ink-2); line-height: 1.5; border-left: 2px solid var(--ring); margin-left: 13px; }
.st-steps li::before { content: counter(st); position: absolute; left: -14px; top: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--a1); color: var(--accent-ink); }
.st-steps li:last-child { border-left-color: transparent; }
/* profit concentration */
.st-bar { display: grid; gap: 8px; margin: 12px 0 6px; }
.st-bar-row { display: grid; grid-template-columns: 110px 1fr 48px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.st-bar-row i { display: block; height: 14px; width: var(--w); min-width: 4px; border-radius: 4px; background: var(--muted); }
.st-bar-row i.pos { background: var(--pos); }
.st-bar-row b { font-variant-numeric: tabular-nums; text-align: right; }
/* tested ideas */
.st-tested { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.st-tested > div { padding: 10px 12px 10px 34px; position: relative; border-radius: var(--radius-sm); background: var(--wash); border: 1px solid var(--ring); }
.st-tested > div::before { content: '✗'; position: absolute; left: 12px; top: 9px; font-weight: 800; color: var(--neg); }
.st-tested > div.maybe::before { content: '?'; color: var(--a3); }
.st-tested > div.maybe { border-color: color-mix(in srgb, var(--a3) 45%, var(--ring)); }
.st-tested b { display: block; font-size: 13px; margin-bottom: 2px; }
.st-tested span { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 1240px) { #view-strategy .c6 { grid-column: span 12; } .st-defs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .st-cols, .st-three, .st-defs { grid-template-columns: 1fr; }
  .st-kpis { grid-template-columns: 1fr 1fr; }
  .st-hero { padding: 20px 18px; }
  .st-grade-cols { grid-template-columns: 1fr; }
  .st-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-matrix { font-size: 12px; }
}

/* ================= Forward test tab ================= */
.fw-head h2 { font-size: 20px; font-family: var(--font-display); }
.fw-start { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.fw-start input { font: inherit; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--ring); background: var(--card-2); color: var(--ink); }
.fw-prog-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.fw-prog-row b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fw-prog { flex: 1; height: 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--ring); overflow: hidden; min-width: 80px; }
.fw-prog i { display: block; height: 100%; background: var(--pos); border-radius: 999px; }
.fw-verdict { display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--ring); border-left: 4px solid var(--muted); background: var(--wash); }
.fw-verdict span { font-size: 13px; color: var(--ink-2); }
.fw-verdict.pos { border-left-color: var(--pos); } .fw-verdict.neg { border-left-color: var(--neg); } .fw-verdict.ok { border-left-color: var(--a5); }
.fw-disc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.fw-disc > div { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--wash); border: 1px solid var(--ring); }
.fw-disc dt { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; } .fw-disc dt.warn { color: var(--warn); }
.fw-disc dd { margin: 0; font-size: 12.5px; font-weight: 600; } .fw-disc small { font-size: 11.5px; }
.fw-curve svg { display: block; width: 100%; height: auto; }
.fw-zero { stroke: var(--axis); stroke-dasharray: 3 3; }
.fw-tick { font-size: 11px; fill: var(--muted); }
.fw-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.fw-line.you { stroke: var(--a1); } .fw-line.plan { stroke: var(--muted); stroke-dasharray: 5 4; }
.fw-key { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.fw-key span::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.fw-key .you::before { background: var(--a1); } .fw-key .plan::before { background: var(--muted); }
.fw-table tr.fw-off { opacity: .55; }
.fw-table tr.clickable, .fw-missed tr.clickable { cursor: pointer; }
.fw-missed summary { cursor: pointer; font-weight: 600; }
@media (max-width: 760px) { .fw-start { align-items: flex-start; } .fw-head .card-row { flex-direction: column; } }
.fw-kpi-v { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; margin: 4px 0 2px; } .fw-kpi-v.pos { color: var(--pos); } .fw-kpi-v.neg { color: var(--neg); }
@media (max-width: 1240px) { #view-forward .c3 { grid-column: span 6; } #view-forward .c6 { grid-column: span 12; } }
.fw-top { justify-content: flex-start; }
.fw-top .fw-start { align-items: flex-start; }
.nav-beta { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; color: var(--a2); border: 1px solid color-mix(in srgb, var(--a2) 50%, transparent); background: color-mix(in srgb, var(--a2) 12%, transparent); }
/* Strategy: every setup, and per grade */
.st-setup-t td { vertical-align: top; } .st-setup-t td.num { white-space: nowrap; }
.st-setup-t .sig-grade { font-size: 11px; }
.st-setup-t td.pos { color: var(--pos); } .st-setup-t td.neg { color: var(--neg); }
.st-setup-t { width: 100%; }
/* the last column takes what's left and truncates; the full text is on hover */
.st-setup-t .st-why { font-size: 12px; color: var(--ink-2); width: 100%; max-width: 0; }
.st-setup-t .st-why span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 60px; cursor: help; }
.st-setup-t .st-when { white-space: normal; min-width: 130px; } .st-setup-t .st-risk-c { white-space: normal; min-width: 70px; }
.st-setup-t th, .st-setup-t td { padding-left: 6px; padding-right: 6px; }
.st-setup-t.avoid tbody tr { background: color-mix(in srgb, var(--neg) 4%, transparent); }
.st-tag { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.st-setups { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.st-setups li { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--wash); font-size: 12.5px; }
.st-setups li i { font-style: normal; font-weight: 800; width: 14px; flex: none; text-align: center; }
.st-setups li.yes i { color: var(--pos); } .st-setups li.track i { color: var(--a3); } .st-setups li.no i { color: var(--neg); }
.st-setups li.no { opacity: .75; }
.st-setups small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
/* condition dots in the setup tables */
.st-cth { font-size: 9.5px !important; text-align: left !important; color: var(--muted); line-height: 1.15; }
.st-cth span { display: inline-block; width: 15px; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; vertical-align: bottom; margin: 0 2px; }
.st-setup-t .st-days { display: block; font-size: 10.5px; color: var(--muted); }
.st-ctd { white-space: nowrap; } .st-ctd .st-cdot { margin: 0 4px 0 4px; }
.st-cdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; cursor: help; }
.st-cdot.yes { background: var(--pos); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pos) 25%, transparent); }
.st-cdot.no { background: var(--neg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--neg) 25%, transparent); }
.st-cdot.any { background: transparent; border: 1.5px solid var(--axis); width: 9px; height: 9px; }
.st-clegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--muted) !important; margin: 6px 0 0 !important; }
.st-clegend .st-cdot { margin-left: 8px; } .st-clegend .st-cdot:first-child { margin-left: 0; }
.st-wrong { display: inline-block; margin-left: 4px; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; white-space: nowrap; color: var(--neg); border: 1px solid color-mix(in srgb, var(--neg) 45%, transparent); background: color-mix(in srgb, var(--neg) 10%, transparent); }
.st-avoid-h { margin-top: 14px !important; }
.pb-slot.skip { opacity: .6; border-style: dashed; } .pb-slot.skip span { color: var(--muted); font-weight: 600; }
/* A+: teal-green with a sheen (A++ has the gold) */
.sig-grade.g-aplus { color: #fff; background: linear-gradient(135deg, #5eead4, #14b8a6 45%, #0f766e); box-shadow: 0 0 0 1px color-mix(in srgb, #14b8a6 60%, #fff), 0 2px 10px -2px color-mix(in srgb, #14b8a6 70%, transparent); text-shadow: 0 1px 0 rgb(0 0 0 / .2); }
.sig-tile .sig-grade.g-aplus::after, .grade-check .sig-grade.g-aplus::after, .grade-card.g-aplus dt::after { content: ''; position: absolute; inset: -2px; transform: translateX(-120%) skewX(-20deg); pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .75), transparent); animation: gradeShine 3.2s ease-in-out infinite; }
.sig-tile.tile-g-aplus { border-color: color-mix(in srgb, #14b8a6 50%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #14b8a6 10%, var(--card-2)), var(--card-2) 60%); }
.grade-card.g-aplus { border-color: color-mix(in srgb, #14b8a6 45%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #14b8a6 9%, var(--card)), var(--card) 65%); }
.grade-card.g-aplus dt { position: relative; overflow: hidden; display: inline-block; color: #0d9488; font-weight: 700; }
.st-leaf.g-aplus rect { fill: color-mix(in srgb, #14b8a6 18%, var(--card)); stroke: #14b8a6; } .st-leaf.g-aplus .st-leaf-g { fill: #0d9488; }
.st-grade.g-aplus { --g: #14b8a6; }
.grade-card.setup-card { border-style: dashed; } .grade-card.setup-card dt { font-weight: 700; }
.fw-sub td:first-child { padding-left: 18px; color: var(--ink-2); font-size: 12.5px; }
.st-cdot.blank { visibility: hidden; }
.st-sess { display: inline-block; width: 44px; text-align: center; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 0 4px; margin: 0 2px; vertical-align: middle; color: var(--ink-2); background: var(--wash); border: 1px solid var(--ring); }
.st-sess.open { color: var(--a1); border-color: color-mix(in srgb, var(--a1) 45%, transparent); }
.st-slot { display: inline-block; width: 19px; text-align: center; vertical-align: middle; }
.st-slot.sess { width: 52px; }
.st-slot .st-cdot, .st-slot .st-sess { margin: 0; }
.st-cth span.sess { width: 15px; margin: 0 18.5px; }
.sig-grade.wrong-time { filter: grayscale(.7); opacity: .75; }
.st-gcell { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.st-gcell .sig-grade, .st-gcell .st-wrong { margin-left: 0; }
.st-gcell .st-tag { line-height: 18px; }
.st-setup-t.avoid .st-gcell { flex-wrap: wrap; white-space: normal; }

.fw-paper-head .fw-verdict { margin-top: 10px; }
.fw-paper-head code { font-size: 12px; padding: 1px 5px; border-radius: 4px; background: var(--wash); border: 1px solid var(--ring); }

/* ---- today's playbook (playbook-hero.js) ---- */
.pbo-hl { font-weight: 700; padding: 1px 7px; border-radius: 999px; font-size: 12px; }
.pbo-hl.strong { color: #16a34a; background: color-mix(in srgb, #22c55e 14%, transparent); } :root[data-mode="dark"] .pbo-hl.strong { color: #4ade80; }
.pbo-hl.weak { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.pbo-hl.mixed { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
/* pieces */
.pbo-g { border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--ring); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pbo-gl { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pbo-g small, .pbo-bar small { font-size: 12px; color: var(--ink-2); }
.pbo-dial { display: grid; justify-items: center; align-content: center; gap: 2px; text-align: center; }
.pbo-dial.bullish { --c: var(--pos); } .pbo-dial.bearish { --c: var(--neg); } .pbo-dial.flat, .pbo-dial.none { --c: var(--muted); }
.pbo-arrow { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: var(--c); background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), color-mix(in srgb, var(--c) 6%, transparent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); margin-bottom: 4px; }
.pbo-dial b { font-size: 17px; color: var(--c); } .pbo-dial small { font-size: 11.5px; color: var(--muted); }
.pbo-dial.small { grid-template-columns: auto auto; column-gap: 8px; justify-content: start; text-align: left; justify-items: start; }
.pbo-dial.small .pbo-arrow { width: 32px; height: 32px; font-size: 15px; margin: 0; grid-row: span 2; }
.pbo-dial.small b { font-size: 15px; line-height: 1.1; }
.pbo-meter, .pbo-pull, .pbo-room { display: flex; flex-direction: column; gap: 7px; }
.pbo-track { position: relative; height: 10px; border-radius: 999px; background: var(--wash); }
.pbo-track i { position: absolute; top: 0; bottom: 0; }
.pbo-meter .pbo-track i:first-child { border-radius: 999px 0 0 999px; } .pbo-meter .pbo-track i:nth-child(4) { border-radius: 0 999px 999px 0; }
.pbo-track i.warn { background: color-mix(in srgb, #fb923c 45%, transparent); } .pbo-track i.cool { background: color-mix(in srgb, #38bdf8 55%, transparent); } .pbo-track i.mid { background: var(--wash); }
.pbo-mark { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card-2); }
.pbo-track.pull i.gz { left: 50%; right: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, #f5b942 32%, transparent) 0 4px, transparent 4px 8px); border-radius: 0 999px 999px 0; }
.pbo-track.pull i.fill { left: 0; border-radius: 999px; background: var(--muted); } .pbo-track.pull i.fill.gold { background: #f5b942; }
.pbo-dots { display: flex; gap: 6px; } .pbo-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ring); } .pbo-dots i.on { background: var(--a1, var(--accent)); box-shadow: none; }
/* the timeline */
.pbo-line { position: relative; height: 10px; margin: 26px 22px 46px; border-radius: 999px; background: var(--wash); }
.pbo-line .pbo-ny { position: absolute; top: -3px; bottom: -3px; border-radius: 6px; background: color-mix(in srgb, var(--a2, #6366f1) 26%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a2, #6366f1) 45%, transparent); }
.pbo-tick { position: absolute; top: -6px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pbo-tick i { width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--ring); }
.pbo-tick.next i { box-shadow: 0 0 0 2px var(--ring); width: 22px; height: 22px; margin-top: -1px; }
.pbo-tick b { font-size: 11px; font-variant-numeric: tabular-nums; } .pbo-tick small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.pbo-tick.prime i { background: #22c55e; } .pbo-tick.ok i { background: color-mix(in srgb, #22c55e 45%, var(--card)); }
.pbo-tick.weak i { background: color-mix(in srgb, var(--neg) 60%, var(--card)); } .pbo-tick.caution i { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, var(--card) 3px 6px); }
.pbo-tick.late i { background: #6366f1; } .pbo-tick.skip i, .pbo-tick.none i { background: var(--card); }
.pbo-tick.past { opacity: .4; }
.pbo-call { position: absolute; bottom: calc(100% + 8px); display: flex; flex-direction: column; align-items: center; padding: 4px 9px; border-radius: 9px; background: var(--ink); color: var(--card); white-space: nowrap; }
.pbo-call::after { content: ''; position: absolute; top: 100%; left: 50%; translate: -50% 0; border: 5px solid transparent; border-top-color: var(--ink); }
.pbo-call b { font-size: 12px; } .pbo-call small { font-size: 10.5px; opacity: .75; color: inherit; }
.pbo-now { position: absolute; top: -14px; bottom: -14px; width: 2px; background: color-mix(in srgb, var(--ink) 70%, transparent); translate: -1px 0; }
.pbo-bl-plays { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; } .pbo-bl-plan { margin: 0; font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.45; }
/* hero options */
.pbo-hero { display: grid; gap: 4px; }
.pbo-hh { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.6fr); gap: 14px; align-items: stretch; }
.pbo-ht { display: grid; gap: 5px; align-content: start; }
.pbo-ht-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.pbo-hday { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.pbo-hero.strong .pbo-hday { color: #16a34a; } :root[data-mode="dark"] .pbo-hero.strong .pbo-hday { color: #4ade80; }
.pbo-hero.weak .pbo-hday { color: var(--neg); } .pbo-hero.mixed .pbo-hday { color: var(--warn); }
.pbo-minis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 8px; align-items: stretch; }
.pbo-minis .pbo-g { padding: 8px 10px; gap: 6px; }
.pbo-ny-story { font-size: 11px !important; color: var(--muted) !important; line-height: 1.35; }
.pbo-line.hero { margin: 16px 18px 34px; }
.pbo-call { padding: 3px 8px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .pbo-hh { grid-template-columns: 1fr; } .pbo-minis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pbo-minis { grid-template-columns: 1fr; } .pbo-g.strats { grid-row: auto; } }
@media (max-width: 700px) { .pbo-tick small { display: none; } .pbo-line { margin-left: 12px; margin-right: 12px; } .pbo-hday { font-size: 26px; } }
/* the playbook card: the original verdict colours, the hero layout */
.day-playbook.pbo-hero { display: grid; gap: 4px; padding: 14px 16px 10px; }
.pbo-hl.strong, .pbo-hl.mixed, .pbo-hl.weak { font-size: 11.5px; }
.pbo-hero .pbo-g { background: color-mix(in srgb, var(--card) 82%, transparent); }
/* RSI: the number, its meaning, the meter and the zone names */
.pbo-g.rsi .pbo-meter { gap: 6px; }
.pbo-rsi-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pbo-rsi-n { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pbo-rsi-n.warn { color: #ea580c; } .pbo-rsi-n.cool { color: #0ea5e9; }
.pbo-rsi-what { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pbo-track.rsi { height: 12px; }
.pbo-zl { display: flex; flex-wrap: wrap; gap: 2px 9px; }
.pbo-zl span { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.pbo-zl span::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--ring); }
.pbo-zl span.warn::before { background: color-mix(in srgb, #fb923c 55%, transparent); box-shadow: none; } .pbo-zl span.cool::before { background: color-mix(in srgb, #38bdf8 65%, transparent); box-shadow: none; }
/* today's strategies */
.pbo-strats { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12px; }
.pbo-strats li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pbo-strats .nm { display: flex; align-items: baseline; gap: 6px; min-width: 0; } .pbo-strats .nm small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbo-strats li b { font-weight: 650; white-space: nowrap; } .pbo-strats li .size { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pbo-strats li.caution b::after { content: ' ⚠'; color: var(--warn); font-size: 10px; }
.pbo-strats li.sep { margin-top: 3px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pbo-strats li.none { color: var(--muted); }
.pbo-g.room .pbo-room { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.pbo-room-top { display: flex; align-items: baseline; gap: 6px; } .pbo-room-n { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; } .pbo-room-top span { font-size: 12px; color: var(--muted); }
.pbo-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.pbo-slots i { height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ring); display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; }
.pbo-slots i.on { background: var(--a1, var(--accent)); color: #fff; box-shadow: none; }
.pbo-slots i.on.long { background: color-mix(in srgb, var(--pos) 85%, #000); } .pbo-slots i.on.short { background: color-mix(in srgb, var(--neg) 85%, #000); }
.pbo-g.room small.full { color: var(--warn); font-weight: 600; }
.pbo-coins { display: flex; flex-wrap: wrap; gap: 4px; } .pbo-coins:empty { display: none; }
.pbo-coins span { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.pbo-coins .long { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); } .pbo-coins .short { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
@media (max-width: 560px) { .sig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- the sidebar folds into a rail (side.js) ---- */
.app { transition: grid-template-columns .5s cubic-bezier(.22, 1, .36, 1); }
.app.side-folded { grid-template-columns: 68px 1fr; }
.side { position: sticky; }
.nav button, .side-btn { position: relative; }
.nav-label { white-space: nowrap; transition: opacity .25s ease, transform .35s cubic-bezier(.22, 1, .36, 1), max-width .45s cubic-bezier(.22, 1, .36, 1); max-width: 180px; overflow: hidden; display: inline-block; }
.logo span, .side-label, #account, .nav-beta { transition: opacity .25s ease, transform .35s cubic-bezier(.22, 1, .36, 1); }
/* the toggle: a ring that draws itself, a double chevron that turns */
.side-toggle { --s: 30px; position: fixed; z-index: 60; width: var(--s); height: var(--s); border: 0; padding: 0; border-radius: 50%; color: var(--accent); cursor: pointer; display: grid; place-items: center;
  background: var(--card); box-shadow: 0 0 0 1px var(--ring), 0 4px 14px -6px color-mix(in srgb, var(--accent) 55%, transparent); transition: background .2s, box-shadow .2s, transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.side-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.side-toggle .st-ring { stroke-width: 1.3; opacity: .45; stroke-dasharray: 66; stroke-dashoffset: 0; transition: stroke-dashoffset .6s ease, opacity .2s; transform-origin: center; }
.side-toggle .st-chev { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; transform-origin: 12px 12px; }
.side-toggle .st-chev.b { opacity: .45; transform: translateX(-2px); }
.side-toggle:hover { background: color-mix(in srgb, var(--accent) 12%, var(--card)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, var(--ring)), 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.side-toggle:hover .st-chev.a { transform: translateX(-2px); } .side-toggle:hover .st-chev.b { transform: translateX(-5px); opacity: .8; }
.side-toggle:active { transform: scale(.88); }
.side-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side-toggle.pulse .st-ring { animation: stRing .6s ease; }
.side-toggle.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: stRipple .6s ease-out forwards; pointer-events: none; }
@keyframes stRing { 0% { stroke-dashoffset: 66; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: .45; } }
@keyframes stRipple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.9); opacity: 0; } }
/* folded: the chevrons point the other way, labels slide out, the rail centres */
.side-folded .side { padding: 18px 10px; overflow: visible; align-items: center; }
.side-toggle.folded { transform: rotate(180deg); }
.side-toggle.folded:active { transform: rotate(180deg) scale(.88); }
.side-folded .logo { padding: 0; justify-content: center; }
.side-folded .logo span { opacity: 0; transform: translateX(-8px); width: 0; overflow: hidden; }
.side-folded .nav { width: 100%; }
.side-folded .nav button, .side-folded .side-btn { justify-content: center; padding: 9px 0; gap: 0; }
.side-folded .nav-label { opacity: 0; transform: translateX(-10px); max-width: 0; }
.side-folded .nav-beta { opacity: 0; position: absolute; pointer-events: none; }
.side-folded .nav button:has(.nav-beta)::before { content: ''; position: absolute; top: 6px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: #a855f7; }
.side-folded .side-label, .side-folded #account { opacity: 0; height: 0; overflow: hidden; margin: 0; }
.side-folded .side-exports { padding: 0; width: 100%; }
.side-folded .side-foot { justify-content: center; padding: 0; }
/* labels stagger back in when unfolding */
.side-anim:not(.side-folded) .nav-label { transition-delay: calc(var(--n, 0) * 22ms + 120ms); }
/* hover labels on the rail */
.side-folded .nav button::after, .side-folded .side-btn::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; translate: -6px -50%; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--card); background: var(--ink); box-shadow: var(--shadow); transition: opacity .15s, translate .2s cubic-bezier(.22, 1, .36, 1); z-index: 50; }
.side-folded .nav button:hover::after, .side-folded .side-btn:hover::after, .side-folded .nav button:focus-visible::after { opacity: 1; translate: 0 -50%; }
/* the current view written down the rail */
.side-vert { display: none; }
.side-folded .side-vert { display: flex; flex: 1 1 0; min-height: 0; overflow: hidden; align-items: center; justify-content: center; writing-mode: sideways-lr; gap: 10px; -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision;
  font-family: 'Sora', var(--font), sans-serif; font-size: 15px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 85%, var(--ink)); white-space: nowrap; animation: vertIn .6s cubic-bezier(.22, 1, .36, 1) both; }
.side-vert span { opacity: .55; } .side-vert i { font-style: normal; font-size: 10px; opacity: .8; animation: vertSpin 6s linear infinite; }
.side-vert b { font-weight: 700; }
@keyframes vertIn { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; letter-spacing: .32em; } }
@keyframes vertSpin { to { transform: rotate(360deg); } }
.side-folded .side-exports { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .app, .nav-label, .side-toggle, .side-toggle * { transition: none !important; animation: none !important; } .side-folded .side-vert, .side-vert i { animation: none; } }
@media (max-width: 860px) { body .side-toggle, .side-vert { display: none !important; } .app.side-folded { grid-template-columns: 1fr; } }
.side-instant, .side-instant * { transition: none !important; }
.side > * { flex-shrink: 0; } .side > .side-vert { flex-shrink: 1; }
.side-folded .nav button, .side-folded .side-btn { padding: 7px 0; }
.side-folded .side-foot { width: 100%; } .side-folded .side-foot .theme-wrap { margin: 0 auto; }
.logo { height: 34px; white-space: nowrap; overflow: hidden; flex-shrink: 0; }
.side .nav-label, .side .side-label, #account, .side-foot { white-space: nowrap; }
#account { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* browsers without sideways writing: the rotated fallback */
@supports not (writing-mode: sideways-lr) { .side-folded .side-vert { writing-mode: vertical-rl; transform: rotate(180deg); } }
/* centre the logo and the theme button on the rail: the hidden name and account text take no room */
.side-folded .logo { gap: 0; } .side-folded .logo span { display: none; }
.side-folded #account { display: none; } .side-folded .side-foot { gap: 0; }
.pbo-tick.next b { position: relative; white-space: nowrap; } .pbo-in { position: absolute; left: 100%; top: 0; padding-left: 4px; white-space: nowrap; font-weight: 500; color: var(--muted); } .pbo-cd-in { font-variant-numeric: tabular-nums; color: var(--ink); }
.pbo-line.hero { margin-top: 22px; }
.pbo-line .pbo-past { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent)); }
.pbo-line .pbo-now { position: absolute; top: 50%; bottom: auto; width: 0; height: 0; background: none; translate: 0 0; z-index: 3; pointer-events: auto; }
.pbo-now .pbo-dot { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--card), 0 0 12px 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.pbo-now .pbo-pulse { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: nowPulse 1.8s cubic-bezier(.2, .6, .4, 1) infinite; }
@keyframes nowPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pbo-now .pbo-pulse { animation: none; opacity: 0; } }

/* ---- the open position: one at a time, its progress as a battery (pos-battery.js) ---- */
.pos-cycle { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; vertical-align: middle; text-transform: none; letter-spacing: 0; } .pos-cycle:empty { display: none; }
.pos-cycle .pv-arrow { width: 20px; height: 20px; font-size: 13px; }
.pos-cycle small { font-size: 11px; font-variant-numeric: tabular-nums; }
.pv-arrow { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--ring); background: var(--card-2); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .15s, background .15s; }
.pv-arrow:hover { background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); } .pv-arrow:active { transform: scale(.9); }
.pv-dots { display: flex; gap: 4px; } .pv-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--ring); cursor: pointer; transition: width .2s; } .pv-dots button.on { width: 18px; border-radius: 4px; background: var(--accent); }
.pos-bat { grid-column: 1 / -1; }
.bat { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bat-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bat-r { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; } .bat-r.pos { color: var(--pos); } .bat-r.neg { color: var(--neg); }
.bat-of { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bat-adds { display: flex; gap: 5px; margin-left: auto; }
.bat-add { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; color: var(--muted); background: var(--card); box-shadow: inset 0 0 0 1px var(--ring); cursor: help; }
.bat-add i { font-style: normal; color: var(--accent); } .bat-add small { font-weight: 500; opacity: .75; }
.bat-add.done { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--ring)); }
.bat-cells { display: flex; align-items: center; gap: 3px; height: 30px; }
.bat-cells .cell { --f: 0; position: relative; flex: 1; min-width: 0; height: 100%; border-radius: 5px; background: var(--wash); overflow: hidden; }
.bat-cells .cell::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f) * 100%); background: linear-gradient(180deg, color-mix(in srgb, var(--pos) 80%, #fff), var(--pos)); }
.bat-cells .cell.risk { background: color-mix(in srgb, var(--neg) 18%, var(--wash)); } .bat-cells .cell.risk::before { left: auto; right: 0; background: var(--neg); }
.bat-cells .cell.add { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent) 70%, transparent); }
/* the target block: a checkered finish line */
.bat-cells .cell.tp { background: transparent; box-shadow: inset 0 0 0 1.5px #22c55e; }
.bat-cells .cell.tp::before { background: #22c55e; }
.bat-cells .cell.tp.lit { box-shadow: inset 0 0 0 1.5px #22c55e, 0 0 10px rgb(34 197 94 / .5); }
.bat-none { margin: 0; font-size: 12.5px; color: var(--muted); }
/* nothing open: the last trade */
.bat-last { margin-top: 0; }
.bat-kick { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bat-lrow { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--ring); }
.bat-lname { display: flex; align-items: center; gap: 8px; } .bat-lname b { font-size: 16px; }
.bat-lres { font-size: 18px; font-variant-numeric: tabular-nums; } .bat-lres.pos { color: var(--pos); } .bat-lres.neg { color: var(--neg); }
/* the live "now" dot sits under the close dots; the next close's dot is see-through so the pulse shows through it */
.pbo-line .pbo-now { z-index: 1; } .pbo-line .pbo-tick { z-index: 2; }
.pbo-line .pbo-tick.next i { opacity: .72; }
.pv1-bar .pin.edge-l em { translate: 0 0; left: -4px; } .pv1-bar .pin.edge-r em { translate: -100% 0; left: 8px; }
/* the playbook folds to its title row */
.pbo-ht-top { cursor: pointer; user-select: none; }
.pbo-fold { margin-left: auto; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.pbo-fold:hover, .pbo-ht-top:hover .pbo-fold { color: var(--ink); background: var(--wash); }
.pbo-fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.day-playbook.folded .pbo-fold svg { transform: rotate(180deg); }
.pbo-peek { display: none; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.day-playbook.folded .pbo-peek { display: inline; }
.day-playbook.folded { padding-top: 10px; padding-bottom: 10px; }
.day-playbook.folded .pbo-hh { display: block; }
.day-playbook.folded .pbo-minis, .day-playbook.folded .pbo-line, .day-playbook.folded .pb-rules, .day-playbook.folded .pbo-bl-plan, .day-playbook.folded .pbo-bl-plays { display: none; }
.day-playbook.folded .pbo-hday { font-size: 22px; }
#posAt { white-space: nowrap; }
#posCard { position: relative; padding-bottom: 24px; } #posAt { position: absolute; right: 14px; bottom: 7px; font-size: 10px !important; opacity: .75; }
.sig-track { display: flex; flex-direction: column; gap: 5px; }
.sig-track .sig-bar { height: 7px; }
.sig-ends { display: flex; justify-content: space-between; gap: 4px; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 600; }
.sig-ends span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .sig-ends .neg { color: var(--neg); } .sig-ends .pos { color: var(--pos); }
.sig-mid .sig-res { font-size: 24px; }
/* the position notes: one fixed height each, two lines at most */
.pos-note { height: 44px; display: flex; align-items: center; }
.pos-note { overflow: hidden; } .pos-note { -webkit-line-clamp: 2; }
/* signal tiles: fill the taller card */
.sig-tile .sig-coin { font-size: 18px; }
.sig-tile .sig-target { font-size: 13.5px; } .sig-tile .sig-target i { font-size: 11px; }
.sig-tile .sig-mid .sig-res { font-size: 27px; }
.sig-track .sig-bar { height: 12px; } .sig-track .sig-bar b { top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; }
.sig-ends { font-size: 10.5px; }
/* signal tiles: fill the taller card */
.sig-tile .sig-coin { font-size: 18px; }
.sig-tile .sig-target { font-size: 13.5px; } .sig-tile .sig-target i { font-size: 11px; }
.sig-tile .sig-mid .sig-res { font-size: 27px; }
.sig-track .sig-bar { height: 12px; } .sig-track .sig-bar b { top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; }
.sig-ends { font-size: 10.5px; }
.sig-tile .sig-coin { flex-direction: column; align-items: flex-start; gap: 0; }
.sig-tile .sig-coin b { max-width: 100%; }
.sig-tile .sig-target { font-size: 12.5px; color: var(--muted); font-weight: 650; } .sig-tile .sig-target i { font-size: 10.5px; }
.sig-tile .sig-coin { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 4px; font-size: 16.5px; }
.sig-tile .sig-target { font-size: 12px; color: var(--ink-2); } .sig-tile .sig-target i { font-size: 10px; }
.sig-tile .sig-mid { flex: 1; justify-content: center; padding: 10px 11px; border-radius: 11px; }
.sig-tile .sig-mid .sig-res { font-size: 28px; }
.sig-tile .sig-coin { font-size: 15.5px; gap: 2px; } .sig-tile .sig-coin b { flex: none; }
.sig-tile .sig-target { font-size: 11.5px; min-width: 0; overflow: hidden; } .sig-tile .sig-target i { font-size: 9px; margin-right: 1px; }
.sig-tile .sig-mid { flex: 0 1 auto; min-height: 92px; }
/* signal tiles: the golden zone and RSI as small pills */
.sig-pill { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; cursor: help; line-height: 15px; }
.sig-pill.warn { color: #fff; background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 2px 6px -2px rgb(234 88 12 / .6); }
.sig-pill.cool { color: #fff; background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 2px 6px -2px rgb(2 132 199 / .5); }
.sig-pill.candle { background: color-mix(in srgb, #a855f7 18%, transparent); padding: 1px 4px; }
.sig-pill.gold { background: color-mix(in srgb, #f5b942 22%, transparent); padding: 1px 4px; }
.sig-top .sig-pill + .sig-trend-top, .sig-top .sig-pill:first-of-type { } .sig-top .sig-grade + .sig-pill { margin-left: 0; }
/* playbook: the NY bias, plain like the other gauges */
.pbo-g.bias-card { --b: var(--muted); } .pbo-g.bias-card.bullish { --b: var(--pos); } .pbo-g.bias-card.bearish { --b: var(--neg); }
.bc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.bc-src { font-size: 11px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; } .bc-src.bullish { color: var(--pos); } .bc-src.bearish { color: var(--neg); }
.bc-call { display: flex; flex-direction: column; line-height: 1.1; } .bc-call b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--b); } .bc-call small { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.bc-runs { display: flex; gap: 3px; } .bc-runs span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 0; border-radius: 6px; background: var(--wash); }
.bc-runs em { font-style: normal; font-size: 9px; color: var(--muted); } .bc-runs i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--muted); }
.bc-runs .bullish i { color: var(--pos); } .bc-runs .bearish i { color: var(--neg); } .bc-runs span:last-child { box-shadow: inset 0 0 0 1px var(--b); }
.bc-next { font-size: 11px !important; color: var(--ink-2) !important; }
/* the RSI / golden-zone pills: soft like the BTC trend pill, on the right beside it */
.sig-top .sig-pill { font-size: 10px; font-weight: 600; letter-spacing: 0; line-height: normal; padding: 1px 6px; border-radius: 999px; box-shadow: none; }
.sig-top .sig-pill.warn { color: #c2410c; background: color-mix(in srgb, #fb923c 18%, transparent); }
.sig-top .sig-pill.cool { color: #0369a1; background: color-mix(in srgb, #38bdf8 18%, transparent); }
:root[data-mode="dark"] .sig-top .sig-pill.warn { color: #fdba74; } :root[data-mode="dark"] .sig-top .sig-pill.cool { color: #7dd3fc; }
.sig-top .sig-pill.gold { background: color-mix(in srgb, #f5b942 18%, transparent); }
.sig-top .sig-grade + .sig-pill { margin-left: auto; }
.sig-top .sig-pill + .sig-trend-top { margin-left: 4px; }
.bot-open .pos-row { grid-template-columns: minmax(150px, 1.3fr) minmax(100px, .9fr) repeat(2, minmax(120px, 1fr)) auto; }
.side-folded .side { z-index: 70; }   /* its hover labels float over the page */
/* the theme menu is always solid: the theme's card colour laid over an opaque base, never see-through */
:root .theme-menu, :root[data-theme] .theme-menu { -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: linear-gradient(var(--card), var(--card)), linear-gradient(var(--side, var(--card)), var(--side, var(--card))), #ffffff !important; }
:root[data-mode="dark"] .theme-menu { background: linear-gradient(var(--card), var(--card)), linear-gradient(var(--side, var(--card)), var(--side, var(--card))), #10141b !important; }
/* the Signals filter panel too: solid in every theme */
:root .sig-filt-panel, :root[data-theme] .sig-filt-panel { -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: linear-gradient(var(--card), var(--card)), linear-gradient(var(--side, var(--card)), var(--side, var(--card))), #ffffff !important; }
:root[data-mode="dark"] .sig-filt-panel { background: linear-gradient(var(--card), var(--card)), linear-gradient(var(--side, var(--card)), var(--side, var(--card))), #10141b !important; }
.side-toggle { z-index: 80; }   /* above the folded sidebar (70) and the themes overlays (60) */
/* light themes show the inverted logo (cream on ink) so it doesn't fade into the page */
.logo-mark.on-light { display: none; }
:root[data-mode="light"] .logo-mark.on-light { display: block; } :root[data-mode="light"] .logo-mark.on-dark { display: none; }
/* the open position's live price */
.pos-cell.live-px { position: relative; }
@keyframes pxSheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.live-px-dot { display: inline-block; flex: none; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #22c55e; vertical-align: 1px; animation: pxDot 1.6s ease-in-out infinite; }
@keyframes pxDot { 0%, 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / .55); } 60% { box-shadow: 0 0 0 5px rgb(34 197 94 / 0); } }
.pos-cell.live-px.tick-up .num { animation: pxUp 1.2s ease-out; } .pos-cell.live-px.tick-down .num { animation: pxDown 1.2s ease-out; }
@keyframes pxUp { from { color: #16a34a; } }
@keyframes pxDown { from { color: #dc2626; } }
/* the battery's lit blocks: stripes drifting toward the target, and the leading edge glowing where progress has reached */
.bat-cells .cell.lit::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--f, 1) * 100%); pointer-events: none;
  background-image: repeating-linear-gradient(120deg, rgb(255 255 255 / .22) 0 5px, transparent 5px 12px); background-size: 28px 100%; animation: batFlow 2.6s linear infinite; }
.bat-cells .cell.risk.lit::after { left: auto; right: 0; animation-direction: reverse; }
@keyframes batFlow { from { background-position: 0 0; } to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) { .live-px-dot, .pos-cell.live-px .num, .bat-cells .cell.lit::after { animation: none !important; } }
/* the open position cycling: the next one revealed by a circle growing from the side it comes from */
#posList { position: relative; overflow: hidden; }
.pos-row.slide-next, .pos-row.slide-prev { position: relative; z-index: 2; background: linear-gradient(var(--card-2), var(--card-2)), var(--card); }
.pos-row.slide-next { animation: posIrisR .65s cubic-bezier(.65, 0, .35, 1) both; } .pos-row.slide-prev { animation: posIrisL .65s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes posIrisR { from { clip-path: circle(0% at 100% 50%); } to { clip-path: circle(150% at 100% 50%); } }
@keyframes posIrisL { from { clip-path: circle(0% at 0% 50%); } to { clip-path: circle(150% at 0% 50%); } }
.pos-row.leaving { position: absolute; left: 0; right: 0; top: 0; z-index: 1; pointer-events: none; animation: posUnder .65s ease forwards; }
@keyframes posUnder { to { opacity: .35; transform: scale(.98); } }
/* the active dot fills as the 10 s run down */
.pv-dots button.on { position: relative; overflow: hidden; background: color-mix(in srgb, var(--accent) 30%, var(--ring)); }
.pv-dots button.on::after { content: ''; position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: var(--accent); border-radius: inherit; transition: width .1s linear; }
@media (prefers-reduced-motion: reduce) { .pos-row.slide-next, .pos-row.slide-prev, .pos-row.leaving { animation: none; } .pos-row.leaving { display: none; } }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 6px; border-radius: 6px; background: var(--wash); line-height: 18px; }
.nav button[aria-current="page"] .nav-count { color: var(--ink-2); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav-count[hidden] { display: none; }
.side-folded .nav-count { position: absolute; bottom: 3px; right: 8px; margin: 0; padding: 0 4px; font-size: 0; line-height: 13px; }
.side-folded .nav-count::after { content: attr(data-n); font-size: 9px; }

/* 👑 S tier: an A grade that engulfed (purple, like the 🕯️ notes) */
.sig-grade.g-splus { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #c084fc, #7e22ce); box-shadow: 0 0 0 1px color-mix(in srgb, #a855f7 60%, transparent), 0 2px 8px -2px rgb(126 34 206 / .6); }
.sig-tile .sig-grade.g-splus::after, .grade-check .sig-grade.g-splus::after { content: ''; position: absolute; inset: -2px; transform: translateX(-120%) skewX(-20deg); pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .7), transparent); animation: gradeShine 2.6s ease-in-out infinite; }
.sig-tile.tile-g-splus { border-color: color-mix(in srgb, #a855f7 60%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #a855f7 12%, var(--card-2)), var(--card-2) 60%); box-shadow: 0 0 16px -6px color-mix(in srgb, #a855f7 80%, transparent); }
.grade-card.g-splus { border-color: color-mix(in srgb, #a855f7 55%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #a855f7 10%, var(--card)), var(--card) 65%); }
.grade-card.g-splus dt { color: #9333ea; font-weight: 700; }
.st-grade.g-splus { --g: #a855f7; }
/* 💪 C+: a C long with strength into a BTC low (teal) */
.sig-grade.g-cplus { color: #fff; background: linear-gradient(135deg, #5eead4, #0d9488); box-shadow: 0 0 0 1px color-mix(in srgb, #14b8a6 55%, transparent); }
.sig-tile.tile-g-cplus { border-color: color-mix(in srgb, #14b8a6 45%, var(--ring)); }
.grade-card.g-cplus { border-color: color-mix(in srgb, #14b8a6 45%, var(--ring)); }
.grade-card.g-cplus dt { color: #0d9488; font-weight: 700; }
.st-grade.g-cplus { --g: #14b8a6; }
/* 💥 Full swing failure: swept the swing candle's own wick */
.sig-full { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; color: color-mix(in srgb, #e11d48 70%, var(--ink)); background: color-mix(in srgb, #f43f5e 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f43f5e 40%, transparent); }
.sig-pill.full { background: color-mix(in srgb, #f43f5e 16%, transparent); padding: 1px 4px; }
/* the open position's ticker opens its chart */
.pos-ticker { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
.pos-ticker:hover, .pos-ticker:focus-visible { color: var(--a1, var(--accent)); text-decoration-color: currentColor; outline: none; }
/* Signals: the grades and splits as one compact card, and the results bar for what's shown */
.sig-sum { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 6px 22px; padding: 10px 14px; align-items: start; }
@media (max-width: 900px) { .sig-sum { grid-template-columns: 1fr; } }
.sig-sum-t { width: 100%; font-size: 12px; }
table.data.sig-sum-t th { font-size: 10.5px; padding: 2px 6px; }
table.data.sig-sum-t td { padding: 1px 6px; line-height: 18px; white-space: nowrap; }
.sig-sum-t tr.clickable { cursor: pointer; }
.sig-sum-t tr.clickable:hover td { background: color-mix(in srgb, var(--a1, var(--accent)) 6%, transparent); }
.sig-sum-t tr.off td { opacity: .45; }
table.data.sig-sum-t tr.sub td { font-size: 11px; color: var(--muted); line-height: 15px; }
.sig-sum-t tr.sub .sig-sum-name { padding-left: 16px; }
.sig-sum-t .sig-grade { font-size: 10px; padding: 0 7px; line-height: 16px; }
.sig-view { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; margin: 2px 0 10px; }
.sig-view-s { display: grid; gap: 1px; padding: 7px 10px; border: 1px solid var(--ring); border-radius: 10px; background: var(--card-2, var(--card)); }
.sig-view-s .kicker { font-size: 10px; }
.sig-view-s b { font-size: 16px; font-variant-numeric: tabular-nums; }
/* 🔒 the far-target lock at +7R: a gold-edged block and chip */
/* 🛡️ the +7R lock block and chip turn gold only once +7R has been reached */
.bat-cells .cell.lock { box-shadow: inset 0 0 0 1px #f5b942; }
/* 🛡️ the block where a far target locks +3R: a bottom bar like the add blocks', in the lock's gold */
.bat-cells .cell.lock-at { box-shadow: inset 0 -3px 0 #f5b942; }
.bat-cells .cell.lock-at.lock { box-shadow: inset 0 -3px 0 #f5b942, inset 0 0 0 1px #f5b942; }
.bat-add.lock { color: var(--ink-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f5b942 75%, var(--ring)); background: color-mix(in srgb, #f5b942 12%, var(--card)); }
/* the signal tiles' battery: the open position's blocks, smaller */
.bat-cells.mini { height: 14px; gap: 2px; }
.bat-cells.mini .cell { border-radius: 3px; }
.bat-cells.mini .cell.tp { box-shadow: inset 0 0 0 1.5px #22c55e; }
/* the Signals table's trade cell: a battery over the prices; the best R as a faint ghost behind */
table.data td.sig-trade-c { min-width: 170px; max-width: 230px; }
.sig-trade-c .bat-cells.mini { height: 12px; margin-bottom: 3px; }
.sig-trade-c small { display: block; font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bat-cells.ghosted .cell:not(.risk) { background: linear-gradient(90deg, color-mix(in srgb, var(--pos) 28%, var(--wash)) 0 calc(var(--g, 0) * 100%), var(--wash) calc(var(--g, 0) * 100%)); }
.bat-cells.ghosted .cell.tp { background: linear-gradient(90deg, color-mix(in srgb, var(--pos) 28%, transparent) 0 calc(var(--g, 0) * 100%), transparent calc(var(--g, 0) * 100%)); }
td.sig-res-c small { display: block; font-size: 10.5px; font-weight: 500; }
table.data td.sig-lvl-c { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
/* a finished trade's battery is still: plain lit blocks, no stripes */
.bat-cells.still .cell.lit::after { display: none; }
/* Signals: the grades as one row of stats: badge, R a trade, verdict; thin dividers, no borders */
.sig-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0; padding: 10px 6px; }
.sig-gstat { display: grid; justify-items: center; gap: 3px; padding: 2px 8px; text-align: center; border-left: 1px solid var(--grid); min-width: 0; cursor: default; }
.sig-gstat:first-child { border-left: 0; }
.sig-gstat .sig-grade { font-size: 10.5px; padding: 1px 8px; }
.sig-gstat-r { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.sig-gstat-v { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sig-gstat-v.best { color: color-mix(in srgb, var(--pos) 80%, var(--ink)); font-weight: 650; }
.sig-gstat-v.bad { color: var(--neg); font-weight: 650; }
.sig-gstat-n { font-size: 10px; color: var(--muted); opacity: .8; font-variant-numeric: tabular-nums; margin-top: -2px; }
.sig-gstat .sig-grade[title] { cursor: help; }
@media (max-width: 700px) { .sig-gstat { border-left: 0; padding: 6px 4px; } }
/* Signals filters: rows of pills, always in view */
.sig-pillbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 2px 0 12px; }
.sig-fbox { flex: 1 1 auto; display: grid; gap: 6px; align-content: start; padding: 8px 10px; border: 1px solid var(--ring); border-radius: 12px; background: color-mix(in srgb, var(--wash) 50%, transparent); }
.sig-fbox-n { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.sig-fbox-b { display: grid; gap: 6px; }
.sig-fbox .sig-pg-n { min-width: 64px; }
.sig-pg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sig-pg-n { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.sig-fpill { font: inherit; font-size: 11.5px; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.sig-fpill:hover { border-color: color-mix(in srgb, var(--a1, var(--accent)) 50%, var(--ring)); color: var(--ink); }
.sig-fpill.on { background: var(--a1, var(--accent)); border-color: var(--a1, var(--accent)); color: #fff; }
.sig-pg-sel { font-size: 11.5px; padding: 3px 6px; border-radius: 999px; }
.sig-dates { flex-wrap: wrap; gap: 6px; align-items: center; }
.sig-dates input[type=date].sig-pg-sel { font: inherit; font-size: 11.5px; color: inherit; background: transparent; border: 1px solid var(--line, rgba(127,127,127,.35)); padding: 2px 8px; }
.sig-pillbar .sig-filt-reset { align-self: end; margin-left: auto; }
.sig-fbox-b > .sig-pg:only-child > .sig-pg-n { display: none; }   /* a box with one row (Hide) doesn't repeat its name */
/* the filters' header: a toggle, and (collapsed) the filters in use as chips */
.sig-fhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 8px; }
.sig-ftoggle { font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: none; border: 0; padding: 4px 2px; cursor: pointer; }
.sig-ftoggle i { font-style: normal; display: inline-block; width: 12px; color: var(--muted); }
.sig-ftoggle:hover { color: var(--ink); }
.sig-fhead:not(.collapsed) #sigFiltChips { display: none; }
.sig-hidden-note .sig-grade { cursor: pointer; border: 0; font-size: 10.5px; padding: 1px 8px; margin: 2px 0; }
/* 🐋 Whale Absorption (teal) and its ⚠️ crowded state (amber) */
.sig-whale { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; color: color-mix(in srgb, #0d9488 75%, var(--ink)); background: color-mix(in srgb, #14b8a6 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #14b8a6 40%, transparent); }
.sig-whale.crowded { color: color-mix(in srgb, #b45309 75%, var(--ink)); background: color-mix(in srgb, #f59e0b 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 40%, transparent); }
.sig-pill.whale { background: color-mix(in srgb, #14b8a6 18%, transparent); padding: 1px 4px; }
.sig-kz { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; color: color-mix(in srgb, #6d28d9 75%, var(--ink)); background: color-mix(in srgb, #8b5cf6 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #8b5cf6 40%, transparent); }
.sig-kz.warn { color: color-mix(in srgb, #b45309 75%, var(--ink)); background: color-mix(in srgb, #f59e0b 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 40%, transparent); }
.sig-pill.kz { background: color-mix(in srgb, #8b5cf6 18%, transparent); padding: 1px 4px; }
.sig-late { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; color: color-mix(in srgb, #0f766e 75%, var(--ink)); background: color-mix(in srgb, #14b8a6 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #14b8a6 40%, transparent); }
.sig-late.early { color: color-mix(in srgb, #a16207 75%, var(--ink)); background: color-mix(in srgb, #eab308 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #eab308 40%, transparent); }
.sig-lean { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; color: color-mix(in srgb, #c2410c 75%, var(--ink)); background: color-mix(in srgb, #f97316 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f97316 40%, transparent); }
.sig-nyx { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; color: color-mix(in srgb, #0f766e 75%, var(--ink)); background: color-mix(in srgb, #14b8a6 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #14b8a6 40%, transparent); }
.sig-pill.lean { background: color-mix(in srgb, #f97316 18%, transparent); padding: 1px 4px; }
.sig-pill.late { background: color-mix(in srgb, #14b8a6 18%, transparent); padding: 1px 4px; }
/* open positions: a 5th+ note hides behind a tiny +N on the 4th */
.pos-note:has(.pos-more) { padding-right: 34px; }
.pos-more { position: absolute; top: 4px; right: 5px; font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 999px; cursor: help; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.pos-more:hover, .pos-more:focus { background: color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
/* signal tiles: tags wrap to a second line instead of being cut off */
.sig-top { flex-wrap: wrap; row-gap: 4px; }
.sig-chips { max-width: 260px; }
/* projected win rate: a quiet pill, tinted by how likely */
.sig-proj { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; cursor: help; font-variant-numeric: tabular-nums; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.sig-proj.hi, .sig-pill.proj.hi { color: color-mix(in srgb, var(--pos) 80%, var(--ink)); background: color-mix(in srgb, var(--pos) 14%, transparent); }
.sig-proj.lo, .sig-pill.proj.lo { color: var(--muted); }
.sig-top .sig-pill.proj { font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.sig-top .sig-pill.proj.hi { background: color-mix(in srgb, var(--pos) 14%, transparent); }
/* 🐋 S: an A / A+ with whale absorption (teal, a notch under S+'s purple) */
.sig-grade.g-s { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #2dd4bf, #0f766e); box-shadow: 0 0 0 1px color-mix(in srgb, #14b8a6 60%, transparent), 0 2px 8px -2px rgb(15 118 110 / .55); }
.sig-tile .sig-grade.g-s::after, .grade-check .sig-grade.g-s::after { content: ''; position: absolute; inset: -2px; transform: translateX(-120%) skewX(-20deg); pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .6), transparent); animation: gradeShine 3s ease-in-out infinite; }
.sig-tile.tile-g-s { border-color: color-mix(in srgb, #14b8a6 55%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #14b8a6 11%, var(--card-2)), var(--card-2) 60%); box-shadow: 0 0 14px -6px color-mix(in srgb, #14b8a6 75%, transparent); }
.grade-card.g-s { border-color: color-mix(in srgb, #14b8a6 50%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #14b8a6 9%, var(--card)), var(--card) 65%); }
.grade-card.g-s dt { color: #0f766e; font-weight: 700; }
.st-grade.g-s { --g: #14b8a6; }
/* tile tags: one right-aligned group that wraps to the right */
.sig-top { flex-wrap: nowrap; align-items: flex-start; }
.sig-top-tags { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.sig-top-tags > * { margin-left: 0 !important; flex: none; }
/* ⓘ setup breakdown on hover */
.sig-info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font: italic 700 10px/1 Georgia, serif; cursor: help; color: var(--muted); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent); flex: none; }
.sig-info:hover, .sig-info:focus { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); outline: none; }
/* 💎 S++: the rarest tier (rose gold) */
.sig-grade.g-splusplus { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #fb7185, #f59e0b 55%, #a855f7); box-shadow: 0 0 0 1px color-mix(in srgb, #f43f5e 55%, transparent), 0 2px 10px -2px rgb(244 63 94 / .6); }
.sig-tile .sig-grade.g-splusplus::after, .grade-check .sig-grade.g-splusplus::after { content: ''; position: absolute; inset: -2px; transform: translateX(-120%) skewX(-20deg); pointer-events: none; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .75), transparent); animation: gradeShine 2.2s ease-in-out infinite; }
.sig-tile.tile-g-splusplus { border-color: color-mix(in srgb, #f43f5e 55%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 12%, var(--card-2)), var(--card-2) 60%); box-shadow: 0 0 18px -6px color-mix(in srgb, #f43f5e 80%, transparent); }
.grade-card.g-splusplus { border-color: color-mix(in srgb, #f43f5e 50%, var(--ring)); background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 10%, var(--card)), var(--card) 65%); }
.grade-card.g-splusplus dt { color: #e11d48; font-weight: 700; }
.st-grade.g-splusplus { --g: #f43f5e; }
/* ⓘ on each grade's stats at the top */
.sig-gstat { position: relative; }

/* 🏁 a trailed trade's R:R: where the trail let go, past its target (↗) or before it (↘) */
.rr-trail { font-weight: 700; cursor: help; }
.rr-trail.up { color: var(--pos); }
.rr-trail.down { color: var(--muted); }

/* ===== Monitoring: the hour before the close ===== */
#view-monitor { --sw: var(--pos); --th: var(--warn); --nr: var(--a2); }
.mon-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 18px 22px;
  background: linear-gradient(120deg, var(--card), color-mix(in srgb, var(--hero) 70%, var(--card))); }
.mon-ring { position: relative; width: 104px; height: 104px; flex: none; }
.mon-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mon-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.mon-ring-bg { stroke: var(--grid); }
.mon-ring-hour { stroke: color-mix(in srgb, var(--accent) 28%, var(--grid)); stroke-linecap: butt !important; }
.mon-ring-fg { stroke: var(--muted); transition: stroke-dashoffset 1s linear, stroke .3s; }
.mon-ring[data-phase="watch"] .mon-ring-fg { stroke: var(--accent); }
.mon-ring[data-phase="late"] .mon-ring-fg { stroke: var(--neg); animation: mon-pulse 1.6s ease-in-out infinite; }
@keyframes mon-pulse { 50% { opacity: .55; } }
.mon-ring-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.mon-ring-t b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mon-ring-t small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mon-hero-mid { min-width: 0; }
.mon-h { font-size: 20px !important; margin: 2px 0 4px; }
.mon-status { margin: 0; }
.mon-counts { display: flex; gap: 10px; }
.mon-count { display: grid; justify-items: center; min-width: 78px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--ring); border-bottom: 3px solid var(--c); }
.mon-count b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mon-count span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mon-count.c-swept { --c: var(--sw); } .mon-count.c-beyond { --c: var(--th); } .mon-count.c-near { --c: var(--nr); }

.mon-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px; }
.mon-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.mon-tog { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; user-select: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card-2); }
.mon-tog:has(input:checked) { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); }
.mon-tog input { margin: 0; accent-color: var(--accent); }
.mon-now { margin-left: auto; }

.mon-btc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
.mon-btc-t { font-size: 13px; margin-right: 4px; }
.mon-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--ring); font-size: 12.5px; }
.mon-chip small { color: var(--muted); font-size: 11px; }
.mon-chip.pos { border-color: color-mix(in srgb, var(--pos) 45%, var(--ring)); } .mon-chip.pos b { color: var(--pos); }
.mon-chip.neg { border-color: color-mix(in srgb, var(--neg) 45%, var(--ring)); } .mon-chip.neg b { color: var(--neg); }
.mon-chip.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--ring)); } .mon-chip.warn b { color: var(--warn); }

.mon-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-left: 3px solid var(--accent); }
.mon-res-t { font-size: 13px; margin-right: 6px; }
.mon-res { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--ring); background: var(--card-2); }
.mon-res.ok { border-color: color-mix(in srgb, var(--pos) 55%, var(--ring)); color: var(--pos); font-weight: 600; }
.mon-res.no { color: var(--muted); }

.mon-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.mon-lane { --c: var(--nr); background: var(--card); border: 1px solid var(--ring); border-top: 3px solid var(--c); border-radius: 14px; padding: 10px; min-width: 0; }
.lane-swept { --c: var(--sw); } .lane-beyond { --c: var(--th); }
.mon-lane-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 2px 4px 10px; cursor: help; }
.mon-lane-h b { font-size: 14px; }
.mon-lane-h small { flex-basis: 100%; font-size: 11.5px; }
.mon-lane-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); align-self: center; }
.lane-swept .mon-lane-dot { box-shadow: 0 0 0 0 var(--c); animation: mon-ping 2s ease-out infinite; }
@keyframes mon-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.mon-lane-n { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, var(--card-2)); color: var(--ink); }
.mon-lane-body { display: grid; gap: 10px; }
.mon-empty { margin: 6px 4px 8px; }

.mon-card { --c: var(--nr); position: relative; display: grid; gap: 8px; padding: 10px 12px 10px 14px; border-radius: 12px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--ring); box-shadow: inset 3px 0 0 var(--c); transition: border-color .2s, transform .2s var(--ease); }
.mon-card.s-swept { --c: var(--sw); } .mon-card.s-beyond { --c: var(--th); }
.mon-card:hover, .mon-card:focus-visible { border-color: color-mix(in srgb, var(--c) 55%, var(--ring)); transform: translateY(-1px); outline: none; }
.mon-card.pinned { border-color: color-mix(in srgb, #f5b942 45%, var(--ring)); }
.mon-card.fresh { animation: mon-fresh 1.4s ease-out 2; }
@keyframes mon-fresh { 0% { box-shadow: inset 3px 0 0 var(--c), 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 100% { box-shadow: inset 3px 0 0 var(--c), 0 0 0 10px transparent; } }
.mon-card-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mon-pin { all: unset; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }
.mon-pin.on { color: #f5b942; }
.mon-coin { font-size: 15px; letter-spacing: .01em; }
.mon-side { font-size: 11.5px; font-weight: 600; }
.mon-side.pos { color: var(--pos); } .mon-side.neg { color: var(--neg); }
.mon-grade { margin-left: auto; }
.mon-grade.maybe { opacity: .72; outline: 1px dashed var(--muted); outline-offset: 1px; }
.mon-flag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 5px; background: var(--c); color: var(--accent-ink); }
.mon-move { font-size: 11px; font-weight: 600; }
.mon-move.closer { color: var(--warn); } .mon-move.away { color: var(--muted); }
.mon-spark { height: 64px; border-radius: 8px; background: var(--card); border: 1px solid var(--ring); overflow: hidden; }
.mon-spark svg { width: 100%; height: 100%; display: block; }
.mon-spark .sp-past { fill: color-mix(in srgb, var(--c) 10%, transparent); }
.mon-spark .sp-now { fill: color-mix(in srgb, var(--ink) 3%, transparent); }
.mon-spark .sp-level { stroke: var(--c); stroke-width: 1.2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.mon-spark line.sp-up, .mon-spark line.sp-dn { stroke-width: 1; vector-effect: non-scaling-stroke; }
.mon-spark .sp-up { stroke: var(--pos); fill: var(--pos); } .mon-spark .sp-dn { stroke: var(--neg); fill: var(--neg); }
.mon-spark .sp-old { opacity: .35; }
.mon-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mon-nums div { display: grid; min-width: 0; }
.mon-nums small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mon-nums b { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-nums b.pos { color: var(--pos); } .mon-nums b.warn { color: var(--warn); } .mon-nums b.muted { color: var(--muted); }
.mon-plan { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--ring); font-variant-numeric: tabular-nums; }
.mon-plan .pos { color: var(--pos); } .mon-plan .neg { color: var(--neg); }
.mon-plan b { margin-left: auto; }
.mon-foot { font-size: 11.5px; }
#view-monitor.mon-stale .mon-board { opacity: .6; }
@media (max-width: 1100px) { .mon-board { grid-template-columns: 1fr 1fr; } .mon-hero { grid-template-columns: auto 1fr; } .mon-counts { grid-column: 1 / -1; } }
@media (max-width: 760px) { .mon-board { grid-template-columns: 1fr; } }

/* ---- tags grouped: in your favour | warnings | plan notes ---- */
.tag-sep { display: inline-block; width: 1px; height: 14px; margin: 0 3px; background: var(--grid, rgba(127,127,127,.35)); vertical-align: middle; flex: none; }
.rg-chips .tag-sep { height: 18px; align-self: center; margin: 0 4px; }
.sig-tagcell .sig-chips + .sig-chips { margin-top: 4px; }
.sig-chips.tags-good, .sig-chips.tags-warn, .sig-chips.tags-info { padding-left: 6px; border-left: 2px solid transparent; }
.sig-chips.tags-good { border-left-color: color-mix(in srgb, var(--pos) 70%, transparent); }
.sig-chips.tags-warn { border-left-color: color-mix(in srgb, #f59e0b 80%, transparent); }
.sig-chips.tags-info { border-left-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.mon-tags { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.mon-tags > span:not(.tag-sep) { font-size: 11px; padding: 1px 5px; }

/* a missed limit: what the close would have made, under it, quieter than a real result */
.sig-missed-alt { display: block; opacity: .75; font-style: italic; }

/* 🔱 God tier: a gold ring on the grade chip */
.sig-grade.god { box-shadow: 0 0 0 1.5px #d4a017, 0 0 10px -2px rgb(212 160 23 / .7); }

/* ---- signal tile header: row 1 the grade + projected win, row 2 the tags in tinted groups ---- */
.sig-tile .sig-top { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-height: 24px; }
.sig-tile .sig-top .sig-proj-r { margin-left: auto !important; }
.sig-tagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 22px; margin: 6px 0 2px; }
.tg { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 7px; font-size: 12px; line-height: 18px; cursor: default;
  border: 1px solid transparent; }
.tg-good { background: color-mix(in srgb, var(--pos) 10%, transparent); border-color: color-mix(in srgb, var(--pos) 32%, transparent); }
.tg-warn { background: color-mix(in srgb, #f59e0b 12%, transparent); border-color: color-mix(in srgb, #f59e0b 45%, transparent); }
.tg-info { background: color-mix(in srgb, var(--ink) 5%, transparent); border-color: color-mix(in srgb, var(--ink) 14%, transparent); }
.tg-pill { cursor: help; padding: 0 1px; }
.tg-pill.tg-word { font-size: 10px; font-weight: 600; }
.tg-good .tg-word { color: color-mix(in srgb, var(--pos) 80%, var(--ink)); }
.tg-warn .tg-pill { color: #b45309; } :root[data-mode="dark"] .tg-warn .tg-pill { color: #fbbf24; }
.tg-warn .tg-pill:not(.tg-word) { font-size: 11px; font-weight: 700; }
.tg-info .tg-word { color: var(--muted); }

/* a missed limit's battery: the close entry's trade, faded and dashed, so it reads as "had it been taken" */
.bat-cells.hypo { opacity: .55; }
.bat-cells.hypo .cell { outline: 1px dashed color-mix(in srgb, var(--ink) 35%, transparent); outline-offset: -1px; }

/* the app-wide tooltip's formatting (tips.js): sections, bold labels, lists, coloured R */
.tip-text .tt-block + .tt-block { margin-top: 7px; padding-top: 7px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.tip-text .tt-line + .tt-line { margin-top: 3px; }
.tip-text .tt-lab { color: var(--ink); font-weight: 700; }
.tip-text .tt-block:first-child .tt-line:first-child .tt-lab { font-size: 13px; }
.tip-text .tt-bullet { position: relative; padding-left: 12px; }
.tip-text .tt-bullet::before { content: '•'; position: absolute; left: 2px; color: var(--muted); }
.tip-text b { color: var(--ink); font-weight: 700; }
.tip-text .tt-pos { color: var(--pos); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-text .tt-neg { color: var(--neg); font-weight: 600; font-variant-numeric: tabular-nums; }

/* the hover tooltip: solid, whatever the theme (themes' cards can be see-through) */
.tip.tip-text[popover] { background: #fcfbf8; opacity: 1; backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid rgb(0 0 0 / .12); box-shadow: 0 10px 30px -6px rgb(0 0 0 / .28), 0 2px 6px rgb(0 0 0 / .08); color: #3a3935; }
.tip.tip-text[popover] .tt-lab, .tip.tip-text[popover] b { color: #121212; }
:root[data-mode="dark"] .tip.tip-text[popover] { background: #1d1d20; border-color: rgb(255 255 255 / .12); color: #d6d4cd; box-shadow: 0 12px 34px -6px rgb(0 0 0 / .6); }
:root[data-mode="dark"] .tip.tip-text[popover] .tt-lab, :root[data-mode="dark"] .tip.tip-text[popover] b { color: #f4f2ec; }

/* ================= phones: an app-style layout =================
   Everything below is inside (max-width: 860px), so desktop browsers are untouched.
   A slim top bar (logo + theme), a tab bar at the bottom (public/mobile.js),
   stats that scroll with the page, and tighter banners and cards. */
.tabbar, .m-sheet { display: none; }
@media (max-width: 860px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { -webkit-text-size-adjust: 100%; }
  .app, .app.side-folded { display: block; }

  /* top bar: logo on the left, theme on the right; stays above the page */
  .app .side, .side-folded .side { position: sticky; top: 0; z-index: 50; isolation: isolate; height: auto; overflow: visible;
    flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; border-right: 0; border-bottom: 1px solid var(--ring);
    background: color-mix(in srgb, var(--side) 86%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
  .side .nav, .side .side-exports, .side #account { display: none !important; }
  .side .logo, .side-folded .logo { padding: 0; gap: 9px; font-size: 17px; }
  .side-folded .logo span { opacity: 1; transform: none; width: auto; }
  .side .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
  .side .side-foot, .side-folded .side-foot { margin: 0; padding: 0; width: auto; }
  [data-theme="synthwave"] .side::after { display: none; }

  /* page: room for the status strip and the tab bar */
  .main { padding: 12px 14px calc(56px + 26px + env(safe-area-inset-bottom) + 18px); }
  .head { margin-bottom: 12px; gap: 10px; }
  .head h1 { font-size: 22px; }
  .filters { width: 100%; gap: 6px; }
  .filters > * { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .card { padding: 14px; border-radius: 14px; }
  @media (hover: none) { .card:hover, .card.accented:hover, .stat:hover { transform: none; } }
  /* iOS zooms into any field under 16px when it's tapped */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }

  /* the stats: no longer pinned, two to a row and compact */
  .stats-sentinel { display: none; }
  .stats, .stats.stuck { position: static; z-index: auto; margin: 0; padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats .stat, .stats.stuck .stat { padding: 9px 11px; gap: 6px; }
  .stats .stat.hero { grid-column: 1 / -1; }
  .stats .stat-value { font-size: 18px; }
  .stats .stat .kicker { font-size: 10px; }
  .stats .stat .muted.small { font-size: 11px; }
  .stats .spark-viz { width: 52px; height: 30px; }

  /* warnings (Saturday, overtrading, loss limit): one compact strip each */
  .sat-banner { gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; flex-wrap: wrap; position: relative; z-index: 0; }
  .sat-banner svg { width: 22px; height: 22px; filter: none; }
  .sat-banner strong { font-size: 15px; }
  .sat-banner span { font-size: 13px; line-height: 1.35; }
  .sat-banner .banner-btn { width: 100%; justify-content: center; }
  .sat-banner + .sat-banner { margin-top: 0; }

  /* the status strip sits just above the tab bar */
  .status-bar { bottom: calc(56px + env(safe-area-inset-bottom)); height: 26px; z-index: 54; gap: 12px; padding: 0 14px; border-top: 1px solid var(--ring); }

  /* the tab bar */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    height: calc(56px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--side) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid var(--ring); }
  .tabbar button, .m-sheet-grid button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; cursor: pointer; padding: 0; }
  .tabbar svg, .m-sheet-grid svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar [data-tab="more"] svg { fill: currentColor; stroke: none; }
  .tabbar button[aria-current="page"], .m-sheet-grid button[aria-current="page"] { color: var(--accent); }
  .tabbar button:active svg, .m-sheet-grid button:active svg { transform: scale(.88); }
  .tabbar svg { transition: transform .15s; }
  .tab-count { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--crit, #ef4444); color: #fff;
    font-style: normal; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
  .tabbar [data-tab="more"] .tab-count { min-width: 8px; width: 8px; height: 8px; padding: 0; top: 9px; left: calc(50% + 9px); }
  .tab-count[hidden] { display: none; }

  /* More: a sheet that slides up */
  .m-sheet { display: block; position: fixed; inset: 0; z-index: 90; }
  .m-sheet[hidden] { display: none; }
  .m-sheet-back { position: absolute; inset: 0; background: rgb(0 0 0 / .42); opacity: 0; transition: opacity .25s; }
  .m-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--ring); border-radius: 20px 20px 0 0; box-shadow: 0 -18px 50px -20px rgb(0 0 0 / .5);
    transform: translateY(100%); transition: transform .28s cubic-bezier(.22, 1, .36, 1); }
  .m-sheet.open .m-sheet-back { opacity: 1; }
  .m-sheet.open .m-sheet-panel { transform: none; }
  .m-sheet-grab { display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--ring); margin: 0 auto 14px; }
  .m-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .m-sheet-grid button { height: 78px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--ring); color: var(--ink-2); font-size: 12px; text-align: center; padding: 0 4px; }
  .m-sheet-grid button span { line-height: 1.2; }
  .m-sheet-grid button[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--ring)); background: color-mix(in srgb, var(--accent) 12%, var(--card-2)); }
  .m-sheet-grid .tab-count { top: 8px; left: auto; right: 10px; }
  .m-sheet-row { display: flex; gap: 8px; margin-top: 12px; }
  .m-sheet-row .btn { flex: 1; justify-content: center; gap: 6px; }
  .m-sheet-row svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

  .dlg { max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .m-sheet-panel, .m-sheet-back, .tabbar svg { transition: none; } }
@media print { .tabbar, .m-sheet { display: none !important; } }

/* phones: the Open positions header, and the chart window as a tabbed full-screen sheet */
.rp-tabs { display: none; }
@media (max-width: 860px) {
  /* title and the two icons on one line, then Unrealized · At risk across the full width */
  .pos-card > .card-row { flex-wrap: wrap; align-items: center; row-gap: 6px; column-gap: 4px; }
  .pos-card > .card-row > .kicker { flex: 1 1 auto; min-width: 0; }
  .pos-card .pos-head-right { display: contents; }
  .pos-card #posEye { order: 1; } .pos-card #posRefresh { order: 2; }
  .pos-card .pos-total { order: 3; flex: 1 0 100%; justify-content: flex-start; gap: 2px 16px; }
  .pos-card #posAt { order: 4; flex: 1 0 100%; } .pos-card #posAt:empty, .pos-card .pos-total:empty { display: none; }
  .pos-card .pos-list { margin-top: 8px; }
  .pos-row { gap: 10px 12px; padding: 10px; align-items: start; }
  .pos-row .bat-line { row-gap: 6px; }
  .pos-row .bat-adds { margin-left: 0; width: 100%; flex-wrap: wrap; }

  /* the chart window: full screen, Chart | Strategy tabs */
  .dlg.replay-dlg[open], .dlg.replay-dlg.has-guide[open] { display: flex; flex-direction: column; inset: 0; margin: 0; width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; overflow: hidden;
    padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 10px); }
  .replay-dlg .rp-tabs { display: flex; flex: none; margin: 8px 0 10px; }
  .replay-dlg .rp-tabs button { flex: 1; padding: 7px 0; font-size: 14px; }
  .replay-dlg .rp-body, .replay-dlg.has-guide .rp-body { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
  /* Chart tab: the chart fills the screen */
  .replay-dlg:not(.rp-on-guide) .rp-side, .replay-dlg:not(.rp-on-guide) #rpHead, .replay-dlg:not(.rp-on-guide) #rpNotes { display: none; }
  .replay-dlg:not(.rp-on-guide) .rp-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .replay-dlg:not(.rp-on-guide) .replay-chart, .replay-dlg.has-guide:not(.rp-on-guide) .replay-chart { flex: 1; min-height: 260px; height: auto; }
  .replay-dlg .replay-bar { flex-wrap: wrap; gap: 6px; }
  /* Strategy tab: everything else, scrolling */
  .replay-dlg.rp-on-guide { overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .replay-dlg.rp-on-guide .rp-main { display: none; }
  .replay-dlg.rp-on-guide .rp-body { flex: none; display: block; }
  .replay-dlg.rp-on-guide .rp-side { overflow: visible; padding: 0; }
}
@media (max-width: 860px) {
  /* the right column (P&L, liquidation) lines up on the right edge */
  .pos-row > .pos-pnl, .pos-row > .pos-cell:not(.live-px) { align-items: flex-end; text-align: right; }
  .pos-row > .pos-cell:not(.live-px) .liq-bar { align-self: stretch; }
}

/* phones: Signals. The count over the grade checks, which scroll sideways; each result
   is a card (pair, side and result on top, then the tags, the trade, and the details)
   instead of a wide table; the sort buttons sit in a sideways-scrolling row above. */
@media (max-width: 860px) {
  .card-row:has(> #sigCount) { flex-direction: column; align-items: stretch; gap: 8px; }
  #sigCount { white-space: normal; letter-spacing: .04em; line-height: 1.4; }
  .card-row:has(> #sigCount) .sig-filters { width: 100%; flex-wrap: nowrap; }
  #sigGradeF { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #sigGradeF::-webkit-scrollbar { display: none; }
  #sigGradeF > * { flex: none; }

  #sigTable, #sigTable thead, #sigTable tbody { display: block; width: 100%; }
  #sigTable thead tr { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; border-bottom: 1px solid var(--grid); }
  #sigTable thead tr::-webkit-scrollbar { display: none; }
  #sigTable thead th { flex: none; padding: 0; border: 0; }
  #sigTable thead th:not(:has(button)) { display: none; }
  #sigTable thead th .sort { border: 1px solid var(--ring); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; background: var(--card-2); }
  #sigTable thead th[aria-sort] .sort { border-color: color-mix(in srgb, var(--accent) 55%, var(--ring)); color: var(--ink); font-weight: 650; }

  #sigTable tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 12px 2px; border-bottom: 1px solid var(--grid); }
  #sigTable tbody td { padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; }
  #sigTable tbody td:nth-child(2) { order: 1; font-size: 16px; font-weight: 750; }                 /* pair */
  #sigTable tbody td:nth-child(3) { order: 2; font-size: 13px; font-weight: 600; }                 /* side */
  #sigTable tbody td:nth-child(11) { order: 3; margin-left: auto; text-align: right; font-size: 15px; font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; }   /* result */
  #sigTable tbody td:nth-child(4) { order: 4; flex: 1 0 100%; }                                     /* grade + tags */
  #sigTable tbody td:nth-child(6) { order: 5; flex: 1 0 100%; }                                     /* trade */
  #sigTable tbody td:nth-child(1) { order: 6; }                                                     /* 4h close */
  #sigTable tbody td:nth-child(8), #sigTable tbody td:nth-child(9), #sigTable tbody td:nth-child(10) { order: 7; }   /* held, best R, R:R */
  #sigTable tbody td:nth-child(7) { order: 8; }                                                     /* BTC trend */
  #sigTable tbody td:nth-child(5) { order: 9; flex: 1 0 100%; }                                     /* level */
  #sigTable tbody td:nth-child(1), #sigTable tbody td:nth-child(5), #sigTable tbody td:nth-child(8), #sigTable tbody td:nth-child(9), #sigTable tbody td:nth-child(10) { font-size: 12px; color: var(--muted); }
  #sigTable tbody td:nth-child(8):not(:empty)::before { content: 'Held '; }
  #sigTable tbody td:nth-child(9):not(:empty)::before { content: 'Best '; color: var(--muted); }
  #sigTable tbody td:nth-child(10)::before { content: 'R:R '; }
  #sigTable tbody td:nth-child(5)::before { content: 'Level '; }
  #sigTable tbody td:nth-child(11) small { font-size: 11px; font-weight: 500; }
  .table-wrap:has(> #sigTable) { overflow-x: visible; }
}
/* Latest signals: ‹ 1–4 of 40 › */
.sig-pager { display: inline-flex; align-items: center; gap: 6px; }
.sig-pager[hidden] { display: none; }
.sig-pager-lab { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 62px; text-align: center; }
.sig-pager .pv-arrow:disabled { opacity: .35; cursor: default; transform: none; }
@media (max-width: 860px) { .sig-pager .pv-arrow { width: 30px; height: 30px; font-size: 17px; } }
@media (max-width: 860px) {
  /* the result sits in the top-right corner, so its "after fees" line shares the grade's line */
  #sigTable tbody tr { position: relative; }
  #sigTable tbody td:nth-child(11) { position: absolute; top: 12px; right: 2px; margin: 0; line-height: 1.3; }
  #sigTable tbody td:nth-child(2), #sigTable tbody td:nth-child(3) { line-height: 1.3; }
  #sigTable tbody td:nth-child(4) { padding-right: 0; }
  #sigTable tbody td:nth-child(4) > .sig-chips:first-child { margin-bottom: 6px; }
}
@media (max-width: 860px) {
  /* the grade checks wrap onto a second row instead of scrolling sideways */
  .card-row:has(> #sigCount) .sig-filters { flex-wrap: wrap; }
  #sigGradeF { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px 4px; overflow: visible; border-radius: 16px; padding: 6px 8px; }
}
@media (max-width: 860px) {
  /* the sort buttons wrap too */
  #sigTable thead tr { flex-wrap: wrap; overflow: visible; gap: 6px 5px; }
  #sigTable thead th .sort { padding: 3px 9px; font-size: 12px; }
}

/* ================= Void ================= */
[data-void] body { background-color: transparent; }
/* a faint dot grid under a soft glow from the top, darker at the edges */
[data-void] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% -8%, rgba(150, 160, 190, 0.13), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1.3px) 0 0 / 22px 22px; }
/* cards: hairline frames with small corner brackets, no accent edges, no lift */
[data-void] .card, [data-void] .stat {
  --br: rgba(255, 255, 255, 0.34);
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br));
  background-repeat: no-repeat;
  background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom; }
[data-void] .card, [data-void] .stat, [data-void] .card.accented,
[data-void] #view-analytics > .card, [data-void] #view-trades > .card { box-shadow: none; }
[data-void] .card:hover, [data-void] .card.accented:hover, [data-void] .stat:hover { transform: none; box-shadow: none; border-color: rgba(255, 255, 255, 0.16); }
[data-void] .stat.hero { background-color: var(--hero); border-color: rgba(255, 255, 255, 0.14); box-shadow: none; }
[data-void] .stat.hero:hover { box-shadow: none; }
/* the heading marker: a hollow square, like the logo's */
[data-void] .card.accented > .kicker::before, [data-void] .card.accented > .card-row > .kicker::before, [data-void] .stat .kicker::before {
  width: 7px; height: 7px; border-radius: 0; background: transparent; border: 1.5px solid var(--ink); box-shadow: none; opacity: .85; }
[data-void] .stat.hero .kicker::before { border-color: var(--pos); }
/* type: mono, wide-tracked labels; a metallic title */
[data-void] .kicker, [data-void] .card h2, [data-void] .sb-conn { font-family: var(--font-display); letter-spacing: .14em; }
[data-void] .head h1 { font-family: var(--font-display); font-weight: 400; letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 15%, #8b909b 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-void] .logo span { font-family: var(--font-display); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: 15px; }
[data-void] .logo b { color: var(--ink); font-weight: 700; }
[data-void] .logo-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); filter: grayscale(1) contrast(1.1); }
/* buttons and fields: outlined, square, a faint inner glow */
[data-void] .btn { border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.025); }
[data-void] .btn:hover { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.05); }
[data-void] .btn.primary { color: var(--ink); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(0, 0, 0, .4); }
[data-void] .btn.primary:hover { background: rgba(255, 255, 255, 0.1); }
[data-void] select, [data-void] input, [data-void] textarea { border-radius: 3px; }
/* nav: the current view gets a thin white edge */
[data-void] .nav button { border-radius: 3px; }
[data-void] .nav button[aria-current="page"] { background: rgba(255, 255, 255, 0.06); box-shadow: inset 2px 0 0 var(--ink); }
[data-void] .side { border-right-color: rgba(255, 255, 255, 0.07); }
[data-void] .chip, [data-void] .seg, [data-void] .seg button { border-radius: 3px; }
.theme-opt[data-theme="void"] .theme-name { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 12.5px; }
@media print { [data-void] body::before { display: none; } }

/* ---- Void, polished: silver edges, a sheen, perforated metal ---- */
:root[data-void] {
  --silver: linear-gradient(135deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .08) 28%, rgba(255, 255, 255, .03) 55%, rgba(255, 255, 255, .26) 100%);
  --perf: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .62) 0 1.05px, rgba(255, 255, 255, .05) 1.35px, transparent 1.7px) 0 0 / 6px 6px;
  --brushed: linear-gradient(180deg, #1b1d22 0%, #131418 55%, #101115 100%);
  --accent: #dfe2e8;
}
/* cards: a silver gradient edge (bright top-left and bottom-right), a soft sheen across the top, the corner brackets kept */
[data-void] .card, [data-void] .stat {
  --br: rgba(255, 255, 255, 0.55); --fill: var(--card);
  border-color: transparent;
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 38%), linear-gradient(var(--fill), var(--fill)), var(--silver);
  background-origin: border-box;
  background-clip: border-box, border-box, border-box, border-box, border-box, border-box, border-box, border-box, padding-box, padding-box, border-box;
  background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 100% 100%, 100% 100%, 100% 100%;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom, 0 0, 0 0, 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -28px rgba(0, 0, 0, .9); }
[data-void] .card:hover, [data-void] .card.accented:hover, [data-void] .stat:hover { border-color: transparent; --br: rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 40px -24px rgba(0, 0, 0, .9); }
/* the headline tile: perforated metal under the number */
[data-void] .stat.hero { --fill: #15171b; border-color: transparent;
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(ellipse 90% 70% at 85% 0%, rgba(255, 255, 255, .10), transparent 60%), radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .7) 0 1.05px, rgba(255, 255, 255, .06) 1.35px, transparent 1.7px),
    var(--brushed), var(--silver);
  background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 9px 1px, 1px 9px, 100% 100%, 6px 6px, 100% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, no-repeat, no-repeat;
  background-clip: border-box, border-box, border-box, border-box, border-box, border-box, border-box, border-box, padding-box, padding-box, padding-box, border-box; }
/* sidebar, status bar and the phone tab bar: brushed metal with a perforated pattern */
[data-void] .side, [data-void] .status-bar, [data-void] .tabbar { background: var(--perf), var(--brushed); }
[data-void] .side { box-shadow: inset -1px 0 0 rgba(255, 255, 255, .09); border-right-color: transparent; }
[data-void] .status-bar, [data-void] .tabbar { border-top-color: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
@media (max-width: 860px) { [data-void] .app .side { background: var(--perf), var(--brushed); border-bottom-color: rgba(255, 255, 255, .12); } }
/* chrome text: the title and card headings in polished silver, with a slow glint across the title */
[data-void] .head h1 { background: linear-gradient(100deg, #8e939d 0%, #ffffff 22%, #a6abb4 40%, #f4f5f7 52%, #7d828c 70%, #dfe2e8 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: voidGlint 9s ease-in-out infinite; }
@keyframes voidGlint { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
[data-void] .card h2 { background: linear-gradient(180deg, #ffffff, #9ba0aa); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-void] .card.accented > .kicker::before, [data-void] .card.accented > .card-row > .kicker::before, [data-void] .stat .kicker::before {
  border: 0; background: linear-gradient(135deg, #ffffff, #8d929c); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 1.5px; }
/* buttons: brushed steel; the primary one solid polished silver */
[data-void] .btn { border: 1px solid transparent; background: linear-gradient(180deg, #202227, #15161a) padding-box, var(--silver) border-box; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
[data-void] .btn:hover { background: linear-gradient(180deg, #282b31, #191b1f) padding-box, linear-gradient(135deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .15) 40%, rgba(255, 255, 255, .35)) border-box; }
[data-void] .btn.primary { color: #0b0c0f; font-weight: 650; border: 1px solid rgba(255, 255, 255, .5);
  background: linear-gradient(180deg, #fbfbfc 0%, #d9dce2 45%, #b4b8c1 55%, #e6e8ec 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .25), 0 6px 18px -8px rgba(220, 225, 235, .35); }
[data-void] .btn.primary:hover { background: linear-gradient(180deg, #ffffff 0%, #e4e7ec 45%, #c2c6ce 55%, #f0f1f4 100%); }
[data-void] .nav button[aria-current="page"] { color: #fff; background: linear-gradient(90deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .02));
  box-shadow: inset 2px 0 0 #e9ebef, inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-void] .tabbar button[aria-current="page"] { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .35); }
@media (prefers-reduced-motion: reduce) { [data-void] .head h1 { animation: none; } }

/* ================= Gallery ================= */
[data-theme="gallery"] body { background-color: transparent; }
.plexus { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
:root:not([data-theme="gallery"]) .plexus { display: none; }
/* panels: white glass over the network, hairline frames with a node at each corner */
[data-theme="gallery"] .card, [data-theme="gallery"] .stat {
  --nd: #9b9b9b; border: 1px solid var(--ring); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  background-image: radial-gradient(circle, var(--nd) 0 2.2px, transparent 2.8px), radial-gradient(circle, var(--nd) 0 2.2px, transparent 2.8px),
    radial-gradient(circle, var(--nd) 0 2.2px, transparent 2.8px), radial-gradient(circle, var(--nd) 0 2.2px, transparent 2.8px);
  background-size: 7px 7px; background-repeat: no-repeat; background-origin: border-box;
  background-position: -3.5px -3.5px, calc(100% + 3.5px) -3.5px, -3.5px calc(100% + 3.5px), calc(100% + 3.5px) calc(100% + 3.5px); }
[data-theme="gallery"] .card { padding: 20px 22px; }
[data-theme="gallery"] .card.accented, [data-theme="gallery"] .stat, [data-theme="gallery"] #view-analytics > .card, [data-theme="gallery"] #view-trades > .card { box-shadow: var(--shadow); }
[data-theme="gallery"] .card:hover, [data-theme="gallery"] .card.accented:hover, [data-theme="gallery"] .stat:hover { transform: none; --nd: #3a3a3a; border-color: rgba(0, 0, 0, .22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -22px rgba(0, 0, 0, .25); }
/* the title row of a card, closed by a circuit trace: a dot, a line that steps down, a dot */
[data-theme="gallery"] .card-row { padding-bottom: 12px; margin-bottom: 6px;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='9'%3E%3Cpath d='M4 3H170L182 8H596' fill='none' stroke='%23b8b8b8' stroke-width='1'/%3E%3Ccircle cx='3.5' cy='3' r='2.5' fill='%23999'/%3E%3Ccircle cx='596' cy='8' r='2.5' fill='%23999'/%3E%3C/svg%3E") left bottom / 100% 9px no-repeat; }
/* the headline tile: white, a big grey number */
[data-theme="gallery"] .stat.hero { background-color: rgba(255, 255, 255, .92); border-color: rgba(0, 0, 0, .16); color: var(--ink); }
[data-theme="gallery"] .stat.hero .kicker, [data-theme="gallery"] .stat.hero .muted { color: var(--muted); }
[data-theme="gallery"] .stat.hero .info { border-color: var(--axis); color: var(--ink-2); }
[data-theme="gallery"] .stat.hero .mark-glyph { color: var(--ink) !important; }
/* heading marker: a node */
[data-theme="gallery"] .card.accented > .kicker::before, [data-theme="gallery"] .card.accented > .card-row > .kicker::before, [data-theme="gallery"] .stat .kicker::before {
  width: 6px; height: 6px; border-radius: 50%; background: #8a8a8a; box-shadow: 0 0 0 3px rgba(0, 0, 0, .05); }
/* type: "Abstract / DIGITAL / T E C H N O L O G Y" */
[data-theme="gallery"] .kicker { font-size: 10px; letter-spacing: .32em; font-weight: 400; color: #6e6e6e; }
[data-theme="gallery"] .head h1 { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: .01em; text-transform: uppercase; color: #4a4a4a; line-height: 1.05;
  padding-bottom: 14px; background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='12'%3E%3Cpath d='M4 4H110L124 9H256' fill='none' stroke='%23777' stroke-width='1'/%3E%3Ccircle cx='4' cy='4' r='3' fill='%23777'/%3E%3Ccircle cx='255' cy='9' r='3' fill='%23777'/%3E%3C/svg%3E") left bottom / 260px 12px no-repeat; }
[data-theme="gallery"] .head-title > .muted, [data-theme="gallery"] .head p.muted { letter-spacing: .28em; text-transform: uppercase; font-size: 11px; }
[data-theme="gallery"] .card h2 { font-family: var(--font-display); font-weight: 700; color: #3d3d3d; letter-spacing: .01em; }
[data-theme="gallery"] .stat-value, [data-theme="gallery"] .big { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
[data-theme="gallery"] .logo span { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 15px; color: #4a4a4a; }
[data-theme="gallery"] .logo b { color: #4a4a4a; font-weight: 400; letter-spacing: .3em; }
[data-theme="gallery"] .logo-mark { filter: grayscale(1) contrast(1.05) brightness(1.1); box-shadow: none; border-radius: 50%; }
/* sidebar: frosted white over the network; the current view marked by a node on a thin line */
[data-theme="gallery"] .side { border-right: 1px solid var(--ring); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
[data-theme="gallery"] .nav button { border-radius: 999px; letter-spacing: .02em; }
[data-theme="gallery"] .nav button[aria-current="page"] { background: rgba(0, 0, 0, .045); color: #1f1f1f; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
[data-theme="gallery"] .nav button[aria-current="page"] svg { color: #1f1f1f; }
[data-theme="gallery"] .nav button:hover:not([aria-current]) { background: rgba(0, 0, 0, .035); }
[data-theme="gallery"] .status-bar, [data-theme="gallery"] .tabbar { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--ring); }
[data-theme="gallery"] .tabbar button[aria-current="page"] { color: #1f1f1f; }
@media (max-width: 860px) { [data-theme="gallery"] .app .side { background: rgba(255, 255, 255, .82); border-bottom: 1px solid var(--ring); } [data-theme="gallery"] .head h1 { font-size: 26px; } }
/* buttons: outlined pills with spaced capitals, like "I N N O V A T I O N" */
[data-theme="gallery"] .btn { border-radius: 999px; border: 1px solid rgba(0, 0, 0, .3); background: rgba(255, 255, 255, .7); box-shadow: none; color: #3a3a3a; }
[data-theme="gallery"] .btn:hover { border-color: #3a3a3a; background: #fff; }
[data-theme="gallery"] .btn.primary, [data-theme="gallery"] .banner-btn { text-transform: uppercase; letter-spacing: .24em; font-size: 11.5px; font-weight: 500; padding-left: 20px; padding-right: 20px;
  background: #fff; color: #2a2a2a; border: 1.5px solid #3a3a3a; }
[data-theme="gallery"] .btn.primary:hover { background: #3a3a3a; color: #fff; }
[data-theme="gallery"] select, [data-theme="gallery"] input, [data-theme="gallery"] textarea { border-radius: 999px; }
[data-theme="gallery"] textarea { border-radius: 6px; }
/* tables: hairlines; spaced capital headers */
[data-theme="gallery"] table.data th, [data-theme="gallery"] table.data td { border-bottom-color: var(--grid); }
[data-theme="gallery"] table.data thead th { border-bottom-color: #9a9a9a; text-transform: uppercase; letter-spacing: .18em; font-size: 10px; }
[data-theme="gallery"] .chip, [data-theme="gallery"] .seg, [data-theme="gallery"] .seg button { border-radius: 999px; }
.theme-opt[data-theme="gallery"] .theme-name { font-family: "Archivo", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #4a4a4a; }
@media print { .plexus { display: none; } }

/* ---- Void, all the way ---- */
.void-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
:root:not([data-void]) .void-fx { display: none; }
/* the orb: hairline rings, two dashed arcs turning opposite ways, a soft core */
.vf-orb { position: absolute; left: 58%; top: 46%; width: min(118vmin, 1180px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 180, 210, .07) 0 18%, transparent 46%),
    repeating-radial-gradient(circle, transparent 0 calc(12.5% - 1px), rgba(255, 255, 255, .045) calc(12.5% - 1px) 12.5%);
  -webkit-mask: radial-gradient(circle, #000 52%, transparent 71%); mask: radial-gradient(circle, #000 52%, transparent 71%); }
.vf-orb b { position: absolute; inset: 6%; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .11); animation: vfSpin 140s linear infinite; }
.vf-orb b:nth-child(2) { inset: 19%; border-style: solid; border-color: transparent; border-top-color: rgba(255, 255, 255, .22); border-left-color: rgba(255, 255, 255, .06); animation-duration: 46s; animation-direction: reverse; }
.vf-orb b:nth-child(3) { inset: 31%; border: 1px solid rgba(255, 255, 255, .05); box-shadow: 0 0 120px -10px rgba(160, 170, 210, .18), inset 0 0 80px -20px rgba(160, 170, 210, .14); animation: vfBreathe 9s ease-in-out infinite; }
@keyframes vfSpin { to { rotate: 360deg; } }
@keyframes vfBreathe { 50% { scale: 1.04; opacity: .7; } }
/* a brighter perforated field, revealed around the cursor */
.vf-dots { position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 255, 255, .5) 0 1px, transparent 1.4px) 0 0 / 22px 22px;
  -webkit-mask: radial-gradient(circle 240px at var(--mx, -999px) var(--my, -999px), rgba(0, 0, 0, .55), transparent 75%); mask: radial-gradient(circle 240px at var(--mx, -999px) var(--my, -999px), rgba(0, 0, 0, .55), transparent 75%); }
/* a scan line that sweeps down every so often */
.vf-scan { position: absolute; left: 0; right: 0; top: -20vh; height: 18vh; background: linear-gradient(180deg, transparent, rgba(200, 210, 235, .035) 70%, rgba(230, 235, 250, .09) 99%, transparent);
  animation: vfScan 14s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes vfScan { 0%, 62% { translate: 0 0; opacity: 0; } 64% { opacity: 1; } 100% { translate: 0 125vh; opacity: 1; } }

/* cards: the silver edge catches the light where the cursor is; the brackets reach out on hover */
[data-void] .card, [data-void] .stat {
  --bl: 9px;
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(340px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .065), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 38%), linear-gradient(var(--fill), var(--fill)),
    radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .85), transparent 70%), var(--silver);
  background-clip: border-box, border-box, border-box, border-box, border-box, border-box, border-box, border-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-size: var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, border-color .3s; }
[data-void] .card:hover, [data-void] .stat:hover { --bl: 18px; }
[data-void] .stat.hero {
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(300px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .09), transparent 65%),
    radial-gradient(ellipse 90% 70% at 85% 0%, rgba(255, 255, 255, .10), transparent 60%), radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .7) 0 1.05px, rgba(255, 255, 255, .06) 1.35px, transparent 1.7px),
    var(--brushed), radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .9), transparent 70%), var(--silver);
  background-size: var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), 100% 100%, 100% 100%, 6px 6px, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, no-repeat, no-repeat, no-repeat;
  background-clip: border-box, border-box, border-box, border-box, border-box, border-box, border-box, border-box, padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }

/* numbers in mono, like instrument readouts */
[data-void] .stat-value, [data-void] .big, [data-void] .sb-4h b, [data-void] .pos-total b, [data-void] .bat-r { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; }
/* the title: bigger, wide-tracked, a halo; it decodes in on every view change (app.js) */
[data-void] .head h1 { font-size: 30px; letter-spacing: .1em; filter: drop-shadow(0 0 22px rgba(220, 228, 255, .14)); }
/* the logo square glows from beneath, like a lit key */
[data-void] .logo-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 8px 18px -6px rgba(190, 200, 255, .55); }
/* the current nav item wears the same corner brackets as the cards */
[data-void] .nav button[aria-current="page"] {
  background: linear-gradient(#e9ebef, #e9ebef) left top / 6px 1px, linear-gradient(#e9ebef, #e9ebef) left top / 1px 6px,
    linear-gradient(#e9ebef, #e9ebef) right top / 6px 1px, linear-gradient(#e9ebef, #e9ebef) right top / 1px 6px,
    linear-gradient(#e9ebef, #e9ebef) left bottom / 6px 1px, linear-gradient(#e9ebef, #e9ebef) left bottom / 1px 6px,
    linear-gradient(#e9ebef, #e9ebef) right bottom / 6px 1px, linear-gradient(#e9ebef, #e9ebef) right bottom / 1px 6px,
    linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02));
  background-repeat: no-repeat; box-shadow: none; }
/* primary buttons: a band of light sweeps across on hover */
[data-void] .btn.primary { background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat,
  linear-gradient(180deg, #fbfbfc 0%, #d9dce2 45%, #b4b8c1 55%, #e6e8ec 100%); transition: background-position .7s cubic-bezier(.22, 1, .36, 1); }
[data-void] .btn.primary:hover { background-position: 250% 0, 0 0; }
/* finishing: silver selection, thin scrollbars, glassy tooltips, a silver focus ring */
[data-void] ::selection { background: rgba(235, 238, 245, .9); color: #0a0b0e; }
:root[data-void] { scrollbar-color: #3a3d45 transparent; scrollbar-width: thin; }
:root[data-void] .tip.tip-text[popover] { background: rgba(16, 17, 21, .92); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -20px #000, inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-void] :focus-visible { outline: 1px solid #e9ebef; outline-offset: 2px; }
@media (max-width: 860px) { .vf-orb { left: 50%; top: 38%; width: 150vmin; } [data-void] .head h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .vf-orb b, .vf-scan { animation: none; } .vf-scan { display: none; } [data-void] .card, [data-void] .stat, [data-void] .btn.primary { transition: none; } }
@media print { .void-fx { display: none; } }
[data-void] .btn.primary:hover { background-image: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%), linear-gradient(180deg, #ffffff 0%, #e4e7ec 45%, #c2c6ce 55%, #f0f1f4 100%);
  background-size: 250% 100%, 100% 100%; background-repeat: no-repeat; background-position: 250% 0, 0 0; }

/* ================= Void Light: the same machine, in chrome ================= */
:root[data-theme="lumen"] {
  --silver: linear-gradient(135deg, rgba(10, 12, 16, .42) 0%, rgba(10, 12, 16, .09) 28%, rgba(10, 12, 16, .04) 55%, rgba(10, 12, 16, .3) 100%);
  --perf: radial-gradient(circle at 50% 50%, rgba(10, 12, 16, .17) 0 1.05px, rgba(255, 255, 255, .95) 1.35px, transparent 1.7px) 0 0 / 6px 6px;
  --brushed: linear-gradient(180deg, #f9fafb 0%, #eef0f3 55%, #e7e9ed 100%);
  --accent: #16181d;
  scrollbar-color: #c4c8cf transparent;
}
/* the page: a bright wash from the top, a graphite dot grid, edges a touch darker */
[data-theme="lumen"] body::before { background: radial-gradient(ellipse 70% 55% at 50% -8%, #ffffff, transparent 70%),
  radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(110, 118, 135, .16) 100%),
  radial-gradient(circle, rgba(10, 12, 16, .075) 1px, transparent 1.3px) 0 0 / 22px 22px; }
/* orb, flashlight and scan, in graphite */
[data-theme="lumen"] .vf-orb { background: radial-gradient(circle, rgba(120, 130, 165, .09) 0 18%, transparent 46%),
  repeating-radial-gradient(circle, transparent 0 calc(12.5% - 1px), rgba(10, 12, 16, .055) calc(12.5% - 1px) 12.5%); }
[data-theme="lumen"] .vf-orb b { border-color: rgba(10, 12, 16, .13); }
[data-theme="lumen"] .vf-orb b:nth-child(2) { border-color: transparent; border-top-color: rgba(10, 12, 16, .3); border-left-color: rgba(10, 12, 16, .08); }
[data-theme="lumen"] .vf-orb b:nth-child(3) { border-color: rgba(10, 12, 16, .07); box-shadow: 0 0 120px -10px rgba(110, 125, 175, .22), inset 0 0 80px -20px rgba(255, 255, 255, .9); }
[data-theme="lumen"] .vf-dots { background-image: radial-gradient(circle, rgba(10, 12, 16, .6) 0 1px, transparent 1.4px); }
[data-theme="lumen"] .vf-scan { background: linear-gradient(180deg, transparent, rgba(40, 48, 70, .03) 70%, rgba(20, 24, 36, .08) 99%, transparent); }
/* cards: white, chrome-graphite edges that darken where the cursor is, brackets in ink */
[data-theme="lumen"] .card, [data-theme="lumen"] .stat {
  --br: rgba(10, 12, 16, .6); --fill: #fbfbfc;
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(340px circle at var(--x, -999px) var(--y, -999px), rgba(120, 135, 175, .08), transparent 65%),
    linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0) 40%), linear-gradient(var(--fill), var(--fill)),
    radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(10, 12, 16, .85), transparent 70%), var(--silver);
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(20, 25, 40, .05), 0 22px 44px -30px rgba(20, 25, 40, .45); }
[data-theme="lumen"] .card:hover, [data-theme="lumen"] .stat:hover { --br: rgba(10, 12, 16, .9); box-shadow: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(10, 12, 16, .05), 0 26px 50px -28px rgba(20, 25, 40, .5); }
/* the headline tile: perforated brushed aluminium */
[data-theme="lumen"] .stat.hero { color: var(--ink);
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(300px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .7), transparent 65%),
    radial-gradient(ellipse 90% 70% at 85% 0%, rgba(255, 255, 255, .95), transparent 60%), radial-gradient(circle at 50% 50%, rgba(10, 12, 16, .2) 0 1.05px, rgba(255, 255, 255, .9) 1.35px, transparent 1.7px),
    var(--brushed), radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(10, 12, 16, .9), transparent 70%), var(--silver); }
[data-theme="lumen"] .stat.hero .kicker, [data-theme="lumen"] .stat.hero .muted { color: var(--muted); }
[data-theme="lumen"] .stat.hero .info { border-color: var(--axis); color: var(--ink-2); }
[data-theme="lumen"] .stat.hero .mark-glyph { color: var(--ink) !important; }
[data-theme="lumen"] .stat.hero .kicker::before { border-color: var(--pos); }
/* chrome text: graphite with a moving glint */
[data-theme="lumen"] .head h1 { background: linear-gradient(100deg, #1a1c20 0%, #6f747e 22%, #0b0c0f 40%, #9196a0 52%, #16181c 70%, #474b53 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 #ffffff); }
[data-theme="lumen"] .card h2 { background: linear-gradient(180deg, #0c0d10, #6b707a); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="lumen"] .card.accented > .kicker::before, [data-theme="lumen"] .card.accented > .card-row > .kicker::before, [data-theme="lumen"] .stat .kicker::before { background: linear-gradient(135deg, #0c0d10, #8d929c); }
[data-theme="lumen"] .logo b { color: var(--ink); }
[data-theme="lumen"] .logo-mark { box-shadow: 0 0 0 1px rgba(10, 12, 16, .14), 0 8px 18px -6px rgba(70, 85, 140, .4); }
/* chrome bars: brushed aluminium, perforated */
[data-theme="lumen"] .side { box-shadow: inset -1px 0 0 rgba(10, 12, 16, .09); }
[data-theme="lumen"] .status-bar, [data-theme="lumen"] .tabbar { border-top-color: rgba(10, 12, 16, .1); box-shadow: inset 0 1px 0 #ffffff; }
@media (max-width: 860px) { [data-theme="lumen"] .app .side { border-bottom-color: rgba(10, 12, 16, .1); } }
/* buttons: polished aluminium; the primary one obsidian glass with a white sweep */
[data-theme="lumen"] .btn { color: var(--ink); background: linear-gradient(180deg, #ffffff, #eceef1) padding-box, var(--silver) border-box; box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(20, 25, 40, .06); }
[data-theme="lumen"] .btn:hover { background: linear-gradient(180deg, #ffffff, #f3f4f6) padding-box, linear-gradient(135deg, rgba(10, 12, 16, .6), rgba(10, 12, 16, .15) 40%, rgba(10, 12, 16, .4)) border-box; }
[data-theme="lumen"] .btn.primary, [data-theme="lumen"] .btn.primary:hover { color: #ffffff; border: 1px solid #000000;
  background-image: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%), linear-gradient(180deg, #3a3d44 0%, #15161a 48%, #000000 52%, #1f2126 100%);
  background-size: 250% 100%, 100% 100%; background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 22px -10px rgba(0, 0, 0, .55); }
[data-theme="lumen"] .btn.primary { background-position: -150% 0, 0 0; }
[data-theme="lumen"] .btn.primary:hover { background-position: 250% 0, 0 0; }
/* nav: ink brackets around the current view */
[data-theme="lumen"] .nav button[aria-current="page"] { color: #0c0d10;
  background: linear-gradient(#16181d, #16181d) left top / 6px 1px, linear-gradient(#16181d, #16181d) left top / 1px 6px,
    linear-gradient(#16181d, #16181d) right top / 6px 1px, linear-gradient(#16181d, #16181d) right top / 1px 6px,
    linear-gradient(#16181d, #16181d) left bottom / 6px 1px, linear-gradient(#16181d, #16181d) left bottom / 1px 6px,
    linear-gradient(#16181d, #16181d) right bottom / 6px 1px, linear-gradient(#16181d, #16181d) right bottom / 1px 6px,
    linear-gradient(90deg, rgba(10, 12, 16, .08), rgba(10, 12, 16, .01));
  background-repeat: no-repeat; }
[data-theme="lumen"] .tabbar button[aria-current="page"] { color: #0c0d10; text-shadow: none; }
/* finishing */
[data-theme="lumen"] ::selection { background: rgba(12, 13, 16, .9); color: #ffffff; }
:root[data-theme="lumen"] .tip.tip-text[popover] { background: rgba(255, 255, 255, .94); color: #3a3d44; border: 1px solid rgba(10, 12, 16, .14); box-shadow: 0 20px 50px -22px rgba(20, 25, 40, .45), inset 0 1px 0 #ffffff; }
[data-theme="lumen"] :focus-visible { outline-color: #16181d; }
.theme-opt[data-theme="lumen"] .theme-name { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 12.5px; }

/* ---- Void Light, v2: chrome instead of perforation, silver cards, black glass, grayscale chrome ---- */
:root[data-theme="lumen"] {
  --page: #e7e9ed;
  --a1: #16181d; --a2: #5c616b; --a3: #8f949e; --a4: #2e3138; --a5: #b5b9c1;   /* decoration in greys; gains, losses, grades and warnings keep their colour */
  --chrome-h: linear-gradient(180deg, #ffffff 0%, #f1f2f5 38%, #d9dce2 50%, #e9ebef 62%, #fbfbfc 100%);
  --chrome-v: linear-gradient(90deg, #f6f7f9 0%, #ffffff 30%, #e4e6ea 62%, #eef0f3 86%, #dcdfe4 100%);
  --brush: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 1px, rgba(120, 128, 145, .035) 1px 2px, transparent 2px 4px);
  --silver-fill: linear-gradient(162deg, #ffffff 0%, #f6f7f9 38%, #eceef2 72%, #f4f5f7 100%);
}
[data-theme="lumen"] body::before { background: radial-gradient(ellipse 70% 55% at 50% -8%, #ffffff, transparent 70%),
  radial-gradient(ellipse 120% 90% at 50% 50%, transparent 50%, rgba(95, 105, 125, .2) 100%),
  radial-gradient(circle, rgba(10, 12, 16, .07) 1px, transparent 1.3px) 0 0 / 22px 22px; }
/* the bars: polished chrome, a hairline of light along the edge, fine brushing */
[data-theme="lumen"] .status-bar, [data-theme="lumen"] .tabbar { background: var(--brush), var(--chrome-h);
  border-top: 1px solid rgba(10, 12, 16, .16); box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 rgba(10, 12, 16, .06), 0 -10px 30px -18px rgba(20, 25, 40, .35); }
[data-theme="lumen"] .side { background: var(--brush), var(--chrome-v); box-shadow: inset -1px 0 0 rgba(10, 12, 16, .14), inset -2px 0 0 #ffffff; }
@media (max-width: 860px) { [data-theme="lumen"] .app .side { background: var(--brush), var(--chrome-h); border-bottom: 1px solid rgba(10, 12, 16, .16); box-shadow: inset 0 -1px 0 #ffffff, 0 10px 30px -20px rgba(20, 25, 40, .35); } }
/* cards: silver, not flat white, with a specular streak and a cursor-lit edge */
[data-theme="lumen"] .card, [data-theme="lumen"] .stat {
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(340px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .95), transparent 65%),
    linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, .85) 38%, transparent 52%), var(--silver-fill),
    radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(10, 12, 16, .9), transparent 70%), var(--silver);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 rgba(10, 12, 16, .04), 0 1px 2px rgba(20, 25, 40, .06), 0 24px 46px -30px rgba(20, 25, 40, .5); }
/* black glass: the headline tile */
[data-theme="lumen"] .stat.hero { color: #ffffff; --br: rgba(255, 255, 255, .7);
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(300px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .12), transparent 65%),
    radial-gradient(ellipse 90% 70% at 85% 0%, rgba(255, 255, 255, .16), transparent 60%), linear-gradient(112deg, transparent 25%, rgba(255, 255, 255, .07) 40%, transparent 55%),
    linear-gradient(180deg, #2a2d33 0%, #111216 46%, #050506 54%, #18191d 100%),
    radial-gradient(240px circle at var(--x, -999px) var(--y, -999px), rgba(255, 255, 255, .9), transparent 70%), linear-gradient(135deg, #5a5e66, #0a0b0d 40%, #0a0b0d 60%, #4a4e56);
  background-size: var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 26px 50px -26px rgba(0, 0, 0, .65); }
[data-theme="lumen"] .stat.hero .kicker, [data-theme="lumen"] .stat.hero .muted { color: rgba(255, 255, 255, .6); }
[data-theme="lumen"] .stat.hero .info { border-color: rgba(255, 255, 255, .4); color: #fff; }
[data-theme="lumen"] .stat.hero .mark-glyph { color: #ffffff !important; }
[data-theme="lumen"] .stat.hero .kicker::before { background: linear-gradient(135deg, #ffffff, #8d929c); }
[data-theme="lumen"] .stat.hero .line.hero { stroke: #ffffff; } [data-theme="lumen"] .stat.hero .area.hero { fill: #ffffff; opacity: .14; }
/* black glass: the current view, in the sidebar and the tab bar */
[data-theme="lumen"] .nav button[aria-current="page"] { color: #ffffff;
  background: linear-gradient(180deg, #2c2f35 0%, #121317 48%, #050506 52%, #1b1d21 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 14px -8px rgba(0, 0, 0, .6); }
[data-theme="lumen"] .nav button[aria-current="page"] svg { color: #ffffff; }
[data-theme="lumen"] .nav button:not([aria-current]) { color: #3a3d44; }
[data-theme="lumen"] .nav button:hover:not([aria-current]) { background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(10, 12, 16, .08); }
[data-theme="lumen"] .tabbar button { color: #6b707a; }
[data-theme="lumen"] .tabbar button[aria-current="page"] { color: #0c0d10; }
[data-theme="lumen"] .tabbar button[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: #0c0d10; }
/* the status bar's text in ink, the live dot keeps its colour */
[data-theme="lumen"] .status-bar { color: #3a3d44; }
/* chrome type: solid ink titles; headings black */
[data-theme="lumen"] .card h2 { background: linear-gradient(180deg, #000000, #3a3d44); -webkit-background-clip: text; background-clip: text; }
[data-theme="lumen"] .kicker { color: #4a4e57; }
[data-theme="lumen"] .card.accented > .kicker::before, [data-theme="lumen"] .card.accented > .card-row > .kicker::before, [data-theme="lumen"] .stat .kicker::before { background: #0c0d10; -webkit-mask: none; mask: none; padding: 0; border-radius: 1px; }
/* tables: a black rule under the headers, hairlines between rows */
[data-theme="lumen"] table.data thead th { color: #0c0d10; border-bottom-color: #0c0d10; text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; font-family: var(--font-display); }
[data-theme="lumen"] table.data td { border-bottom-color: rgba(10, 12, 16, .07); }
/* controls in black and white */
[data-theme="lumen"] .seg button[aria-pressed="true"] { background: #0c0d10; color: #ffffff; box-shadow: none; }
[data-theme="lumen"] select, [data-theme="lumen"] input:not([type="checkbox"]):not([type="radio"]), [data-theme="lumen"] textarea { background: linear-gradient(180deg, #ffffff, #f4f5f7); border-color: rgba(10, 12, 16, .16); }
[data-theme="lumen"] input[type="checkbox"], [data-theme="lumen"] input[type="radio"] { accent-color: #0c0d10; }
[data-theme="lumen"] .pv-arrow { background: linear-gradient(180deg, #ffffff, #e9ebef); border-color: rgba(10, 12, 16, .2); color: #0c0d10; }

/* ---- Void Light, v3: more black and white; a shine you can see ---- */
:root[data-theme="lumen"] {
  /* a deeper silver, so white light shows on it */
  --silver-fill: linear-gradient(162deg, #f8f9fa 0%, #eceef2 38%, #e1e4e9 74%, #eef0f3 100%);
  --page: #e2e5ea;
}
/* cards: a bright spot under the cursor, a streak of light that sweeps across on hover, an ink edge where the cursor is */
[data-theme="lumen"] .card, [data-theme="lumen"] .stat:not(.hero) {
  background-image: linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)), linear-gradient(var(--br), var(--br)),
    radial-gradient(260px circle at var(--x, -999px) var(--y, -999px), #ffffff, rgba(255, 255, 255, .55) 30%, transparent 70%),
    linear-gradient(112deg, transparent 42%, rgba(255, 255, 255, .25) 46%, #ffffff 50%, rgba(255, 255, 255, .25) 54%, transparent 58%),
    linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, .7) 38%, transparent 52%), var(--silver-fill),
    radial-gradient(200px circle at var(--x, -999px) var(--y, -999px), #000000, rgba(10, 12, 16, .5) 40%, transparent 72%), var(--silver);
  background-clip: border-box, border-box, border-box, border-box, border-box, border-box, border-box, border-box, padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-size: var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), var(--bl) 1px, 1px var(--bl), 100% 100%, 260% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom, 0 0, 100% 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1), background-position .9s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
[data-theme="lumen"] .card:hover, [data-theme="lumen"] .stat:not(.hero):hover {
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom, 0 0, 0% 0, 0 0, 0 0, 0 0, 0 0;
  box-shadow: inset 0 1px 0 #ffffff, 0 0 0 1px rgba(10, 12, 16, .08), 0 2px 4px rgba(20, 25, 40, .06), 0 30px 54px -28px rgba(20, 25, 40, .6); }
/* the black tile: a light sweep too */
[data-theme="lumen"] .stat.hero { transition: background-size .35s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
[data-theme="lumen"] .stat.hero:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(0, 0, 0, .3), 0 30px 56px -24px rgba(0, 0, 0, .75); }
/* black and white: long/short pills, counts, links, the progress line, info dots, toggles */
[data-theme="lumen"] .pos-side.long { background: #0c0d10; color: #ffffff; }
[data-theme="lumen"] .pos-side.short { background: transparent; color: #0c0d10; box-shadow: inset 0 0 0 1px #0c0d10; }
[data-theme="lumen"] .nav-count, [data-theme="lumen"] .tab-count { background: #0c0d10; color: #ffffff; }
[data-theme="lumen"] .nav button[aria-current="page"] .nav-count { background: #ffffff; color: #0c0d10; }
[data-theme="lumen"] .more-link { color: #0c0d10; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(10, 12, 16, .3); text-underline-offset: 3px; }
[data-theme="lumen"] .progress > div { background: #0c0d10; box-shadow: none; }
[data-theme="lumen"] .info { border-color: rgba(10, 12, 16, .35); color: #0c0d10; background: transparent; }
[data-theme="lumen"] .chip:not(.pos):not(.neg) { background: rgba(10, 12, 16, .07); color: #0c0d10; }
[data-theme="lumen"] .icon-btn { color: #0c0d10; }
[data-theme="lumen"] .today-card.done .today-status { background: #0c0d10; color: #ffffff; box-shadow: none; }
[data-theme="lumen"] .today-card.done { border-color: transparent; }
[data-theme="lumen"] .sb-4h b, [data-theme="lumen"] .sb-stats b { color: #0c0d10; }
[data-theme="lumen"] .logo-mark { filter: grayscale(1) contrast(1.2); }
@media (prefers-reduced-motion: reduce) { [data-theme="lumen"] .card, [data-theme="lumen"] .stat { transition: none; } }

/* ---- Void's HUD: more thin rings and quiet machinery behind the page (dark Void only) ---- */
.vf-hud { position: absolute; inset: 0; }
[data-theme="lumen"] .vf-hud { display: none; }
.vf-ring { position: absolute; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .055); }
.vf-ring > i { position: absolute; inset: 0; border-radius: 50%; }
.vf-ring.g1 { left: 9%; top: 16%; width: 260px; }
.vf-ring.g2 { left: 14%; top: 82%; width: 190px; }
.vf-ring.g3 { left: 90%; top: 14%; width: 150px; }
.vf-ring.g4 { left: 86%; top: 80%; width: 360px; }
.vf-ring.g5 { left: 40%; top: 6%; width: 90px; }
/* gauge ticks: a fine ring of marks, every tenth a little longer */
.vf-ticks { background: repeating-conic-gradient(rgba(255, 255, 255, .2) 0 .35deg, transparent .35deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 7px), #000 calc(50% - 6px) calc(50% - 1px), transparent 50%); mask: radial-gradient(circle, transparent calc(50% - 7px), #000 calc(50% - 6px) calc(50% - 1px), transparent 50%);
  animation: vfSpin 90s linear infinite; }
.vf-ticks::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 255, 255, .35) 0 .5deg, transparent .5deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 13px), #000 calc(50% - 12px) calc(50% - 1px), transparent 50%); mask: radial-gradient(circle, transparent calc(50% - 13px), #000 calc(50% - 12px) calc(50% - 1px), transparent 50%); }
/* a dashed inner ring turning the other way */
.vf-dash { inset: 16% !important; border: 1px dashed rgba(255, 255, 255, .1); animation: vfSpin 60s linear infinite reverse; }
/* a dot travelling the ring, with a short fading trail */
.vf-orbit { animation: vfSpin 24s linear infinite; }
.vf-orbit::before { content: ''; position: absolute; left: 50%; top: -2.5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #e9ebef; box-shadow: 0 0 10px 2px rgba(220, 228, 255, .5); }
.vf-orbit::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid transparent; border-top-color: rgba(233, 235, 239, .35); rotate: -28deg;
  -webkit-mask: conic-gradient(from -40deg, transparent, #000 40deg, transparent 41deg); mask: conic-gradient(from -40deg, transparent, #000 40deg, transparent 41deg); }
.vf-orbit.rev { animation-direction: reverse; animation-duration: 16s; }
.vf-orbit.slow { animation-duration: 48s; }
/* a radar sweep */
.vf-radar { background: conic-gradient(from 0deg, rgba(220, 228, 255, .14), transparent 70deg, transparent); animation: vfSpin 7s linear infinite; }
.vf-radar::after { content: ''; position: absolute; left: 50%; top: 0; width: 1px; height: 50%; background: linear-gradient(rgba(233, 235, 239, .5), transparent); }
/* a broken arc in the big ring */
.vf-arc { inset: 7% !important; border: 1.5px solid transparent; border-right-color: rgba(255, 255, 255, .16); border-bottom-color: rgba(255, 255, 255, .05); animation: vfSpin 34s cubic-bezier(.6, 0, .4, 1) infinite; }
/* guide lines with packets of light running along them */
.vf-line { position: absolute; overflow: hidden; }
.vf-line.h { left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05) 15%, rgba(255, 255, 255, .05) 85%, transparent); }
.vf-line.v { top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .045) 15%, rgba(255, 255, 255, .045) 85%, transparent); }
.vf-line.l1 { top: 24%; } .vf-line.l2 { top: 61%; } .vf-line.l3 { top: 92%; } .vf-line.l4 { left: 27%; } .vf-line.l5 { left: 73%; }
.vf-line::after { content: ''; position: absolute; background: linear-gradient(90deg, transparent, rgba(233, 238, 255, .75), transparent); }
.vf-line.h::after { top: 0; left: 0; width: 140px; height: 1px; animation: vfRunX var(--d, 11s) linear var(--w, 0s) infinite; }
.vf-line.v::after { left: 0; top: 0; width: 1px; height: 120px; background: linear-gradient(180deg, transparent, rgba(233, 238, 255, .7), transparent); animation: vfRunY var(--d, 13s) linear var(--w, 0s) infinite; }
.vf-line.l1 { --d: 12s; --w: -3s; } .vf-line.l2 { --d: 17s; --w: -9s; } .vf-line.l3 { --d: 9s; --w: -5s; } .vf-line.l4 { --d: 15s; --w: -2s; } .vf-line.l5 { --d: 11s; --w: -7s; }
@keyframes vfRunX { 0% { translate: -160px 0; } 55%, 100% { translate: 100vw 0; } }
@keyframes vfRunY { 0% { translate: 0 -140px; } 55%, 100% { translate: 0 100vh; } }
/* crosshairs with tiny readouts */
.vf-cross { position: absolute; width: 15px; height: 15px; translate: -50% -50%;
  background: linear-gradient(rgba(255, 255, 255, .32), rgba(255, 255, 255, .32)) center / 1px 100% no-repeat, linear-gradient(rgba(255, 255, 255, .32), rgba(255, 255, 255, .32)) center / 100% 1px no-repeat; }
.vf-cross u { position: absolute; left: 14px; top: 10px; text-decoration: none; white-space: nowrap; font: 500 9px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; color: rgba(255, 255, 255, .22); }
.vf-cross.c1 { left: 27%; top: 24%; } .vf-cross.c2 { left: 73%; top: 61%; } .vf-cross.c3 { left: 27%; top: 92%; } .vf-cross.c4 { left: 73%; top: 24%; }
.vf-cross.c2 u, .vf-cross.c4 u { animation: vfBlink 3.2s steps(1) infinite; }
.vf-cross.c4 u { animation-delay: -1.4s; }
@keyframes vfBlink { 0%, 70% { opacity: 1; } 71%, 78% { opacity: .2; } 79%, 100% { opacity: 1; } }
@media (max-width: 860px) { .vf-ring.g1 { width: 170px; left: 4%; top: 12%; } .vf-ring.g4 { width: 240px; left: 96%; top: 84%; } .vf-ring.g2, .vf-ring.g5, .vf-line.l4, .vf-line.l5, .vf-cross.c3, .vf-cross.c4 { display: none; } }
@media (prefers-reduced-motion: reduce) { .vf-hud *, .vf-hud *::before, .vf-hud *::after { animation: none !important; } .vf-line::after { display: none; } }
