/* QuarterEdge theme tokens. Default is Easy on the Eyes (calm); all themes stay selectable. */
:root {
  --space: 8px; --space-2: 16px; --space-3: 24px;
  --radius: 12px; --sidebar: 220px; --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: Syne, "DM Sans", sans-serif;
  --text-xs: 11px; --text-sm: 12px; --text-md: 13px; --text-lg: 15px;
  --text-xl: 18px; --text-num: 28px; --text-status: 24px;
}
[data-theme="best"] {
  --space: 8px; --space-2: 16px; --space-3: 24px;
  --radius: 10px; --sidebar: 220px; --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: Syne, "DM Sans", sans-serif;
  --text-xs: 11px; --text-sm: 12px; --text-md: 13px; --text-lg: 15px;
  --text-xl: 18px; --text-num: 28px; --text-status: 24px;
  --bg: #0A0C10; --bg-2: #12151C; --navy: #161A22;
  --glass: rgba(18, 21, 28, 0.88);
  --glass-top: rgba(22, 26, 34, 0.94);
  --glass-bot: rgba(12, 14, 18, 0.96);
  --glass-2: rgba(22, 26, 34, 0.7);
  --ink: #0B0E12; --text: #E8EDF4; --muted: #8B93A1; --dim: #6A7280;
  --label: #9AA4B2; --hi: #F4F7FB; --hub: #0B0E12;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(92, 225, 255, 0.35);
  --grid-line: rgba(255, 255, 255, 0.05);
  --inset: rgba(255, 255, 255, 0.08);
  --accent: #5CE1FF; --accent-2: #9AEDFF; --accent-hot: #7AF0FF;
  --accent-rgb: 92, 225, 255;
  --mint: #3DDC9A; --mint-rgb: 61, 220, 154;
  --cyan: #5CE1FF; --cyan-2: #9AEDFF; --blue: #5B8CFF;
  --purple: #8B7CFF; --purple-2: #A99BFF; --purple-rgb: 139, 124, 255;
  --up: #3DDC9A; --green: #3DDC9A; --green-rgb: 61, 220, 154;
  --down: #F0717A; --red: #F0717A; --red-rgb: 240, 113, 122; --down-2: #FF8A92;
  --gold: #E6C36A; --wait: #E6C36A; --wait-rgb: 230, 195, 106;
  --gauge-a: #7A74FF; --gauge-b: #5CE1FF; --gauge-c: #3DDC9A;
  --dot: rgba(92, 225, 255, 0.55);
  --twinkle-1: rgba(92, 225, 255, 0.7);
  --twinkle-2: rgba(91, 140, 255, 0.55);
  --twinkle-3: rgba(61, 220, 154, 0.4);
  --glow-1: rgba(92, 225, 255, 0.16);
  --glow-2: rgba(61, 220, 154, 0.08);
  --glow-3: rgba(91, 140, 255, 0.10);
  --glow-4: transparent; --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(92, 225, 255, 0.35), rgba(139, 124, 255, 0.18));
  --card-shadow: 0 1px 0 var(--inset) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
  --fx-filter: none; --nav-on-fg: #0B0E12;
}
[data-theme="teal"] {
  --bg: #03110f; --bg-2: #061c1a; --navy: #0a2220;
  --glass: rgba(8, 28, 26, 0.88);
  --glass-top: rgba(8, 28, 26, 0.92);
  --glass-bot: rgba(4, 16, 16, 0.96);
  --glass-2: rgba(10, 36, 32, 0.7);
  --ink: #042018; --text: #e8fff8; --muted: #8ab0b4; --dim: #5d7a7c;
  --label: #8adfff; --hi: #f2fff9; --hub: #062018;
  --line: rgba(80, 255, 210, 0.26); --line-strong: rgba(95, 255, 210, 0.5);
  --grid-line: rgba(93, 255, 192, 0.06); --inset: rgba(210, 255, 240, 0.16);
  --accent: #3ee0ff; --accent-2: #7af0ff; --accent-hot: #7affd2; --accent-rgb: 62, 224, 255;
  --mint: #5dffc0; --mint-rgb: 93, 255, 192;
  --cyan: #3ee0ff; --cyan-2: #7af0ff;
  --purple: #b066ff; --purple-2: #c084fc; --purple-rgb: 176, 102, 255;
  --up: #5dffc0; --green: #5dffc0; --green-rgb: 93, 255, 192;
  --down: #ff4d6a; --red: #ff4d6a; --red-rgb: 255, 77, 106; --down-2: #ff6b82;
  --gold: #ffd56a; --wait: #ffd56a;
  --gauge-a: #b066ff; --gauge-b: #3ee0ff; --gauge-c: #5dffc0;
  --dot: rgba(93, 255, 192, 0.7);
  --twinkle-1: rgba(62, 224, 255, 0.75);
  --twinkle-2: rgba(77, 141, 255, 0.5);
  --twinkle-3: rgba(93, 255, 192, 0.45);
  --glow-1: rgba(0, 255, 170, 0.32); --glow-2: rgba(62, 224, 255, 0.24);
  --glow-3: rgba(80, 255, 210, 0.22); --glow-4: rgba(0, 220, 160, 0.18);
  --glow-5: rgba(160, 110, 255, 0.16);
  --border-grad: linear-gradient(135deg, rgba(125, 255, 220, 0.9) 0%, rgba(62, 224, 255, 0.7) 52%, rgba(176, 102, 255, 0.45) 100%);
  --card-shadow: 0 0 0 1px rgba(93, 255, 192, 0.14), 0 0 16px rgba(93, 255, 192, 0.16), 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(210, 255, 240, 0.14);
  --fx-filter: none; --nav-on-fg: #042018;
}
/* Neon Purple tokens are defined with the active themes below (after Easy on the Eyes). */
[data-theme="blue"] {
  --bg: #050814; --bg-2: #0a1020; --navy: #10182c;
  --glass: rgba(12, 18, 36, 0.9);
  --glass-top: rgba(16, 24, 48, 0.94);
  --glass-bot: rgba(8, 12, 24, 0.96);
  --glass-2: rgba(16, 24, 48, 0.7);
  --ink: #061018; --text: #e8f4ff; --muted: #8aa0b8; --dim: #5d738c;
  --label: #8adfff; --hi: #e8f4ff; --hub: #061018;
  --line: rgba(80, 180, 255, 0.28); --line-strong: rgba(90, 200, 255, 0.5);
  --grid-line: rgba(80, 180, 255, 0.08); --inset: rgba(180, 220, 255, 0.12);
  --accent: #4da3ff; --accent-2: #7ad0ff; --accent-hot: #3ee0ff; --accent-rgb: 77, 163, 255;
  --mint: #3DDC9A; --mint-rgb: 61, 220, 154;
  --cyan: #3ee0ff; --cyan-2: #7af0ff; --blue: #4d8dff;
  --purple: #6a8cff; --purple-2: #8ab0ff; --purple-rgb: 106, 140, 255;
  --up: #3DDC9A; --green: #3DDC9A; --green-rgb: 61, 220, 154;
  --down: #ff4d6a; --red: #ff4d6a; --red-rgb: 255, 77, 106; --down-2: #ff6b82;
  --gold: #ffd56a; --wait: #ffd56a;
  --gauge-a: #4d8dff; --gauge-b: #3ee0ff; --gauge-c: #3DDC9A;
  --dot: rgba(77, 163, 255, 0.75);
  --twinkle-1: rgba(62, 224, 255, 0.8);
  --twinkle-2: rgba(77, 141, 255, 0.7);
  --twinkle-3: rgba(160, 200, 255, 0.45);
  --glow-1: rgba(62, 224, 255, 0.28); --glow-2: rgba(77, 141, 255, 0.26);
  --glow-3: rgba(80, 180, 255, 0.18); --glow-4: rgba(40, 100, 255, 0.14);
  --glow-5: rgba(61, 220, 154, 0.08);
  --border-grad: linear-gradient(135deg, rgba(62, 224, 255, 0.85), rgba(77, 141, 255, 0.6) 60%, rgba(106, 140, 255, 0.35) 100%);
  --card-shadow: 0 0 0 1px rgba(77, 163, 255, 0.16), 0 0 18px rgba(62, 224, 255, 0.16), 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(180, 220, 255, 0.12);
  --fx-filter: hue-rotate(-10deg) saturate(1.15); --nav-on-fg: #061018;
}
[data-theme="gold"] {
  --bg: #080805; --bg-2: #10100c; --navy: #18160f;
  --glass: rgba(22, 20, 14, 0.92);
  --glass-top: rgba(28, 24, 16, 0.94);
  --glass-bot: rgba(12, 10, 8, 0.96);
  --glass-2: rgba(28, 24, 16, 0.7);
  --ink: #16130a; --text: #f4efe4; --muted: #a89a7c; --dim: #7a705c;
  --label: #e4c56a; --hi: #f5e6c4; --hub: #16130a;
  --line: rgba(228, 197, 106, 0.28); --line-strong: rgba(240, 215, 140, 0.5);
  --grid-line: rgba(228, 197, 106, 0.08); --inset: rgba(245, 230, 196, 0.12);
  --accent: #e4c56a; --accent-2: #f0d78c; --accent-hot: #f5e6c4; --accent-rgb: 228, 197, 106;
  --mint: #3DDC9A; --mint-rgb: 61, 220, 154;
  --cyan: #e4c56a; --cyan-2: #f0d78c;
  --purple: #c4a46a; --purple-2: #e4c56a; --purple-rgb: 228, 197, 106;
  --up: #3DDC9A; --green: #3DDC9A; --green-rgb: 61, 220, 154;
  --down: #F0717A; --red: #F0717A; --red-rgb: 240, 113, 122; --down-2: #FF8A92;
  --gold: #e4c56a; --wait: #e4c56a;
  --gauge-a: #a8893c; --gauge-b: #f0d78c; --gauge-c: #3DDC9A;
  --dot: rgba(228, 197, 106, 0.65);
  --twinkle-1: rgba(245, 230, 196, 0.7);
  --twinkle-2: rgba(228, 197, 106, 0.5);
  --twinkle-3: rgba(61, 220, 154, 0.35);
  --glow-1: rgba(228, 197, 106, 0.22); --glow-2: rgba(245, 230, 196, 0.12);
  --glow-3: rgba(180, 150, 70, 0.16); --glow-4: rgba(228, 197, 106, 0.10);
  --glow-5: rgba(61, 220, 154, 0.06);
  --border-grad: linear-gradient(135deg, rgba(245, 230, 196, 0.8), rgba(228, 197, 106, 0.55) 60%, rgba(168, 137, 60, 0.35) 100%);
  --card-shadow: 0 0 0 1px rgba(228, 197, 106, 0.16), 0 0 16px rgba(228, 197, 106, 0.12), 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(245, 230, 196, 0.12);
  --fx-filter: hue-rotate(-48deg) saturate(0.85); --nav-on-fg: #16130a;
}


/* Neon Wave — black, violet fog, neon-tube border with visible hot red-pink */
[data-theme="wave"] {
  --bg: #05040A; --bg-2: #0C0818; --navy: #120A22;
  --glass: rgba(10, 8, 22, 0.86);
  --glass-top: rgba(18, 12, 36, 0.92);
  --glass-bot: rgba(6, 4, 12, 0.96);
  --glass-2: rgba(16, 10, 32, 0.7);
  --ink: #0A0614; --text: #F4EEFF; --muted: #A89BB8; --dim: #6E6680;
  --label: #C8B8FF; --hi: #FFF4FB; --hub: #0A0614;
  --line: rgba(138, 60, 255, 0.32); --line-strong: rgba(255, 45, 85, 0.55);
  --grid-line: rgba(30, 160, 255, 0.10); --inset: rgba(200, 180, 255, 0.12);
  --accent: #1EA0FF; --accent-2: #8A3CFF; --accent-hot: #FF2D55; --accent-rgb: 30, 160, 255;
  --mint: #5DFFC0; --mint-rgb: 93, 255, 192;
  --cyan: #1EA0FF; --cyan-2: #7AC8FF;
  --purple: #8A3CFF; --purple-2: #FF2BD6; --purple-rgb: 138, 60, 255;
  --up: #5DFFC0; --green: #5DFFC0; --green-rgb: 93, 255, 192;
  --down: #FF2D55; --red: #FF2D55; --red-rgb: 255, 45, 85; --down-2: #FF6A2B;
  --gold: #ffd56a; --wait: #ffd56a; --wait-rgb: 255, 213, 106;
  --gauge-a: #1EA0FF; --gauge-b: #8A3CFF; --gauge-c: #FF2BD6;
  --dot: rgba(138, 60, 255, 0.62);
  --twinkle-1: rgba(30, 160, 255, 0.85);
  --twinkle-2: rgba(255, 45, 85, 0.7);
  --twinkle-3: rgba(255, 43, 214, 0.55);
  --glow-1: rgba(30, 160, 255, 0.28);
  --glow-2: rgba(138, 60, 255, 0.34);
  --glow-3: rgba(255, 43, 214, 0.22);
  --glow-4: rgba(255, 45, 85, 0.30);
  --glow-5: rgba(255, 106, 43, 0.22);
  --border-grad: linear-gradient(135deg,
    #1EA0FF 0%, #8A3CFF 28%, #FF2BD6 52%, #FF2D55 76%, #FF6A2B 100%);
  --card-shadow:
    0 0 0 1px rgba(255, 45, 85, 0.28),
    0 0 16px rgba(30, 160, 255, 0.28),
    0 0 22px rgba(138, 60, 255, 0.26),
    0 10px 28px rgba(255, 45, 85, 0.32),
    0 22px 40px rgba(255, 106, 43, 0.20),
    0 16px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(200, 180, 255, 0.14);
  --fx-filter: none; --nav-on-fg: #0A0614;
}

/* Reef — navy deep water; lime, aqua, periwinkle, a touch of coral */
[data-theme="reef"] {
  --bg: #001437; --bg-2: #021C4A; --navy: #032056;
  --glass: rgba(0, 24, 64, 0.88);
  --glass-top: rgba(8, 36, 88, 0.94);
  --glass-bot: rgba(0, 16, 48, 0.96);
  --glass-2: rgba(8, 36, 88, 0.7);
  --ink: #00102C; --text: #E8F4FF; --muted: #8AA8C8; --dim: #5C7898;
  --label: #A8C4FF; --hi: #F3FFF0; --hub: #00102C;
  --line: rgba(92, 229, 213, 0.30); --line-strong: rgba(184, 251, 60, 0.5);
  --grid-line: rgba(120, 152, 251, 0.12); --inset: rgba(92, 229, 213, 0.12);
  --accent: #5CE5D5; --accent-2: #7898FB; --accent-hot: #B8FB3C; --accent-rgb: 92, 229, 213;
  --mint: #B8FB3C; --mint-rgb: 184, 251, 60;
  --cyan: #5CE5D5; --cyan-2: #9AF5EC;
  --purple: #7898FB; --purple-2: #A8BCFF; --purple-rgb: 120, 152, 251;
  --up: #B8FB3C; --green: #B8FB3C; --green-rgb: 184, 251, 60;
  --down: #FF6A4A; --red: #FF6A4A; --red-rgb: 255, 106, 74; --down-2: #FF8A3D;
  --gold: #FFB35A; --wait: #FFB35A; --wait-rgb: 255, 179, 90;
  --gauge-a: #7898FB; --gauge-b: #5CE5D5; --gauge-c: #B8FB3C;
  --dot: rgba(92, 229, 213, 0.7);
  --twinkle-1: rgba(184, 251, 60, 0.8);
  --twinkle-2: rgba(92, 229, 213, 0.7);
  --twinkle-3: rgba(120, 152, 251, 0.55);
  --glow-1: rgba(0, 20, 55, 0.0);
  --glow-2: rgba(92, 229, 213, 0.28);
  --glow-3: rgba(120, 152, 251, 0.24);
  --glow-4: rgba(184, 251, 60, 0.14);
  --glow-5: rgba(255, 106, 74, 0.10);
  --border-grad: linear-gradient(135deg, #5CE5D5 0%, #7898FB 48%, #B8FB3C 82%, rgba(255, 106, 74, 0.85) 100%);
  --card-shadow:
    0 0 0 1px rgba(92, 229, 213, 0.22),
    0 0 18px rgba(120, 152, 251, 0.22),
    0 0 16px rgba(184, 251, 60, 0.12),
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(164, 230, 255, 0.14);
  --fx-filter: none; --nav-on-fg: #00102C;
}

/* Neon Street — plum dark; Hong Kong signs, pink-red with lime/cyan outlines */
[data-theme="street"] {
  --bg: #14040E; --bg-2: #3D1530; --navy: #2A0C20;
  --glass: rgba(40, 12, 30, 0.88);
  --glass-top: rgba(61, 21, 48, 0.94);
  --glass-bot: rgba(16, 4, 12, 0.96);
  --glass-2: rgba(61, 21, 48, 0.7);
  --ink: #1A0814; --text: #FFE8F0; --muted: #C49AAA; --dim: #8A6570;
  --label: #7FE6F7; --hi: #FFF4F0; --hub: #1A0814;
  --line: rgba(190, 18, 56, 0.40); --line-strong: rgba(178, 201, 53, 0.55);
  --grid-line: rgba(127, 230, 247, 0.10); --inset: rgba(255, 180, 190, 0.10);
  --accent: #7FE6F7; --accent-2: #F45F52; --accent-hot: #BE1238; --accent-rgb: 127, 230, 247;
  --mint: #B2C935; --mint-rgb: 178, 201, 53;
  --cyan: #7FE6F7; --cyan-2: #B8F4FF;
  --purple: #BE1238; --purple-2: #F45F52; --purple-rgb: 190, 18, 56;
  --up: #B2C935; --green: #B2C935; --green-rgb: 178, 201, 53;
  --down: #F45F52; --red: #F45F52; --red-rgb: 244, 95, 82; --down-2: #BE1238;
  --gold: #ffd56a; --wait: #ffd56a; --wait-rgb: 255, 213, 106;
  --gauge-a: #7FE6F7; --gauge-b: #B2C935; --gauge-c: #F45F52;
  --dot: rgba(244, 95, 82, 0.55);
  --twinkle-1: rgba(127, 230, 247, 0.85);
  --twinkle-2: rgba(178, 201, 53, 0.7);
  --twinkle-3: rgba(244, 95, 82, 0.6);
  --glow-1: rgba(190, 18, 56, 0.32);
  --glow-2: rgba(127, 230, 247, 0.20);
  --glow-3: rgba(178, 201, 53, 0.16);
  --glow-4: rgba(244, 95, 82, 0.24);
  --glow-5: rgba(61, 21, 48, 0.4);
  --border-grad: linear-gradient(135deg, #B2C935 0%, #7FE6F7 28%, #F45F52 68%, #BE1238 100%);
  --card-shadow:
    0 0 0 1px rgba(178, 201, 53, 0.28),
    0 0 16px rgba(127, 230, 247, 0.20),
    0 0 22px rgba(190, 18, 56, 0.34),
    0 16px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(178, 201, 53, 0.16);
  --fx-filter: none; --nav-on-fg: #1A0814;
}

/* Jellyfish — pure black; deep teal, aqua, green, yellow glow */
[data-theme="jelly"] {
  --bg: #000000; --bg-2: #041016; --navy: #05506E;
  --glass: rgba(0, 12, 16, 0.9);
  --glass-top: rgba(5, 80, 110, 0.28);
  --glass-bot: rgba(0, 0, 0, 0.96);
  --glass-2: rgba(5, 80, 110, 0.35);
  --ink: #000000; --text: #E8FFF6; --muted: #7AA0A0; --dim: #4E6A6A;
  --label: #7ED6C4; --hi: #F7FFE8; --hub: #000000;
  --line: rgba(126, 214, 196, 0.28); --line-strong: rgba(255, 214, 0, 0.5);
  --grid-line: rgba(5, 80, 110, 0.45); --inset: rgba(126, 214, 196, 0.10);
  --accent: #7ED6C4; --accent-2: #05506E; --accent-hot: #FFD600; --accent-rgb: 126, 214, 196;
  --mint: #6CC70A; --mint-rgb: 108, 199, 10;
  --cyan: #7ED6C4; --cyan-2: #B8F0E6;
  --purple: #05506E; --purple-2: #0A7AA0; --purple-rgb: 5, 80, 110;
  --up: #6CC70A; --green: #6CC70A; --green-rgb: 108, 199, 10;
  --down: #FF5A6A; --red: #FF5A6A; --red-rgb: 255, 90, 106; --down-2: #FF8A90;
  --gold: #FFD600; --wait: #FFD600; --wait-rgb: 255, 214, 0;
  --gauge-a: #05506E; --gauge-b: #7ED6C4; --gauge-c: #6CC70A;
  --dot: rgba(126, 214, 196, 0.62);
  --twinkle-1: rgba(255, 214, 0, 0.85);
  --twinkle-2: rgba(126, 214, 196, 0.7);
  --twinkle-3: rgba(108, 199, 10, 0.5);
  --glow-1: rgba(5, 80, 110, 0.50);
  --glow-2: rgba(126, 214, 196, 0.22);
  --glow-3: rgba(108, 199, 10, 0.14);
  --glow-4: rgba(255, 214, 0, 0.16);
  --glow-5: rgba(5, 80, 110, 0.28);
  --border-grad: linear-gradient(135deg, #05506E 0%, #7ED6C4 48%, #6CC70A 78%, #FFD600 100%);
  --card-shadow:
    0 0 0 1px rgba(126, 214, 196, 0.22),
    0 0 20px rgba(5, 80, 110, 0.45),
    0 0 16px rgba(255, 214, 0, 0.16),
    0 16px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(126, 214, 196, 0.14);
  --fx-filter: none; --nav-on-fg: #000000;
}

/* Easy on the Eyes — default. Plain black, neon red + yellow, low glow, high readability */
:root, [data-theme="calm"] {
  --bg: #000000; --bg-2: #0A0A0A; --navy: #0A0A0A;
  --glass: rgba(12, 12, 12, 0.94);
  --glass-top: rgba(16, 16, 16, 0.96);
  --glass-bot: rgba(8, 8, 8, 0.98);
  --glass-2: rgba(16, 16, 16, 0.8);
  --ink: #000000; --text: #F0EEE8; --muted: #A8A69E; --dim: #7A7870;
  --label: #D8D4CC; --hi: #F7F5F0; --hub: #000000;
  --line: rgba(255, 255, 255, 0.10); --line-strong: rgba(255, 210, 63, 0.38);
  --grid-line: rgba(255, 255, 255, 0.05); --inset: rgba(255, 255, 255, 0.06);
  --accent: #FF3B3B; --accent-2: #FFD23F; --accent-hot: #FFD23F; --accent-rgb: 255, 59, 59;
  --mint: #7DCCA8; --mint-rgb: 125, 204, 168;
  --cyan: #FFD23F; --cyan-2: #FFE48A;
  --purple: #FF3B3B; --purple-2: #FF6A6A; --purple-rgb: 255, 59, 59;
  --blue: #FF3B3B;
  --up: #7DCCA8; --green: #7DCCA8; --green-rgb: 125, 204, 168;
  --down: #FF3B3B; --red: #FF3B3B; --red-rgb: 255, 59, 59; --down-2: #FF6A6A;
  --gold: #FFD23F; --wait: #FFD23F; --wait-rgb: 255, 210, 63;
  --gauge-a: #FF3B3B; --gauge-b: #FFD23F; --gauge-c: #7DCCA8;
  --dot: rgba(255, 255, 255, 0.10);
  --twinkle-1: rgba(255, 210, 63, 0.18);
  --twinkle-2: rgba(255, 59, 59, 0.12);
  --twinkle-3: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(255, 59, 59, 0.06);
  --glow-2: rgba(255, 210, 63, 0.05);
  --glow-3: rgba(255, 59, 59, 0.04);
  --glow-4: rgba(255, 210, 63, 0.03);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(255, 59, 59, 0.45) 0%, rgba(255, 210, 63, 0.35) 100%);
  --card-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --fx-filter: none; --nav-on-fg: #000000;
}

/* Vice City — ocean night, sunset pink → vice cyan, synthwave skyline */
[data-theme="vice"] {
  --bg: #0B0F2B; --bg-2: #101536; --navy: #0B0F2B;
  --glass: rgba(12, 16, 48, 0.90);
  --glass-top: rgba(20, 24, 64, 0.94);
  --glass-bot: rgba(8, 12, 40, 0.97);
  --glass-2: rgba(16, 20, 56, 0.72);
  --ink: #0B0F2B; --text: #F4F7FF; --muted: #9AA6C8; --dim: #6E7898;
  --label: #E8D0FF; --hi: #FFFFFF; --hub: #0B0F2B;
  --line: rgba(255, 92, 168, 0.35); --line-strong: rgba(0, 240, 255, 0.5);
  --grid-line: rgba(0, 240, 255, 0.14); --inset: rgba(188, 108, 255, 0.14);
  --accent: #FF5CA8; --accent-2: #BC6CFF; --accent-hot: #00F0FF; --accent-rgb: 255, 92, 168;
  --mint: #00F0FF; --mint-rgb: 0, 240, 255;
  --cyan: #00F0FF; --cyan-2: #7AFFFF;
  --purple: #BC6CFF; --purple-2: #E0A8FF; --purple-rgb: 188, 108, 255;
  --up: #5DFFE8; --green: #5DFFE8; --green-rgb: 93, 255, 232;
  --down: #FF4D6A; --red: #FF4D6A; --red-rgb: 255, 77, 106; --down-2: #FF7A9A;
  --gold: #FFB86B; --wait: #FFB86B; --wait-rgb: 255, 184, 107;
  --gauge-a: #00F0FF; --gauge-b: #BC6CFF; --gauge-c: #FF5CA8;
  --dot: rgba(0, 240, 255, 0.42);
  --twinkle-1: rgba(0, 240, 255, 0.8);
  --twinkle-2: rgba(255, 92, 168, 0.7);
  --twinkle-3: rgba(188, 108, 255, 0.55);
  --glow-1: rgba(255, 92, 168, 0.28);
  --glow-2: rgba(0, 240, 255, 0.24);
  --glow-3: rgba(188, 108, 255, 0.22);
  --glow-4: rgba(255, 184, 107, 0.16);
  --glow-5: rgba(0, 240, 255, 0.12);
  --border-grad: linear-gradient(135deg, #FF5CA8 0%, #BC6CFF 50%, #00F0FF 100%);
  --card-shadow:
    0 0 0 1px rgba(255, 92, 168, 0.28),
    0 0 18px rgba(0, 240, 255, 0.28),
    0 0 24px rgba(188, 108, 255, 0.24),
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 184, 107, 0.12);
  --fx-filter: none; --nav-on-fg: #0B0F2B;
}

/* Sunset — deep violet, amber > orange > magenta > purple, fiery marble */
[data-theme="sunset"] {
  --bg: #1A0630; --bg-2: #2A0845; --navy: #1A0630;
  --glass: rgba(32, 8, 56, 0.90);
  --glass-top: rgba(48, 12, 72, 0.94);
  --glass-bot: rgba(22, 4, 40, 0.97);
  --glass-2: rgba(42, 8, 69, 0.72);
  --ink: #1A0630; --text: #FDEEFF; --muted: #C4A0C8; --dim: #8A6A90;
  --label: #FFD4A8; --hi: #FFF6E8; --hub: #1A0630;
  --line: rgba(255, 20, 147, 0.35); --line-strong: rgba(255, 166, 32, 0.55);
  --grid-line: rgba(178, 29, 214, 0.16); --inset: rgba(255, 166, 32, 0.14);
  --accent: #FFA620; --accent-2: #FF1493; --accent-hot: #F7721A; --accent-rgb: 255, 166, 32;
  --mint: #5DFFC0; --mint-rgb: 93, 255, 192;
  --cyan: #FFA620; --cyan-2: #FFD27A;
  --purple: #B21DD6; --purple-2: #7A0FA8; --purple-rgb: 178, 29, 214;
  --up: #5DFFC0; --green: #5DFFC0; --green-rgb: 93, 255, 192;
  --down: #FF4D6A; --red: #FF4D6A; --red-rgb: 255, 77, 106; --down-2: #FF7A9A;
  --gold: #FFA620; --wait: #FFA620; --wait-rgb: 255, 166, 32;
  --gauge-a: #FFA620; --gauge-b: #FF1493; --gauge-c: #B21DD6;
  --dot: rgba(255, 166, 32, 0.4);
  --twinkle-1: rgba(255, 166, 32, 0.85);
  --twinkle-2: rgba(255, 20, 147, 0.7);
  --twinkle-3: rgba(247, 114, 26, 0.6);
  --glow-1: rgba(255, 166, 32, 0.32);
  --glow-2: rgba(247, 114, 26, 0.28);
  --glow-3: rgba(255, 20, 147, 0.30);
  --glow-4: rgba(178, 29, 214, 0.26);
  --glow-5: rgba(122, 15, 168, 0.28);
  --border-grad: linear-gradient(135deg, #FFA620 0%, #F7721A 25%, #FF1493 50%, #B21DD6 75%, #7A0FA8 100%);
  --card-shadow:
    0 0 0 1px rgba(255, 20, 147, 0.32),
    0 0 20px rgba(255, 166, 32, 0.28),
    0 0 28px rgba(255, 20, 147, 0.26),
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 210, 160, 0.14);
  --fx-filter: none; --nav-on-fg: #1A0630;
}

/* Seoul Nights — sambucus rain street; teal-green glow, palesun highlights, plum accents */
[data-theme="seoul"] {
  --bg: #021826; --bg-2: #052030; --navy: #021826;
  --glass: rgba(4, 28, 40, 0.90);
  --glass-top: rgba(8, 40, 48, 0.94);
  --glass-bot: rgba(2, 18, 28, 0.97);
  --glass-2: rgba(6, 36, 44, 0.72);
  --ink: #021826; --text: #F3FFF6; --muted: #8AAEAA; --dim: #5C7A78;
  --label: #EAF405; --hi: #F7FFE8; --hub: #021826;
  --line: rgba(6, 242, 132, 0.28); --line-strong: rgba(234, 244, 5, 0.5);
  --grid-line: rgba(6, 242, 132, 0.12); --inset: rgba(155, 255, 108, 0.12);
  --accent: #06F284; --accent-2: #9BFF6C; --accent-hot: #EAF405; --accent-rgb: 6, 242, 132;
  --mint: #06F284; --mint-rgb: 6, 242, 132;
  --cyan: #01595A; --cyan-2: #06F284;
  --purple: #5C1966; --purple-2: #8A2A96; --purple-rgb: 92, 25, 102;
  --up: #06F284; --green: #06F284; --green-rgb: 6, 242, 132;
  --down: #FF4D6A; --red: #FF4D6A; --red-rgb: 255, 77, 106; --down-2: #FF7A9A;
  --gold: #EAF405; --wait: #EAF405; --wait-rgb: 234, 244, 5;
  --gauge-a: #01595A; --gauge-b: #06F284; --gauge-c: #EAF405;
  --dot: rgba(6, 242, 132, 0.38);
  --twinkle-1: rgba(234, 244, 5, 0.85);
  --twinkle-2: rgba(6, 242, 132, 0.7);
  --twinkle-3: rgba(155, 255, 108, 0.55);
  --glow-1: rgba(6, 242, 132, 0.26);
  --glow-2: rgba(1, 89, 90, 0.34);
  --glow-3: rgba(155, 255, 108, 0.18);
  --glow-4: rgba(234, 244, 5, 0.16);
  --glow-5: rgba(92, 25, 102, 0.22);
  --border-grad: linear-gradient(135deg, #01595A 0%, #06F284 40%, #9BFF6C 70%, #EAF405 88%, #5C1966 100%);
  --card-shadow:
    0 0 0 1px rgba(6, 242, 132, 0.28),
    0 0 18px rgba(6, 242, 132, 0.22),
    0 0 22px rgba(92, 25, 102, 0.24),
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(234, 244, 5, 0.12);
  --fx-filter: none; --nav-on-fg: #021826;
}

/* Neon Purple — pure black base, glowing neon-purple trims */
[data-theme="purple"] {
  --bg: #000000; --bg-2: #07040C; --navy: #07040C;
  --glass: rgba(7, 4, 12, 0.96);
  --glass-top: rgba(10, 7, 14, 0.97);
  --glass-bot: rgba(7, 4, 12, 0.98);
  --glass-2: rgba(10, 7, 14, 0.84);
  --ink: #000000; --text: #F0EEE8; --muted: #9A969E; --dim: #6E6A72;
  --label: #C8C4CC; --hi: #F7F5F0; --hub: #000000;
  --line: rgba(122, 43, 184, 0.65); --line-strong: rgba(155, 77, 214, 0.70);
  --grid-line: rgba(122, 43, 184, 0.10); --inset: rgba(155, 77, 214, 0.08);
  --accent: #7A2BB8; --accent-2: #9B4DD6; --accent-hot: #9B4DD6; --accent-rgb: 122, 43, 184;
  --mint: #7DCCA8; --mint-rgb: 125, 204, 168;
  --cyan: #FFD23F; --cyan-2: #C8C4CC;
  --purple: #7A2BB8; --purple-2: #9B4DD6; --purple-rgb: 122, 43, 184;
  --blue: #7A2BB8;
  --up: #7DCCA8; --green: #7DCCA8; --green-rgb: 125, 204, 168;
  --down: #FF3B3B; --red: #FF3B3B; --red-rgb: 255, 59, 59; --down-2: #FF6A6A;
  --gold: #FFD23F; --wait: #FFD23F; --wait-rgb: 255, 210, 63;
  --gauge-a: #7DCCA8; --gauge-b: #FFD23F; --gauge-c: #FF3B3B;
  --dot: rgba(155, 77, 214, 0.12);
  --twinkle-1: rgba(155, 77, 214, 0.16);
  --twinkle-2: rgba(122, 43, 184, 0.12);
  --twinkle-3: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(155, 77, 214, 0.12);
  --glow-2: rgba(122, 43, 184, 0.10);
  --glow-3: rgba(155, 77, 214, 0.08);
  --glow-4: rgba(122, 43, 184, 0.05);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(155, 77, 214, 0.70) 0%, rgba(122, 43, 184, 0.62) 55%, rgba(155, 77, 214, 0.58) 100%);
  --card-shadow:
    0 0 0 1.5px rgba(122, 43, 184, 0.65),
    0 0 6px rgba(155, 77, 214, 0.32),
    0 0 8px rgba(122, 43, 184, 0.25),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --fx-filter: none; --nav-on-fg: #F0EEE8;
}

/* Neon Pink — black base, dim pink trims; DOWN is orange-red so it stays distinct from magenta */
[data-theme="pink"] {
  --bg: #000000; --bg-2: #0C070A; --navy: #0C070A;
  --glass: rgba(7, 7, 8, 0.96);
  --glass-top: rgba(12, 8, 11, 0.97);
  --glass-bot: rgba(7, 6, 8, 0.98);
  --glass-2: rgba(12, 8, 11, 0.84);
  --ink: #000000; --text: #F0EEE8; --muted: #9A969E; --dim: #6E6A72;
  --label: #C8C4CC; --hi: #F7F5F0; --hub: #000000;
  --line: rgba(194, 54, 127, 0.65); --line-strong: rgba(224, 96, 159, 0.70);
  --grid-line: rgba(194, 54, 127, 0.10); --inset: rgba(224, 96, 159, 0.08);
  --accent: #C2367F; --accent-2: #E0609F; --accent-hot: #E0609F; --accent-rgb: 194, 54, 127;
  --mint: #7DCCA8; --mint-rgb: 125, 204, 168;
  --cyan: #FFD23F; --cyan-2: #C8C4CC;
  --purple: #C2367F; --purple-2: #E0609F; --purple-rgb: 194, 54, 127;
  --blue: #C2367F;
  --up: #7DCCA8; --green: #7DCCA8; --green-rgb: 125, 204, 168;
  --down: #FF4E32; --red: #FF4E32; --red-rgb: 255, 78, 50; --down-2: #FF7A5C;
  --gold: #FFD23F; --wait: #FFD23F; --wait-rgb: 255, 210, 63;
  --gauge-a: #7DCCA8; --gauge-b: #FFD23F; --gauge-c: #FF4E32;
  --dot: rgba(224, 96, 159, 0.12);
  --twinkle-1: rgba(224, 96, 159, 0.16);
  --twinkle-2: rgba(194, 54, 127, 0.12);
  --twinkle-3: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(224, 96, 159, 0.12);
  --glow-2: rgba(194, 54, 127, 0.10);
  --glow-3: rgba(224, 96, 159, 0.08);
  --glow-4: rgba(194, 54, 127, 0.05);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(224, 96, 159, 0.70) 0%, rgba(194, 54, 127, 0.62) 55%, rgba(224, 96, 159, 0.58) 100%);
  --card-shadow:
    0 0 0 1.5px rgba(194, 54, 127, 0.65),
    0 0 6px rgba(224, 96, 159, 0.32),
    0 0 8px rgba(194, 54, 127, 0.25),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --fx-filter: none; --nav-on-fg: #F0EEE8;
}

/* Neon Blue — black base, dim blue trims */
[data-theme="blue"] {
  --bg: #000000; --bg-2: #04070C; --navy: #04070C;
  --glass: rgba(7, 7, 8, 0.96);
  --glass-top: rgba(10, 10, 12, 0.97);
  --glass-bot: rgba(7, 7, 8, 0.98);
  --glass-2: rgba(10, 10, 12, 0.84);
  --ink: #000000; --text: #F0EEE8; --muted: #9A969E; --dim: #6E6A72;
  --label: #C8C4CC; --hi: #F7F5F0; --hub: #000000;
  --line: rgba(31, 111, 209, 0.65); --line-strong: rgba(74, 149, 240, 0.7);
  --grid-line: rgba(31, 111, 209, 0.1); --inset: rgba(74, 149, 240, 0.08);
  --accent: #1F6FD1; --accent-2: #4A95F0; --accent-hot: #4A95F0; --accent-rgb: 31, 111, 209;
  --mint: #7DCCA8; --mint-rgb: 125, 204, 168;
  --cyan: #FFD23F; --cyan-2: #C8C4CC;
  --purple: #1F6FD1; --purple-2: #4A95F0; --purple-rgb: 31, 111, 209;
  --blue: #1F6FD1;
  --up: #7DCCA8; --green: #7DCCA8; --green-rgb: 125, 204, 168;
  --down: #FF3B3B; --red: #FF3B3B; --red-rgb: 255, 59, 59; --down-2: #FF6A6A;
  --gold: #FFD23F; --wait: #FFD23F; --wait-rgb: 255, 210, 63;
  --gauge-a: #7DCCA8; --gauge-b: #FFD23F; --gauge-c: #FF3B3B;
  --dot: rgba(74, 149, 240, 0.12);
  --twinkle-1: rgba(74, 149, 240, 0.16);
  --twinkle-2: rgba(31, 111, 209, 0.12);
  --twinkle-3: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(74, 149, 240, 0.12);
  --glow-2: rgba(31, 111, 209, 0.1);
  --glow-3: rgba(74, 149, 240, 0.08);
  --glow-4: rgba(31, 111, 209, 0.05);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(74, 149, 240, 0.7) 0%, rgba(31, 111, 209, 0.62) 55%, rgba(74, 149, 240, 0.58) 100%);
  --card-shadow:
    0 0 0 1.5px rgba(31, 111, 209, 0.65),
    0 0 6px rgba(74, 149, 240, 0.32),
    0 0 8px rgba(31, 111, 209, 0.25),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --fx-filter: none; --nav-on-fg: #F0EEE8;
}

/* Neon Green — black base, dim green trims; UP is cooler aqua-mint so it stays distinct */
[data-theme="green"] {
  --bg: #000000; --bg-2: #040A07; --navy: #040A07;
  --glass: rgba(7, 7, 8, 0.96);
  --glass-top: rgba(10, 10, 12, 0.97);
  --glass-bot: rgba(7, 7, 8, 0.98);
  --glass-2: rgba(10, 10, 12, 0.84);
  --ink: #000000; --text: #F0EEE8; --muted: #9A969E; --dim: #6E6A72;
  --label: #C8C4CC; --hi: #F7F5F0; --hub: #000000;
  --line: rgba(31, 158, 90, 0.65); --line-strong: rgba(63, 203, 126, 0.7);
  --grid-line: rgba(31, 158, 90, 0.1); --inset: rgba(63, 203, 126, 0.08);
  --accent: #1F9E5A; --accent-2: #3FCB7E; --accent-hot: #3FCB7E; --accent-rgb: 31, 158, 90;
  --mint: #7DCCA8; --mint-rgb: 125, 204, 168;
  --cyan: #FFD23F; --cyan-2: #C8C4CC;
  --purple: #1F9E5A; --purple-2: #3FCB7E; --purple-rgb: 31, 158, 90;
  --blue: #1F9E5A;
  --up: #7AFFE0; --green: #7AFFE0; --green-rgb: 122, 255, 224;
  --down: #FF3B3B; --red: #FF3B3B; --red-rgb: 255, 59, 59; --down-2: #FF6A6A;
  --gold: #FFD23F; --wait: #FFD23F; --wait-rgb: 255, 210, 63;
  --gauge-a: #7DCCA8; --gauge-b: #FFD23F; --gauge-c: #FF3B3B;
  --dot: rgba(63, 203, 126, 0.12);
  --twinkle-1: rgba(63, 203, 126, 0.16);
  --twinkle-2: rgba(31, 158, 90, 0.12);
  --twinkle-3: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(63, 203, 126, 0.12);
  --glow-2: rgba(31, 158, 90, 0.1);
  --glow-3: rgba(63, 203, 126, 0.08);
  --glow-4: rgba(31, 158, 90, 0.05);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(63, 203, 126, 0.7) 0%, rgba(31, 158, 90, 0.62) 55%, rgba(63, 203, 126, 0.58) 100%);
  --card-shadow:
    0 0 0 1.5px rgba(31, 158, 90, 0.65),
    0 0 6px rgba(63, 203, 126, 0.32),
    0 0 8px rgba(31, 158, 90, 0.25),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --fx-filter: none; --nav-on-fg: #F0EEE8;
}

/* Neon Fire — charcoal / deep teal, flame gradient blue > pink > orange */
[data-theme="fire"] {
  --bg: #0A0A0E; --bg-2: #0D1F2D; --navy: #0A0A0E;
  --glass: rgba(10, 16, 24, 0.90);
  --glass-top: rgba(13, 31, 45, 0.94);
  --glass-bot: rgba(8, 10, 14, 0.97);
  --glass-2: rgba(13, 31, 45, 0.72);
  --ink: #0A0A0E; --text: #F6F3EE; --muted: #8A9AAB; --dim: #5C6C7A;
  --label: #FFC24D; --hi: #FFF6E8; --hub: #0A0A0E;
  --line: rgba(255, 46, 147, 0.32); --line-strong: rgba(255, 106, 0, 0.5);
  --grid-line: rgba(0, 196, 255, 0.14); --inset: rgba(255, 194, 77, 0.12);
  --accent: #00C4FF; --accent-2: #FF2E93; --accent-hot: #FF6A00; --accent-rgb: 0, 196, 255;
  --mint: #00C4FF; --mint-rgb: 0, 196, 255;
  --cyan: #00C4FF; --cyan-2: #7AD8FF;
  --purple: #8A1C5C; --purple-2: #FF2E93; --purple-rgb: 138, 28, 92;
  --up: #00C4FF; --green: #5DFFC0; --green-rgb: 93, 255, 192;
  --down: #FF4D6A; --red: #FF4D6A; --red-rgb: 255, 77, 106; --down-2: #FF7A9A;
  --gold: #FFC24D; --wait: #FFC24D; --wait-rgb: 255, 194, 77;
  --gauge-a: #00C4FF; --gauge-b: #FF2E93; --gauge-c: #FF6A00;
  --dot: rgba(0, 196, 255, 0.38);
  --twinkle-1: rgba(0, 196, 255, 0.8);
  --twinkle-2: rgba(255, 46, 147, 0.7);
  --twinkle-3: rgba(255, 194, 77, 0.65);
  --glow-1: rgba(0, 196, 255, 0.28);
  --glow-2: rgba(255, 46, 147, 0.26);
  --glow-3: rgba(255, 106, 0, 0.28);
  --glow-4: rgba(255, 194, 77, 0.16);
  --glow-5: rgba(50, 91, 122, 0.22);
  --border-grad: linear-gradient(135deg, #00C4FF 0%, #FF2E93 48%, #FF6A00 82%, #FFC24D 100%);
  --card-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.32),
    0 0 18px rgba(0, 196, 255, 0.26),
    0 0 24px rgba(255, 46, 147, 0.24),
    0 16px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 194, 77, 0.12);
  --fx-filter: none; --nav-on-fg: #0A0A0E;
}

/* Nature Earth — walnut / dark forest, sage and tan, cream type, no neon */
[data-theme="earth"] {
  --bg: #1B2A1E; --bg-2: #3E2723; --navy: #1B2A1E;
  --glass: rgba(36, 28, 22, 0.94);
  --glass-top: rgba(62, 39, 35, 0.92);
  --glass-bot: rgba(27, 42, 30, 0.96);
  --glass-2: rgba(44, 32, 26, 0.8);
  --ink: #1B2A1E; --text: #F7E7CE; --muted: #C8B59A; --dim: #8E7C68;
  --label: #D4A373; --hi: #F7E7CE; --hub: #1B2A1E;
  --line: rgba(212, 163, 115, 0.28); --line-strong: rgba(46, 125, 50, 0.45);
  --grid-line: rgba(129, 199, 132, 0.14); --inset: rgba(247, 231, 206, 0.08);
  --accent: #2E7D32; --accent-2: #81C784; --accent-hot: #D4A373; --accent-rgb: 46, 125, 50;
  --mint: #81C784; --mint-rgb: 129, 199, 132;
  --cyan: #D4A373; --cyan-2: #E8C9A8;
  --purple: #3E2723; --purple-2: #5C3A32; --purple-rgb: 62, 39, 35;
  --up: #81C784; --green: #2E7D32; --green-rgb: 46, 125, 50;
  --down: #D36B4A; --red: #D36B4A; --red-rgb: 211, 107, 74; --down-2: #E08A6A;
  --gold: #D4A373; --wait: #D4A373; --wait-rgb: 212, 163, 115;
  --gauge-a: #2E7D32; --gauge-b: #81C784; --gauge-c: #D4A373;
  --dot: rgba(247, 231, 206, 0.16);
  --twinkle-1: rgba(247, 231, 206, 0.18);
  --twinkle-2: rgba(212, 163, 115, 0.14);
  --twinkle-3: rgba(129, 199, 132, 0.12);
  --glow-1: rgba(46, 125, 50, 0.08);
  --glow-2: rgba(62, 39, 35, 0.18);
  --glow-3: rgba(129, 199, 132, 0.06);
  --glow-4: rgba(212, 163, 115, 0.06);
  --glow-5: transparent;
  --border-grad: linear-gradient(135deg, rgba(46, 125, 50, 0.45) 0%, rgba(212, 163, 115, 0.4) 55%, rgba(129, 199, 132, 0.35) 100%);
  --card-shadow:
    0 0 0 1px rgba(212, 163, 115, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 2px 8px rgba(27, 42, 30, 0.25),
    inset 0 1px 0 rgba(247, 231, 206, 0.08);
  --fx-filter: none; --nav-on-fg: #1B2A1E;
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Login */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(440px, 100%);
  padding: 28px 28px 24px;
}
.login-mark {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 20px;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--nav-on-fg);
  background: linear-gradient(135deg, var(--hi) 0%, var(--accent-hot) 48%, var(--accent) 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.25) inset,
    0 0 18px rgba(var(--accent-rgb), 0.7),
    0 0 42px rgba(var(--purple-rgb), 0.45);
  margin-bottom: 16px;
}
.login-mark.sm {
  width: 48px; height: 48px;
  font-size: 14px;
  border-radius: 14px;
  margin: 0;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.2) inset,
    0 0 14px rgba(var(--accent-rgb), 0.65),
    0 0 28px rgba(var(--purple-rgb), 0.35);
}
.login-card h1 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  margin: 0 0 6px;
  font-size: 42px;
}
.wordmark {
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--hi) 0%, var(--accent-hot) 42%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.55)) drop-shadow(0 0 24px rgba(var(--purple-rgb), 0.3));
}
.brand-name.wordmark {
  font-size: 20px;
  line-height: 1.15;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.6)) drop-shadow(0 0 20px rgba(var(--purple-rgb), 0.35));
}
.login-card h1.wordmark {
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.65)) drop-shadow(0 0 32px rgba(var(--purple-rgb), 0.4));
}
.wordmark-kicker {
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-right: 8px;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.35));
}
.login-sub { color: var(--muted); margin: 0 0 20px; }
.login-card label, .settings-form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.login-card input, .settings-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: rgba(4, 16, 14, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
.login-card input:focus, .settings-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.disclaimer {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(4, 16, 14, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0 14px;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px !important;
  color: var(--text) !important;
  font-size: 14px !important;
}
.check input { width: auto !important; margin: 0 !important; accent-color: var(--cyan); }
.form-error { color: var(--red); font-size: 13px; margin: 10px 0 0; }
.form-ok { color: var(--green); font-size: 13px; margin: 10px 0 0; }

.btn {
  border: 1px solid var(--line);
  background: rgba(8, 32, 28, 0.6);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text);
}
.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  border: 0;
  color: var(--nav-on-fg);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(var(--mint-rgb), 0.45), 0 0 32px rgba(var(--accent-rgb), 0.2);
  padding: 12px 16px;
}
.btn.ghost { width: 100%; background: transparent; }
.btn.primary:hover { filter: brightness(1.08); }

/* Shell */
.app, .login-view { position: relative; z-index: 2; }
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(var(--mint-rgb), 0.22);
  background: linear-gradient(180deg, rgba(6, 22, 20, 0.88), rgba(4, 14, 14, 0.92));
  box-shadow: 8px 0 32px rgba(0,0,0,0.35), 0 0 28px rgba(var(--mint-rgb), 0.08);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-name { font-family: Syne, sans-serif; font-weight: 700; letter-spacing: 0.04em; }
.brand-sub { color: var(--dim); font-size: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
}
.nav-btn:hover {
  color: var(--text);
  background: rgba(var(--mint-rgb), 0.08);
  border-color: rgba(var(--mint-rgb), 0.22);
}
.nav-btn.active {
  color: var(--nav-on-fg);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(var(--mint-rgb), 0.55), 0 0 32px rgba(var(--accent-rgb), 0.25);
}
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.who { font-size: 12px; color: var(--muted); padding: 0 4px; }

html.auth-off #logout-btn,
html.auth-off #login-view { display: none !important; }

/* Owner PIN gate (used while member login is off) */
.pin-view {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  padding: 16px;
  justify-items: center;
  align-items: center;
}
.pin-card {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  text-align: center;
  padding: 24px 16px 20px;
  margin: 0 auto;
}
.pin-card h1.wordmark,
.pin-card h1 {
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.15;
  margin: 0 0 8px;
}
.pin-card .login-mark { margin-left: auto; margin-right: auto; }
.pin-card .login-sub { margin-bottom: 18px; }
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 22px;
  margin: 4px 0 22px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.pin-dot.filled {
  background: #FFD23F;
  border-color: #FFD23F;
  box-shadow: 0 0 10px rgba(255, 210, 63, 0.75), 0 0 22px rgba(255, 210, 63, 0.35);
  transform: scale(1.08);
}
.pin-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(300px, 100%);
  margin: 0 auto;
}
.pin-pad button {
  height: 64px;
  border-radius: 18px;
  font-family: "IBM Plex Mono", "DM Sans", sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset;
  -webkit-tap-highlight-color: transparent;
}
.pin-pad button:hover {
  border-color: rgba(255, 210, 63, 0.45);
}
.pin-pad button:active {
  background: rgba(255, 59, 59, 0.16);
  border-color: #FF3B3B;
  box-shadow: 0 0 16px rgba(255, 59, 59, 0.28);
}
.pin-pad button.pin-action {
  font-size: 18px;
  color: var(--muted);
}
.pin-pad button:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pin-view.shake .pin-dots {
  animation: pin-shake 0.38s ease;
}
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@media (max-width: 430px) {
  .pin-view { padding: 12px; }
  .pin-card { padding: 22px 14px 18px; }
  .pin-pad { width: 100%; max-width: none; gap: 8px; }
  .pin-pad button { height: 58px; }
  .pin-sub, .pin-card .login-sub { font-size: 14px; }
}
html.auth-off #login-view { display: none !important; }


.main {
  padding: 18px 20px 28px;
  min-width: 0;
}
.view { display: flex; flex-direction: column; gap: var(--space-2); }

.glass, .panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bot)) padding-box,
    var(--border-grad) border-box;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(16px);
}
.glass::before, .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
  opacity: 0.22;
  background-image:
    radial-gradient(80% 50% at 8% 0%, rgba(var(--accent-rgb), 0.10), transparent 60%),
    radial-gradient(70% 50% at 100% 100%, rgba(var(--purple-rgb), 0.08), transparent 60%),
    radial-gradient(circle at 6px 6px, var(--dot) 0.55px, transparent 0.85px);
  background-size: auto, auto, 12px 12px;
  background-position: 0 0, 100% 100%, 0 0;
}
.glass::after, .panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  /* quiet HUD corner brackets */
  background:
    linear-gradient(var(--accent-hot), var(--accent-hot)) 10px 10px / 16px 2px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) 10px 10px / 2px 16px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) calc(100% - 10px) 10px / 16px 2px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) calc(100% - 10px) 10px / 2px 16px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) 10px calc(100% - 10px) / 16px 2px no-repeat,
    linear-gradient(var(--purple-2), var(--purple-2)) 10px calc(100% - 10px) / 2px 16px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - 10px) calc(100% - 10px) / 16px 2px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - 10px) calc(100% - 10px) / 2px 16px no-repeat;
}
.glass > *, .panel > * { position: relative; z-index: 1; }
.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px 11px 14px;
  background: linear-gradient(90deg, rgba(var(--mint-rgb), 0.14), rgba(var(--accent-rgb), 0.08) 50%, rgba(var(--purple-rgb), 0.06) 100%);
  border-bottom: 1px solid rgba(var(--mint-rgb), 0.16);
}
.panel-h h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 600;
}

.pill {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--cyan-2);
  background: rgba(var(--accent-rgb), 0.08);
}
.pill.calm { color: var(--green); border-color: rgba(var(--green-rgb), 0.35); background: rgba(var(--green-rgb), 0.08); }
.pill.risky { color: var(--gold); border-color: rgba(var(--wait-rgb), 0.35); background: rgba(var(--wait-rgb), 0.08); }
.pill.dim { color: var(--muted); }

.view-live { display: flex; flex-direction: column; gap: var(--space-2); }
.live-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  align-items: stretch;
}
.live-metrics .panel { display: flex; flex-direction: column; min-height: 0; }
.live-metrics .compact-face { flex: 1; }
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space) var(--space-2) 0;
}

.live-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 10px;
}
.status-block { min-width: 0; flex: 1; }
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dir-arrow {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.dir-arrow.up {
  color: var(--green);
  background: rgba(var(--mint-rgb), 0.14);
  border-color: rgba(var(--mint-rgb), 0.65);
  box-shadow: 0 0 14px rgba(var(--mint-rgb), 0.55), 0 0 28px rgba(var(--mint-rgb), 0.22);
}
.dir-arrow.down {
  color: var(--red);
  background: rgba(var(--red-rgb), 0.14);
  border-color: rgba(var(--red-rgb), 0.65);
  box-shadow: 0 0 14px rgba(var(--red-rgb), 0.5), 0 0 28px rgba(var(--red-rgb), 0.2);
}
.status-word {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: var(--text-status);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
  display: inline-block;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid rgba(138, 160, 184, 0.35);
  background: rgba(6, 18, 16, 0.72);
}
.status-word.tone-up {
  color: #3dff9a;
  border-color: rgba(var(--green-rgb), 0.7);
  background: rgba(var(--green-rgb), 0.12);
  box-shadow: 0 0 10px rgba(var(--green-rgb), 0.45), 0 0 24px rgba(var(--green-rgb), 0.25), inset 0 0 12px rgba(var(--green-rgb), 0.08);
  animation: pulse-up 2.2s ease-in-out infinite;
}
.status-word.tone-down {
  color: var(--down-2);
  border-color: rgba(var(--red-rgb), 0.7);
  background: rgba(var(--red-rgb), 0.12);
  box-shadow: 0 0 10px rgba(var(--red-rgb), 0.45), 0 0 24px rgba(var(--red-rgb), 0.22), inset 0 0 12px rgba(var(--red-rgb), 0.08);
  animation: pulse-down 2.2s ease-in-out infinite;
}
.status-word.tone-wait, .status-word.WAIT, .status-word.NO {
  color: #ffd56a;
  border-color: rgba(var(--wait-rgb), 0.7);
  background: rgba(var(--wait-rgb), 0.10);
  box-shadow: 0 0 10px rgba(var(--wait-rgb), 0.4), 0 0 22px rgba(var(--wait-rgb), 0.2), inset 0 0 12px rgba(var(--wait-rgb), 0.08);
  animation: pulse-wait 2.6s ease-in-out infinite;
}
@keyframes pulse-up {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--green-rgb), 0.35), 0 0 18px rgba(var(--green-rgb), 0.18); }
  50% { box-shadow: 0 0 16px rgba(var(--green-rgb), 0.7), 0 0 36px rgba(var(--green-rgb), 0.4); }
}
@keyframes pulse-down {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--red-rgb), 0.35), 0 0 18px rgba(var(--red-rgb), 0.16); }
  50% { box-shadow: 0 0 16px rgba(var(--red-rgb), 0.7), 0 0 36px rgba(var(--red-rgb), 0.35); }
}
@keyframes pulse-wait {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--wait-rgb), 0.3), 0 0 16px rgba(var(--wait-rgb), 0.14); }
  50% { box-shadow: 0 0 16px rgba(var(--wait-rgb), 0.65), 0 0 32px rgba(var(--wait-rgb), 0.32); }
}
.status-meta { margin-top: 8px; color: var(--muted); font-size: 13px; }
.market-line {
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--cyan-2);
}
.market-line.down { color: var(--red); }

.quotes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.ring-wrap {
  position: relative;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
}
.ring-wrap.sm { width: 132px; height: 132px; margin: 8px auto 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(80,200,255,0.12); stroke-width: 8; }
.ring-fg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 80;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6));
  transition: stroke-dashoffset 0.6s ease;
}
.ring-fg.goal { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(var(--green-rgb), 0.5)); }
.ring-fg.goal.neg { stroke: var(--red); filter: drop-shadow(0 0 6px rgba(var(--red-rgb), 0.5)); }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
}
.ring-time { font-family: "IBM Plex Mono", monospace; font-weight: 700; font-size: 22px; color: var(--mint); text-shadow: 0 0 12px rgba(var(--mint-rgb), 0.45); }
.ring-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.ring-sub.ring-sub-note { font-size: 9px; letter-spacing: 0.04em; text-transform: none; margin-top: 1px; }

.goal-body { padding: 8px 14px 14px; }
.goal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.goal-stats b { color: var(--text); font-weight: 600; display: block; font-family: "IBM Plex Mono", monospace; }

.stop-banner {
  margin: 0 14px 14px;
  background: rgba(255, 40, 70, 0.12);
  border: 1px solid rgba(var(--red-rgb), 0.45);
  color: #ffd0d8;
  text-align: center;
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 10px 8px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 40, 70, 0.2);
  text-transform: uppercase;
}
.stop-banner small { display: block; letter-spacing: 0; font-family: "DM Sans", sans-serif; font-weight: 500; margin-top: 4px; text-transform: none; color: #ffb3bf; }

.flip-body { padding: 6px 14px 14px; }
.gauge { position: relative; }
.gauge svg { width: 100%; height: auto; display: block; }
.g-track { fill: none; stroke: rgba(80,200,255,0.14); stroke-width: 14; stroke-linecap: round; }
.g-fill { fill: none; stroke: var(--gold); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 251; stroke-dashoffset: 120; filter: drop-shadow(0 0 6px rgba(var(--wait-rgb), 0.4)); }
.g-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.g-hub { fill: var(--text); }
.gauge-label {
  text-align: center;
  font-family: Syne, sans-serif;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-top: -8px;
}
.gauge-label.LOW { color: var(--green); }
.gauge-label.MEDIUM { color: var(--gold); }
.gauge-label.HIGH { color: var(--red); }
.flip-why { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 4px 2px 0; min-height: 2.8em; }

.chart-panel { padding-bottom: 10px; }
.chart { height: 280px; width: 100%; }
.chart-readout {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  display: flex; gap: 8px; align-items: center;
}
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 8px 16px 4px;
  color: var(--muted);
  font-size: 11px;
}
.lg::before {
  content: "";
  display: inline-block;
  width: 12px; height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: middle;
}
.lg.resist::before { background: rgba(255, 80, 100, 0.45); }
.lg.support::before { background: rgba(var(--green-rgb), 0.4); }
.lg.target::before { background: transparent; border-top: 2px dashed var(--cyan); width: 14px; height: 0; }
.lg.cone::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.35)); }

.hourly-list, .rounds { padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hourly-list.wide { padding: 12px 16px 16px; }
.hour-row, .round-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--space);
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(4, 10, 22, 0.35);
  border: 1px solid rgba(80,200,255,0.08);
}
.round-row { grid-template-columns: 92px 1fr auto; }
.hour-row .h, .round-row .h { font-weight: 600; }
.hour-row .d, .round-row .d { color: var(--muted); font-size: 12px; }
.call, .chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--line);
}
.call.SKIP, .call.NO, .chip.SKIP { color: var(--muted); }
.call.PENDING { color: var(--gold); border-color: rgba(var(--wait-rgb), 0.35); }
.call.BUY, .chip.ENTRY, .chip.BUY, .chip.WIN { color: var(--green); border-color: rgba(var(--green-rgb), 0.35); }
.call.SCALP { color: var(--gold); }
.pnl { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.pnl.pos { color: var(--green); text-shadow: 0 0 10px rgba(var(--mint-rgb), 0.45); }
.pnl.neg { color: var(--red); text-shadow: 0 0 10px rgba(var(--red-rgb), 0.4); }

.page-note { color: var(--muted); font-size: 13px; padding: 0 16px; margin: 12px 0 0; }
.settings-form { padding: 16px 18px 20px; max-width: 420px; }
.hint { color: var(--dim); font-size: 12px; margin: -4px 0 14px; }
.score-page { padding: 16px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: rgba(4, 18, 16, 0.45);
  border: 1px solid rgba(var(--mint-rgb), 0.14);
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 0 18px rgba(var(--mint-rgb), 0.04);
}
.stat .k { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.stat .v {
  font-family: "IBM Plex Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--mint);
  text-shadow: 0 0 14px rgba(var(--mint-rgb), 0.45);
}

.foot {
  margin-top: 8px;
  padding: 8px 4px 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}
.feed-meta { margin: 4px 0 0; color: var(--muted); }
.tabbar { display: none; }

/* Phone */
@media (max-width: 699px) {
  .app { grid-template-columns: 1fr; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 8px); }
  .sidebar { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(4, 16, 14, 0.94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
    z-index: 20;
    padding: 6px 6px var(--safe-b);
    gap: 4px;
  }
  .tabbar .nav-btn {
    text-align: center;
    font-size: 11px;
    padding: 8px 4px;
    border-radius: 999px;
    border: 0;
    background: transparent;
  }
  .tabbar .nav-btn.active {
    color: var(--nav-on-fg);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-hot), var(--accent));
    box-shadow: 0 0 14px rgba(var(--mint-rgb), 0.5);
  }
  .main { padding: 10px 10px 16px; }
  .live-metrics, .score-page { grid-template-columns: 1fr 1fr; }
  .view-live { gap: var(--space-2); }
  .live-head { padding: var(--space) var(--space) 0; }
  .info-table { grid-template-columns: 100px 1fr; padding: 8px 12px 12px; font-size: 12px; }

  .today-compact { padding: 6px 10px 10px; }
  .today-compact .today-pnl { font-size: 24px; }
  .gauge-pct { font-size: 26px; }
  .chart { height: 220px; }
  .dir-arrow { width: 24px; height: 24px; }
}
@media (min-width: 700px) and (max-width: 1100px) {
  .chart { height: 260px; }
  .sidebar { width: 180px; }
  .app { grid-template-columns: 180px 1fr; }
}
@media (max-width: 520px) {
  .live-metrics { grid-template-columns: 1fr; }
}

/* Auth tabs + watermark + account */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(4, 16, 14, 0.55);
  border: 1px solid var(--line);
}
.login-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
}
.login-tab.active {
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  color: var(--nav-on-fg);
  box-shadow: 0 0 16px rgba(var(--mint-rgb), 0.4);
}
.chart-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 85% at 50% 100%, rgba(var(--mint-rgb), 0.18), transparent 58%),
    radial-gradient(80% 50% at 80% 0%, rgba(var(--accent-rgb), 0.08), transparent 60%),
    rgba(2, 12, 12, 0.94);
  box-shadow: inset 0 0 40px rgba(var(--mint-rgb), 0.08), inset 0 0 0 1px rgba(var(--mint-rgb), 0.14);
}
.chart-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  user-select: none;
}
.chart-watermark, .chart-watermark .wm-inner { display: none !important; }
.account-box {
  margin: 0 18px 20px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(80,200,255,0.12);
  background: rgba(4,16,14,0.35);
  color: var(--muted);
  font-size: 13px;
  max-width: 420px;
}
.account-box b { color: var(--text); }


/* Today scoreboard */
.today-body { padding: 16px 18px 18px; }
.today-pnl {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-shadow: 0 0 18px color-mix(in srgb, currentColor 55%, transparent);
}
.today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.today-grid b {
  display: block;
  color: var(--mint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  text-shadow: 0 0 10px rgba(var(--mint-rgb), 0.35);
}

/* STATUS kicker + info table */
.status-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 2px;
}
.info-table {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 var(--space-2);
  padding: var(--space) var(--space-2) var(--space-2);
  font-size: var(--text-md);
  line-height: 1.35;
}
.info-table .k {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.info-table .v {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  white-space: pre-line;
}
.info-table .v.up, .info-table .v.calm { color: var(--green); }
.info-table .v.down { color: var(--red); }
.info-table .v.risky, .info-table .v.scalp { color: var(--gold); }
.info-table .v.muted, .info-table .v.flat { color: var(--muted); }
.more-btn {
  display: none;
  width: calc(100% - 36px);
  margin: 0 18px 14px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--cyan-2);
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.reset-view {
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan-2);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.reset-view:hover { background: rgba(var(--accent-rgb), 0.16); }

@media (max-width: 699px) {
  .info-table { padding: 2px 14px 8px; grid-template-columns: 96px 1fr; font-size: 12px; }
  .today-compact .today-pnl { font-size: 24px; }
}


#info-more { display: grid; }

/* Invisible leak-tracing layer — no readable text */
.desk-trace {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  mix-blend-mode: screen;
}
.app > *:not(.desk-trace):not(.sr-trace) { position: relative; z-index: 1; }
.sr-trace {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  opacity: 0;
  color: transparent;
  font-size: 1px;
  pointer-events: none;
}

/* Info icons + tooltip */
.info-btn {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(122, 240, 255, 0.45);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--cyan-2);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  vertical-align: middle;
}
.info-btn:hover, .info-btn:focus-visible {
  background: rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.35);
}
.panel-h h2 { display: inline-flex; align-items: center; }
.status-kicker { display: inline-flex; align-items: center; gap: 0; }
.tip {
  position: fixed;
  z-index: 80;
  max-width: min(280px, 86vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(80, 220, 255, 0.35);
  background: rgba(6, 18, 16, 0.96);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(var(--accent-rgb), 0.12);
  pointer-events: none;
}
.lg { display: inline-flex; align-items: center; }
.lg.trend::before {
  content: "";
  width: 10px; height: 0;
  border-top: 1.5px dashed rgba(122, 240, 255, 0.7);
  margin-right: 6px;
}

/* Hourly live badge */
.hourly-now { padding: 12px 16px 4px; }
.hour-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(var(--mint-rgb), 0.22);
  background: rgba(4, 18, 16, 0.45);
  box-shadow: inset 0 0 22px rgba(var(--mint-rgb), 0.06);
}
.hour-badge .call-word {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 16px currentColor;
}
.hour-badge .call-word.BUY, .hour-badge .call-word.SCALP { color: var(--green); }
.hour-badge .call-word.SKIP, .hour-badge .call-word.NOTRADE { color: var(--muted); }
.hour-badge .call-word.PENDING { color: var(--gold); }
.hour-badge .call-word.WIN { color: var(--green); }
.hour-badge .call-word.LOSS { color: var(--red); }
.hour-meta { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1 1 180px; }
.hour-row .call.SKIP, .hour-row .call.PENDING, .hour-row .call.\— { color: var(--muted); }
.hourly-hist-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}

/* Track record */
.track-panel { margin-top: 12px; }
.view-live .track-panel { /* desktop: full width under live-bottom */ }
.track-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
}
.track-toggle .chev { color: var(--muted); transition: transform 0.2s ease; }
.track-panel.collapsed .chev { transform: rotate(-90deg); }
.track-body { padding: 12px 16px 18px; }
.track-panel.collapsed .track-body { display: none; }
.track-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 24px;
  align-items: center;
}
.track-ring-wrap { position: relative; width: 110px; height: 110px; }
.track-ring { width: 110px; height: 110px; }
.track-stats { display: grid; gap: 10px; }
.track-stat .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.track-stat .v {
  font-size: 24px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--mint);
  text-shadow: 0 0 12px rgba(var(--mint-rgb), 0.4);
}
.track-split { display: flex; flex-wrap: wrap; gap: 8px; }
.track-split .pill { font-size: 11px; }
.track-grid-label {
  margin: 16px 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}
.rr-block { margin: 0; }
.rr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  min-height: 32px;
}
.rr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 11px;
  font-weight: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rr-toggle:hover { color: var(--text); }
.rr-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.rr-count { letter-spacing: 0.08em; }
.rr-chev {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}
.rr-block:not(.is-collapsed) .rr-chev { transform: rotate(90deg); }
.rr-block.is-collapsed .rr-body,
.rr-body[hidden] { display: none; }
@media (max-width: 699px) {
  .rr-head, .rr-toggle { min-height: 40px; }
}
.wl-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 4px;
  max-width: 560px;
}
.wl-grid-dir {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.wl-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  min-height: 12px;
  background: rgba(80, 200, 255, 0.12);
}
.wl-cell.W { background: var(--green); box-shadow: 0 0 6px rgba(var(--green-rgb), 0.35); }
.wl-cell.L { background: var(--red); box-shadow: 0 0 6px rgba(var(--red-rgb), 0.3); }
.wl-cell.F { background: var(--muted); }
.track-table-wrap { overflow-x: auto; margin-top: 14px; }
.track-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.track-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid rgba(80, 200, 255, 0.15);
  font-weight: 600;
}
.track-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(80, 200, 255, 0.08);
  white-space: nowrap;
  color: var(--text);
}
.badge-mini {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.badge-mini.WIN { color: var(--green); border: 1px solid rgba(var(--green-rgb), 0.4); background: rgba(var(--green-rgb), 0.1); }
.badge-mini.LOSS { color: var(--red); border: 1px solid rgba(var(--red-rgb), 0.4); background: rgba(var(--red-rgb), 0.1); }
.badge-mini.LIVE, .badge-mini.PENDING { color: var(--gold); border: 1px solid rgba(var(--wait-rgb), 0.4); background: rgba(var(--wait-rgb), 0.1); }
.badge-mini.SKIP { color: var(--muted); border: 1px solid rgba(138, 160, 184, 0.35); background: rgba(138, 160, 184, 0.08); }
.call-up { color: var(--green); }
.call-dn { color: var(--red); }

/* Cheat sheet */
.sheet-panel { padding-bottom: 20px; }
.sheet-h {
  padding: 6px 18px 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}
.sheet-grid, .rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.sheet-card, .rule-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(80, 200, 255, 0.16);
  background: rgba(4, 10, 22, 0.4);
}
.badge {
  display: inline-block;
  font-family: "DM Sans", "IBM Plex Mono", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  padding: 6px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.badge.BUY { color: #062; background: rgba(var(--green-rgb), 0.16); border: 1px solid rgba(var(--green-rgb), 0.45); color: var(--green); }
.badge.SCALP { color: #c9a0ff; background: rgba(170, 110, 255, 0.16); border: 1px solid rgba(170, 110, 255, 0.45); }
.badge.SELL { color: #ffd56a; background: rgba(var(--wait-rgb), 0.14); border: 1px solid rgba(var(--wait-rgb), 0.45); }
.badge.HOLD { color: var(--green); background: rgba(var(--green-rgb), 0.1); border: 1px solid rgba(var(--green-rgb), 0.3); }
.badge.TPOK { color: #ffd56a; background: rgba(var(--wait-rgb), 0.1); border: 1px solid rgba(var(--wait-rgb), 0.3); }
.badge.WAIT { color: var(--muted); background: rgba(138, 160, 184, 0.1); border: 1px solid rgba(138, 160, 184, 0.3); }
.badge.NOTRADE { color: var(--muted); background: rgba(138, 160, 184, 0.08); border: 1px solid rgba(93, 115, 140, 0.35); }
.sheet-do { color: var(--text); font-size: 13px; line-height: 1.4; }
.sheet-ex { color: var(--muted); font-size: 12px; line-height: 1.35; margin: -2px 0 8px; }
.rule-k {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan-2);
  margin-bottom: 6px;
}
.rule-k.SCALP { color: #c9a0ff; }
.rule-k.SELL { color: var(--gold); }
.rule-v { font-size: 14px; color: var(--text); line-height: 1.4; }

@media (max-width: 699px) {
  .track-panel { grid-area: track; margin-top: 0; }
  .tabbar .nav-btn { font-size: 10px; padding: 8px 2px; }
  .track-top { grid-template-columns: 1fr; justify-items: start; }
  .wl-grid { grid-template-columns: repeat(10, 1fr); }
  .hour-badge .call-word { font-size: 22px; }
  .sheet-grid, .rules-grid { grid-template-columns: 1fr; }
}

@media (min-width: 700px) {
  #track-more { display: none; }
}

.mobile-brand { display: none; }
@media (max-width: 699px) {
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 10px;
  }
  .mobile-brand .login-mark.sm { width: 42px; height: 42px; font-size: 13px; }
  .mobile-brand .brand-name { font-size: 22px; }
}

/* ===== Sci-fi page FX (behind the desk) ===== */
.fx-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--bg);
}
.fx-glow {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(920px 560px at 0% 100%, var(--glow-1), transparent 58%),
    radial-gradient(880px 520px at 100% 8%, var(--glow-2), transparent 55%),
    radial-gradient(760px 520px at 8% -8%, var(--glow-3), transparent 58%),
    radial-gradient(700px 460px at 92% 110%, var(--glow-4), transparent 55%),
    radial-gradient(640px 420px at 78% 0%, var(--glow-5), transparent 58%);
}
.fx-dots {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image: radial-gradient(circle at 6px 6px, var(--dot) 0.55px, transparent 0.85px);
  background-size: 12px 12px;
}
.fx-twinkle {
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background-image:
    radial-gradient(circle at 12% 18%, var(--twinkle-1) 0 1px, transparent 8px),
    radial-gradient(circle at 78% 12%, var(--twinkle-2) 0 1px, transparent 9px),
    radial-gradient(circle at 42% 8%, var(--twinkle-3) 0 1px, transparent 7px),
    radial-gradient(circle at 88% 42%, var(--twinkle-1) 0 1px, transparent 8px),
    radial-gradient(circle at 18% 62%, var(--twinkle-2) 0 1px, transparent 7px),
    radial-gradient(circle at 62% 78%, var(--twinkle-1) 0 1px, transparent 9px),
    radial-gradient(circle at 8% 88%, var(--twinkle-3) 0 1px, transparent 6px),
    radial-gradient(circle at 92% 86%, var(--twinkle-2) 0 1px, transparent 8px);
  animation: twinkle-soft 7s ease-in-out infinite;
}
@keyframes twinkle-soft {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.5; }
}
.fx-hex {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background:
    url("/static/fx/hex.svg") 10px 10px / 36px 21px no-repeat,
    url("/static/fx/hex.svg") calc(100% - 10px) 10px / 36px 21px no-repeat,
    url("/static/fx/hex.svg") 10px calc(100% - 10px) / 36px 21px no-repeat,
    url("/static/fx/hex.svg") calc(100% - 10px) calc(100% - 10px) / 36px 21px no-repeat;
  filter: var(--fx-filter);
}
.fx-circuit {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background: url("/static/fx/circuit.svg") repeat;
  background-size: 720px 480px;
  filter: var(--fx-filter);
}
.fx-grid {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -8%;
  height: 72%;
  background-image:
    linear-gradient(rgba(var(--mint-rgb), 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--mint-rgb), 0.18) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 45%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.45) 45%, transparent 85%);
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.12);
  animation: grid-drift 48s linear infinite;
}
@keyframes grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 44px, 44px 0; }
}
.fx-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.18) 2px 3px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
  animation: scan-shift 10s linear infinite;
}
@keyframes scan-shift {
  0% { background-position: 0 0; }
  100% { background-position: 0 12px; }
}
.fx-shimmer {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(var(--accent-rgb), 0.10) 50%,
    rgba(var(--purple-rgb), 0.08) 54%,
    transparent 62%
  );
  background-size: 220% 100%;
  animation: shimmer-pan 16s ease-in-out infinite;
}
@keyframes shimmer-pan {
  0% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}
.fx-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Section header icons */
.panel-h h2::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  flex: 0 0 14px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.55);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='black'/%3E%3C/svg%3E");
}
.live-round .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='black'/%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='black'/%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
}
.today-panel .panel-h h2::before, .score-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M2 6.5h12' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M5 2v2.5M11 2v2.5' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M2 6.5h12' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M5 2v2.5M11 2v2.5' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
}
.flip-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 12a6 6 0 1 1 12 0' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 12l3.2-4' stroke='black' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='12' r='1.3' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 12a6 6 0 1 1 12 0' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 12l3.2-4' stroke='black' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='12' r='1.3' fill='black'/%3E%3C/svg%3E");
}
.chart-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 12V7M7 12V4M11 12V8' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M2 13.5h12' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 12V7M7 12V4M11 12V8' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M2 13.5h12' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E");
}
.hourly-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 4.5V8l2.8 1.8' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 4.5V8l2.8 1.8' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
}
.recent-panel .panel-h h2::before, .history-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 4h10M3 8h10M3 12h7' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 4h10M3 8h10M3 12h7' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
}
.track-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='black'/%3E%3C/svg%3E");
}
.sheet-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 2.5h7.5L13 5.5V13.5H3z' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M10.5 2.5V5.5H13' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 2.5h7.5L13 5.5V13.5H3z' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M10.5 2.5V5.5H13' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");
}
.settings-panel .panel-h h2::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='2.3' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 1.6v1.8M8 12.6v1.8M1.6 8h1.8M12.6 8h1.8M3.2 3.2l1.3 1.3M11.5 11.5l1.3 1.3M3.2 12.8l1.3-1.3M11.5 4.5l1.3-1.3' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='2.3' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 1.6v1.8M8 12.6v1.8M1.6 8h1.8M12.6 8h1.8M3.2 3.2l1.3 1.3M11.5 11.5l1.3 1.3M3.2 12.8l1.3-1.3M11.5 4.5l1.3-1.3' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Accent dividers */
.info-table {
  border-top: 1px solid transparent;
  box-shadow: 0 -1px 0 rgba(var(--purple-rgb), 0.12);
}
.today-pnl, .hour-badge, .track-top {
  position: relative;
}
.foot {
  border-top: 1px solid transparent;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.25), rgba(var(--purple-rgb), 0.25), transparent) top / 100% 1px no-repeat;
}
.sheet-h {
  position: relative;
}
.sheet-h::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--accent), var(--purple), transparent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.35);
}

.desk-trace { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .fx-grid, .fx-scan, .fx-shimmer, .fx-twinkle, .status-word { animation: none !important; }
}

@media (max-width: 699px) {
  .status-word { font-size: 20px; padding: 6px 10px; }
  .glass, .panel {
    box-shadow:
      0 0 0 1px rgba(var(--mint-rgb), 0.14),
      0 0 12px rgba(var(--mint-rgb), 0.18),
      0 10px 28px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(210, 255, 240, 0.12),
      inset 0 0 20px rgba(var(--mint-rgb), 0.05);
  }
  .today-pnl { font-size: 34px; }
  .stat .v { font-size: 24px; }
}

/* ===== Compact top cards + redesigned flip meter ===== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.panel-h { cursor: pointer; }
.panel-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  flex: 0 0 26px;
  background: rgba(var(--mint-rgb), 0.10);
  border: 1px solid rgba(var(--mint-rgb), 0.35);
  color: var(--mint);
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(var(--mint-rgb), 0.2);
}
.panel-toggle:hover { background: rgba(var(--mint-rgb), 0.2); }
.panel-toggle .chev { display: inline-block; transition: transform 0.2s ease; font-size: 15px; line-height: 1; filter: drop-shadow(0 0 6px rgba(var(--mint-rgb), 0.55)); }
.compact-panel.collapsed .panel-toggle .chev { transform: rotate(-90deg); }
.compact-panel .panel-details { display: none; }
.compact-panel:not(.collapsed) .panel-details { display: block; }
.compact-face { cursor: pointer; }

.live-round .panel-h .pill { margin-left: auto; }

.live-compact {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 6px 14px 12px;
}
.live-compact .status-word {
  font-size: 18px;
  padding: 5px 10px;
}
.ring-wrap.sm-chip {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
}
.ring-wrap.sm-chip .ring-time { font-size: 11px; }
.ring-wrap.sm-chip .ring-sub { font-size: 8px; letter-spacing: 0.06em; }
.vs-chip { min-width: 0; }
.vs-val {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--mint);
  text-shadow: 0 0 10px rgba(var(--mint-rgb), 0.35);
  line-height: 1.2;
}
.vs-val.down { color: var(--red); text-shadow: 0 0 10px rgba(var(--red-rgb), 0.35); }

.today-compact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 14px;
}
.today-compact .today-pnl {
  font-size: 28px;
  margin: 0;
}
.today-wl {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--mint);
  text-shadow: 0 0 10px rgba(var(--mint-rgb), 0.35);
  letter-spacing: -0.02em;
}
.today-panel .panel-details { padding: 0 14px 12px; }

.flip-compact { padding: 0 10px 12px; }
.gauge { position: relative; max-width: 260px; margin: 0 auto; }
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.g-track-under {
  fill: none;
  stroke: rgba(8, 28, 26, 0.95);
  stroke-width: 20;
  stroke-linecap: round;
}
.g-track-grad {
  fill: none;
  stroke: url(#flip-grad);
  stroke-width: 16;
  stroke-linecap: round;
}
.g-tick { stroke: rgba(184, 255, 232, 0.38); stroke-width: 1.4; stroke-linecap: round; }
.g-tick.major { stroke: rgba(210, 255, 245, 0.75); stroke-width: 2; }
.g-needle {
  stroke: var(--text);
  stroke-width: 2.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(var(--mint-rgb), 0.65));
}
.g-knob {
  fill: var(--hi);
  stroke: var(--accent-hot);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(var(--mint-rgb), 0.95)) drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.6));
}
.g-hub {
  fill: var(--hub);
  stroke: var(--accent-hot);
  stroke-width: 2;
}
.gauge-center {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(3, 17, 15, 0.94) 0 62%, rgba(3, 17, 15, 0) 78%);
  padding: 10px 16px 8px;
  min-width: 96px;
}
.gauge-pct {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--mint);
  text-shadow: 0 0 16px rgba(var(--mint-rgb), 0.6), 0 0 28px rgba(var(--accent-rgb), 0.25);
}
.gauge-pct.down {
  color: var(--down-2);
  text-shadow: 0 0 16px rgba(var(--red-rgb), 0.55);
}
.gauge-pct-label {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.flip-risk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 0 6px;
}
.flip-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid rgba(138, 160, 184, 0.35);
  background: rgba(6, 18, 16, 0.7);
}
.flip-pill.LOW {
  color: var(--green);
  border-color: rgba(var(--mint-rgb), 0.7);
  background: rgba(var(--mint-rgb), 0.12);
  box-shadow: 0 0 10px rgba(var(--mint-rgb), 0.35);
}
.flip-pill.MEDIUM {
  color: var(--gold);
  border-color: rgba(var(--wait-rgb), 0.7);
  background: rgba(var(--wait-rgb), 0.10);
  box-shadow: 0 0 10px rgba(var(--wait-rgb), 0.3);
}
.flip-pill.HIGH {
  color: var(--down-2);
  border-color: rgba(var(--red-rgb), 0.7);
  background: rgba(var(--red-rgb), 0.12);
  box-shadow: 0 0 10px rgba(var(--red-rgb), 0.35);
}
.flip-bar {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(8, 28, 26, 0.85);
  box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.18);
}
.flip-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--accent), var(--mint));
  box-shadow: 0 0 8px rgba(var(--mint-rgb), 0.4);
  min-width: 8px;
}
.flip-bar-knob {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--hi);
  border: 2px solid var(--accent-hot);
  box-shadow: 0 0 8px rgba(var(--mint-rgb), 0.85);
  pointer-events: none;
}
.flip-rows { padding: 2px 14px 6px; }
.flip-kv {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(80, 200, 255, 0.1);
  font-size: 13px;
  line-height: 1.35;
}
.flip-kv .k {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.flip-kv .v { color: var(--text); white-space: pre-line; }
.flip-kv .v.up { color: var(--green); }
.flip-kv .v.down { color: var(--red); }
.flip-why {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 2px 14px 12px;
  min-height: 0;
}

@media (max-width: 699px) {
  .flip-kv { grid-template-columns: 1fr; gap: 2px; }
  .ring-wrap.sm-chip { width: 48px; height: 48px; flex-basis: 48px; }
  .today-wl { font-size: 14px; }
  .vs-val { font-size: 12px; }
}

.more-link {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent-2);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.more-link:hover { background: rgba(var(--accent-rgb), 0.08); }
.theme-setting {
  margin: 16px 18px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 420px;
}
.theme-setting-k {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-swatch {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: 600;
}
.theme-swatch.active, .theme-swatch[aria-checked="true"] {
  color: var(--nav-on-fg);
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
}
.theme-swatch[data-theme-pick="best"] { box-shadow: inset 0 0 0 1px rgba(92,225,255,0.25); }
#hourly-panel .hourly-list { max-height: none; }
.track-panel .rounds { padding: 0; }
.status-word { font-family: var(--font-display); }
.today-pnl, .gauge-pct, .ring-time, .stat .v, .track-stat .v, .vs-val {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 699px) {
  .status-word { font-size: 20px; }
  .chart { height: 220px; }
  .track-panel { margin-top: 0; }
}

.live-round .panel-h, .chart-panel .panel-h, .hourly-panel .panel-h { cursor: default; }

/* ===== designer polish ===== */
.info-table {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
}
.info-table .k {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  white-space: nowrap;
}
.info-table .k .info-btn {
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: 1px;
}
@media (max-width: 699px) {
  .info-table {
    grid-template-columns: max-content minmax(0, 1fr);
    padding: 4px 12px 10px;
    font-size: 12px;
  }
}
.more-link {
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 4px auto 10px;
  padding: 6px 14px;
}
.more-link[hidden] { display: none !important; }
#info-more.hidden, #info-more[hidden] { display: none !important; }
.flip-panel .compact-face {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 699px) {
  .tabbar {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top-color: var(--line);
  }
}

/* ===== desk layout v2 + texture ===== */

/* Page texture: fine glowing dot grid + twinkles, visible in every theme.
   The app shell stays transparent so the grid shows in the gutters. */
.app, .login-view, .main, .view { background: transparent !important; }
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  grid-template-columns: none;
}
.sidebar { display: none !important; }

.fx-bg { z-index: 0; background-color: transparent; }
.fx-dots {
  opacity: 0.58;
  background-image: radial-gradient(circle at 6px 6px, var(--dot) 0.75px, transparent 1.1px);
  background-size: 14px 14px;
}
.fx-twinkle {
  opacity: 0.95;
  background-image:
    radial-gradient(circle at 12% 18%, var(--twinkle-1) 0 1.2px, transparent 9px),
    radial-gradient(circle at 78% 12%, var(--twinkle-2) 0 1.2px, transparent 10px),
    radial-gradient(circle at 42% 8%, var(--twinkle-3) 0 1px, transparent 8px),
    radial-gradient(circle at 88% 42%, var(--twinkle-1) 0 1.2px, transparent 9px),
    radial-gradient(circle at 18% 62%, var(--twinkle-2) 0 1px, transparent 8px),
    radial-gradient(circle at 62% 78%, var(--twinkle-1) 0 1.2px, transparent 10px),
    radial-gradient(circle at 8% 88%, var(--twinkle-3) 0 1px, transparent 7px),
    radial-gradient(circle at 92% 86%, var(--twinkle-2) 0 1.2px, transparent 9px),
    radial-gradient(circle at 50% 48%, var(--twinkle-1) 0 1px, transparent 8px),
    radial-gradient(circle at 30% 30%, var(--twinkle-3) 0 1px, transparent 7px);
}
.fx-hex, .fx-circuit { filter: none; opacity: 0.12; }
:root, [data-theme="best"], [data-theme="teal"], [data-theme="purple"], [data-theme="blue"], [data-theme="gold"] {
  --fx-filter: none;
}
.glass::before, .panel::before {
  opacity: 0.48;
  background-image:
    radial-gradient(80% 50% at 8% 0%, rgba(var(--accent-rgb), 0.12), transparent 60%),
    radial-gradient(70% 50% at 100% 100%, rgba(var(--purple-rgb), 0.10), transparent 60%),
    radial-gradient(circle at 6px 6px, var(--dot) 0.7px, transparent 1.05px);
  background-size: auto, auto, 12px 12px;
}

/* Slim desktop header */
.desk-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 78%, transparent);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 12;
  box-shadow: 0 1px 0 var(--inset), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.desk-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.desk-brand .login-mark.sm { width: 36px; height: 36px; font-size: 12px; margin: 0; padding: 0; }
.desk-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.desk-nav .nav-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.desk-nav .nav-btn[data-view="live"].active {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.desk-header-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn.ghost.sm { width: auto; padding: 6px 10px; font-size: 12px; }

.mobile-brand { display: none; }
.fit-toggle {
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fit-toggle.active {
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  color: var(--nav-on-fg);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
}

/* Ticker row + 3 equal columns */
.view-live { gap: 16px; }
.ticker-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}
.ticker-card { padding: 12px 16px; }
.ticker-k {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticker-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.ticker-px {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ticker-side {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.ticker-side.up { color: var(--green); background: rgba(var(--green-rgb), 0.12); border-color: rgba(var(--green-rgb), 0.35); }
.ticker-side.down { color: var(--red); background: rgba(var(--red-rgb), 0.12); border-color: rgba(var(--red-rgb), 0.35); }
.ticker-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.live-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.live-cols > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.signal-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding: 12px 16px 8px;
}
.signal-side {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.signal-side.up { color: var(--green); text-shadow: 0 0 18px rgba(var(--green-rgb), 0.45); }
.signal-side.down { color: var(--red); text-shadow: 0 0 18px rgba(var(--red-rgb), 0.4); }
.panel-h-note {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  padding: 4px 16px 16px;
  flex: 1;
}
.info-cell {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.info-cell .k {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.info-cell .k .info-btn { margin-left: 0; }
.info-cell .v {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
  margin-top: 2px;
  line-height: 1.35;
}
.info-cell .v.up, .info-cell .v.calm { color: var(--green); }
.info-cell .v.down { color: var(--red); }
.info-cell .v.risky, .info-cell .v.scalp { color: var(--gold); }
.info-cell .v.muted, .info-cell .v.flat { color: var(--muted); }

.flip-panel .flip-compact { padding: 4px 12px 8px; }
.flip-panel .flip-rows { padding: 0 16px 8px; }
.flip-panel .flip-why { padding: 0 16px 12px; margin: 0; }

.kalshi-card { padding-bottom: 12px; }
.kl-ticker {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 16px 0;
  letter-spacing: 0.04em;
  word-break: break-all;
  font-family: var(--font-mono);
}
.kl-block { padding: 8px 16px 4px; }
.kl-target {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.03em;
  text-shadow: 0 0 16px color-mix(in srgb, var(--gold) 55%, transparent);
}
.kl-vs {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}
.kl-vs.up { color: var(--green); }
.kl-vs.down { color: var(--red); }
.kl-asks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 16px;
}
.kl-ask {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 var(--inset);
}
.kl-ask .k {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kl-ask .v {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}
.window-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.window-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gauge-a), var(--gauge-b), var(--gauge-c));
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.45);
}
.window-bar-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }
.kl-hourly { padding: 8px 16px 4px; }
.kl-hourly .hour-badge { padding: 10px 12px; }
.kl-hourly .hour-badge.quiet { background: transparent; box-shadow: none; }

.admin-today-box {
  margin: 16px 18px 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-width: 420px;
}

/* Desktop chart height so the 3-col + chart fit a 1440x900 fold */
@media (min-width: 700px) {
  .mobile-brand, .tabbar { display: none !important; }
  .chart { height: 220px; }
  .main { padding: 16px 16px 24px; }
  .app { grid-template-columns: none; }
}

@media (max-width: 699px) {
  .desk-header { display: none; }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 10px;
  }
  .ticker-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ticker-card { padding: 8px 10px; }
  .ticker-px { font-size: 15px; }
  .live-cols { grid-template-columns: 1fr; gap: 12px; }
  .signal-side { font-size: 28px; }
  .info-grid { gap: 0 12px; padding: 4px 12px 12px; }
  .chart { height: 200px; }
  .tabbar {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top-color: var(--line);
  }
}

/* Phone Fit / One-screen: everything in 390x844, no scroll */
@media (max-width: 699px) {
  html[data-layout="fit"],
  html[data-layout="fit"] body {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  html[data-layout="fit"] .app {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  html[data-layout="fit"] .main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
  }
  html[data-layout="fit"] .view-live {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 6px;
  }
  html[data-layout="fit"] .mobile-brand { padding: 0 2px 4px; }
  html[data-layout="fit"] .mobile-brand .login-mark.sm { width: 28px; height: 28px; font-size: 10px; margin: 0; }
  html[data-layout="fit"] .mobile-brand .brand-name { font-size: 16px; }
  html[data-layout="fit"] .fit-toggle { padding: 4px 10px; font-size: 11px; }
  html[data-layout="fit"] .ticker-card { padding: 5px 8px; }
  html[data-layout="fit"] .ticker-k { font-size: 8px; }
  html[data-layout="fit"] .ticker-px { font-size: 13px; }
  html[data-layout="fit"] .ticker-sub { font-size: 10px; margin-top: 1px; }
  html[data-layout="fit"] .panel-h { padding: 5px 8px; }
  html[data-layout="fit"] .signal-head { padding: 4px 8px 2px; gap: 8px; }
  html[data-layout="fit"] .signal-side { font-size: 20px; }
  html[data-layout="fit"] .status-word { font-size: 16px; padding: 3px 8px; }
  html[data-layout="fit"] .info-grid { padding: 0 8px 6px; gap: 0 8px; }
  html[data-layout="fit"] .info-cell { padding: 2px 0; }
  html[data-layout="fit"] .info-cell .k,
  html[data-layout="fit"] .info-cell .v { font-size: 10px; line-height: 1.2; }
  html[data-layout="fit"] .info-cell .v {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }
  html[data-layout="fit"] .gauge { max-width: 168px; }
  html[data-layout="fit"] .gauge-pct { font-size: 18px; }
  html[data-layout="fit"] .flip-compact { padding: 0 8px 4px; }
  html[data-layout="fit"] .flip-rows,
  html[data-layout="fit"] .flip-why,
  html[data-layout="fit"] .chart-legend,
  html[data-layout="fit"] .foot,
  html[data-layout="fit"] .track-grid-label,
  html[data-layout="fit"] .rr-block,
  html[data-layout="fit"] #wl-grid,
  html[data-layout="fit"] #track-rounds,
  html[data-layout="fit"] #track-more,
  html[data-layout="fit"] .track-split,
  html[data-layout="fit"] .kl-ticker { display: none !important; }
  html[data-layout="fit"] .chart { height: 92px; min-height: 84px; max-height: 100px; }
  html[data-layout="fit"] .chart-panel { flex: 0 0 auto; }
  html[data-layout="fit"] .kl-target { font-size: 18px; }
  html[data-layout="fit"] .kl-vs { font-size: 13px; }
  html[data-layout="fit"] .kl-ask { padding: 4px 8px; }
  html[data-layout="fit"] .kl-ask .v { font-size: 14px; }
  html[data-layout="fit"] .kl-block { padding: 4px 8px; }
  html[data-layout="fit"] .kl-asks { padding: 4px 8px; gap: 6px; }
  html[data-layout="fit"] .kl-hourly { padding: 2px 8px 4px; }
  html[data-layout="fit"] .kl-hourly .hour-meta { display: none; }
  html[data-layout="fit"] .kl-hourly .call-word { font-size: 16px; }
  html[data-layout="fit"] .kl-hourly .hour-badge { padding: 6px 8px; }
  html[data-layout="fit"] .track-panel { flex: 0 0 auto; }
  html[data-layout="fit"] .track-top { padding: 4px 8px 6px; }
  html[data-layout="fit"] .track-ring-wrap,
  html[data-layout="fit"] .track-ring { width: 44px; height: 44px; }
  html[data-layout="fit"] #track-win { font-size: 11px; }
  html[data-layout="fit"] .tabbar {
    height: 52px;
    padding-top: 4px;
  }
}

/* Themed chrome (no leftover teal shells) */
@media (max-width: 699px) {
  .tabbar .nav-btn.active {
    background: linear-gradient(135deg, var(--accent-hot), var(--accent));
    color: var(--nav-on-fg);
  }
}

/* ===== nested cards (boxes within boxes) ===== */
.signal-head { display: block; padding: 12px 16px 4px; }
.action-box, .info-cell, .kl-block, .kl-ask, .flip-panel .flip-compact, .flip-rows, .track-top, .kl-hourly .hour-badge {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 var(--inset), inset 0 0 18px rgba(var(--accent-rgb), 0.05);
}
.action-box {
  margin: 4px 16px 12px;
  padding: 10px 12px;
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: inset 0 0 22px rgba(var(--accent-rgb), 0.12), 0 0 14px rgba(var(--accent-rgb), 0.12);
}
.action-box .status-word { margin-top: 4px; display: inline-block; }

/* Hours badge: small, right-aligned, just above the STATUS box (not inside it). Hidden when not calm. */
.hours-row {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  margin: 0 16px 4px;
  min-height: 0;
}
.hours-row:not([hidden]) {
  display: flex;
}
.hours-badge {
  display: inline-block;
  font-family: var(--font-display, Inter, system-ui, sans-serif);
  font-weight: 800;
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  white-space: nowrap;
}
.hours-row .info-btn {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-left: 0;
  font-size: 8px;
}
.hours-badge.calm {
  color: var(--green);
  border-color: rgba(var(--green-rgb), 0.45);
  background: rgba(var(--green-rgb), 0.10);
  box-shadow: 0 0 6px rgba(var(--green-rgb), 0.28);
}
.hourly-line {
  margin-top: 6px;
  font-family: var(--font-display, Inter, system-ui, sans-serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text);
}
.hourly-line .hourly-watch {
  color: var(--muted);
  font-weight: 600;
}
.hourly-line.up { color: var(--green); }
.hourly-line.down { color: var(--red); }
.hourly-line.skip, .hourly-line.watch {
  color: var(--gold);
}
html[data-layout="fit"] .hours-row { margin: 0 8px 2px; }
html[data-layout="fit"] .hours-badge { font-size: 7px; padding: 1px 4px; letter-spacing: 0.06em; }
html[data-layout="fit"] .hourly-line { margin-top: 3px; font-size: 10px; }
@media (max-width: 699px) {
  .hours-row { margin: 0 12px 4px; }
  .hours-badge { font-size: 8px; padding: 2px 5px; }
  .hourly-line { font-size: 11px; }
}

.info-grid { gap: 8px; padding: 0 16px 16px; align-content: start; }
.info-cell { padding: 8px 10px; border-top: 1px solid var(--line); }
.info-cell.wide, .info-grid .info-cell:nth-last-child(-n+2) { grid-column: span 1; }
.kl-block { margin: 8px 16px 0; padding: 8px 10px; }
.kl-asks { padding: 8px 16px 0; }
.kl-hourly { padding: 8px 16px 0; }
.flip-panel .flip-compact { margin: 12px 16px 8px; padding: 8px; }
.flip-rows { margin: 0 16px 8px; padding: 4px 10px; }
.track-top { margin: 12px 16px; padding: 12px; }
@media (max-width: 699px) {
  .action-box { margin: 4px 12px 10px; }
  .info-grid { padding: 0 12px 12px; gap: 6px; }
  .kl-block { margin: 6px 12px 0; }
  .kl-asks, .kl-hourly { padding: 6px 12px 0; }
  .flip-panel .flip-compact { margin: 8px 12px 6px; }
  .flip-rows { margin: 0 12px 8px; }
}
html[data-layout="fit"] .action-box { margin: 2px 8px 4px; padding: 4px 8px; }
html[data-layout="fit"] .info-grid { gap: 3px; padding: 0 8px 6px; }
html[data-layout="fit"] .info-cell { padding: 3px 6px; }
html[data-layout="fit"] .kl-block { margin: 3px 8px 0; padding: 3px 6px; }
html[data-layout="fit"] .flip-panel .flip-compact { margin: 4px 8px; padding: 2px; }
html[data-layout="fit"] .track-top { margin: 4px 8px; padding: 4px 8px; }
.ticker-card::after { display: none; }
.info-grid .info-cell:nth-last-child(-n+2) { grid-column: 1 / -1; }
html[data-layout="fit"] .info-grid .info-cell:nth-last-child(-n+2) { grid-column: auto; }

/* Fit: signal full width, meter + Kalshi side by side, tight stack, no overflow */
@media (max-width: 699px) {
  html[data-layout="fit"] .live-cols {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  html[data-layout="fit"] .signal-card { grid-column: 1 / -1; }
  html[data-layout="fit"] .ticker-row { gap: 6px; }
  html[data-layout="fit"] .ticker-side { padding: 1px 6px; font-size: 9px; }
  html[data-layout="fit"] .pill { font-size: 9px; padding: 2px 6px; }
  html[data-layout="fit"] .kalshi-card .panel-h { display: none; }
  html[data-layout="fit"] .window-bar-lbl { display: none; }
  html[data-layout="fit"] .kl-hourly .hour-badge { padding: 4px 6px; }
  html[data-layout="fit"] .chart-panel .panel-h { padding: 3px 8px; }
  html[data-layout="fit"] .chart-readout { font-size: 10px; }
  html[data-layout="fit"] .chart { height: 80px; min-height: 72px; max-height: 84px; }
  html[data-layout="fit"] .track-panel .track-toggle .chev { display: none; }
  html[data-layout="fit"] .track-stats .track-stat:last-of-type { display: none; }
  html[data-layout="fit"] .flip-risk-row { margin: 0 4px 4px; }
  html[data-layout="fit"] .gauge { max-width: 140px; }
}
@media (max-width: 699px) {
  html[data-layout="fit"] .flip-panel .panel-h { display: none; }
  html[data-layout="fit"] .kl-spot,
  html[data-layout="fit"] .kl-window { display: none; }
  html[data-layout="fit"] .signal-head { padding: 2px 8px 0; }
  html[data-layout="fit"] .signal-side { font-size: 16px; }
  html[data-layout="fit"] .action-box { margin: 2px 8px 4px; padding: 2px 8px; }
  html[data-layout="fit"] .info-cell .v {
    -webkit-line-clamp: 1;
    white-space: nowrap;
    display: block;
    text-overflow: ellipsis;
  }
  html[data-layout="fit"] .chart { height: 72px; min-height: 68px; max-height: 76px; }
  html[data-layout="fit"] .track-body { padding-bottom: 0; }
  html[data-layout="fit"] .panel::after { display: none; }
}
@media (max-width: 699px) {
  html[data-layout="fit"] .track-panel.collapsed .track-body { display: block !important; }
  html[data-layout="fit"] .chart { height: 68px; min-height: 64px; max-height: 70px; }
}
@media (max-width: 699px) {
  html[data-layout="fit"] .track-panel.collapsed .track-body { display: none !important; }
  .fit-track-line { display: none; }
  html[data-layout="fit"] .fit-track-line {
    display: inline;
    margin-left: auto;
    margin-right: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--mint);
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
  }
  html[data-layout="fit"] .chart { height: 72px; min-height: 68px; max-height: 76px; }
}
@media (max-width: 699px) {
  html[data-layout="fit"] .view-live { gap: 4px; }
  html[data-layout="fit"] .chart { height: 64px; min-height: 60px; max-height: 66px; }
}

/* ===== Glow pass: purple+teal bloom, without hurting Fit overflow ===== */
.glass, .panel {
  overflow: visible;
  box-shadow: var(--card-shadow);
}
.glass::after, .panel::after {
  filter:
    drop-shadow(0 0 3px var(--accent-hot))
    drop-shadow(0 0 5px var(--mint));
  background:
    linear-gradient(var(--mint), var(--mint)) 10px 10px / 18px 2px no-repeat,
    linear-gradient(var(--mint), var(--mint)) 10px 10px / 2px 18px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - 10px) 10px / 18px 2px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - 10px) 10px / 2px 18px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) 10px calc(100% - 10px) / 18px 2px no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) 10px calc(100% - 10px) / 2px 18px no-repeat,
    linear-gradient(var(--mint), var(--mint)) calc(100% - 10px) calc(100% - 10px) / 18px 2px no-repeat,
    linear-gradient(var(--mint), var(--mint)) calc(100% - 10px) calc(100% - 10px) / 2px 18px no-repeat;
}
.fx-glow {
  opacity: 1;
  background:
    radial-gradient(920px 560px at 0% 100%, var(--glow-1), transparent 58%),
    radial-gradient(880px 520px at 100% 8%, var(--glow-2), transparent 55%),
    radial-gradient(760px 520px at 8% -8%, var(--glow-3), transparent 58%),
    radial-gradient(700px 460px at 92% 110%, var(--glow-4), transparent 55%),
    radial-gradient(640px 420px at 78% 0%, var(--glow-5), transparent 58%),
    radial-gradient(520px 380px at 50% 45%, rgba(var(--accent-rgb), 0.10), transparent 70%);
}
.fx-dots { opacity: 0.62; }

/* Direction words: neon bloom like the ref */
.signal-side.up {
  color: #7dffc8;
  text-shadow:
    0 0 8px rgba(var(--green-rgb), 0.95),
    0 0 18px rgba(var(--green-rgb), 0.75),
    0 0 36px rgba(var(--green-rgb), 0.45),
    0 0 56px rgba(62, 224, 255, 0.25);
}
.signal-side.down {
  color: #ff6b82;
  text-shadow:
    0 0 8px rgba(var(--red-rgb), 0.95),
    0 0 18px rgba(var(--red-rgb), 0.7),
    0 0 36px rgba(var(--red-rgb), 0.4);
}

/* STATUS action box: large glowing panel tinted by state */
.action-box {
  border-width: 1px;
  border-style: solid;
}
.action-box .status-word {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 4px 0 0;
  animation: none;
  text-shadow:
    0 0 8px currentColor,
    0 0 20px color-mix(in srgb, currentColor 65%, transparent);
}
.action-box.tone-buy {
  color: #7dffc8;
  border-color: rgba(125, 255, 200, 0.8);
  background:
    linear-gradient(180deg, rgba(125, 255, 200, 0.16), rgba(20, 60, 40, 0.28));
  box-shadow:
    0 0 12px rgba(125, 255, 200, 0.45),
    0 0 28px rgba(80, 255, 180, 0.22),
    inset 0 0 22px rgba(80, 255, 180, 0.12),
    inset 0 1px 0 rgba(210, 255, 240, 0.25);
}
.action-box.tone-buy .status-word { color: #7dffc8; }
.action-box.tone-scalp {
  color: #E0B8FF;
  border-color: rgba(188, 108, 255, 0.8);
  background:
    linear-gradient(180deg, rgba(188, 108, 255, 0.18), rgba(40, 16, 64, 0.32));
  box-shadow:
    0 0 12px rgba(188, 108, 255, 0.5),
    0 0 28px rgba(176, 102, 255, 0.28),
    inset 0 0 22px rgba(188, 108, 255, 0.14),
    inset 0 1px 0 rgba(232, 210, 255, 0.28);
}
.action-box.tone-scalp .status-word { color: #E0B8FF; }
.action-box.tone-wait {
  color: #ffd56a;
  border-color: rgba(255, 213, 106, 0.75);
  background:
    linear-gradient(180deg, rgba(255, 213, 106, 0.16), rgba(50, 36, 8, 0.28));
  box-shadow:
    0 0 12px rgba(255, 213, 106, 0.4),
    0 0 24px rgba(255, 210, 63, 0.18),
    inset 0 0 22px rgba(255, 213, 106, 0.10),
    inset 0 1px 0 rgba(255, 240, 200, 0.22);
}
.action-box.tone-wait .status-word { color: #ffd56a; }
.action-box.tone-sell {
  color: #ffd56a;
  border-color: rgba(255, 210, 63, 0.85);
  background:
    linear-gradient(180deg, rgba(255, 210, 63, 0.18), rgba(50, 36, 8, 0.32));
  box-shadow:
    0 0 12px rgba(255, 210, 63, 0.5),
    0 0 28px rgba(255, 213, 106, 0.28),
    inset 0 0 22px rgba(255, 210, 63, 0.14),
    inset 0 1px 0 rgba(255, 240, 200, 0.28);
}
.action-box.tone-sell .status-word { color: #ffd56a; }

/* Big numbers: subtle text bloom, not on labels */
.ticker-px, .kl-target, .kl-ask .v, .kl-vs, .gauge-pct {
  text-shadow:
    0 0 8px color-mix(in srgb, currentColor 55%, transparent),
    0 0 18px color-mix(in srgb, currentColor 30%, transparent);
}
.gauge-pct {
  text-shadow:
    0 0 10px color-mix(in srgb, currentColor 70%, transparent),
    0 0 22px rgba(176, 102, 255, 0.35),
    0 0 28px rgba(62, 224, 255, 0.28);
}

/* Gauge arc: stronger purple-to-teal bloom */
.g-track-bloom {
  fill: none;
  stroke: url(#flip-grad);
  stroke-width: 26;
  stroke-linecap: round;
  opacity: 0.45;
}
.g-track-grad {
  filter: drop-shadow(0 0 4px #c084fc) drop-shadow(0 0 8px #3ee0ff);
}
.g-track-under { stroke: rgba(8, 6, 16, 0.92); }

[data-theme="blue"] .g-track-grad {
  filter: drop-shadow(0 0 4px #4d8dff) drop-shadow(0 0 8px #3ee0ff);
}

/* Don't let glow shadows add scroll in Fit; shadows don't affect box size anyway.
   Hide corner drop-shadow bloom only if it paints into the tab bar — keep it. */
@media (prefers-reduced-motion: reduce) {
  .action-box .status-word { animation: none !important; }
}

/* ===== De-dupe + chart prominence ===== */
.ticker-row { display: none !important; }

@media (min-width: 700px) {
  .main { padding: 12px 16px 16px; }
  .view-live { gap: 12px; }
  .live-cols { gap: 12px; }
  .panel-h { padding: 8px 12px; }
  .signal-head { padding: 8px 14px 4px; }
  .signal-side { font-size: 30px; }
  .action-box { margin: 4px 14px 8px; padding: 8px 10px; }
  .info-grid { padding: 0 14px 12px; gap: 6px; }
  .info-cell { padding: 6px 8px; }
  .flip-compact { padding: 4px 10px 6px; }
  .flip-why { padding: 0 14px 10px; min-height: 0; }
  .kl-block, .kl-asks, .kl-hourly { }
  .chart { height: 440px; }
  .chart-legend { padding: 6px 12px 8px; font-size: 11px; }
}

@media (max-width: 699px) {
  .view-live { display: flex; flex-direction: column; gap: 12px; }
  .live-cols { display: contents; }
  .signal-card { order: 1; }
  .chart-panel { order: 2; }
  .flip-panel { order: 3; }
  .kalshi-card { order: 4; }
  .track-panel { order: 5; }
  .chart { height: 300px; }
}

@media (max-width: 699px) {
  html[data-layout="fit"] .view-live {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  html[data-layout="fit"] .live-cols { display: contents; }
  html[data-layout="fit"] .signal-card {
    grid-column: 1 / -1;
    grid-row: 1;
    order: unset;
  }
  html[data-layout="fit"] .chart-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset;
  }
  html[data-layout="fit"] .flip-panel {
    grid-column: 1;
    grid-row: 3;
    order: unset;
  }
  html[data-layout="fit"] .kalshi-card {
    grid-column: 2;
    grid-row: 3;
    order: unset;
  }
  html[data-layout="fit"] .track-panel {
    grid-column: 1 / -1;
    grid-row: 4;
    order: unset;
  }
  html[data-layout="fit"] .chart {
    height: 152px;
    min-height: 140px;
    max-height: 168px;
  }
  html[data-layout="fit"] .kl-window { display: block; } /* window stays; unique here */
  html[data-layout="fit"] .chart-legend { display: none !important; }
}

/* Compact the 3-col row so a ~420px chart fits in a 1440x900 fold */
@media (min-width: 700px) {
  .desk-header { min-height: 52px; }
  .main { padding: 10px 16px 12px; }
  .view-live { gap: 10px; }
  .live-cols { gap: 10px; }
  .panel-h { padding: 6px 12px; }
  .signal-head { padding: 4px 12px 2px; }
  .signal-side { font-size: 26px; }
  .action-box { margin: 2px 12px 6px; padding: 5px 10px; }
  .action-box .status-word { font-size: 20px; }
  .info-grid { padding: 0 12px 8px; gap: 4px; }
  .info-cell { padding: 4px 8px; }
  .info-cell .k { font-size: 10px; }
  .info-cell .v { font-size: 12px; line-height: 1.25; }
  .flip-why { padding: 0 12px 8px; font-size: 11px; }
  .kl-ticker { padding-top: 4px; font-size: 10px; }
  .kl-target { font-size: 22px; }
  .chart { height: 420px; }
}
@media (min-width: 700px) {
  .info-grid .info-cell:nth-last-child(-n+2) { grid-column: auto; }
  .info-cell .v { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
  .chart { height: 420px; }
  .chart-legend { padding: 2px 12px 6px; gap: 10px; font-size: 10px; }
}

/* ===== Fit clip fix + laptop Pattern/Votes wrap ===== */

/* Laptop: Pattern & Votes span full width and can wrap 2 lines (no ellipsis). Chart ~400px. */
@media (min-width: 700px) {
  .info-grid .info-cell.wide,
  .info-grid .info-cell:nth-last-child(-n+2) {
    grid-column: 1 / -1;
  }
  .info-cell .v {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
    white-space: pre-line;
  }
  .info-grid .info-cell.wide .v,
  .info-grid .info-cell:nth-last-child(-n+2) .v {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
    /* 2-line wrap is allowed; full width means typical text fits without "..." */
  }
  .chart { height: 400px; }
}

/* Fit: Signal sizes to its rows; nothing may shrink or paint under the chart. */
@media (max-width: 699px) {
  html[data-layout="fit"] .view-live {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(72px, 1fr) auto auto;
    align-items: start;
    gap: 4px;
    overflow: hidden;
  }
  html[data-layout="fit"] .signal-card {
    min-height: min-content !important;
    height: auto !important;
    overflow: visible;
    align-self: start;
  }
  html[data-layout="fit"] .info-grid .info-cell.wide,
  html[data-layout="fit"] .info-grid .info-cell:nth-last-child(-n+2) {
    grid-column: 1 / -1;
  }
  html[data-layout="fit"] .info-cell .v {
    -webkit-line-clamp: unset !important;
    display: block !important;
    overflow: visible !important;
    white-space: pre-line !important;
    text-overflow: unset;
  }
  html[data-layout="fit"] .info-grid .info-cell.wide .v {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: pre-line !important;
  }
  /* Mid row: compact meter + Kalshi */
  html[data-layout="fit"] .flip-panel,
  html[data-layout="fit"] .kalshi-card {
    align-self: stretch;
    min-height: 0;
  }
  html[data-layout="fit"] .flip-why { display: none !important; }
  html[data-layout="fit"] .kl-window,
  html[data-layout="fit"] .kl-ticker { display: none !important; }
  html[data-layout="fit"] .gauge { max-width: 108px; margin: 0 auto; }
  html[data-layout="fit"] .gauge-pct { font-size: 16px; }
  html[data-layout="fit"] .kl-target { font-size: 16px; }
  html[data-layout="fit"] .kl-block { margin: 2px 6px 0; padding: 2px 6px; }
  html[data-layout="fit"] .kl-asks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 2px 6px;
    gap: 4px;
  }
  html[data-layout="fit"] .kl-ask { padding: 2px 6px; }
  html[data-layout="fit"] .kl-ask .v { font-size: 13px; }
  html[data-layout="fit"] .kl-hourly { padding: 2px 6px 4px; }
  html[data-layout="fit"] .kl-hourly .hour-meta { display: none !important; }
  html[data-layout="fit"] .kl-hourly .call-word { font-size: 14px; }
  html[data-layout="fit"] .chart-panel {
    min-height: 72px;
    align-self: stretch;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  html[data-layout="fit"] .chart-wrap { flex: 1; min-height: 0; }
  html[data-layout="fit"] .chart {
    flex: 1 1 auto;
    height: 100% !important;
    min-height: 72px !important;
    max-height: none !important;
  }
}

/* Pattern & Votes: wrap fully, no ellipsis, on laptop and Fit */
@media (min-width: 700px) {
  .info-grid .info-cell.wide .v,
  .info-grid .info-cell:nth-last-child(-n+2) .v {
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    white-space: pre-line !important;
    max-height: none !important;
  }
  .chart { height: 400px; }
}
@media (max-width: 699px) {
  html[data-layout="fit"] .info-grid .info-cell.wide .v,
  html[data-layout="fit"] .info-cell .v {
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    overflow: visible !important;
    white-space: pre-line !important;
    text-overflow: unset !important;
    max-height: none !important;
  }
}

/* ===== Fit v3: tall chart, dense Signal, one slim meter/Kalshi strip ===== */
.fit-strip { display: none !important; }
.signal-topline { display: contents; }

@media (max-width: 699px) {
  html[data-layout="fit"] .app {
    padding-bottom: 52px !important;
  }
  html[data-layout="fit"] .tabbar {
    height: 52px !important;
    padding: 4px 6px 0 !important;
  }
  html[data-layout="fit"] .mobile-brand {
    padding: 0 2px 2px !important;
    min-height: 0;
    gap: 8px;
  }
  html[data-layout="fit"] .mobile-brand .login-mark.sm { width: 26px; height: 26px; font-size: 9px; }
  html[data-layout="fit"] .mobile-brand .brand-name { font-size: 15px; }
  html[data-layout="fit"] .main {
    padding: 4px 8px 0 !important;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  html[data-layout="fit"] .foot { display: none !important; }

  html[data-layout="fit"] .view-live {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(230px, 1fr) 76px auto !important;
    align-items: stretch;
    gap: 4px !important;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  html[data-layout="fit"] .live-cols { display: contents; }

  /* Signal: auto height, never shrink under the chart */
  html[data-layout="fit"] .signal-card {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-height: min-content !important;
    height: auto !important;
    overflow: visible;
    align-self: start;
  }
  html[data-layout="fit"] .signal-card .panel-h { padding: 3px 8px !important; }
  html[data-layout="fit"] .signal-card .panel-h h2 { font-size: 11px; }

  /* Direction + STATUS on one row */
  html[data-layout="fit"] .signal-topline {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 8px 4px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  html[data-layout="fit"] .signal-topline:has(.action-box.tone-buy) {
    border-color: rgba(125, 255, 200, 0.65);
    background: rgba(20, 60, 40, 0.35);
    box-shadow: inset 0 0 16px rgba(80, 255, 180, 0.16), 0 0 10px rgba(80, 255, 180, 0.12);
  }
  html[data-layout="fit"] .signal-topline:has(.action-box.tone-scalp) {
    border-color: rgba(188, 108, 255, 0.65);
    background: rgba(40, 16, 64, 0.4);
    box-shadow: inset 0 0 16px rgba(188, 108, 255, 0.18), 0 0 10px rgba(176, 102, 255, 0.16);
  }
  html[data-layout="fit"] .signal-topline:has(.action-box.tone-wait) {
    border-color: rgba(255, 200, 80, 0.55);
    background: rgba(50, 36, 8, 0.4);
    box-shadow: inset 0 0 16px rgba(255, 200, 80, 0.16), 0 0 10px rgba(255, 200, 80, 0.12);
  }
  html[data-layout="fit"] .signal-topline:has(.action-box.tone-sell) {
    border-color: rgba(255, 210, 63, 0.7);
    background: rgba(50, 36, 8, 0.4);
    box-shadow: inset 0 0 16px rgba(255, 210, 63, 0.18), 0 0 10px rgba(255, 213, 106, 0.16);
  }
  html[data-layout="fit"] .signal-head {
    display: flex !important;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 0 !important;
    margin: 0;
    flex: 0 0 auto;
  }
  html[data-layout="fit"] .signal-side { font-size: 15px !important; line-height: 1.1; }
  html[data-layout="fit"] .signal-head .status-kicker,
  html[data-layout="fit"] .action-box .status-kicker { font-size: 8px; letter-spacing: 0.08em; }
  html[data-layout="fit"] .action-box {
    display: flex !important;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  html[data-layout="fit"] .action-box .status-word {
    margin-top: 0 !important;
    font-size: 15px !important;
    padding: 0 !important;
  }

  /* Dense one-line info rows; Pattern/Votes full width, 2-line max */
  html[data-layout="fit"] .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 6px !important;
    padding: 0 8px 6px !important;
  }
  html[data-layout="fit"] .info-cell {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    padding: 2px 5px !important;
    min-height: 0;
    overflow: hidden;
  }
  html[data-layout="fit"] .info-cell .k {
    flex: 0 0 auto;
    font-size: 9px !important;
    line-height: 1.2;
    white-space: nowrap;
  }
  html[data-layout="fit"] .info-cell .v {
    flex: 1 1 auto;
    font-size: 10px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    max-height: none !important;
  }
  html[data-layout="fit"] .info-cell .info-btn { display: none; }
  html[data-layout="fit"] .info-grid .info-cell.wide,
  html[data-layout="fit"] .info-grid .info-cell:nth-last-child(-n+2) {
    grid-column: 1 / -1 !important;
    align-items: flex-start;
  }
  html[data-layout="fit"] .info-cell.wide .v,
  html[data-layout="fit"] .info-grid .info-cell:nth-last-child(-n+2) .v {
    white-space: pre-line !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Hide original meter + Kalshi cards; show one slim strip */
  html[data-layout="fit"] .flip-panel,
  html[data-layout="fit"] .kalshi-card { display: none !important; }

  html[data-layout="fit"] .fit-strip {
    display: flex !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    height: 76px !important;
    max-height: 76px !important;
    min-height: 70px !important;
    align-items: center;
    padding: 0 8px;
    overflow: hidden;
  }
  html[data-layout="fit"] .fit-strip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  html[data-layout="fit"] .fit-strip-chance {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 44px;
    line-height: 1;
  }
  html[data-layout="fit"] .fit-strip-pct {
    font-family: var(--font-mono, "IBM Plex Mono", monospace);
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 8px currentColor;
  }
  html[data-layout="fit"] .fit-strip-pct.up { color: var(--up, #5bffc0); }
  html[data-layout="fit"] .fit-strip-pct.down { color: var(--down, #ff6b82); }
  html[data-layout="fit"] .fit-strip-pct-lbl {
    font-size: 8px;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 2px;
  }
  html[data-layout="fit"] .fit-strip .flip-pill {
    flex: 0 0 auto;
    font-size: 10px;
    padding: 3px 7px;
  }
  html[data-layout="fit"] .fit-strip-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
  }
  html[data-layout="fit"] .fit-strip-item .k {
    font-size: 8px;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-transform: uppercase;
  }
  html[data-layout="fit"] .fit-strip-item .v {
    font-family: var(--font-mono, "IBM Plex Mono", monospace);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 0 8px currentColor;
  }
  html[data-layout="fit"] .fit-hour-pill {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-transform: uppercase;
  }
  html[data-layout="fit"] .fit-hour-pill.SKIP { color: var(--muted); }
  html[data-layout="fit"] .fit-hour-pill.BUY,
  html[data-layout="fit"] .fit-hour-pill.WIN { color: #7dffc8; border-color: rgba(80,255,180,0.45); }
  html[data-layout="fit"] .fit-hour-pill.SCALP { color: #7af0ff; border-color: rgba(80,230,255,0.45); }

  /* Chart takes remaining height, at least 230px */
  html[data-layout="fit"] .chart-panel {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-height: 230px !important;
    max-height: none !important;
    align-self: stretch !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    padding-bottom: 0 !important;
  }
  html[data-layout="fit"] .chart-panel .panel-h { padding: 2px 8px !important; }
  html[data-layout="fit"] .chart-legend { display: none !important; }
  html[data-layout="fit"] .chart-wrap {
    flex: 1 1 auto;
    min-height: 230px;
    display: flex;
    flex-direction: column;
  }
  html[data-layout="fit"] .chart {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 230px !important;
    max-height: none !important;
    width: 100%;
  }

  /* Track: thin one-liner */
  html[data-layout="fit"] .track-panel {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden;
    align-self: stretch;
  }
  html[data-layout="fit"] .track-panel .panel-h { padding: 3px 8px !important; }
  html[data-layout="fit"] .track-panel .track-toggle { gap: 8px; width: 100%; }
  html[data-layout="fit"] .track-panel .track-toggle h2 { font-size: 11px; }
  html[data-layout="fit"] .track-panel .track-toggle .chev { display: none !important; }
  html[data-layout="fit"] .track-body,
  html[data-layout="fit"] .track-panel.collapsed .track-body { display: none !important; }
  html[data-layout="fit"] .fit-track-line {
    display: inline !important;
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--mint, #5bffc0);
    white-space: nowrap;
  }
}

@media (max-width: 699px) {
  html[data-layout="fit"] html,
  html[data-layout="fit"],
  html[data-layout="fit"] body {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
  }
  html[data-layout="fit"] .app {
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  html[data-layout="fit"] .tabbar {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 52px !important;
    height: 52px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px 6px 0 !important;
    z-index: 20;
  }
  html[data-layout="fit"] .main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  html[data-layout="fit"] .track-toggle .chev,
  html[data-layout="fit"] .track-panel .chev {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Hide market ticker on all views */
.kl-ticker { display: none !important; }

/* Flip-risk note in its own amber pill (same yellow as Target) */
.flip-panel .flip-why,
#flip-why.flip-why,
.flip-why {
  display: inline-block;
  max-width: calc(100% - 32px);
  margin: 8px 16px 14px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold);
  font-size: 12px;
  line-height: 1.4;
  min-height: 0;
  text-shadow: 0 0 10px color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow:
    0 0 16px color-mix(in srgb, var(--gold) 28%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--gold) 8%, transparent);
}
.flip-why[hidden] { display: none !important; }

.kl-ask .v.up, #kl-yes.up { color: var(--up); }
.kl-ask .v.down, #kl-no.down { color: var(--down); }

.tabbar.with-mail { grid-template-columns: repeat(8, 1fr); }
.mail-nav.has-unread::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent-hot);
  box-shadow: 0 0 8px var(--accent-hot);
  vertical-align: middle;
}
.foot-contact { margin: 8px 0 0; }
.foot-contact a { color: var(--label); text-decoration: none; font-size: 12px; }
.foot-contact a:hover { color: var(--hi); text-decoration: underline; }

.contact-setting { margin-top: 20px; }
.inbox-panel { padding-bottom: 16px; }
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 8px 12px 16px;
}
.inbox-list-col, .inbox-read-col { min-width: 0; }
.inbox-compose {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.03);
}
.inbox-compose.admin-hide { display: none; }
.inbox-compose h3 { margin: 0 0 10px; font-size: 14px; }
.inbox-form, .inbox-reply { display: grid; gap: 8px; }
.inbox-form label, .inbox-reply label { display: grid; gap: 4px; font-size: 11px; color: var(--label); }
.inbox-form input, .inbox-form select, .inbox-form textarea,
.inbox-reply textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  color: var(--text);
  font: 500 13px var(--font-sans);
  padding: 8px 10px;
}
.inbox-form .hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.inbox-threads { display: grid; gap: 6px; }
.inbox-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: inherit;
  padding: 8px 10px;
  cursor: pointer;
}
.inbox-item.active, .inbox-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.18);
}
.inbox-item.unread { box-shadow: inset 2px 0 0 var(--accent-hot); }
.inbox-item-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.inbox-item-preview { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-meta { color: var(--dim); font-size: 11px; margin-top: 2px; }
.inbox-thread-h { font-size: 13px; margin-bottom: 10px; color: var(--label); }
.inbox-msg-list { display: grid; gap: 8px; margin-bottom: 12px; }
.inbox-msg {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}
.inbox-msg.support {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.inbox-msg.member { background: rgba(255,255,255,0.03); }
.inbox-msg-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 4px; color: var(--label); }
.inbox-msg-b { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
@media (max-width: 699px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .tabbar.with-mail .nav-btn { font-size: 9px; padding: 6px 1px; }
}

/* Neon Wave: violet fog + floor-reflection red/orange glow under the cards */
[data-theme="wave"] .fx-glow {
  background:
    radial-gradient(1000px 640px at 50% -10%, rgba(138, 60, 255, 0.28), transparent 58%),
    radial-gradient(900px 520px at 8% 0%, rgba(30, 160, 255, 0.22), transparent 55%),
    radial-gradient(820px 480px at 100% 8%, rgba(255, 43, 214, 0.18), transparent 55%),
    radial-gradient(1100px 420px at 50% 112%, rgba(255, 45, 85, 0.38), transparent 58%),
    radial-gradient(900px 380px at 80% 118%, rgba(255, 106, 43, 0.28), transparent 55%),
    radial-gradient(640px 420px at 20% 100%, rgba(255, 45, 85, 0.22), transparent 58%);
}
[data-theme="wave"] .glass,
[data-theme="wave"] .panel {
  box-shadow: var(--card-shadow);
}
[data-theme="wave"] .glass::after,
[data-theme="wave"] .panel::after {
  filter:
    drop-shadow(0 0 4px #1EA0FF)
    drop-shadow(0 0 6px #FF2D55)
    drop-shadow(0 0 8px #FF6A2B);
}

/* Street: lime/cyan outlines on a crimson glow */
[data-theme="street"] .glass::after,
[data-theme="street"] .panel::after {
  filter:
    drop-shadow(0 0 4px #B2C935)
    drop-shadow(0 0 6px #7FE6F7);
}

/* Jellyfish: yellow glow wash on a black field */
[data-theme="jelly"] .fx-glow {
  background:
    radial-gradient(900px 600px at 50% 40%, rgba(5, 80, 110, 0.55), transparent 60%),
    radial-gradient(700px 480px at 20% 80%, rgba(126, 214, 196, 0.18), transparent 55%),
    radial-gradient(640px 400px at 80% 20%, rgba(255, 214, 0, 0.16), transparent 55%),
    radial-gradient(520px 360px at 70% 90%, rgba(108, 199, 10, 0.12), transparent 55%);
}

/* Easy on the Eyes: toned-down glow, faint dots, high-readability type */
[data-theme="calm"] .fx-glow {
  opacity: 0.28;
  background:
    radial-gradient(800px 500px at 20% 0%, rgba(255, 59, 59, 0.08), transparent 60%),
    radial-gradient(700px 420px at 90% 100%, rgba(255, 210, 63, 0.07), transparent 60%);
}
[data-theme="calm"] .fx-dots { opacity: 0.16; }
[data-theme="calm"] .fx-twinkle { opacity: 0.12; }
[data-theme="calm"] .glass::before,
[data-theme="calm"] .panel::before { opacity: 0.16; }
[data-theme="calm"] .glass::after,
[data-theme="calm"] .panel::after {
  filter: drop-shadow(0 0 2px rgba(255, 210, 63, 0.25));
}
[data-theme="calm"] .glass,
[data-theme="calm"] .panel {
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px);
}
[data-theme="calm"] .gauge-pct,
[data-theme="calm"] .kl-target,
[data-theme="calm"] .kl-ask .v,
[data-theme="calm"] .signal-side,
[data-theme="calm"] .status-word,
[data-theme="calm"] .ticker-px {
  text-shadow: 0 0 4px color-mix(in srgb, currentColor 35%, transparent);
}
[data-theme="calm"] .g-track-bloom,
[data-theme="calm"] .g-track-grad { filter: none; }
[data-theme="calm"] .flip-why {
  text-shadow: 0 0 6px color-mix(in srgb, var(--gold) 35%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 14%, transparent);
}

[data-theme="calm"] .signal-side.up {
  color: #7DCCA8;
  text-shadow: 0 0 6px rgba(125, 204, 168, 0.45);
}
[data-theme="calm"] .signal-side.down {
  color: #FF3B3B;
  text-shadow: 0 0 6px rgba(255, 59, 59, 0.45);
}
/* STATUS highlight colors are locked (see end of file); theme must not recolor them. */

/* --------------------------------------------------------------------------
   Neon Wave desktop vibrancy (>=1024px): match phone intensity on a wide 1x
   layout. Thicker neon-tube borders, bigger outer glows, denser light pools,
   glowing headers, bloom only on DIRECTION / STATUS / big numbers.
   Other themes are untouched. Small body/label text stays unsmeared.
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  [data-theme="wave"] {
    --glass: rgba(16, 10, 38, 0.90);
    --glass-top: rgba(32, 18, 64, 0.94);
    --glass-bot: rgba(12, 6, 24, 0.97);
    --grid-line: rgba(30, 160, 255, 0.26);
    --card-shadow:
      0 0 0 1px rgba(255, 45, 85, 0.5),
      0 0 24px rgba(30, 160, 255, 0.58),
      0 0 40px rgba(138, 60, 255, 0.52),
      0 0 32px rgba(255, 43, 214, 0.38),
      0 16px 44px rgba(255, 45, 85, 0.48),
      0 28px 64px rgba(255, 106, 43, 0.32),
      0 18px 44px rgba(0, 0, 0, 0.62),
      inset 0 1px 0 rgba(200, 180, 255, 0.22),
      inset 0 0 48px rgba(138, 60, 255, 0.10);
  }
  [data-theme="wave"] .glass,
  [data-theme="wave"] .panel {
    border-width: 2px;
    box-shadow: var(--card-shadow);
  }
  [data-theme="wave"] .fx-glow {
    background:
      radial-gradient(70% 62% at 10% 0%, rgba(30, 160, 255, 0.46), transparent 58%),
      radial-gradient(62% 58% at 90% 0%, rgba(138, 60, 255, 0.52), transparent 55%),
      radial-gradient(55% 50% at 50% 6%, rgba(255, 43, 214, 0.36), transparent 60%),
      radial-gradient(42% 48% at 28% 46%, rgba(138, 60, 255, 0.26), transparent 70%),
      radial-gradient(42% 48% at 74% 52%, rgba(30, 160, 255, 0.24), transparent 70%),
      radial-gradient(80% 48% at 50% 112%, rgba(255, 45, 85, 0.48), transparent 58%),
      radial-gradient(55% 42% at 88% 116%, rgba(255, 106, 43, 0.38), transparent 55%),
      radial-gradient(55% 42% at 12% 116%, rgba(255, 45, 85, 0.34), transparent 55%);
  }
  [data-theme="wave"] .glass::before,
  [data-theme="wave"] .panel::before {
    opacity: 0.72;
    background-image:
      radial-gradient(80% 55% at 8% 0%, rgba(30, 160, 255, 0.22), transparent 60%),
      radial-gradient(70% 55% at 100% 100%, rgba(138, 60, 255, 0.20), transparent 60%),
      radial-gradient(60% 50% at 80% 0%, rgba(255, 43, 214, 0.14), transparent 62%),
      radial-gradient(circle at 6px 6px, var(--dot) 0.7px, transparent 1.05px);
    background-size: auto, auto, auto, 12px 12px;
  }
  [data-theme="wave"] .glass::after,
  [data-theme="wave"] .panel::after {
    filter:
      drop-shadow(0 0 6px #1EA0FF)
      drop-shadow(0 0 9px #8A3CFF)
      drop-shadow(0 0 11px #FF2D55)
      drop-shadow(0 0 14px #FF6A2B);
    background:
      linear-gradient(#1EA0FF, #1EA0FF) 10px 10px / 22px 3px no-repeat,
      linear-gradient(#1EA0FF, #1EA0FF) 10px 10px / 3px 22px no-repeat,
      linear-gradient(#FF2D55, #FF2D55) calc(100% - 10px) 10px / 22px 3px no-repeat,
      linear-gradient(#FF2D55, #FF2D55) calc(100% - 10px) 10px / 3px 22px no-repeat,
      linear-gradient(#FF2BD6, #FF2BD6) 10px calc(100% - 10px) / 22px 3px no-repeat,
      linear-gradient(#FF2BD6, #FF2BD6) 10px calc(100% - 10px) / 3px 22px no-repeat,
      linear-gradient(#FF6A2B, #FF6A2B) calc(100% - 10px) calc(100% - 10px) / 22px 3px no-repeat,
      linear-gradient(#FF6A2B, #FF6A2B) calc(100% - 10px) calc(100% - 10px) / 3px 22px no-repeat;
  }
  [data-theme="wave"] .panel-h {
    background: linear-gradient(90deg,
      rgba(30, 160, 255, 0.26) 0%,
      rgba(138, 60, 255, 0.22) 45%,
      rgba(255, 45, 85, 0.20) 100%);
    border-bottom: 1px solid rgba(255, 45, 85, 0.42);
    box-shadow:
      0 6px 18px rgba(138, 60, 255, 0.22),
      inset 0 -1px 0 rgba(30, 160, 255, 0.28);
  }
  [data-theme="wave"] .panel-h h2 {
    color: var(--hi);
    text-shadow: 0 0 8px rgba(200, 180, 255, 0.5);
  }
  [data-theme="wave"] .signal-side.up {
    text-shadow:
      0 0 8px rgba(var(--green-rgb), 1),
      0 0 20px rgba(var(--green-rgb), 0.85),
      0 0 42px rgba(var(--green-rgb), 0.55),
      0 0 64px rgba(30, 160, 255, 0.35);
  }
  [data-theme="wave"] .signal-side.down {
    text-shadow:
      0 0 8px rgba(var(--red-rgb), 1),
      0 0 20px rgba(var(--red-rgb), 0.85),
      0 0 42px rgba(var(--red-rgb), 0.5),
      0 0 64px rgba(255, 43, 214, 0.3);
  }
  [data-theme="wave"] .action-box .status-word {
    text-shadow:
      0 0 8px currentColor,
      0 0 22px color-mix(in srgb, currentColor 75%, transparent),
      0 0 40px color-mix(in srgb, currentColor 40%, transparent);
  }
  [data-theme="wave"] .kl-target,
  [data-theme="wave"] .ticker-px,
  [data-theme="wave"] .kl-ask .v {
    text-shadow:
      0 0 8px color-mix(in srgb, currentColor 70%, transparent),
      0 0 20px color-mix(in srgb, currentColor 40%, transparent);
  }
  [data-theme="wave"] .chart-panel {
    box-shadow:
      var(--card-shadow),
      0 0 36px rgba(30, 160, 255, 0.28),
      0 0 28px rgba(138, 60, 255, 0.22);
  }
  [data-theme="wave"] .chart {
    box-shadow:
      inset 0 0 48px rgba(30, 160, 255, 0.10),
      inset 0 0 80px rgba(138, 60, 255, 0.08);
  }
}

/* Meter / slim-strip chance %: never use direction red on a pink/crimson field.
   Wave: electric cyan. Street (crimson cards) and Purple (magenta field) too. */
[data-theme="wave"] .gauge-pct,
[data-theme="wave"] .gauge-pct.up,
[data-theme="wave"] .gauge-pct.down,
[data-theme="wave"] .fit-strip-pct,
[data-theme="wave"] .fit-strip-pct.up,
[data-theme="wave"] .fit-strip-pct.down {
  color: #3FE0FF;
  text-shadow:
    0 0 8px rgba(63, 224, 255, 0.95),
    0 0 18px rgba(63, 224, 255, 0.65),
    0 0 28px rgba(30, 160, 255, 0.4);
}
[data-theme="street"] .gauge-pct,
[data-theme="street"] .gauge-pct.up,
[data-theme="street"] .gauge-pct.down,
[data-theme="street"] .fit-strip-pct,
[data-theme="street"] .fit-strip-pct.up,
[data-theme="street"] .fit-strip-pct.down {
  color: #7FE6F7;
  text-shadow:
    0 0 8px rgba(127, 230, 247, 0.95),
    0 0 18px rgba(127, 230, 247, 0.55);
}
[data-theme="purple"] .gauge-pct,
[data-theme="purple"] .gauge-pct.up,
[data-theme="purple"] .gauge-pct.down,
[data-theme="purple"] .fit-strip-pct,
[data-theme="purple"] .fit-strip-pct.up,
[data-theme="purple"] .fit-strip-pct.down,
[data-theme="pink"] .gauge-pct,
[data-theme="pink"] .gauge-pct.up,
[data-theme="pink"] .gauge-pct.down,
[data-theme="pink"] .fit-strip-pct,
[data-theme="pink"] .fit-strip-pct.up,
[data-theme="pink"] .fit-strip-pct.down,
[data-theme="blue"] .gauge-pct,
[data-theme="blue"] .gauge-pct.up,
[data-theme="blue"] .gauge-pct.down,
[data-theme="blue"] .fit-strip-pct,
[data-theme="blue"] .fit-strip-pct.up,
[data-theme="blue"] .fit-strip-pct.down,
[data-theme="green"] .gauge-pct,
[data-theme="green"] .gauge-pct.up,
[data-theme="green"] .gauge-pct.down,
[data-theme="green"] .fit-strip-pct,
[data-theme="green"] .fit-strip-pct.up,
[data-theme="green"] .fit-strip-pct.down {
  color: #FFFFFF;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.30);
}

/* Leading-side chance chip + caption; flip-risk segmented bar */
.chance-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.chance-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}
.chance-chip.up {
  color: var(--up);
  background: color-mix(in srgb, var(--up) 16%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--up) 30%, transparent);
}
.chance-chip.down {
  color: var(--down);
  background: color-mix(in srgb, var(--down) 16%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--down) 30%, transparent);
}
.gauge-pct-label {
  max-width: 160px;
  margin-left: auto;
  margin-right: auto;
  white-space: nowrap;
}
.flip-seg {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  height: 8px;
}
.flip-seg-bit {
  flex: 1 1 0;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.flip-seg-bit.on {
  background: currentColor;
  box-shadow: 0 0 6px color-mix(in srgb, currentColor 55%, transparent);
}
.flip-seg.LOW { color: var(--up); }
.flip-seg.MEDIUM, .flip-seg.MED { color: var(--gold); }
.flip-seg.HIGH { color: var(--down); }

html[data-layout="fit"] .fit-chance-top {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
html[data-layout="fit"] .fit-strip-chance {
  flex: 0 0 auto;
  min-width: 0;
  align-items: flex-start;
}
html[data-layout="fit"] .fit-strip-pct {
  font-size: 16px;
  line-height: 1;
}
html[data-layout="fit"] .fit-strip-pct-lbl {
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-layout="fit"] .fit-strip-flip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  flex: 0 1 auto;
  min-width: 0;
}
html[data-layout="fit"] .fit-strip .flip-pill {
  font-size: 8px;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 100%;
}
html[data-layout="fit"] .fit-strip .flip-seg {
  width: 72px;
  flex: 0 0 5px;
  height: 5px;
  gap: 2px;
}
html[data-layout="fit"] .fit-strip .flip-seg-bit { height: 5px; }
html[data-layout="fit"] .chance-chip {
  font-size: 8px;
  padding: 2px 5px;
}
html[data-layout="fit"] .fit-strip-chance .info-btn {
  width: 12px;
  height: 12px;
  font-size: 8px;
  flex: 0 0 auto;
}

/* Colorful themes: chance % stays high-contrast (chip carries UP/DOWN color) */
[data-theme="calm"] .gauge-pct,
[data-theme="calm"] .gauge-pct.up,
[data-theme="calm"] .gauge-pct.down,
[data-theme="calm"] .fit-strip-pct,
[data-theme="calm"] .fit-strip-pct.up,
[data-theme="calm"] .fit-strip-pct.down {
  color: #F7F5F0;
  text-shadow: 0 0 4px rgba(247, 245, 240, 0.35);
}
[data-theme="vice"] .gauge-pct,
[data-theme="vice"] .gauge-pct.up,
[data-theme="vice"] .gauge-pct.down,
[data-theme="vice"] .fit-strip-pct,
[data-theme="vice"] .fit-strip-pct.up,
[data-theme="vice"] .fit-strip-pct.down,
[data-theme="sunset"] .gauge-pct,
[data-theme="sunset"] .gauge-pct.up,
[data-theme="sunset"] .gauge-pct.down,
[data-theme="sunset"] .fit-strip-pct,
[data-theme="sunset"] .fit-strip-pct.up,
[data-theme="sunset"] .fit-strip-pct.down,
[data-theme="seoul"] .gauge-pct,
[data-theme="seoul"] .gauge-pct.up,
[data-theme="seoul"] .gauge-pct.down,
[data-theme="seoul"] .fit-strip-pct,
[data-theme="seoul"] .fit-strip-pct.up,
[data-theme="seoul"] .fit-strip-pct.down,
[data-theme="fire"] .gauge-pct,
[data-theme="fire"] .gauge-pct.up,
[data-theme="fire"] .gauge-pct.down,
[data-theme="fire"] .fit-strip-pct,
[data-theme="fire"] .fit-strip-pct.up,
[data-theme="fire"] .fit-strip-pct.down {
  color: #FFFFFF;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 16px color-mix(in srgb, var(--accent-hot) 40%, transparent);
}

/* Vice City: synthwave skyline / horizon glow along the bottom */
[data-theme="vice"] .fx-glow {
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(188, 108, 255, 0.28), transparent 60%),
    radial-gradient(50% 40% at 12% 18%, rgba(0, 240, 255, 0.22), transparent 55%),
    radial-gradient(50% 40% at 90% 12%, rgba(255, 92, 168, 0.26), transparent 55%),
    linear-gradient(180deg, transparent 58%, rgba(255, 92, 168, 0.16) 78%, rgba(0, 240, 255, 0.14) 90%, transparent 100%);
}
[data-theme="vice"] .fx-glow::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18%;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 92, 168, 0.2) 55%, rgba(0, 240, 255, 0.18) 100%),
    linear-gradient(#0B0F2B, #0B0F2B) 2% 100% / 2.2% 30% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 6% 100% / 3.2% 62% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 10% 100% / 2.4% 44% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 14% 100% / 4% 78% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 19% 100% / 2% 36% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 23% 100% / 3.4% 70% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 28% 100% / 2.6% 50% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 33% 100% / 4.2% 88% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 39% 100% / 2.2% 40% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 43% 100% / 3.6% 66% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 48% 100% / 2.4% 48% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 53% 100% / 4% 80% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 59% 100% / 2.2% 34% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 63% 100% / 3.2% 58% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 68% 100% / 2.6% 72% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 73% 100% / 3.8% 46% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 79% 100% / 2.4% 64% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 84% 100% / 4.2% 86% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 90% 100% / 2.2% 38% no-repeat,
    linear-gradient(#0B0F2B, #0B0F2B) 94% 100% / 3.4% 70% no-repeat;
  filter: drop-shadow(0 0 10px rgba(255, 92, 168, 0.45)) drop-shadow(0 0 16px rgba(0, 240, 255, 0.3));
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 -8px 24px rgba(255, 92, 168, 0.25);
}
[data-theme="vice"] .glass::after,
[data-theme="vice"] .panel::after {
  filter: drop-shadow(0 0 5px #FF5CA8) drop-shadow(0 0 8px #00F0FF);
}

/* Sunset: fiery marbled glow */
[data-theme="sunset"] .fx-glow {
  background:
    radial-gradient(42% 38% at 18% 28%, rgba(255, 166, 32, 0.36), transparent 58%),
    radial-gradient(38% 42% at 82% 18%, rgba(247, 114, 26, 0.32), transparent 55%),
    radial-gradient(50% 46% at 58% 62%, rgba(255, 20, 147, 0.34), transparent 62%),
    radial-gradient(36% 36% at 30% 78%, rgba(178, 29, 214, 0.30), transparent 58%),
    radial-gradient(48% 40% at 75% 82%, rgba(122, 15, 168, 0.36), transparent 58%),
    radial-gradient(80% 42% at 50% 112%, rgba(255, 20, 147, 0.28), transparent 55%);
  filter: saturate(1.12);
}
[data-theme="sunset"] .glass::after,
[data-theme="sunset"] .panel::after {
  filter: drop-shadow(0 0 5px #FFA620) drop-shadow(0 0 8px #FF1493);
}

/* Seoul Nights: wet-street teal-green glow, palesun sparks, plum puddles */
[data-theme="seoul"] .fx-glow {
  background:
    radial-gradient(60% 45% at 20% 0%, rgba(6, 242, 132, 0.22), transparent 58%),
    radial-gradient(50% 40% at 85% 8%, rgba(234, 244, 5, 0.16), transparent 55%),
    radial-gradient(40% 40% at 70% 40%, rgba(92, 25, 102, 0.28), transparent 60%),
    radial-gradient(70% 35% at 50% 100%, rgba(1, 89, 90, 0.4), transparent 58%),
    linear-gradient(180deg, transparent 72%, rgba(6, 242, 132, 0.10) 86%, rgba(234, 244, 5, 0.08) 100%);
}
[data-theme="seoul"] .glass::after,
[data-theme="seoul"] .panel::after {
  filter: drop-shadow(0 0 5px #06F284) drop-shadow(0 0 8px #EAF405);
}

/* Neon Fire: flame wash rising blue > pink > orange */
[data-theme="fire"] .fx-glow {
  background:
    radial-gradient(50% 40% at 15% 0%, rgba(0, 196, 255, 0.28), transparent 58%),
    radial-gradient(46% 42% at 80% 8%, rgba(255, 46, 147, 0.26), transparent 55%),
    radial-gradient(70% 50% at 50% 110%, rgba(255, 106, 0, 0.36), transparent 58%),
    radial-gradient(40% 36% at 30% 85%, rgba(255, 46, 147, 0.24), transparent 58%),
    radial-gradient(40% 36% at 72% 88%, rgba(255, 194, 77, 0.20), transparent 55%),
    radial-gradient(80% 30% at 50% 100%, rgba(50, 91, 122, 0.28), transparent 60%);
}
[data-theme="fire"] .glass::after,
[data-theme="fire"] .panel::after {
  filter: drop-shadow(0 0 5px #00C4FF) drop-shadow(0 0 8px #FF6A00);
}

/* Calm desktop: match phone density (2x 1px border / low glow) without loud bloom */
@media (min-width: 1024px) {
  [data-theme="calm"] {
    --grid-line: rgba(255, 255, 255, 0.08);
    --card-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.08),
      0 0 16px rgba(255, 59, 59, 0.10),
      0 0 22px rgba(255, 210, 63, 0.08),
      0 10px 28px rgba(0, 0, 0, 0.58),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  [data-theme="calm"] .glass,
  [data-theme="calm"] .panel { border-width: 2px; box-shadow: var(--card-shadow); }
  [data-theme="calm"] .fx-glow {
    background:
      radial-gradient(70% 55% at 12% 0%, rgba(255, 59, 59, 0.10), transparent 60%),
      radial-gradient(62% 50% at 88% 0%, rgba(255, 210, 63, 0.09), transparent 58%),
      radial-gradient(80% 42% at 50% 112%, rgba(255, 59, 59, 0.08), transparent 58%);
  }
  [data-theme="vice"] .glass,
  [data-theme="vice"] .panel,
  [data-theme="sunset"] .glass,
  [data-theme="sunset"] .panel,
  [data-theme="seoul"] .glass,
  [data-theme="seoul"] .panel,
  [data-theme="fire"] .glass,
  [data-theme="fire"] .panel { border-width: 2px; }
}

/* Nature Earth: linen/paper texture, organic radius, no neon bloom */
[data-theme="earth"] .fx-glow {
  opacity: 0.4;
  background:
    radial-gradient(70% 50% at 18% 0%, rgba(46, 125, 50, 0.10), transparent 62%),
    radial-gradient(60% 48% at 88% 100%, rgba(62, 39, 35, 0.28), transparent 62%),
    radial-gradient(50% 40% at 50% 50%, rgba(212, 163, 115, 0.06), transparent 70%);
}
[data-theme="earth"] .fx-dots {
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(0deg, rgba(247, 231, 206, 0.04) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(62, 39, 35, 0.10) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(45deg, rgba(212, 163, 115, 0.035) 0 1px, transparent 1px 6px);
  background-size: auto, auto, auto;
}
[data-theme="earth"] .fx-twinkle { opacity: 0.06; }
[data-theme="earth"] .glass,
[data-theme="earth"] .panel {
  border-radius: 22px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(6px);
}
[data-theme="earth"] .glass::before,
[data-theme="earth"] .panel::before {
  opacity: 0.35;
  background-image:
    radial-gradient(80% 50% at 8% 0%, rgba(46, 125, 50, 0.08), transparent 62%),
    radial-gradient(70% 50% at 100% 100%, rgba(212, 163, 115, 0.08), transparent 62%),
    repeating-linear-gradient(0deg, rgba(247, 231, 206, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(62, 39, 35, 0.08) 0 1px, transparent 1px 4px);
  background-size: auto, auto, auto, auto;
}
[data-theme="earth"] .glass::after,
[data-theme="earth"] .panel::after {
  filter: none;
  opacity: 0.35;
}
[data-theme="earth"] .panel-h {
  background: linear-gradient(90deg, rgba(46, 125, 50, 0.16), rgba(212, 163, 115, 0.10) 100%);
  border-bottom: 1px solid rgba(212, 163, 115, 0.22);
  box-shadow: none;
}
[data-theme="earth"] .gauge-pct,
[data-theme="earth"] .gauge-pct.up,
[data-theme="earth"] .gauge-pct.down,
[data-theme="earth"] .fit-strip-pct,
[data-theme="earth"] .fit-strip-pct.up,
[data-theme="earth"] .fit-strip-pct.down,
[data-theme="earth"] .kl-target,
[data-theme="earth"] .ticker-px,
[data-theme="earth"] .signal-side,
[data-theme="earth"] .status-word {
  text-shadow: none;
}
[data-theme="earth"] .gauge-pct,
[data-theme="earth"] .gauge-pct.up,
[data-theme="earth"] .gauge-pct.down,
[data-theme="earth"] .fit-strip-pct,
[data-theme="earth"] .fit-strip-pct.up,
[data-theme="earth"] .fit-strip-pct.down {
  color: #F7E7CE;
}
[data-theme="earth"] .signal-side.up { color: #81C784; text-shadow: none; }
[data-theme="earth"] .signal-side.down { color: #D36B4A; text-shadow: none; }
[data-theme="earth"] .g-track-bloom,
[data-theme="earth"] .g-track-grad { filter: none; }
[data-theme="earth"] .flip-why {
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Fit strip: keep one row, stack the flip-risk label so it doesn't wrap the bar */
html[data-layout="fit"] .fit-strip-row {
  flex-wrap: nowrap !important;
  gap: 6px;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
html[data-layout="fit"] .fit-strip {
  padding: 4px 8px !important;
}
html[data-layout="fit"] .fit-strip .flip-pill {
  white-space: pre;
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 2px 5px;
}
html[data-layout="fit"] .fit-strip-item .v {
  font-size: 12px;
}
html[data-layout="fit"] .fit-hour-pill {
  font-size: 9px;
  padding: 2px 5px;
}
html[data-layout="fit"] .fit-strip-flip {
  max-height: 100%;
  overflow: hidden;
  flex: 0 0 auto;
}

/* Caption under the gauge %: leading-side color when contrast is good, else cream */
.gauge-pct-label,
.fit-strip-pct-lbl {
  color: var(--hi, #F7E7CE);
}
.gauge-pct-label.up,
.fit-strip-pct-lbl.up { color: var(--up); }
.gauge-pct-label.down,
.fit-strip-pct-lbl.down { color: var(--down); }
[data-theme="calm"] .gauge-pct-label,
[data-theme="calm"] .fit-strip-pct-lbl { color: #F7E7CE; }
[data-theme="calm"] .gauge-pct-label.up,
[data-theme="calm"] .fit-strip-pct-lbl.up { color: #7DCCA8; }
[data-theme="calm"] .gauge-pct-label.down,
[data-theme="calm"] .fit-strip-pct-lbl.down { color: #FF3B3B; }
[data-theme="seoul"] .gauge-pct-label,
[data-theme="seoul"] .fit-strip-pct-lbl { color: #F7FFE8; }
[data-theme="seoul"] .gauge-pct-label.up,
[data-theme="seoul"] .fit-strip-pct-lbl.up { color: #06F284; }
[data-theme="seoul"] .gauge-pct-label.down,
[data-theme="seoul"] .fit-strip-pct-lbl.down { color: #FF4D6A; }
[data-theme="vice"] .gauge-pct-label,
[data-theme="vice"] .fit-strip-pct-lbl { color: #F4F7FF; }
[data-theme="vice"] .gauge-pct-label.up,
[data-theme="vice"] .fit-strip-pct-lbl.up { color: #5DFFE8; }
[data-theme="vice"] .gauge-pct-label.down,
[data-theme="vice"] .fit-strip-pct-lbl.down { color: #FF4D6A; }

/* Chart: vertical page scroll by default; JS takes over horizontal-dominant swipes */
.chart, #chart { touch-action: pan-y; cursor: grab; }
.chart:active, #chart:active { cursor: grabbing; }
.chart.is-panned, #chart.is-panned { touch-action: none; }

.reset-view {
  font-variant-ligatures: none;
}
.reset-view.is-away {
  color: var(--hi, #fff);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Laptop Flip Risk card: stack gauge, label, full-width bar, ahead-note; fill the card */
.flip-panel .flip-risk-row {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.flip-panel .flip-seg {
  width: 100%;
  flex: 0 0 8px;
  height: 8px;
}
.flip-panel .flip-seg-bit { height: 8px; }

@media (min-width: 700px) {
  .flip-panel {
    display: flex;
    flex-direction: column;
  }
  .flip-panel .flip-compact {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    min-height: 0;
    padding: 10px 16px 16px;
    gap: 10px;
  }
  .flip-panel .gauge {
    flex: 1 1 auto;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
  }
  .flip-panel .gauge svg {
    width: min(100%, 280px);
    max-height: 100%;
  }
  .flip-panel .flip-risk-row {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .flip-panel .flip-pill {
    align-self: center;
  }
  .flip-panel .flip-seg {
    width: 100%;
    flex: 0 0 10px;
    height: 10px;
    gap: 4px;
  }
  .flip-panel .flip-seg-bit {
    height: 10px;
    border-radius: 3px;
  }
  .flip-panel .flip-why,
  .flip-panel #flip-why.flip-why {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: center;
    box-sizing: border-box;
  }
}


/* ===== Laptop: Signal | Chart (wide, ~520px+) | Bitcoin Live; slim Flip Risk bar under chart ===== */
.flip-seg { position: relative; overflow: visible; }
.flip-seg-bit.z-low {
  background: color-mix(in srgb, var(--up, #3DDB8A) 52%, #111);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up, #3DDB8A) 55%, transparent);
}
.flip-seg-bit.z-mid {
  background: color-mix(in srgb, var(--gold, #FFD23F) 52%, #111);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold, #FFD23F) 55%, transparent);
}
.flip-seg-bit.z-high {
  background: color-mix(in srgb, var(--down, #FF3B3B) 52%, #111);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--down, #FF3B3B) 55%, transparent);
}
.flip-seg-bit.z-low.on {
  background: var(--up, #3DDB8A);
  box-shadow: 0 0 8px color-mix(in srgb, var(--up, #3DDB8A) 75%, transparent);
}
.flip-seg-bit.z-mid.on {
  background: var(--gold, #FFD23F);
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold, #FFD23F) 75%, transparent);
}
.flip-seg-bit.z-high.on {
  background: var(--down, #FF3B3B);
  box-shadow: 0 0 8px color-mix(in srgb, var(--down, #FF3B3B) 75%, transparent);
}
.flip-seg-mark {
  position: absolute;
  top: 50%;
  width: 3px;
  height: calc(100% + 8px);
  margin-left: -1.5px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.9), 0 0 0 1px rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: 2;
}
.flip-seg-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 0;
  height: 0;
  margin-left: -4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.8));
}

/* Phone: unwrap the center stack so existing scroll/Fit order still applies */
@media (max-width: 699px) {
  .live-center { display: contents; }
  .flip-panel .gauge { display: none !important; }
  .flip-panel .flip-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 10px;
    margin: 0;
  }
  .flip-panel .flip-risk-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 12px;
    width: 100%;
  }
  .flip-panel .flip-seg {
    width: 100%;
    flex: 0 0 10px;
    height: 10px;
    gap: 3px;
  }
  .flip-panel .flip-seg-bit { height: 10px; }
  .flip-panel .flip-why,
  .flip-panel #flip-why.flip-why {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: center;
    box-sizing: border-box;
  }
  html[data-layout="fit"] .fit-strip .flip-seg-mark {
    width: 2px;
    height: calc(100% + 4px);
    margin-left: -1px;
  }
  html[data-layout="fit"] .fit-strip .flip-seg-mark::after {
    top: -3px;
    margin-left: -3px;
    border-left-width: 3px;
    border-right-width: 3px;
    border-top-width: 3px;
  }
}

@media (min-width: 700px) {
  .live-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }
  .live-center {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
  }
  .live-center .chart-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    min-width: 0;
  }
  .live-center .chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .live-center .chart,
  .live-center #chart {
    flex: 1 1 auto !important;
    height: 520px;
    min-height: 520px;
    width: 100%;
  }
  .live-center .chart-legend { flex: 0 0 auto; }
  .live-center .flip-panel {
    flex: 0 0 auto;
    min-height: 0;
  }
  .flip-panel .gauge { display: none !important; }
  .flip-panel .flip-compact {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
    padding: 8px 14px 12px;
    margin: 0;
    gap: 8px;
  }
  .flip-panel .flip-risk-row {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 14px;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .flip-panel .flip-pill { align-self: center; }
  .flip-panel .flip-chance,
  .flip-panel #up-chance-label {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 650;
    white-space: nowrap;
  }
  .flip-panel .flip-seg {
    position: relative;
    width: 100%;
    flex: 0 0 12px;
    height: 12px;
    gap: 3px;
    margin: 4px 0 2px;
  }
  .flip-panel .flip-seg-bit {
    height: 12px;
    border-radius: 3px;
  }
  .flip-panel .flip-why,
  .flip-panel #flip-why.flip-why {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 2px 0 0;
    text-align: center;
    box-sizing: border-box;
  }
}


/* Soft neon family: dim 1.5px trims, small low-alpha glow, outline/muted chrome */
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fx-glow {
  opacity: 0.32;
  background:
    radial-gradient(70% 50% at 15% 0%, rgba(var(--accent-rgb), 0.10), transparent 62%),
    radial-gradient(60% 45% at 90% 8%, rgba(var(--accent-rgb), 0.08), transparent 60%),
    radial-gradient(80% 40% at 50% 112%, rgba(var(--accent-rgb), 0.07), transparent 60%);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fx-dots { opacity: 0.12; }
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fx-twinkle { opacity: 0.10; }
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .glass::before,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .panel::before { opacity: 0.12; }
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .glass::after,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .panel::after {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-2) 32%, transparent));
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .glass,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .panel {
  border-width: 1.5px;
  box-shadow: var(--card-shadow);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .panel-h {
  background: transparent;
  border-bottom-color: rgba(var(--accent-rgb), 0.28);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .signal-side.up {
  color: var(--up);
  text-shadow: 0 0 6px color-mix(in srgb, var(--up) 45%, transparent);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .signal-side.down {
  color: #FF3B3B;
  text-shadow: 0 0 6px rgba(255, 59, 59, 0.45);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .gauge-pct-label,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fit-strip-pct-lbl { color: #F0EEE8; }
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .gauge-pct-label.up,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fit-strip-pct-lbl.up { color: var(--up); }
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .gauge-pct-label.down,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fit-strip-pct-lbl.down { color: #FF3B3B; }

:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .nav-btn.active,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .tabbar .nav-btn.active,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .fit-toggle.active,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .theme-swatch.active,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .theme-swatch[aria-checked="true"],
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .btn.primary {
  color: #F0EEE8;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid color-mix(in srgb, var(--accent-2) 65%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent-2) 28%, transparent);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .reset-view {
  color: #F0EEE8;
  background: transparent;
  border-color: color-mix(in srgb, var(--accent-2) 55%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent-2) 22%, transparent);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .reset-view.is-away,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .reset-view:hover {
  color: #F7F5F0;
  background: rgba(var(--accent-rgb), 0.14);
  border-color: color-mix(in srgb, var(--accent-2) 70%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent-2) 30%, transparent);
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .wordmark {
  background: linear-gradient(135deg, #F0EEE8 0%, #C8C4CC 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-2) 28%, transparent));
}
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .login-mark,
:is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .login-mark.sm {
  color: #F0EEE8;
  background: linear-gradient(135deg, #141414 0%, #1C1C1C 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-2) 55%, transparent),
    0 0 8px color-mix(in srgb, var(--accent-2) 28%, transparent);
}
@media (min-width: 1024px) {
  :is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .glass,
  :is([data-theme="purple"], [data-theme="pink"], [data-theme="blue"], [data-theme="green"]) .panel { border-width: 1.5px; }
}

/* Pink: DOWN is orange-red so it doesn't blend into the magenta trim */
[data-theme="pink"] .signal-side.down,
[data-theme="pink"] .gauge-pct-label.down,
[data-theme="pink"] .fit-strip-pct-lbl.down {
  color: #FF4E32;
  text-shadow: 0 0 6px rgba(255, 78, 50, 0.45);
}

/* Green: UP stays cooler aqua-mint so it doesn't blend into the leaf-green trim */
[data-theme="green"] .signal-side.up,
[data-theme="green"] .gauge-pct-label.up,
[data-theme="green"] .fit-strip-pct-lbl.up {
  color: #7AFFE0;
  text-shadow: 0 0 6px rgba(122, 255, 224, 0.45);
}


/* STATUS highlights are fixed on every theme: green BUY, gold TP/SELL, purple SCALP */
.action-box.tone-buy,
.action-box.tone-buy .status-word { color: #7dffc8 !important; }
.action-box.tone-scalp,
.action-box.tone-scalp .status-word { color: #E0B8FF !important; }
.action-box.tone-sell,
.action-box.tone-sell .status-word,
.action-box.tone-wait,
.action-box.tone-wait .status-word { color: #ffd56a !important; }


/* ===== Alignment pass: consistent corners, headers, STATUS, Flip Risk, Bitcoin Live ===== */
:root {
  --corner-inset: 10px;
  --corner-arm: 16px;
  --corner-thick: 2px;
  --card-pad: 16px;
}

/* Corner brackets: same inset/arm/thickness on every card, from the outer edge. */
.glass::after,
.panel::after {
  inset: 0;
  /* Paint from the border box so 1px and 1.5px theme borders share the same inset. */
  border: 0;
  background:
    linear-gradient(var(--mint), var(--mint)) var(--corner-inset) var(--corner-inset) / var(--corner-arm) var(--corner-thick) no-repeat,
    linear-gradient(var(--mint), var(--mint)) var(--corner-inset) var(--corner-inset) / var(--corner-thick) var(--corner-arm) no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - var(--corner-inset)) var(--corner-inset) / var(--corner-arm) var(--corner-thick) no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) calc(100% - var(--corner-inset)) var(--corner-inset) / var(--corner-thick) var(--corner-arm) no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) var(--corner-inset) calc(100% - var(--corner-inset)) / var(--corner-arm) var(--corner-thick) no-repeat,
    linear-gradient(var(--accent-hot), var(--accent-hot)) var(--corner-inset) calc(100% - var(--corner-inset)) / var(--corner-thick) var(--corner-arm) no-repeat,
    linear-gradient(var(--mint), var(--mint)) calc(100% - var(--corner-inset)) calc(100% - var(--corner-inset)) / var(--corner-arm) var(--corner-thick) no-repeat,
    linear-gradient(var(--mint), var(--mint)) calc(100% - var(--corner-inset)) calc(100% - var(--corner-inset)) / var(--corner-thick) var(--corner-arm) no-repeat;
  background-origin: padding-box;
  background-clip: padding-box;
  pointer-events: none;
}

/* Header row: icon, label, and i sit on one centered line. */
.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 10px var(--card-pad);
  line-height: 1;
  box-sizing: border-box;
}
.panel-h h2 {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  line-height: 1;
  letter-spacing: 0.16em;
}
.panel-h h2::before {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
  letter-spacing: 0;
  align-self: center;
  position: relative;
  top: 0;
}
.panel-h h2 .info-btn,
.panel-h .info-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  line-height: 1;
  align-self: center;
  vertical-align: middle;
}
.track-toggle {
  display: flex;
  align-items: center;
  line-height: 1;
}
.track-toggle h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  margin: 0;
}
.chart-panel .panel-h .chart-readout,
.chart-panel .panel-h .reset-view {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* STATUS: never wrap; ≤ ≥ stay on the same baseline and in a font that has them. */
.status-word {
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
  line-height: 1;
}
.action-box {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 6px 10px;
  min-width: 0;
  container-type: inline-size;
  container-name: statusbox;
  box-sizing: border-box;
}
.action-box .status-kicker {
  flex: 0 0 auto;
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.action-box .status-kicker .info-btn {
  margin: 0;
  flex: 0 0 16px;
}
.action-box .status-word {
  flex: 1 1 0;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1;
  font-size: clamp(14px, 7.8cqi, 24px);
  text-align: left;
}
@media (max-width: 699px) {
  html[data-layout="fit"] .signal-topline { flex-wrap: wrap; }
  html[data-layout="fit"] .action-box.status-stacked,
  html[data-layout="fit"] .action-box:has(.status-word) {
    /* stacked only when the box is told to; default stays on the strip */
  }
}

.status-op {
  font-family: "IBM Plex Mono", "Segoe UI Symbol", "DejaVu Sans", sans-serif;
  font-weight: 700;
  font-size: 0.96em;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  vertical-align: 0;
  letter-spacing: 0;
  transform: translateY(-0.02em);
}

/* Laptop: shared content inset so nothing sits under a corner bracket. */
@media (min-width: 700px) {
  :root { --card-pad: 18px; }

  .main {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
    overflow-x: clip;
  }
  .view-live,
  .live-cols {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .live-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }
  .live-cols > .panel,
  .live-cols > .live-center,
  .kalshi-card,
  .signal-card,
  .track-panel,
  .live-center .chart-panel,
  .live-center .flip-panel {
    min-width: 0;
    max-width: 100%;
  }

  .panel-h { padding: 12px var(--card-pad); }

  .signal-head { padding: 10px var(--card-pad) 6px; }
  .action-box {
    margin: 0 var(--card-pad) 10px;
    padding: 8px 12px;
  }
  .info-grid { padding: 0 var(--card-pad) 16px; }

  /* Bitcoin Live: inner boxes stay fully inside the card with even padding. */
  .kalshi-card { padding-bottom: 16px; overflow-x: clip; }
  .kalshi-card .kl-block,
  .kalshi-card .kl-asks,
  .kalshi-card .kl-hourly {
    margin-left: var(--card-pad);
    margin-right: var(--card-pad);
    padding-left: 0;
    padding-right: 0;
    max-width: calc(100% - 2 * var(--card-pad));
    box-sizing: border-box;
    min-width: 0;
  }
  .kalshi-card .kl-block { padding: 8px 10px; }
  .kalshi-card .kl-asks {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-top: 8px;
  }
  .kalshi-card .kl-ask {
    min-width: 0;
    overflow: hidden;
    padding: 8px 10px;
  }
  .kalshi-card .kl-hourly {
    padding-top: 8px;
    padding-bottom: 0;
  }
  .kalshi-card .kl-hourly .hour-badge {
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    box-sizing: border-box;
  }
  .kalshi-card .kl-hourly .hour-meta {
    flex: 1 1 auto;
    min-width: 0;
  }

  .track-panel .track-top,
  .track-panel .track-body { padding-left: var(--card-pad); padding-right: var(--card-pad); }
  .track-panel .track-top { margin-left: var(--card-pad); margin-right: var(--card-pad); }

  /* Flip Risk: inset the inner card so the bar and pills never touch the L-corners. */
  .flip-panel .flip-compact {
    margin: 8px var(--card-pad) var(--card-pad) !important;
    padding: 10px 12px 12px !important;
    gap: 8px;
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    width: auto;
  }
  .flip-panel .flip-risk-row {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .flip-panel .flip-seg {
    width: 100%;
    margin: 2px 0;
    box-sizing: border-box;
  }
  .flip-panel .flip-why,
  .flip-panel #flip-why.flip-why {
    width: 100%;
    max-width: 100% !important;
    margin: 2px 0 0 !important;
    box-sizing: border-box;
  }
}

/* Phone scroll: keep corners clear without blowing up the compact Fit layout. */
@media (max-width: 699px) {
  :root { --card-pad: 14px; }
  .panel-h { padding: 10px var(--card-pad); }
  .action-box { margin-left: var(--card-pad); margin-right: var(--card-pad); }
  .signal-card .signal-head { padding-left: var(--card-pad); padding-right: var(--card-pad); }
  .signal-card .info-grid { padding-left: var(--card-pad); padding-right: var(--card-pad); }
  .kalshi-card .kl-block,
  .kalshi-card .kl-asks,
  .kalshi-card .kl-hourly {
    margin-left: var(--card-pad);
    margin-right: var(--card-pad);
    min-width: 0;
    max-width: calc(100% - 2 * var(--card-pad));
    box-sizing: border-box;
  }
  .flip-panel .flip-compact {
    margin: 8px var(--card-pad) var(--card-pad) !important;
    padding: 8px 10px 10px !important;
    box-sizing: border-box;
  }
  .flip-panel .flip-why,
  .flip-panel #flip-why.flip-why {
    width: 100%;
    max-width: 100% !important;
    margin: 2px 0 0 !important;
    box-sizing: border-box;
  }
}

/* Fit (one-screen) keeps its tight strip; corners are already hidden there. */
@media (max-width: 699px) {
  html[data-layout="fit"] {
    --card-pad: 8px;
  }
  html[data-layout="fit"] .action-box {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html[data-layout="fit"] .action-box {
    min-width: 0;
    overflow: hidden;
  }
  html[data-layout="fit"] .action-box .status-word {
    font-size: clamp(11px, 4.8vw, 15px) !important;
    min-width: 0;
    overflow: hidden;
  }
}

/* ===== Corner-dot lock: dot centered in the top-left L, label and i on the same centerline ===== */
:root {
  --dot-size: 8px;
  --header-gap: 8px;
  --corner-center: calc(var(--corner-inset) + var(--corner-arm) / 2);
  --header-h: calc((var(--corner-inset) + var(--corner-arm) / 2) * 2);
  /* Optical nudge so uppercase cap-height center matches the dot. Tuned after measure. */
  --header-optical-y: 0px;
  --header-i-optical-y: 0px;
}

/* Kill per-card header icons — every carded panel uses the same locked corner dot. */
.panel-h h2::before,
.signal-card .panel-h h2::before,
#live-round .panel-h h2::before,
.live-round .panel-h h2::before,
.today-panel .panel-h h2::before,
.score-panel .panel-h h2::before,
.flip-panel .panel-h h2::before,
.chart-panel .panel-h h2::before,
.hourly-panel .panel-h h2::before,
.recent-panel .panel-h h2::before,
.history-panel .panel-h h2::before,
.track-panel .panel-h h2::before,
.sheet-panel .panel-h h2::before,
.settings-panel .panel-h h2::before,
.kalshi-card .panel-h h2::before,
.inbox-panel .panel-h h2::before {
  content: none !important;
  display: none !important;
  background: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/*
  Header height is exactly 2 × the L-square center so flex-centering
  lands on the same Y as the dot. The 1px rule is drawn with inset
  box-shadow so it does not shrink the content box and shift the line.
*/
.panel-h {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--header-h);
  min-height: var(--header-h);
  max-height: var(--header-h);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: calc(var(--corner-center) + var(--dot-size) / 2 + var(--header-gap)) !important;
  padding-right: var(--card-pad) !important;
  line-height: 1;
  box-sizing: border-box;
  border-bottom-width: 0 !important;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent, var(--mint)) 28%, transparent);
}

/* The gold/cyan dot is positioned from the same origin as the L-bracket (panel-h = panel padding box top-left). */
.panel-h::before {
  content: "";
  position: absolute;
  left: calc(var(--corner-center) - var(--dot-size) / 2);
  top: calc(var(--corner-center) - var(--dot-size) / 2);
  width: var(--dot-size);
  height: var(--dot-size);
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 70%, transparent);
  transform: none;
  z-index: 3;
  pointer-events: none;
  display: block;
  -webkit-mask: none;
  mask: none;
}

.panel-h h2 {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--header-gap);
  margin: 0;
  line-height: 1;
  height: auto;
  position: relative;
}
.panel-h h2 .panel-label {
  display: inline-block;
  line-height: 1;
  letter-spacing: inherit;
  text-transform: inherit;
  font: inherit;
  transform: translateY(var(--header-optical-y));
}
.panel-h h2 .info-btn,
.panel-h .info-btn {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  line-height: 1;
  align-self: center;
  transform: translateY(var(--header-i-optical-y));
}
.panel-h .chart-readout,
.panel-h .reset-view,
.panel-h .pip-btn,
.panel-h .track-toggle,
.panel-h .chev,
.panel-h .fit-track-line {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.track-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  line-height: 1;
}

/* Same geometry on phone scroll, Fit, and laptop — beat earlier !important paddings. */
@media (min-width: 700px) {
  .panel-h {
    height: var(--header-h) !important;
    min-height: var(--header-h) !important;
    max-height: var(--header-h) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: calc(var(--corner-center) + var(--dot-size) / 2 + var(--header-gap)) !important;
  }
}
@media (max-width: 699px) {
  .panel-h,
  html[data-layout="fit"] .panel-h,
  html[data-layout="fit"] .signal-card .panel-h,
  html[data-layout="fit"] .chart-panel .panel-h,
  html[data-layout="fit"] .track-panel .panel-h,
  html[data-layout="fit"] .hourly-panel .panel-h {
    height: var(--header-h) !important;
    min-height: var(--header-h) !important;
    max-height: var(--header-h) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: calc(var(--corner-center) + var(--dot-size) / 2 + var(--header-gap)) !important;
    padding-right: var(--card-pad) !important;
  }
  /* Show the L-brackets in Fit so the locked dot stays visible and identical. */
  html[data-layout="fit"] .panel::after {
    display: block !important;
  }
}


/* ===== Pop-out mini view (picture-in-picture) ===== */
.pip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
  padding: 4px 10px 4px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex: 0 0 auto;
  white-space: nowrap;
}
.pip-btn .pip-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: block;
}
.pip-btn:hover {
  background: rgba(var(--accent-rgb), 0.16);
}
.pip-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  color: var(--nav-on-fg, #000);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
}
.mobile-brand-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand .fit-toggle { margin-left: 0; }

@media (max-width: 699px) {
  .pip-btn-signal .pip-btn-label { display: none; }
  .pip-btn-signal { padding: 4px 7px; }
  .mobile-brand .pip-btn { padding: 6px 10px 6px 8px; font-size: 11px; }
  html[data-layout="fit"] .mobile-brand .pip-btn {
    padding: 4px 8px 4px 6px;
    font-size: 10px;
  }
  html[data-layout="fit"] .pip-btn-signal { display: none; }
}

/* iOS Safari: MediaStream frames are dropped for offscreen / display:none /
   opacity-hidden ancestors (WebKit 319387). Keep the 1px video at 0,0 in
   the viewport with no faded parent. Canvas stays in the DOM so it can paint. */
.pip-stage {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}
.pip-stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  display: block;
  pointer-events: none;
}
.pip-stage video {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  display: block;
  pointer-events: none;
}

.pip-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar, 0px) + var(--safe-b, 0px) + 16px);
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-2) 92%, black);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}
@media (min-width: 700px) {
  .pip-toast { bottom: 20px; }
}

/* In-page fallback / screenshot preview of the mini panel */
.pip-float {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar, 0px) + var(--safe-b, 0px) + 16px);
  z-index: 70;
  width: 360px;
  aspect-ratio: 720 / 900;
  max-width: calc(100vw - 24px);
  max-height: min(72vh, 540px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.55);
  cursor: grab;
}
@media (min-width: 700px) {
  .pip-float { bottom: 20px; }
}
.pip-float[hidden] { display: none !important; }

.pip-mini {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 12px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background:
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
  font-family: var(--font-sans);
  position: relative;
}
.pip-mini::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pip-mini-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  line-height: 1;
}
.pip-mini-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pip-mini-clock {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--hi, var(--text));
}
.pip-mini-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.pip-float .pip-mini-top { padding-right: 24px; }
.pip-mini[data-tone="tone-buy"] .pip-mini-word {
  color: #7dffc8;
  border-color: rgba(125, 255, 200, 0.8);
  background: linear-gradient(180deg, rgba(125, 255, 200, 0.16), rgba(20, 60, 40, 0.28));
  box-shadow:
    0 0 12px rgba(125, 255, 200, 0.45),
    0 0 28px rgba(80, 255, 180, 0.22),
    inset 0 0 22px rgba(80, 255, 180, 0.12);
  text-shadow: 0 0 8px currentColor, 0 0 20px color-mix(in srgb, currentColor 65%, transparent);
}
.pip-mini[data-tone="tone-scalp"] .pip-mini-word {
  color: #E0B8FF;
  border-color: rgba(188, 108, 255, 0.8);
  background: linear-gradient(180deg, rgba(188, 108, 255, 0.18), rgba(40, 16, 64, 0.32));
  box-shadow:
    0 0 12px rgba(188, 108, 255, 0.5),
    0 0 28px rgba(176, 102, 255, 0.28),
    inset 0 0 22px rgba(188, 108, 255, 0.14);
  text-shadow: 0 0 8px currentColor, 0 0 20px color-mix(in srgb, currentColor 65%, transparent);
}
.pip-mini[data-tone="tone-wait"] .pip-mini-word,
.pip-mini[data-tone="tone-sell"] .pip-mini-word {
  color: #ffd56a;
  border-color: rgba(255, 213, 106, 0.75);
  background: linear-gradient(180deg, rgba(255, 213, 106, 0.16), rgba(50, 36, 8, 0.28));
  box-shadow:
    0 0 12px rgba(255, 213, 106, 0.4),
    0 0 24px rgba(255, 210, 63, 0.18),
    inset 0 0 22px rgba(255, 213, 106, 0.10);
  text-shadow: 0 0 8px currentColor, 0 0 20px color-mix(in srgb, currentColor 65%, transparent);
}
.pip-mini-asks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pip-mini-asks .k {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.pip-mini-asks .v {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 8px color-mix(in srgb, currentColor 55%, transparent);
}
.pip-mini-asks .up .v { color: var(--up); }
.pip-mini-asks .down .v { color: var(--down); }
.pip-mini-flip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pip-mini-flip .bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.pip-mini-flip .bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
}
.pip-mini-flip[data-level="LOW"] .bar > i { background: var(--up); }
.pip-mini-flip[data-level="MEDIUM"] .bar > i,
.pip-mini-flip[data-level="MED"] .bar > i { background: var(--gold); }
.pip-mini-flip[data-level="HIGH"] .bar > i { background: var(--down); }
.pip-mini-flip .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.pip-float-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.pip-mini.pip-mini-chart {
  padding: 0;
  min-height: 0;
  height: 100%;
  gap: 0;
  background: #000;
}
.pip-mini.pip-mini-chart .pip-mini-view {
  display: block;
  width: 100%;
  height: 100%;
}


/* ===== Signal tile values: Inter Bold (default). Does not change --font-mono. ===== */
.font-setting { margin-top: 14px; }
.info-cell .v {
  font-family: Inter, "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
html[data-font="plex"] .info-cell .v,
html[data-font="current"] .info-cell .v {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
/* Fit keeps its compact sizes so the one-screen layout does not overflow. */
@media (max-width: 699px) {
  html[data-layout="fit"] .info-cell .v {
    font-family: Inter, "DM Sans", sans-serif;
    font-weight: 700;
  }
  html[data-layout="fit"][data-font="plex"] .info-cell .v,
  html[data-layout="fit"][data-font="current"] .info-cell .v {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
  }
}


/* ===== STATUS word: no inner highlight/pill. Text sits on the card and can wrap. ===== */
.status-word,
.action-box .status-word,
.live-compact .status-word,
html[data-layout="fit"] .status-word,
html[data-layout="fit"] .action-box .status-word {
  background: none !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
  animation: none !important;
}
.action-box .status-word {
  display: block;
  min-width: 0;
  flex: 1 1 0;
  margin: 0 !important;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.1;
  text-align: left;
  font-size: clamp(14px, 7.8cqi, 24px);
}
/* In-page PiP fallback: same treatment if that STATUS word is shown. */
.pip-mini-word,
.pip-mini[data-tone="tone-buy"] .pip-mini-word,
.pip-mini[data-tone="tone-scalp"] .pip-mini-word,
.pip-mini[data-tone="tone-wait"] .pip-mini-word,
.pip-mini[data-tone="tone-sell"] .pip-mini-word {
  background: none !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  overflow: visible !important;
  white-space: normal;
}

/* Rules card (under Track Record) */
.rules-block { margin: 0; }
.rules-head { margin-top: 8px; }
.rules-block:not(.is-collapsed) .rr-chev { transform: rotate(90deg); }
.rules-block.is-collapsed .rules-body,
.rules-body[hidden] { display: none; }
.rules-list {
  list-style: none;
  margin: 0 0 2px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 640px;
}
.rules-list li {
  display: grid;
  grid-template-columns: 16px 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
}
.rule-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 22px;
  text-align: center;
}
.rule-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: rgba(var(--wait-rgb), 0.14);
  box-shadow: 0 0 0 1px rgba(var(--wait-rgb), 0.28);
}
.rule-ico svg { display: block; }
.rule-text {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  min-width: 0;
}
.rule-text b {
  font-weight: 700;
  color: var(--hi);
}
.rule-size {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Settings: Balance used to scale rule 2 */
@media (max-width: 699px) {
  .rules-head, #rules-toggle { min-height: 40px; }
  .rule-text { font-size: 12px; }
}
html[data-layout="fit"] .rules-list { gap: 6px; }
html[data-layout="fit"] .rules-list li { padding: 5px 8px; gap: 6px; }
html[data-layout="fit"] .rule-text { font-size: 11px; line-height: 1.3; }

/* Rules page (same nav pattern as Cheat Sheet) */
.rules-page-list {
  margin: 16px 18px 22px;
  max-width: 640px;
  gap: 10px;
}
.rules-page-list li { padding: 12px 12px; }
.rules-panel .rule-text { font-size: 14px; line-height: 1.4; }
@media (max-width: 699px) {
  .rules-page-list { margin: 12px 12px 18px; }
  .rules-panel .rule-text { font-size: 13px; }
}



/* ===== Fit Flip Risk: show the actual Flip Risk chart in Fit / one-screen view =====
   Unhide #flip-panel (previously display:none on phone Fit, replaced by a slim strip).
   Keep the fit-strip and every other tile. Shrink the price chart slightly so the
   page still fits on one screen. */
@media (max-width: 699px) {
  html[data-layout="fit"] .view-live {
    grid-template-rows: auto minmax(160px, 1fr) auto 76px auto !important;
  }
  html[data-layout="fit"] .flip-panel {
    display: flex !important;
    flex-direction: column !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden;
    align-self: stretch !important;
    order: unset;
  }
  html[data-layout="fit"] .flip-panel .panel-h {
    display: flex !important;
    padding: 3px 8px !important;
  }
  html[data-layout="fit"] .flip-panel .panel-h h2 {
    font-size: 11px;
  }
  html[data-layout="fit"] .flip-panel .flip-compact {
    margin: 2px 8px 6px;
    padding: 2px 0 4px;
  }
  html[data-layout="fit"] .flip-panel .flip-seg {
    width: 100%;
    height: 12px !important;
    flex: 0 0 12px !important;
    gap: 3px;
  }
  html[data-layout="fit"] .flip-panel .flip-seg-bit {
    height: 12px !important;
  }
  html[data-layout="fit"] .fit-strip {
    grid-row: 4 !important;
  }
  html[data-layout="fit"] .track-panel {
    grid-row: 5 !important;
  }
  html[data-layout="fit"] .chart-panel {
    min-height: 160px !important;
  }
  html[data-layout="fit"] .chart-wrap {
    min-height: 160px;
  }
  html[data-layout="fit"] .chart,
  html[data-layout="fit"] .chart-panel .chart,
  html[data-layout="fit"] .chart-panel #chart {
    min-height: 160px !important;
  }
}

@media (min-width: 700px) {
  html[data-layout="fit"] .live-center .chart-panel {
    min-height: 320px !important;
  }
  html[data-layout="fit"] .live-center .chart,
  html[data-layout="fit"] .live-center #chart {
    height: auto !important;
    min-height: 320px !important;
  }
  html[data-layout="fit"] .live-center .flip-panel {
    display: flex !important;
    flex: 0 0 auto !important;
    min-height: 0;
    overflow: visible;
  }
  html[data-layout="fit"] .flip-panel .flip-seg {
    height: 12px !important;
    flex: 0 0 12px !important;
  }
  html[data-layout="fit"] .flip-panel .flip-seg-bit {
    height: 12px !important;
  }
}


/* ===== Fit view: hide the slim fit-strip now that Flip Risk is the real card =====
   Remaining cards keep their rows; the chart grows into the freed space.
   Track Record stays. */
html[data-layout="fit"] .fit-strip {
  display: none !important;
}
@media (max-width: 699px) {
  html[data-layout="fit"] .view-live {
    grid-template-rows: auto minmax(160px, 1fr) auto auto !important;
  }
  html[data-layout="fit"] .track-panel {
    grid-row: 4 !important;
  }
}


/* ===== Hourly BUY call: own full-width tile above Pattern; no gap when hidden ===== */
.info-grid .hourly-box {
  grid-column: 1 / -1 !important;
}
.info-grid .hourly-box[hidden] {
  display: none !important;
}
.info-grid .hourly-box .hourly-line {
  margin-top: 0;
}

/* Cheat sheet: cards that show yellow on STATUS (tone-wait) */
.badge.YWAIT { color: #ffd56a; background: rgba(var(--wait-rgb), 0.14); border: 1px solid rgba(var(--wait-rgb), 0.45); }

/* v15: 'TP 80% or HOLD → 95%' = amber, same as the Pine STATUS (255,170,0) */
.action-box.tone-sell.tp80 {
  color: #ffaa00 !important;
  border-color: rgba(255, 170, 0, 0.9) !important;
  background: linear-gradient(180deg, rgba(255, 170, 0, 0.22), rgba(60, 34, 0, 0.34)) !important;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.55), 0 0 28px rgba(255, 170, 0, 0.3), inset 0 0 22px rgba(255, 170, 0, 0.16) !important;
}
.action-box.tone-sell.tp80 .status-word,
.status-word.tp80 { color: #ffaa00 !important; }
html[data-layout="fit"] .signal-topline:has(.action-box.tp80) {
  border-color: rgba(255, 170, 0, 0.75);
  background: rgba(60, 34, 0, 0.42);
}
.pip-mini[data-tone="tone-tp80"] .pip-mini-word { color: #ffaa00 !important; }
.badge.SELL.tp80 { color: #111; background: #ffaa00; border-color: #ffaa00; }

/* HOURLY · PRACTICE box (display only; shown only while an hourly call is live) */
.hp-box { margin: 4px 16px 12px; padding: 12px 14px; border: 3px solid #FFE600; border-radius: 12px;
  background: rgba(255, 230, 0, 0.14); box-shadow: 0 0 18px rgba(255, 230, 0, 0.45); }
.hp-box[hidden] { display: none !important; }
.hp-title { font-size: 12px; font-weight: 900; letter-spacing: 0.14em; color: #0d0f14; background: #FFE600;
  display: inline-block; padding: 2px 8px; border-radius: 6px; }
.hp-word { margin-top: 6px; font-size: clamp(22px, 6vw, 30px); font-weight: 900; text-shadow: 0 0 12px rgba(255, 230, 0, 0.55); line-height: 1.2; color: #FFE600; word-break: break-word; }
.hp-detail { margin-top: 3px; font-size: 11px; color: #fff6b0; }
.hp-detail:empty { display: none; }
.hp-note { margin-top: 4px; font-size: 11px; font-weight: 700; color: #E0B8FF; }
html[data-layout="fit"] .hp-box { margin: 0 8px 8px; padding: 6px 8px; }
html[data-layout="fit"] .hp-word { font-size: 16px; }
@keyframes hpPulse { 0%,100% { box-shadow: 0 0 18px rgba(255,230,0,.45); } 50% { box-shadow: 0 0 30px rgba(255,230,0,.85); } }
.hp-box:not([hidden]) { animation: hpPulse 1.6s ease-in-out infinite; }

/* ===== Shared call colors (Nov 22 2026). Define once; dash, cheat sheet, rules, pop-up and chart markers all read these. ===== */
:root {
  --qe-weak: #E8C872;            /* weak call amber: big STATUS, badge, BU/BD markers, sheet/rules/pop-up examples */
  --qe-weak-rgb: 232, 200, 114;
  --qe-call-buy: #7dffc8;        /* real BUY STATUS word (BOUNCE / GET READY), both sides */
  --qe-call-buy-rgb: 125, 255, 200;
  --qe-call-wait: #ffd56a;       /* WAIT / HOLD (real) STATUS word */
  --qe-call-wait-rgb: 255, 213, 106;
  --qe-mark-up: #7af0ff;         /* real chart marker, UP (BU / BO BU) */
  --qe-mark-down: #ff8aa0;       /* real chart marker, DOWN (BD / BO BD) */
}
.action-box.tone-buy .status-word, .action-box.tone-buy { color: var(--qe-call-buy) !important; }
.action-box.tone-wait .status-word, .action-box.tone-wait { color: var(--qe-call-wait) !important; }
.badge.BUY { color: var(--qe-call-buy); background: rgba(var(--qe-call-buy-rgb), .14); border-color: rgba(var(--qe-call-buy-rgb), .6); }
.badge.YWAIT { color: var(--qe-call-wait); }

/* ===== WEAK CALL (live, 65-75% band) ===== */
.hours-badge.weak { color: var(--qe-weak); border: 1px dashed rgba(var(--qe-weak-rgb), .55); background: rgba(var(--qe-weak-rgb), .07);
  box-shadow: none; text-shadow: none; font-weight: 700; letter-spacing: .04em; }
.hours-badge.weak .weak-meas { color: rgba(var(--qe-weak-rgb), .7); font-weight: 600; text-transform: none; }
html[data-layout="fit"] .hours-badge.weak { font-size: 8px; padding: 1px 5px; }
.action-box.weak-box { color: var(--qe-weak) !important; border: 1.5px dashed rgba(var(--qe-weak-rgb), .75) !important;
  background: rgba(var(--qe-weak-rgb), .06) !important; box-shadow: none !important; }
.action-box.weak-box .status-word, .status-word.weak-status { color: var(--qe-weak) !important; text-shadow: none !important; animation: none !important; }
.action-box.weak-box .status-word[data-weak="hold"] { opacity: .85; }
.round-row .weak-grade { display: inline-block; margin-left: 6px; padding: 0 5px; border-left: 2px solid var(--qe-weak);
  color: var(--qe-weak); background: rgba(var(--qe-weak-rgb), .07); font-weight: 700; font-size: .92em; }
.round-row .weak-grade.lost { color: var(--qe-mark-down); border-left-color: var(--qe-mark-down); background: rgba(255, 138, 160, .07); }
/* prelaunch4: WEAK CALL rows in History: amber entry words, WON green / LOST red */
.round-row .weak-entry { color: #E8C872; font-weight: 700; }
.round-row .weak-grade.won { color: #7dffc8; border-left-color: #7dffc8; background: rgba(125, 255, 200, .07); }
.round-row .weak-grade.lost { color: #ff8aa0; border-left-color: #ff8aa0; background: rgba(255, 138, 160, .07); }
/* noskip1: settled LEAN / ⚠ calls show on the right instead of SKIP */
.round-row .d { min-width: 0; }
.round-row .pnl.is-call {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
  font-family: inherit;
  text-align: right;
  white-space: nowrap;
  text-shadow: none;
}
.round-row .pnl.is-call .call-lbl {
  color: #E8C872;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.round-row .pnl.is-call .call-grade {
  font-weight: 700;
  font-size: 10px;
}
.round-row .pnl.is-call .call-grade.won { color: #7dffc8; }
.round-row .pnl.is-call .call-grade.lost { color: #ff8aa0; }
@media (max-width: 360px) {
  .round-row .pnl.is-call .call-lbl,
  .round-row .pnl.is-call .call-grade { font-size: 10px; }
}

/* Quick read: one line per call type (cheat sheet, rules, pop-up) */
.qe-quick { display: grid; gap: 8px; margin: 4px 16px 16px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .025); }
.rules-panel .qe-quick { margin: 4px 0 14px; max-width: 640px; }
.qe-quick-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; line-height: 1.35; }
.qe-quick-ex { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; max-width: 100%; }
.qe-st { display: inline-block; white-space: nowrap; font-weight: 800; font-size: 12px; letter-spacing: -.01em; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; }
.qe-st.buy { color: var(--qe-call-buy); border-color: rgba(var(--qe-call-buy-rgb), .8); background: rgba(var(--qe-call-buy-rgb), .14); }
.qe-st.weak { color: var(--qe-weak); border: 1.5px dashed rgba(var(--qe-weak-rgb), .75); background: rgba(var(--qe-weak-rgb), .06); }
.qe-st.wait { color: var(--qe-call-wait); border-color: rgba(var(--qe-call-wait-rgb), .45); background: rgba(var(--qe-call-wait-rgb), .12); }
.qe-st.badge-weak { white-space: normal; max-width: 150px; font-size: 10px; font-weight: 700; padding: 2px 6px; color: var(--qe-weak); border: 1px dashed rgba(var(--qe-weak-rgb), .55); background: rgba(var(--qe-weak-rgb), .07); }
.qe-kal { white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--muted, #9aa3ad); }
.qe-kal b { color: inherit; }
.qe-quick-do { min-width: 0; }
.qe-quick-do .fail { color: var(--qe-weak); font-weight: 700; }
.qe-mk-up { color: var(--qe-mark-up); font-weight: 800; }
.qe-mk-down { color: var(--qe-mark-down); font-weight: 800; }
.qe-mk-weak { color: var(--qe-weak); font-weight: 800; }
.qe-hc-overlay .qe-quick { margin: 0 0 16px; }
.qe-hc-overlay .qe-quick-row { grid-template-columns: 130px 1fr; }

/* Quick read: weak badge must fit its column (fix 8 PM Nov 22) */
.qe-st { box-sizing: border-box; max-width: 100%; }
.qe-st.badge-weak { white-space: normal; max-width: 100%; line-height: 1.35; overflow-wrap: anywhere; }
.qe-st.badge-weak .bw-tail { display: block; font-weight: 600; color: rgba(var(--qe-weak-rgb), .75); }
.qe-hc-overlay .qe-quick-row { grid-template-columns: minmax(0, 130px) minmax(0, 1fr); }
.qe-hc-overlay .qe-hc-g { color: var(--qe-call-buy); }
.qe-hc-overlay .qe-hc-y { color: var(--qe-weak); }

/* ===== Nov 22 8:30 PM: chart target readout, How Calls Work tab, panel X, tour ===== */
/* Chart: compact target price at the top of the plot (no 'Target' word/box on the right) */
.chart-wrap { position: relative; }
.chart-tgt { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px;
  font: 700 12px/1.3 "IBM Plex Mono", ui-monospace, monospace; background: rgba(2, 12, 12, .72); border: 1px solid currentColor; }
.chart-tgt[hidden] { display: none !important; }
.chart-tgt .sw { width: 14px; height: 0; border-top: 2px dashed currentColor; }
@media (max-width: 699px) { .chart { height: 300px; } .live-center .chart, .live-center #chart { min-height: 300px; } }
/* How Calls Work link in the tabs */
a.nav-btn.nav-link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
/* X close on pages/windows opened from the tabs */
.panel.has-close { position: relative; }
.panel.has-close > .panel-h { padding-right: 58px; }
.panel-close { position: absolute; top: 6px; right: 8px; z-index: 20; width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; font: 700 18px/1 system-ui, sans-serif; cursor: pointer;
  color: var(--text, #e8eef0); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); }
.panel-close:hover, .panel-close:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
/* Tour */
.qe-tour-spot { position: fixed; z-index: 9998; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 6, 10, .72), 0 0 0 2px var(--qe-call-buy), 0 0 18px rgba(var(--qe-call-buy-rgb), .55);
  transition: top .25s, left .25s, width .25s, height .25s; }
.qe-tour-block { position: fixed; inset: 0; z-index: 9997; background: transparent; }
.qe-tour-tip { position: fixed; z-index: 9999; width: min(330px, calc(100vw - 24px)); box-sizing: border-box; padding: 14px 14px 12px;
  border-radius: 14px; background: #0b1416; color: #e8eef0; border: 1px solid rgba(var(--qe-call-buy-rgb), .55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55); font: 14px/1.45 "DM Sans", system-ui, sans-serif; }
.qe-tour-tip h4 { margin: 0 0 6px; font: 800 15px/1.2 "DM Sans", system-ui, sans-serif; color: var(--qe-call-buy); }
.qe-tour-tip p { margin: 0 0 10px; }
.qe-tour-tip .g { color: var(--qe-call-buy); font-weight: 700; }
.qe-tour-tip .y { color: var(--qe-weak); font-weight: 700; }
.qe-tour-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 10px; }
.qe-tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.qe-tour-dots i.on { background: var(--qe-call-buy); }
.qe-tour-btns { display: flex; gap: 8px; align-items: center; }
.qe-tour-btns button { min-height: 40px; border-radius: 10px; padding: 0 14px; font: 700 14px/1 "DM Sans", system-ui, sans-serif; cursor: pointer; }
.qe-tour-skip { background: transparent; color: #9aa3ad; border: 0; padding: 0 6px !important; margin-right: auto; }
.qe-tour-back { background: rgba(255, 255, 255, .08); color: #e8eef0; border: 1px solid rgba(255, 255, 255, .2); }
.qe-tour-next { background: var(--qe-call-buy); color: #04120c; border: 0; }
.tour-setting { margin-top: 14px; }

/* ===== Nov 22 8:47 PM clean-up: target readout in the chart header, header-row close pill ===== */
.chart-panel .panel-h .chart-readout { gap: 10px; }
.chart-tgt { position: static; transform: none; z-index: auto; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; pointer-events: auto;
  font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.06em; color: var(--label); white-space: nowrap; }
.chart-tgt .k { text-transform: uppercase; letter-spacing: 0.16em; color: var(--label); }
.chart-tgt .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-tgt.is-up .v { color: var(--up); } .chart-tgt.is-down .v { color: var(--down); }
.chart-tgt .sw { display: none; }
/* close pill: same look as LIVE ⟶, in the header row; 40px tap area via ::after */
.panel.has-close > .panel-h { padding-right: 16px; }
.panel-h .panel-close { position: relative; top: auto; right: auto; width: auto; height: auto; margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1; font-weight: 600; }
.panel-h .panel-close::after { content: ""; position: absolute; left: -8px; right: -8px; top: 50%; height: 40px; transform: translateY(-50%); min-width: 40px; }
.panel-h .panel-close span { font-size: 10px; }
.panel-h .panel-close:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
@media (max-width: 699px) { .chart-tgt .k { letter-spacing: 0.1em; } .chart-panel .panel-h .chart-readout { gap: 8px; } }
.panel-h .panel-close, .panel-h .panel-close:is(button) { font-size: 11px !important; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px !important;
  margin-right: 10px; min-height: 0; border-radius: 999px; }
.panel-h .panel-close span { font-size: 9px; }

/* ===== Nov 22 8:54 PM: R / S in the chart header (no boxes), target readout removed ===== */
.chart-rs { display: inline-flex; align-items: baseline; gap: 12px; font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-rs[hidden], .chart-rs > [hidden] { display: none !important; }
.chart-rs .r, .chart-rs .s { font-weight: 700; }
@media (max-width: 699px) { .chart-rs { gap: 9px; } }

/* ===== Nov 22 9:37 PM: History merged into Score ===== */
.score-rounds { padding: 4px 18px 18px; border-top: 1px solid rgba(var(--mint-rgb), 0.12); }
.score-rounds .page-note { margin: 4px 0 10px; }
@media (max-width: 699px) { .score-rounds { padding: 4px 12px 14px; } }

/* ===== Nov 22 9:40 PM: Score > Today's rounds collapsible (same look as Recent rounds) ===== */
.score-rounds .score-rr .rr-body { padding-top: 6px; }

/* ===== Nov 22 11:05 PM: History (past days) on Scoreboard ===== */
.score-rounds .score-hist { margin-top: 4px; }
.score-rounds .score-day { margin: 0; }
.score-rounds .score-day .rr-head { margin: 4px 0 4px 8px; }
.score-rounds .score-day-pnl {
  letter-spacing: 0.04em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.score-rounds .score-day-pnl.pos { color: var(--green); }
.score-rounds .score-day-pnl.neg { color: var(--red); }

/* ===== LEAN CALL (live Nov 22 2026). Same amber token as weak calls: --qe-weak #E8C872. ===== */
.action-box .status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  flex: 1 1 0;
  gap: 5px;
}
.action-box .status-stack .status-word {
  flex: 0 1 auto;
  width: 100%;
}
.action-box.lean-box {
  color: var(--qe-weak, #E8C872) !important;
  border: 1.5px dashed rgba(var(--qe-weak-rgb, 232, 200, 114), .75) !important;
  background: rgba(var(--qe-weak-rgb, 232, 200, 114), .06) !important;
  box-shadow: none !important;
}
.action-box.lean-box .status-word,
.status-word.lean-status {
  color: var(--qe-weak, #E8C872) !important;
  text-shadow: none !important;
  animation: none !important;
}
.status-sub {
  display: none;
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.25;
  color: #E8C872;
  text-transform: none;
  text-shadow: none;
}
.action-box.lean-box:not(.settle-won):not(.settle-lost) .status-sub,
.status-sub.is-on { display: block; }
.status-sub[hidden],
.action-box.settle-won .status-sub,
.action-box.settle-lost .status-sub { display: none !important; }

.badge.LEAN {
  color: var(--qe-weak, #E8C872);
  background: rgba(var(--qe-weak-rgb, 232, 200, 114), .06);
  border: 1.5px dashed rgba(var(--qe-weak-rgb, 232, 200, 114), .75);
}
.sheet-sub {
  margin: 4px 0 2px;
  font-size: 11px;
  font-weight: 700;
  color: #E8C872;
  letter-spacing: .03em;
}
.qe-lean-ex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px dashed rgba(var(--qe-weak-rgb, 232, 200, 114), .75);
  background: rgba(var(--qe-weak-rgb, 232, 200, 114), .06);
  max-width: 100%;
  box-sizing: border-box;
}
.qe-lean-ex .qe-st.weak {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13px;
  letter-spacing: -.01em;
  color: var(--qe-weak, #E8C872);
}
.qe-st-sub {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  color: #E8C872;
  line-height: 1.25;
}

/* ===== LEAN CALL fix 2 (Nov 22 2026): WAIT example matches row box style; lean word wraps inside the box. ===== */
.qe-lean-ex {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.qe-lean-ex .qe-st.weak,
.qe-lean-ex .qe-st {
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: normal;
  max-width: 100%;
  line-height: 1.2;
}
.badge.LEAN {
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

/* WAIT: same shape, width, padding and dashed-border family as .qe-lean-ex; keep wait (neutral gold) color. */
.qe-quick-row .qe-quick-ex > .qe-st.wait,
.qe-wait-ex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px dashed rgba(var(--qe-call-wait-rgb, 255, 213, 106), .55);
  background: rgba(var(--qe-call-wait-rgb, 255, 213, 106), .10);
  color: var(--qe-call-wait, #ffd56a);
}
.qe-wait-ex .qe-st.wait {
  border: 0;
  background: transparent;
  padding: 0;
  white-space: normal;
}

/* ===== LEAN BUY + LBU/LBD chart-tag examples (Nov 23 2026) ===== */
.qe-chart-tag {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 3px;
  color: #111;
  background: var(--qe-weak, #E8C872);
  box-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.qe-mk-ex .rule-k { display: flex; align-items: center; gap: 6px; }
.qe-mk-ex .rule-v { min-width: 0; }

/* ===== Settle colors (Nov 23 2026): WON green / LOST red, only after the round ends. Live LEAN and WEAK CALL stay amber #E8C872. ===== */
:root { --qe-settle-won: #7dffc8; --qe-settle-won-rgb: 125, 255, 200; --qe-settle-lost: #ff8aa0; --qe-settle-lost-rgb: 255, 138, 160; }
.action-box.lean-box.settle-won,
.action-box.weak-box.settle-won,
.status-word.settle-won,
.qe-st.settle-won,
.badge.settle-won,
.qe-lean-ex:has(.settle-won),
.lean-status-pic.settle-won,
.lean-status-word.settle-won,
.call-chip.settle-won {
  color: var(--qe-settle-won, #7dffc8) !important;
  border-color: rgba(var(--qe-settle-won-rgb, 125, 255, 200), .75) !important;
  background: rgba(var(--qe-settle-won-rgb, 125, 255, 200), .10) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.action-box.settle-won .status-word,
.action-box.settle-won .status-sub { color: var(--qe-settle-won, #7dffc8) !important; }
.action-box.lean-box.settle-lost,
.action-box.weak-box.settle-lost,
.status-word.settle-lost,
.qe-st.settle-lost,
.badge.settle-lost,
.qe-lean-ex:has(.settle-lost),
.lean-status-pic.settle-lost,
.lean-status-word.settle-lost,
.call-chip.settle-lost {
  color: var(--qe-settle-lost, #ff8aa0) !important;
  border-color: rgba(var(--qe-settle-lost-rgb, 255, 138, 160), .75) !important;
  background: rgba(var(--qe-settle-lost-rgb, 255, 138, 160), .10) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.action-box.settle-lost .status-word,
.action-box.settle-lost .status-sub { color: var(--qe-settle-lost, #ff8aa0) !important; }

/* Yellow-call rules box (names, priority, ⚠ live / settle colors) */
.qe-call-rules {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(232, 200, 114, .4);
  background: rgba(232, 200, 114, .07);
  border-radius: 10px;
  color: var(--text, #eee);
  font-size: 13px;
  line-height: 1.5;
}
.qe-call-rules p { margin: 0 0 8px; }
.qe-call-rules p:last-child { margin-bottom: 0; }
.qe-call-rules .settle-won { color: #7dffc8; font-weight: 700; }
.qe-call-rules .settle-lost { color: #ff8aa0; font-weight: 700; }

/* Long yellow STATUS examples in the cheat sheet / rules / popup must wrap on a phone. */
.qe-quick-ex > .qe-st.weak,
.qe-quick-ex > .qe-st {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  max-width: 100%;
}

/* t980u: LEAN / WEAK CALL STATUS stays on one line; JS shrinks the font to fit. Real-call .status-word wrap behavior is unchanged. */
.status-word.lean-status,
.status-word.weak-status,
.action-box.lean-box .status-word,
.action-box.weak-box .status-word {
  white-space: nowrap !important;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
/* Example pills / sheet badges for these call states also stay on one line. */
.qe-st.weak,
.qe-st.settle-won,
.qe-st.settle-lost,
.badge.LEAN,
.lean-status-word,
.call-chip.lean,
.call-chip.weak {
  white-space: nowrap !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}
.qe-st-sub,
.lean-status-sub,
.sheet-card:has(.badge.LEAN) .sheet-sub {
  display: none !important;
}

/* t980u override: yellow STATUS example pills stay on one line (wins over earlier wrap fixes). Leave .qe-st.badge-weak wrapping. */
.qe-lean-ex .qe-st.weak,
.qe-lean-ex .qe-st.settle-won,
.qe-lean-ex .qe-st.settle-lost,
.qe-quick-ex > .qe-st.weak,
.qe-quick-ex > .qe-st.settle-won,
.qe-quick-ex > .qe-st.settle-lost,
.qe-st.weak,
.qe-st.settle-won,
.qe-st.settle-lost,
.badge.LEAN,
.lean-status-word,
.call-chip.lean,
.call-chip.weak {
  white-space: nowrap !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

/* Launch prep (Nov 23): on narrow phones (<=360px) and the 3-column desk (900-1199px), a yellow LEAN / WEAK CALL
   word shrank to 6-8px beside the STATUS label. Give it its own full-width row under the label (still one line). */
@media (max-width: 360px), (min-width: 900px) and (max-width: 1199px) {
  .action-box.weak-box, .action-box.lean-box { flex-wrap: wrap !important; }
  .action-box.weak-box > .status-stack, .action-box.lean-box > .status-stack { flex: 1 1 100% !important; max-width: 100%; min-width: 0; }
}

/* prelaunch5 (Nov 23 2026): 320-379px phones. The mobile header row (logo + wordmark + Pop out + Fit)
   was ~370px wide, so the page scrolled sideways and the How Calls 'Got it' sat partly off-screen.
   Narrow phones only: Pop out shows its icon (label stays as aria-label), and at <=340px the wordmark
   is a little smaller. Logo gradient / theme rules are untouched. 380px+ is unchanged. */
@media (max-width: 379px) {
  .mobile-brand .pip-btn .pip-btn-label { display: none; }
  .mobile-brand .pip-btn { padding: 6px 8px; }
  .mobile-brand { min-width: 0; }
  .mobile-brand .brand-name { min-width: 0; white-space: nowrap; }
}
@media (max-width: 340px) {
  .mobile-brand { gap: 8px; }
  .mobile-brand .brand-name { font-size: 20px; }
  html[data-layout="fit"] .mobile-brand .brand-name { font-size: 15px; }
}

/* Weekly call results (live Nov 23 2026). Colors locked: amber #E8C872, green #7dffc8, red #ff8aa0. */
.weekly-box { margin-top: 14px; }
.weekly-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.weekly-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9AA4B2;
  font-weight: 700;
}
.weekly-note { margin: 0 0 8px; font-size: 11px; color: var(--muted, #8B93A1); line-height: 1.4; }
.weekly-weeks { display: flex; flex-direction: column; gap: 10px; }
.weekly-panel {
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22,26,34,.96), rgba(12,14,18,.98));
  border: 1px solid rgba(125,255,200,.22);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
  overflow: hidden;
  min-width: 0;
}
.weekly-h { padding: 10px 12px 8px; background: linear-gradient(90deg, rgba(125,255,200,.14), rgba(224,184,255,.08)); border-bottom: 1px solid rgba(125,255,200,.16); }
.weekly-h h3 { margin: 0; font-size: 13px; font-weight: 700; color: #F4F7FB; }
.weekly-h .range { margin: 2px 0 0; font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace); font-size: 11px; color: #F4F7FB; }
.weekly-h .so-far {
  display: inline-block; margin-left: 6px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: #E0B8FF; border: 1px solid rgba(224,184,255,.4); background: rgba(224,184,255,.12);
  border-radius: 999px; padding: 1px 7px; vertical-align: 1px;
}
.weekly-h .asof { margin: 3px 0 0; font-size: 10px; color: #6A7280; }
.weekly-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.weekly-block { border-radius: 10px; padding: 8px 10px; background: rgba(255,255,255,.03); min-width: 0; }
.weekly-block.green { border-left: 3px solid #7dffc8; }
.weekly-block.lean, .weekly-block.warn { border-left: 3px solid #E8C872; background: rgba(232,200,114,.08); }
.weekly-block .tally { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .01em; line-height: 1.3; }
.weekly-block.green .tally { color: #7dffc8; }
.weekly-block.lean .tally, .weekly-block.warn .tally { color: #E8C872; }
.weekly-block .money { margin: 0 0 8px; font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace); font-size: 11px; color: var(--muted, #8B93A1); }
.weekly-block .pnl-pos { color: #7dffc8; }
.weekly-block .pnl-neg { color: #ff8aa0; }
.weekly-block .lines { list-style: none; margin: 0; padding: 0; }
.weekly-block .lines li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: 5px 0; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
}
.weekly-block .lines li:first-child { border-top: 0; padding-top: 0; }
.weekly-block .when { font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace); font-size: 11px; font-weight: 500; color: #6A7280; min-width: 7.2em; }
.weekly-block .call { color: #F0EEE8; }
.weekly-block.lean .call, .weekly-block.warn .call { color: #E8C872; }
.weekly-block .won { color: #7dffc8; }
.weekly-block .lost { color: #ff8aa0; }
.weekly-block details.more { margin-top: 4px; }
.weekly-block details.more summary {
  cursor: pointer; font-size: 11px; color: #E0B8FF; font-weight: 600;
  list-style: none;
}
.weekly-block details.more summary::-webkit-details-marker { display: none; }
.weekly-block details.more summary::after { content: " ▸"; }
.weekly-block details.more[open] summary::after { content: " ▾"; }
@media (max-width: 360px) {
  .weekly-block .tally { font-size: 12px; }
  .weekly-h { padding: 8px 10px 6px; }
  .weekly-body { padding: 6px 8px 8px; }
}

/* Nov 23: weekly results folded on Score page */
.weekly-fold { margin: 12px 0; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.03); }
.weekly-fold-sum { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.weekly-fold-sum::-webkit-details-marker { display: none; }
.weekly-fold[open] .weekly-fold-chev { transform: rotate(90deg); }
.weekly-fold-chev { transition: transform .15s; }
.weekly-fold > .weekly-box { padding: 0 10px 10px; }

.round-row .pnl.is-call .call-lbl.real { color: #7dffc8; }

/* BOUNCE SOON UP/DOWN is a heads-up, not a buy: wait-style box, side-tinted word. */
.action-box.tone-bosoon-up,
.action-box.tone-bosoon-down {
  border-color: rgba(255, 213, 106, 0.75);
  background:
    linear-gradient(180deg, rgba(255, 213, 106, 0.16), rgba(50, 36, 8, 0.28));
  box-shadow:
    0 0 12px rgba(255, 213, 106, 0.4),
    0 0 24px rgba(255, 210, 63, 0.18),
    inset 0 0 22px rgba(255, 213, 106, 0.10),
    inset 0 1px 0 rgba(255, 240, 200, 0.22);
  color: #ffd56a;
}
.action-box.tone-bosoon-up .status-word { color: #7dffc8 !important; }
.action-box.tone-bosoon-down .status-word { color: #ff8aa0 !important; }
.badge.BOSOON-UP,
.badge.BOSOON-DOWN {
  background: rgba(var(--wait-rgb), 0.14);
  border: 1px solid rgba(var(--wait-rgb), 0.45);
}
.badge.BOSOON-UP { color: #7dffc8; }
.badge.BOSOON-DOWN { color: #ff8aa0; }
.qe-bo-up { color: #7dffc8; font-weight: 700; }
.qe-bo-dn { color: #ff8aa0; font-weight: 700; }

/* Flip Risk chance caption: Model + Kalshi, approved UP/DOWN colors */
.flip-panel #up-chance-label,
.flip-panel .flip-chance {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 650;
  white-space: normal;
  line-height: 1.25;
  max-width: 62%;
}
.flip-panel #up-chance-label.up,
.flip-panel .flip-chance.up { color: #7dffc8 !important; }
.flip-panel #up-chance-label.down,
.flip-panel .flip-chance.down { color: #ff8aa0 !important; }

/* Held-call note under STATUS (shown only when the live leader is the other side) */
.held-note {
  margin: 8px 0 0;
  padding: 0;
  max-width: 28rem;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}
.held-note.warn,
.held-note.lean { color: #E8C872; }
.held-note.green.up { color: #7dffc8; }
.held-note.green.down { color: #ff8aa0; }
.held-note[hidden] { display: none !important; }
