        /* ============================================================
           EMI ALIGN — marketing-site parity (Option A)
           Force dark-only, marketing palette, marketing radii.
           This block runs FIRST; the original :root below is overridden
           by the html[data-theme="dark"] block at the bottom of this shim.
           ============================================================ */
        :root {
            color-scheme: dark;
            /* Marketing-site brand tokens (verbatim from /styles.css) */
            --emi-bg:        #1B2B34;
            --emi-bg-2:      #223842;
            --emi-bg-3:      #2b4452;
            --emi-line:      #2e4754;
            --emi-line-2:    #3b576a;
            --emi-fg:        #E9FBFF;
            --emi-fg-2:      #a8c4cf;
            --emi-fg-3:      #6b8794;
            --emi-mint:      #4BB7A3;
            --emi-mint-2:    #3fa090;
            --emi-mint-bright: #7BE0C8;
            --emi-mint-pale: #BDF5E4;
            --emi-mint-dim:  #1f3d3a;
            --emi-tv-up:     #26A69A;
            --emi-tv-down:   #EF5350;
            --emi-amber:     #ffb454;
        }
        /* Auto-default to dark before any JS runs */
        html:not([data-theme="light"]) { color-scheme: dark; }

        /* Original :root — kept for compat but neutralised at the bottom */
        :root {
            color-scheme: dark;
            /* DARK is default — light requires explicit data-theme="light" */
            --bg: #1B2B34;
            --bg-2: #223842;
            --bg-3: #2b4452;
            --panel: #223842;
            --text: #E9FBFF;
            --muted: #a8c4cf;
            --muted-strong: #c9edf5;
            --accent: #4BB7A3;
            --accent-bright: #7BE0C8;
            --accent-soft: rgba(75, 183, 163, 0.18);
            --accent-strong: #7BE0C8;
            --danger: #EF5350;
            --danger-soft: rgba(239, 83, 80, 0.18);
            --danger-strong: #ff7e89;
            --warning: #ffb454;
            --warning-soft: rgba(255, 180, 84, 0.18);
            --warning-strong: #ffd99f;
            --line: #2e4754;
            --line-strong: #3b576a;
            --shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
            --radius: 8px;
            --button-active-bg: #E9FBFF;
            --button-active-text: #0b1d22;
            --surface-soft: #223842;
            --surface-control: #223842;
            --surface-input: #1B2B34;
            --surface-subtle: rgba(233, 251, 255, 0.03);
            --surface-muted: rgba(233, 251, 255, 0.05);
            --surface-muted-strong: rgba(233, 251, 255, 0.08);
            --surface-dialog: #223842;
            --surface-card: #223842;
            --surface-card-strong: #2b4452;
            --surface-card-soft: #223842;
            --surface-chip: #2b4452;
            --surface-toggle-thumb: #E9FBFF;
            --surface-chart: #223842;
            --tv-up: #26A69A;
            --tv-up-rgb: 38, 166, 154;
            --tv-down: #EF5350;
            --tv-down-rgb: 239, 83, 80;
        }
        html[data-theme="dark"] {
            color-scheme: dark;
            /* Marketing-site palette (verbatim) — solid borders, sharp radii. */
            --bg: #1B2B34;
            --bg-2: #223842;
            --bg-3: #2b4452;
            --panel: #223842;
            --text: #E9FBFF;
            --muted: #a8c4cf;
            --muted-strong: #c9edf5;
            --accent: #4BB7A3;
            --accent-bright: #7BE0C8;
            --accent-soft: rgba(75, 183, 163, 0.18);
            --accent-strong: #7BE0C8;
            --danger: #EF5350;
            --danger-soft: rgba(239, 83, 80, 0.18);
            --danger-strong: #ff7e89;
            --warning: #ffb454;
            --warning-soft: rgba(255, 180, 84, 0.18);
            --warning-strong: #ffd99f;
            --line: #2e4754;
            --line-strong: #3b576a;
            --shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
            --button-active-bg: #E9FBFF;
            --button-active-text: #0b1d22;
            --surface-soft: #223842;
            --surface-control: #223842;
            --surface-input: #1B2B34;
            --surface-subtle: rgba(233, 251, 255, 0.03);
            --surface-muted: rgba(233, 251, 255, 0.05);
            --surface-muted-strong: rgba(233, 251, 255, 0.08);
            --surface-dialog: #223842;
            --surface-card: #223842;
            --surface-card-strong: #2b4452;
            --surface-card-soft: #223842;
            --surface-chip: #2b4452;
            --surface-toggle-thumb: #E9FBFF;
            --tv-up: #26A69A;
            --tv-up-rgb: 38, 166, 154;
            --tv-down: #EF5350;
            --tv-down-rgb: 239, 83, 80;
            --surface-chart: #223842;
        }
        html[data-theme="light"] {
            color-scheme: light;
            --bg: #f4f8f9;
            --bg-2: #edf5f6;
            --bg-3: #e2ecef;
            --panel: #ffffff;
            --text: #17313a;
            --muted: #5f7882;
            --muted-strong: #36555f;
            --accent: #4BB7A3;
            --accent-bright: #267f73;
            --accent-soft: rgba(75, 183, 163, 0.14);
            --accent-strong: #267f73;
            --danger: #d84f5f;
            --danger-soft: rgba(216, 79, 95, 0.12);
            --danger-strong: #b93445;
            --warning: #c9871f;
            --warning-soft: rgba(201, 135, 31, 0.16);
            --warning-strong: #9d640f;
            --line: rgba(27, 43, 52, 0.14);
            --line-strong: rgba(27, 43, 52, 0.24);
            --shadow: 0 12px 32px rgba(17, 43, 52, 0.08);
            --button-active-bg: #1B2B34;
            --button-active-text: #ffffff;
            --surface-soft: #f7fbfc;
            --surface-control: #ffffff;
            --surface-input: #ffffff;
            --surface-subtle: rgba(27, 43, 52, 0.025);
            --surface-muted: rgba(27, 43, 52, 0.045);
            --surface-muted-strong: rgba(27, 43, 52, 0.075);
            --surface-dialog: #ffffff;
            --surface-card: #ffffff;
            --surface-card-strong: #f1f7f8;
            --surface-card-soft: #f8fbfc;
            --surface-chip: #eef6f7;
            --surface-toggle-thumb: #1B2B34;
            --surface-chart: #ffffff;
            --tv-up: #168f82;
            --tv-up-rgb: 22, 143, 130;
            --tv-down: #d84f5f;
            --tv-down-rgb: 216, 79, 95;
        }
        * { box-sizing: border-box; }
        html {
            background: var(--bg);
            overflow-x: hidden;
        }
        body {
            margin: 0;
            min-height: 100vh;
            padding-top: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            color: var(--text);
            background: var(--bg);
            font-size: 15px;
            transition: background 180ms ease, color 180ms ease;
            overflow-x: hidden;
        }
        [hidden] {
            display: none !important;
        }
        html[data-theme="dark"] body {
            background: var(--bg);
        }
        html[data-theme="light"] body {
            background: var(--bg);
        }
        .shell {
            width: min(1380px, calc(100% - 32px));
            margin: 0 auto 48px;
            display: grid;
            gap: 18px;
        }
        body.dashboard-access-locked {
            background: url("./dashboard-bg.jpg") center center / cover fixed no-repeat;
        }
        html[data-theme="dark"] body.dashboard-access-locked {
            background: url("./dashboard-bg.jpg") center center / cover fixed no-repeat;
        }
        body.dashboard-access-locked .shell {
            width: 100%;
            min-height: 100vh;
            margin: 0;
            gap: 0;
            grid-template-rows: auto 1fr;
        }
        .topbar {
            position: sticky;
            top: 0;
            z-index: 60;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            width: 100vw;
            margin-left: calc(50% - 50vw);
            padding: 0 max(16px, calc((100vw - 1380px) / 2 + 16px));
            min-height: 68px;
            border-radius: 0;
            background: rgba(10,11,13,0.78);
            backdrop-filter: saturate(140%) blur(16px);
            border: none;
            border-bottom: 1px solid rgba(123, 224, 200, 0.16);
            box-shadow: none;
        }
        html:not([data-theme="dark"]) .topbar {
            background: rgba(255, 255, 255, 0.94);
            backdrop-filter: saturate(140%) blur(16px);
            border-bottom: 1px solid rgba(27, 43, 52, 0.10);
        }
        .topbar-brand {
            display: inline-flex;
            align-items: center;
            gap: 0;
            min-width: 0;
            color: inherit;
            text-decoration: none;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-weight: 700;
            letter-spacing: -0.02em;
            font-size: 0;
            line-height: 0;
        }
        .topbar-brand::before {
            content: "";
            display: block;
            width: 90px;
            height: 25px;
            background: url("/assets/EMI_LOGO_DARKBACKGROUND_WEB.png") left center / contain no-repeat;
            flex: 0 0 auto;
        }
        html:not([data-theme="dark"]) .topbar-brand::before {
            background-image: url("/assets/EMI_LOGO_COLOR_WEB.png");
        }
        .topbar-logo {
            display: none;
        }
        .topbar-brand-copy {
            display: none;
        }
        .topbar-nav {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 30px;
            flex: 1 1 auto;
            flex-wrap: wrap;
            padding-left: 44px;
        }
        .topbar-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 68px;
            padding: 0;
            border-radius: 0;
            border: none;
            background: transparent;
            color: #a8c4cf;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-decoration: none;
            text-transform: uppercase;
            box-shadow: inset 0 -2px 0 transparent;
            transition: color 140ms ease, box-shadow 140ms ease;
        }
        html:not([data-theme="dark"]) .topbar-link {
            color: #557480;
        }
        .topbar-link:hover,
        .topbar-link:focus-visible {
            background: transparent;
            color: #e9fbff;
            outline: none;
        }
        html:not([data-theme="dark"]) .topbar-link:hover,
        html:not([data-theme="dark"]) .topbar-link:focus-visible {
            color: #1b2b34;
        }
        .topbar-link.active {
            background: transparent;
            color: #e9fbff;
            box-shadow: inset 0 -2px 0 #4BB7A3;
        }
        html:not([data-theme="dark"]) .topbar-link.active {
            color: #1b2b34;
        }
        .topbar-actions {
            display: flex;
            flex-wrap: nowrap;
            gap: 12px;
            align-items: center;
            justify-content: flex-end;
            margin-left: auto;
        }
        .topbar-menu {
            position: relative;
        }
        .topbar-dropdown {
            position: absolute;
            top: calc(100% + 12px);
            right: 0;
            min-width: 170px;
            padding: 12px;
            border-radius: 14px;
            background: rgba(10,11,13,0.96);
            border: 1px solid rgba(123, 224, 200, 0.16);
            box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
            backdrop-filter: saturate(140%) blur(16px);
            display: grid;
            gap: 6px;
            z-index: 80;
            color: #e9fbff;
        }
        html:not([data-theme="dark"]) .topbar-dropdown {
            background: rgba(255, 255, 255, 0.98);
            border-color: rgba(27, 43, 52, 0.10);
            box-shadow: 0 24px 56px rgba(27, 43, 52, 0.14);
            color: #1b2b34;
        }
        .theme-option {
            border: 1px solid transparent;
            background: transparent;
            color: #a8c4cf;
            border-radius: 10px;
            padding: 9px 12px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            cursor: pointer;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
        }
        html:not([data-theme="dark"]) .theme-option {
            color: #557480;
        }
        .theme-option:hover,
        .theme-option:focus-visible {
            border-color: rgba(123, 224, 200, 0.18);
            background: rgba(233, 251, 255, 0.05);
            color: #e9fbff;
            outline: none;
        }
        html:not([data-theme="dark"]) .theme-option:hover,
        html:not([data-theme="dark"]) .theme-option:focus-visible {
            border-color: rgba(27, 43, 52, 0.12);
            background: rgba(27, 43, 52, 0.04);
            color: #1b2b34;
        }
        .theme-option.active {
            color: #e9fbff;
            background: rgba(75, 183, 163, 0.12);
        }
        html:not([data-theme="dark"]) .theme-option.active {
            color: #1b2b34;
        }
        .theme-option.active::after {
            content: "•";
            color: #4BB7A3;
            font-size: 14px;
            line-height: 1;
        }
        .topbar .button {
            background: transparent;
            border-color: rgba(123, 224, 200, 0.16);
            color: #e9fbff;
        }
        html:not([data-theme="dark"]) .topbar .button {
            border-color: rgba(27, 43, 52, 0.12);
            color: #1b2b34;
        }
        .topbar .button:hover,
        .topbar .button:focus-visible {
            background: rgba(233, 251, 255, 0.05);
            border-color: rgba(123, 224, 200, 0.22);
            outline: none;
        }
        html:not([data-theme="dark"]) .topbar .button:hover,
        html:not([data-theme="dark"]) .topbar .button:focus-visible {
            background: rgba(27, 43, 52, 0.04);
            border-color: rgba(27, 43, 52, 0.16);
        }
        .icon-button {
            min-width: 14px;
            min-height: 14px;
            padding: 0 2px;
            border: none !important;
            background: transparent !important;
            box-shadow: none !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
        }
        .topbar-icon,
        .follow-star-glyph {
            font-family: "Material Symbols Rounded";
            font-weight: normal;
            font-style: normal;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            white-space: nowrap;
            direction: ltr;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-feature-settings: "liga";
        }
        .topbar-icon {
            font-size: 14px;
            font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
        }
        .topbar .icon-button {
            color: #a8c4cf;
        }
        html:not([data-theme="dark"]) .topbar .icon-button {
            color: #557480;
        }
        .topbar .icon-button:hover,
        .topbar .icon-button:focus-visible {
            background: transparent !important;
            border-color: transparent !important;
            color: #e9fbff;
            outline: none;
        }
        html:not([data-theme="dark"]) .topbar .icon-button:hover,
        html:not([data-theme="dark"]) .topbar .icon-button:focus-visible {
            background: transparent !important;
            border-color: transparent !important;
            color: #1b2b34;
        }
        .notification-button {
            position: relative;
        }
        .notification-badge {
            position: absolute;
            top: -6px;
            right: -7px;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: #4BB7A3;
            color: #0b1d22;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.06em;
            line-height: 1;
            border: 1px solid rgba(10,11,13,0.92);
        }
        .topbar-notification-dropdown {
            min-width: 360px;
            max-width: min(380px, calc(100vw - 32px));
            gap: 10px;
        }
        .notification-panel {
            display: grid;
            gap: 12px;
        }
        .notification-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .notification-header-copy {
            display: grid;
            gap: 4px;
        }
        .notification-title {
            color: #e9fbff;
            font-size: 14px;
            font-weight: 600;
            letter-spacing: -0.01em;
            line-height: 1.2;
        }
        .notification-subtitle {
            color: #a8c4cf;
            font-size: 12px;
            line-height: 1.4;
        }
        .notification-list {
            display: grid;
            gap: 8px;
        }
        .notification-item {
            width: 100%;
            display: grid;
            gap: 6px;
            padding: 12px;
            border-radius: 12px;
            border: 1px solid rgba(123, 224, 200, 0.12);
            background: rgba(233, 251, 255, 0.03);
            color: inherit;
            text-align: left;
            cursor: pointer;
            transition: border-color 140ms ease, background 140ms ease;
        }
        .notification-item:hover,
        .notification-item:focus-visible {
            border-color: rgba(123, 224, 200, 0.2);
            background: rgba(233, 251, 255, 0.06);
            outline: none;
        }
        .notification-item.unread {
            border-color: rgba(75, 183, 163, 0.26);
            background: rgba(75, 183, 163, 0.08);
        }
        .notification-item-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }
        .notification-item-title {
            color: #e9fbff;
            font-size: 13px;
            font-weight: 600;
            line-height: 1.35;
        }
        .notification-item-time {
            color: #a8c4cf;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.08em;
            line-height: 1.3;
            text-transform: uppercase;
            white-space: nowrap;
        }
        .notification-item-body {
            color: #a8c4cf;
            font-size: 12px;
            line-height: 1.45;
        }
        .notification-item-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .notification-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 8px;
            height: 8px;
            border-radius: 999px;
            background: #4BB7A3;
        }
        .notification-status {
            color: #7BE0C8;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        .notification-empty {
            color: #a8c4cf;
            font-size: 12px;
            line-height: 1.5;
            padding: 4px 0;
        }
        body.dashboard-access-locked #dashboardMainContent,
        body.dashboard-access-locked #routeDetailHostPanel {
            display: none !important;
        }
        .access-gate-panel {
            padding: clamp(24px, 5vw, 48px);
            border-radius: 0;
        }
        body.dashboard-access-locked .access-gate-panel {
            width: 100%;
            min-height: 100%;
            display: grid;
            place-items: center;
            padding: clamp(28px, 6vw, 64px);
            background: transparent;
            backdrop-filter: none;
            border: none;
            box-shadow: none;
        }
        .access-gate-body {
            display: grid;
            gap: 18px;
            width: min(620px, 100%);
            margin: 0 auto;
            padding: clamp(28px, 4vw, 42px);
            border-radius: 26px;
            border: 1px solid rgba(123, 224, 200, 0.16);
            background:
                linear-gradient(180deg, rgba(15, 25, 31, 0.64), rgba(15, 25, 31, 0.54)),
                radial-gradient(circle at top right, rgba(75, 183, 163, 0.12), transparent 38%);
            box-shadow: 0 34px 80px rgba(4, 10, 12, 0.42);
            backdrop-filter: blur(16px) saturate(120%);
            justify-items: center;
            text-align: center;
        }
        .access-gate-title {
            color: #f3fcff;
            font-size: clamp(30px, 4.6vw, 54px);
            font-weight: 700;
            letter-spacing: -0.03em;
            line-height: 0.98;
            margin: 0;
            max-width: 12ch;
        }
        .access-gate-copy {
            color: rgba(233, 251, 255, 0.82);
            font-size: 15px;
            line-height: 1.7;
            max-width: 52ch;
        }
        .access-gate-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }
        .access-gate-actions .button,
        .access-gate-actions a.button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            min-width: 152px;
        }
        body.dashboard-access-locked .access-gate-actions .button,
        body.dashboard-access-locked .access-gate-actions a.button {
            border-color: rgba(123, 224, 200, 0.22);
            color: #effcff;
            background: rgba(10, 20, 24, 0.58);
            box-shadow: 0 12px 30px rgba(4, 10, 12, 0.18);
        }
        body.dashboard-access-locked .access-gate-actions .button.primary {
            background: #4BB7A3;
            color: #071317;
            border-color: rgba(75, 183, 163, 0.78);
            box-shadow: 0 18px 36px rgba(75, 183, 163, 0.22);
        }
        body.dashboard-access-locked .access-gate-actions .button:hover,
        body.dashboard-access-locked .access-gate-actions .button:focus-visible,
        body.dashboard-access-locked .access-gate-actions a.button:hover,
        body.dashboard-access-locked .access-gate-actions a.button:focus-visible {
            background: rgba(16, 29, 35, 0.78);
            border-color: rgba(123, 224, 200, 0.34);
            color: #ffffff;
            outline: none;
        }
        body.dashboard-access-locked .access-gate-actions .button.primary:hover,
        body.dashboard-access-locked .access-gate-actions .button.primary:focus-visible {
            background: #63d1ba;
            color: #071317;
            border-color: rgba(99, 209, 186, 0.88);
        }
        .entry-signin-form {
            display: grid;
            gap: 18px;
            width: min(560px, 100%);
        }
        .entry-form-links {
            display: flex;
            justify-content: center;
            gap: 16px;
            flex-wrap: wrap;
            margin-top: -4px;
        }
        .entry-inline-link {
            appearance: none;
            border: none;
            background: none;
            padding: 0;
            color: var(--accent);
            font: inherit;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.02em;
            cursor: pointer;
            text-decoration: none;
        }
        .entry-inline-link:hover,
        .entry-inline-link:focus-visible {
            color: #7be0c8;
            outline: none;
            text-decoration: underline;
        }
        .entry-signed-in-state {
            display: grid;
            gap: 12px;
            width: min(560px, 100%);
            padding: 18px 20px;
            border-radius: 20px;
            border: 1px solid var(--line);
            background: color-mix(in srgb, var(--surface-card-strong) 92%, transparent);
            margin-bottom: 16px;
        }
        .entry-signed-in-kicker {
            color: var(--accent);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .entry-signed-in-meta {
            color: var(--text);
            font-size: 15px;
            line-height: 1.55;
        }
        .entry-signin-grid {
            display: grid;
            gap: 14px;
        }
        .entry-reset-copy {
            width: min(560px, 100%);
            color: var(--muted);
            font-size: 14px;
            line-height: 1.6;
            text-align: center;
            margin: -4px 0 2px;
        }
        .entry-signin-field {
            display: grid;
            gap: 8px;
            text-align: left;
        }
        .entry-signin-field span {
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .entry-signin-field input {
            width: 100%;
            padding: 14px 16px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: color-mix(in srgb, var(--surface-card-strong) 92%, transparent);
            color: var(--text);
            font: inherit;
            outline: none;
        }
        .entry-signin-field input:focus {
            border-color: rgba(75, 183, 163, 0.44);
            box-shadow: 0 0 0 3px rgba(75, 183, 163, 0.16);
        }
        .access-gate-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
        }
        .access-gate-chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--surface-soft);
            color: var(--muted);
            padding: 7px 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        html[data-theme="dark"] .access-gate-chip {
            border-color: rgba(123, 224, 200, 0.16);
            background: rgba(233, 251, 255, 0.04);
            color: #a8c4cf;
        }
        body.dashboard-access-locked .topbar {
            background: rgba(10, 11, 13, 0.48);
            border-bottom-color: rgba(123, 224, 200, 0.18);
        }
        html:not([data-theme="dark"]) body.dashboard-access-locked .topbar {
            background: rgba(255, 255, 255, 0.88);
            border-bottom-color: rgba(27, 43, 52, 0.10);
        }
        .topbar-account-dropdown {
            min-width: 340px;
            max-width: min(360px, calc(100vw - 32px));
        }
        .account-button {
            min-height: 42px;
            padding: 5px 8px 5px 5px;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            text-transform: none;
            letter-spacing: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
        }
        .account-button:hover,
        .account-button:focus-visible {
            border-color: var(--line);
            background: var(--surface-soft);
            outline: none;
        }
        .account-button.is-authenticated .account-avatar {
            background: #4BB7A3;
            color: #0b1d22;
        }
        .account-avatar {
            width: 30px;
            height: 30px;
            border-radius: 999px;
            display: grid;
            place-items: center;
            background: var(--surface-soft);
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0;
            flex: 0 0 auto;
        }
        .account-avatar.has-image,
        .account-header-avatar.has-image {
            padding: 0;
            overflow: hidden;
            background: rgba(233, 251, 255, 0.08);
            color: transparent;
        }
        .account-avatar img,
        .account-header-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .account-copy {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
            min-width: 0;
        }
        .account-label {
            color: #e9fbff;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: -0.01em;
            line-height: 1.1;
            white-space: nowrap;
        }
        .account-meta {
            color: #a8c4cf;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.12em;
            line-height: 1.1;
            text-transform: uppercase;
            white-space: nowrap;
        }
        html:not([data-theme="dark"]) .account-button {
            background: rgba(255, 255, 255, 0.94);
            border-color: rgba(15, 38, 46, 0.12);
        }
        html:not([data-theme="dark"]) .account-button:hover,
        html:not([data-theme="dark"]) .account-button:focus-visible {
            background: #ffffff;
            border-color: rgba(15, 38, 46, 0.18);
        }
        html:not([data-theme="dark"]) .account-label {
            color: #10262d;
        }
        html:not([data-theme="dark"]) .account-meta {
            color: #5f7680;
        }
        .account-panel {
            display: grid;
            gap: 14px;
        }
        .account-header {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .account-header-avatar {
            width: 42px;
            height: 42px;
            border-radius: 999px;
            display: grid;
            place-items: center;
            background: #4BB7A3;
            color: #0b1d22;
            font-size: 15px;
            font-weight: 800;
            flex: 0 0 auto;
        }
        .account-header-copy {
            min-width: 0;
            display: grid;
            gap: 3px;
        }
        .account-header-title-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            min-width: 0;
        }
        .account-header-title {
            color: #e9fbff;
            font-size: 15px;
            font-weight: 600;
            letter-spacing: -0.01em;
            line-height: 1.15;
        }
        .account-verified {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 999px;
            background: #4BB7A3;
            color: #0b1d22;
            flex: 0 0 auto;
        }
        .account-verified svg {
            width: 11px;
            height: 11px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2.4;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .account-header-subtitle {
            color: #a8c4cf;
            font-size: 12px;
            line-height: 1.4;
        }
        .account-form {
            display: grid;
            gap: 10px;
        }
        .account-field {
            display: grid;
            gap: 6px;
        }
        .account-field label {
            color: #a8c4cf;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        .account-input {
            width: 100%;
            border: 1px solid rgba(123, 224, 200, 0.16);
            background: rgba(233, 251, 255, 0.04);
            color: #e9fbff;
            border-radius: 14px;
            padding: 12px 14px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            line-height: 1.2;
        }
        .account-input::placeholder {
            color: rgba(168, 196, 207, 0.8);
        }
        .account-input:focus-visible {
            outline: none;
            border-color: rgba(75, 183, 163, 0.7);
            box-shadow: 0 0 0 3px rgba(75, 183, 163, 0.14);
        }
        .account-actions {
            display: grid;
            gap: 8px;
        }
        .account-actions .button,
        .account-actions a.button {
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            text-decoration: none;
            width: 100%;
        }
        .account-actions .button.action-secondary {
            background: rgba(233, 251, 255, 0.04);
            color: #a8c4cf;
        }
        .account-actions .button.action-secondary:hover,
        .account-actions .button.action-secondary:focus-visible {
            background: rgba(233, 251, 255, 0.07);
            color: #e9fbff;
        }
        .account-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .account-chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            border: 1px solid rgba(123, 224, 200, 0.12);
            background: rgba(75, 183, 163, 0.08);
            color: #cfe8ef;
            padding: 6px 11px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            line-height: 1;
        }
        .account-chip.good {
            color: var(--accent);
        }
        .account-chip.role {
            background: rgba(233, 251, 255, 0.05);
            border-color: rgba(233, 251, 255, 0.08);
            color: #9fb8c0;
        }
        .account-message {
            font-size: 12px;
            line-height: 1.5;
        }
        .account-message[data-tone="error"] {
            color: #ff7b8d;
        }
        .account-message[data-tone="warn"] {
            color: #ffb454;
        }
        .account-message[data-tone="info"] {
            color: #7BE0C8;
        }
        .account-note {
            color: #a8c4cf;
            font-size: 12px;
            line-height: 1.5;
        }
        .account-note a {
            color: #e9fbff;
        }
        .topbar-dropdown .button.primary {
            background: #4BB7A3;
            color: #0b1d22;
            border-color: transparent;
        }
        .topbar-dropdown .button.primary:hover,
        .topbar-dropdown .button.primary:focus-visible {
            background: #61c8b5;
            color: #0b1d22;
            border-color: transparent;
        }
        .utility-card .button.primary,
        .utility-form-actions .button.primary,
        .utility-inline-actions .button.primary {
            border-color: transparent;
        }
        html[data-theme="dark"] .utility-card .button.primary,
        html[data-theme="dark"] .utility-form-actions .button.primary,
        html[data-theme="dark"] .utility-inline-actions .button.primary {
            background: #4BB7A3;
            color: #071317;
            border-color: rgba(75, 183, 163, 0.78);
            box-shadow: 0 14px 28px rgba(75, 183, 163, 0.18);
        }
        html[data-theme="dark"] .utility-card .button.primary:hover,
        html[data-theme="dark"] .utility-card .button.primary:focus-visible,
        html[data-theme="dark"] .utility-form-actions .button.primary:hover,
        html[data-theme="dark"] .utility-form-actions .button.primary:focus-visible,
        html[data-theme="dark"] .utility-inline-actions .button.primary:hover,
        html[data-theme="dark"] .utility-inline-actions .button.primary:focus-visible {
            background: #63d1ba;
            color: #071317;
            border-color: rgba(99, 209, 186, 0.88);
        }
        html:not([data-theme="dark"]) .utility-card .button.primary,
        html:not([data-theme="dark"]) .utility-form-actions .button.primary,
        html:not([data-theme="dark"]) .utility-inline-actions .button.primary {
            background: #1b2b34;
            color: #e9fbff;
            border-color: #1b2b34;
            box-shadow: 0 14px 28px rgba(27, 43, 52, 0.10);
        }
        html:not([data-theme="dark"]) .utility-card .button.primary:hover,
        html:not([data-theme="dark"]) .utility-card .button.primary:focus-visible,
        html:not([data-theme="dark"]) .utility-form-actions .button.primary:hover,
        html:not([data-theme="dark"]) .utility-form-actions .button.primary:focus-visible,
        html:not([data-theme="dark"]) .utility-inline-actions .button.primary:hover,
        html:not([data-theme="dark"]) .utility-inline-actions .button.primary:focus-visible {
            background: #243844;
            color: #f4fdff;
            border-color: #243844;
        }
        .utility-card .button.primary:disabled,
        .utility-form-actions .button.primary:disabled,
        .utility-inline-actions .button.primary:disabled {
            opacity: 0.62;
        }
        .masthead, .panel, .metric, .table-wrap, .token-pane {
            background: var(--panel);
            backdrop-filter: blur(10px) saturate(120%);
            border: 1px solid var(--line);
            box-shadow: var(--shadow);
        }
        html[data-theme="dark"] .masthead,
        html[data-theme="dark"] .panel,
        html[data-theme="dark"] .metric,
        html[data-theme="dark"] .table-wrap,
        html[data-theme="dark"] .token-pane {
            box-shadow: none;
        }
        .masthead {
            border-radius: 24px;
            padding: 20px 26px 22px;
            display: grid;
            gap: 18px;
        }
        .masthead-top {
            display: flex;
            justify-content: space-between;
            gap: 18px;
            align-items: flex-start;
        }
        .brand {
            display: grid;
            gap: 8px;
        }
        .eyebrow {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            font-size: 10px;
            color: var(--muted);
        }
        h1 {
            margin: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: clamp(28px, 4vw, 40px);
            line-height: 1;
            font-weight: 600;
            letter-spacing: -0.04em;
        }
        .subcopy {
            margin: 0;
            max-width: 720px;
            color: var(--muted);
            line-height: 1.55;
            font-size: 14px;
        }
        .toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            justify-content: flex-end;
        }
        .toolbar-segment,
        .breadcrumb-bar {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--surface-soft);
        }
        /* Base .button — universal ghost/neutral style from the unified system.
           Variants (.button.primary, .casefile-cta, icon-button, .action-secondary)
           override the bg/border/color layer. Typography + shape here apply system-wide. */
        .button, .token-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: 1px solid var(--line);
            background: var(--surface-control);
            color: var(--text);
            border-radius: 8px;
            padding: 8px 14px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0;
            text-transform: none;
            line-height: 1.2;
            cursor: pointer;
            white-space: nowrap;
            text-decoration: none;
            transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
        }
        a.button,
        a.button:hover,
        a.button:focus-visible { text-decoration: none; }
        .button:hover,
        .button:focus-visible,
        .token-toggle:hover,
        .token-toggle:focus-visible {
            border-color: var(--text);
            outline: none;
        }
        .button:active,
        .token-toggle:active {
            transform: translateY(1px);
        }
        /* Dark-theme surface override applies only to neutral / ghost buttons.
           Primary CTAs (.button.primary, .button.casefile-cta, and the legacy
           data-open-casefile-* selectors) keep their mint background — without
           the :not() guard the dark rule's specificity (0,0,2,1) beats the CTA
           rule's (0,0,2,0) and silently re-paints them as dark surface-input,
           producing the unreadable black-on-black "Casefile" buttons. */
        html[data-theme="dark"] .button:not(.primary):not(.casefile-cta):not([data-open-casefile-from-executive]):not([data-open-casefile-from-symbol-review]),
        html[data-theme="dark"] .token-toggle,
        html[data-theme="dark"] .control-group select,
        html[data-theme="dark"] .control-group input,
        html[data-theme="dark"] .token-pane input {
            background: var(--surface-input);
        }
        /* Default primary CTA: mint-on-dark across both themes. The legacy
           token-driven (--button-active-bg) values rendered as dark navy in
           light theme and off-white in dark theme — both produced low-contrast
           "ghost" CTAs that home-gamer traders couldn't see at a glance.
           Specific surfaces (utility-card / utility-form-actions /
           utility-inline-actions) keep their tailored overrides above. */
        .button.primary {
            background: #4BB7A3;
            color: #0b1d22;
            border-color: transparent;
        }
        .button.primary:hover,
        .button.primary:focus-visible {
            background: #3fa090;
            color: #0b1d22;
            border-color: transparent;
            outline: none;
        }
        .button.primary:active {
            background: #2e8876;
            color: #0b1d22;
        }
        /* ============================================================= */
        /*  Unified button family — ported from marketing .btn system.   */
        /*  LG for hero surfaces, MD for primary dashboard CTAs,         */
        /*  SM for table-row actions. Black-on-mint, 8px radius.         */
        /*  Spec lives in /root/emi/docs/DESIGN.md.                      */
        /* ============================================================= */
        .btn,
        a.btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            font-weight: 500;
            letter-spacing: 0;
            text-transform: none;
            line-height: 1.2;
            border-radius: 8px;
            border: 1px solid transparent;
            white-space: nowrap;
            cursor: pointer;
            text-decoration: none;
            transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
        }
        .btn-primary { background: #4BB7A3; color: #0b1d22; font-weight: 600; }
        .btn-primary:hover,
        .btn-primary:focus-visible { background: #3fa090; color: #0b1d22; outline: none; }
        .btn-primary:active { background: #2e8876; color: #0b1d22; }
        .btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
        .btn-ghost:hover,
        .btn-ghost:focus-visible { border-color: var(--text); outline: none; }
        .btn-lg { padding: 16px 24px; font-size: 15px; border-radius: 10px; }
        .btn-md { padding: 12px 20px; font-size: 14px; }
        .btn-sm { padding: 8px 14px; font-size: 13px; }
        .btn .arrow,
        .btn .mi-14 { transition: transform 200ms ease; }
        .btn:hover .arrow,
        .btn:hover .mi-14 { transform: translateX(2px); }

        /* .casefile-cta — legacy class kept for backward compat, mapped to SM primary. */
        .button.casefile-cta,
        button[data-open-casefile-from-executive],
        button[data-open-casefile-from-symbol-review] {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0;
            text-transform: none;
            line-height: 1.2;
            padding: 8px 14px;
            border-radius: 8px;
            background: #4BB7A3;
            color: #0b1d22;
            border: 1px solid transparent;
            box-shadow: none;
        }
        .button.casefile-cta:hover,
        .button.casefile-cta:focus-visible,
        button[data-open-casefile-from-executive]:hover,
        button[data-open-casefile-from-executive]:focus-visible,
        button[data-open-casefile-from-symbol-review]:hover,
        button[data-open-casefile-from-symbol-review]:focus-visible {
            background: #3fa090;
            color: #0b1d22;
            border-color: transparent;
            outline: none;
        }
        .button.casefile-cta:active,
        button[data-open-casefile-from-executive]:active,
        button[data-open-casefile-from-symbol-review]:active {
            background: #2e8876;
            color: #0b1d22;
        }
        .theme-button {
            border: none;
            background: transparent;
            color: var(--muted);
            border-radius: 999px;
            padding: 7px 12px;
            font: inherit;
            font-weight: 700;
            cursor: pointer;
        }
        .theme-button.active {
            background: var(--button-active-bg);
            color: var(--button-active-text);
        }
        .button:disabled {
            opacity: 0.42;
            cursor: not-allowed;
        }
        .status-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 13px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent);
            font-size: 12px;
            font-weight: 700;
            justify-self: start;
        }
        /* V16.1 #1: variant for inline use in the casefile pageheader. Auto-width,
           tighter padding, JetBrains Mono uppercase like the marketing tags. */
        .status-pill.status-pill--inline {
            padding: 5px 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10.5px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            font-weight: 600;
            background: rgba(75, 183, 163, 0.12);
            border: 1px solid rgba(75, 183, 163, 0.32);
            color: #4BB7A3;
            align-self: center;
        }
        .status-pill.status-pill--inline .status-dot { width: 6px; height: 6px; }
        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: currentColor;
        }
        .tab-strip {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }
        .masthead-tabs {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }
        .crumb-label {
            color: var(--muted);
            font-size: 13px;
            font-weight: 700;
        }
        .breadcrumb-link {
            border: none;
            background: transparent;
            color: var(--muted);
            font: inherit;
            font-size: 12px;
            font-weight: 700;
            padding: 0;
            margin: 0;
            cursor: pointer;
        }
        .breadcrumb-link:hover,
        .breadcrumb-link:focus-visible {
            color: var(--text);
            outline: none;
        }
        .breadcrumb-link.current {
            color: var(--text);
        }
        .crumb-current {
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
        }
        .crumb-separator {
            color: var(--muted);
            font-size: 12px;
        }
        .tab-button {
            border: 1px solid var(--line);
            background: var(--surface-soft);
            color: var(--text);
            border-radius: 999px;
            padding: 10px 18px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            cursor: pointer;
        }
        .tab-button.active {
            background: var(--button-active-bg);
            color: var(--button-active-text);
            border-color: var(--button-active-bg);
        }
        html[data-theme="dark"] .tab-button.active {
            background: var(--button-active-bg);
            color: var(--button-active-text);
            border-color: var(--button-active-bg);
        }
        /* Same exclusion as the earlier dark-theme override: skip primary
           CTAs and casefile-cta so the mint background isn't repainted. */
        html[data-theme="dark"] .tab-button,
        html[data-theme="dark"] .button:not(.primary):not(.casefile-cta):not([data-open-casefile-from-executive]):not([data-open-casefile-from-symbol-review]),
        html[data-theme="dark"] .route-chip,
        html[data-theme="dark"] .chart-range,
        html[data-theme="dark"] .casefile-chip {
            background: rgba(31, 50, 60, 0.54);
        }
        .section-head-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: flex-end;
            align-items: center;
        }
        .route-chip {
            border: 1px solid var(--line);
            background: transparent;
            color: var(--muted);
            border-radius: 999px;
            padding: 7px 11px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            cursor: pointer;
            transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
        }
        .route-chip:hover {
            color: var(--text);
            border-color: rgba(27, 43, 52, 0.18);
        }
        html[data-theme="dark"] .route-chip:hover {
            border-color: rgba(233, 251, 255, 0.18);
        }
        .route-chip.active {
            background: var(--button-active-bg);
            color: var(--button-active-text);
            border-color: var(--button-active-bg);
        }
        .hidden {
            display: none !important;
        }
        .detail-callout {
            margin-top: 14px;
            padding: 15px 16px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--surface-soft);
            color: var(--muted);
            line-height: 1.6;
        }
        .detail-callout strong {
            color: var(--text);
        }
        .scope-toggle {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            user-select: none;
            color: var(--muted);
            font-weight: 700;
        }
        .scope-toggle-label {
            font-size: 15px;
        }
        .scope-toggle input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .scope-toggle-track {
            position: relative;
            width: 58px;
            height: 32px;
            border-radius: 999px;
            background: var(--surface-muted-strong);
            border: 1px solid rgba(27, 43, 52, 0.14);
            transition: background 160ms ease, border-color 160ms ease;
        }
        .scope-toggle-thumb {
            position: absolute;
            top: 3px;
            left: 3px;
            width: 24px;
            height: 24px;
            border-radius: 999px;
            background: var(--surface-toggle-thumb);
            box-shadow: 0 4px 10px rgba(27, 43, 52, 0.18);
            transition: transform 160ms ease;
        }
        .scope-toggle input:checked + .scope-toggle-track {
            background: rgba(14, 143, 97, 0.18);
            border-color: rgba(14, 143, 97, 0.35);
        }
        .scope-toggle input:checked + .scope-toggle-track .scope-toggle-thumb {
            transform: translateX(26px);
        }
        .scope-toggle input:focus-visible + .scope-toggle-track {
            outline: 2px solid rgba(14, 143, 97, 0.45);
            outline-offset: 2px;
        }
        .tab-panel {
            display: none;
            gap: 18px;
        }
        .tab-panel.active {
            display: grid;
        }
        body.route-detail-focus #dashboardMainContent {
            display: none !important;
        }
        body.route-detail-focus #routeDetailHostPanel {
            display: block !important;
        }
        .token-pane {
            display: none;
            border-radius: 18px;
            padding: 18px;
            gap: 10px;
        }
        .token-pane.active {
            display: grid;
        }
        .token-pane label {
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--muted);
            font-weight: 700;
        }
        .token-pane input {
            width: 100%;
            border: 1px solid var(--line);
            background: var(--surface-input);
            border-radius: 14px;
            padding: 13px 14px;
            font: inherit;
        }
        .summary-grid, .broker-grid, .alert-grid {
            display: grid;
            gap: 14px;
        }
        .summary-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
        .broker-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .risk-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .panel {
            border-radius: var(--radius);
            padding: 22px;
        }
        .metric {
            border-radius: var(--radius);
            padding: 20px 18px 16px;
            display: grid;
            align-content: start;
            gap: 8px;
        }
        .metric-button {
            width: 100%;
            border: 1px solid var(--line);
            text-align: left;
            cursor: pointer;
            font: inherit;
        }
        .metric-button:hover,
        .metric-button:focus-visible {
            border-color: var(--line-strong);
            box-shadow: 0 20px 44px rgba(27, 43, 52, 0.12);
            outline: none;
        }
        .metric-label {
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--muted);
            font-weight: 700;
            margin-bottom: 0;
            line-height: 1.2;
        }
        .metric-value {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 26px;
            font-weight: 700;
            line-height: 1.06;
            margin: 0;
            letter-spacing: -0.04em;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .metric-note {
            margin: 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.42;
        }
        .strip-head {
            margin: 0 0 12px;
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--muted);
            font-weight: 700;
        }
        .metric {
            min-width: 0;
            overflow: hidden;
        }
        .profit-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        #profitOutcomeGrid .metric {
            padding: 20px;
        }
        #profitOutcomeGrid .metric-value {
            font-size: 28px;
        }
        .profit-stack {
            display: grid;
            gap: 14px;
        }
        .profit-dashboard {
            display: grid;
            gap: 16px;
        }
        .profit-command-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.78fr) minmax(300px, 0.92fr);
            gap: 14px;
            align-items: stretch;
        }
        .profit-primary-panel,
        .profit-chart-card {
            min-width: 0;
            border: 1px solid var(--line);
            border-radius: var(--radius);
            background: var(--surface-card-soft);
            padding: 18px;
            display: grid;
            align-content: start;
            gap: 14px;
        }
        .profit-card-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 14px;
        }
        .profit-card-head .strip-head {
            margin-bottom: 6px;
        }
        .profit-card-head h3 {
            margin: 0;
            font-size: 17px;
            line-height: 1.15;
            letter-spacing: 0;
        }
        .profit-window-pill {
            display: inline-flex;
            align-items: center;
            min-height: 30px;
            padding: 0 11px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--surface-muted);
            color: var(--muted-strong);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
        }
        .profit-primary-metrics {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .profit-primary-metrics .metric {
            min-height: 132px;
            padding: 16px;
            background: var(--surface-muted);
        }
        .profit-primary-metrics .metric-value {
            font-size: 25px;
        }
        .profit-radar {
            display: grid;
            grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1fr);
            gap: 12px;
            align-items: center;
        }
        .profit-radar-svg {
            width: 100%;
            max-width: 250px;
            justify-self: center;
            overflow: visible;
        }
        .profit-radar-ring {
            fill: none;
            stroke: var(--line);
            stroke-width: 1;
        }
        .profit-radar-axis {
            stroke: var(--line-strong);
            stroke-width: 1;
        }
        .profit-radar-area {
            fill: rgba(var(--tv-up-rgb), 0.18);
            stroke: rgba(var(--tv-up-rgb), 0.82);
            stroke-width: 1.5;
        }
        .profit-radar-line {
            fill: none;
            stroke: var(--accent-bright);
            stroke-width: 2;
        }
        .profit-radar-dot {
            fill: var(--accent-bright);
            stroke: var(--panel);
            stroke-width: 1.5;
        }
        .profit-radar-label {
            fill: var(--muted-strong);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 9px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .profit-radar-list {
            display: grid;
            gap: 8px;
            min-width: 0;
        }
        .profit-radar-stat {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 4px 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--line);
        }
        .profit-radar-stat:last-child {
            border-bottom: 0;
            padding-bottom: 0;
        }
        .profit-radar-stat span {
            color: var(--text);
            font-weight: 800;
            font-size: 12px;
        }
        .profit-radar-stat strong {
            color: var(--accent-bright);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 12px;
        }
        .profit-radar-stat em {
            grid-column: 1 / -1;
            color: var(--muted);
            font-style: normal;
            font-size: 11px;
            line-height: 1.35;
        }
        .profit-funnel {
            min-width: 0;
        }
        .profit-funnel-list {
            display: grid;
            gap: 14px;
        }
        .profit-funnel-footer {
            display: flex;
            flex-wrap: wrap;
            gap: 8px 14px;
            margin-top: 16px;
            color: var(--muted);
            font-size: 12px;
        }
        .profit-funnel-footer strong {
            color: var(--text);
            font-family: "JetBrains Mono", ui-monospace, monospace;
        }
        .profit-secondary-strip {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
        }
        .profit-pulse {
            min-width: 0;
            display: grid;
            gap: 5px;
            border: 1px solid var(--line);
            border-left: 3px solid var(--line-strong);
            border-radius: 12px;
            background: var(--surface-subtle);
            padding: 13px 14px;
        }
        .profit-pulse.good {
            border-left-color: var(--accent);
        }
        .profit-pulse.warn {
            border-left-color: var(--warning);
        }
        .profit-pulse strong {
            color: var(--text);
            font-size: 18px;
            line-height: 1.1;
            overflow-wrap: anywhere;
        }
        .profit-pulse span {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.35;
        }
        .profit-diagnostics {
            border: 1px solid var(--line);
            border-radius: var(--radius);
            background: var(--surface-subtle);
            overflow: hidden;
        }
        .profit-diagnostics summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-height: 48px;
            padding: 0 16px;
            cursor: pointer;
            color: var(--muted-strong);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            list-style: none;
        }
        .profit-diagnostics summary::-webkit-details-marker {
            display: none;
        }
        .profit-diagnostics summary::after {
            content: "+";
            color: var(--accent-bright);
            font-size: 16px;
            letter-spacing: 0;
        }
        .profit-diagnostics[open] summary {
            border-bottom: 1px solid var(--line);
        }
        .profit-diagnostics[open] summary::after {
            content: "-";
        }
        .profit-diagnostics .profit-stack {
            padding: 16px;
        }
        .metric-kicker {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            border-radius: 999px;
            background: var(--surface-muted);
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            margin-bottom: 2px;
            justify-self: start;
        }
        .utility-stack {
            display: grid;
            gap: 18px;
        }
        .utility-hero {
            display: grid;
            gap: 10px;
        }
        .utility-kicker {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            font-weight: 700;
        }
        .utility-title {
            margin: 0;
            font-size: clamp(30px, 5vw, 44px);
            line-height: 0.98;
            letter-spacing: -0.04em;
        }
        .utility-copy {
            margin: 0;
            max-width: 70ch;
            color: var(--muted);
            line-height: 1.65;
        }
        .utility-grid {
            display: grid;
            grid-template-columns: 1.15fr 0.85fr;
            gap: 18px;
            align-items: start;
        }
        .utility-card {
            display: grid;
            gap: 16px;
        }
        /* V16.1: Brain sub-tab strip. Injected at the top of each brain
           page (emiwatch / learning / broker / zhp). Mint accent under the
           active tab so admins know which brain section they're in. */
        .brain-subnav {
            display: flex;
            gap: 4px;
            padding: 0 4px;
            margin: 14px 0 4px;
            border-bottom: 1px solid var(--line);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .brain-subnav::-webkit-scrollbar { display: none; }
        .brain-subnav-tab {
            display: inline-flex;
            align-items: center;
            padding: 12px 18px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.02em;
            color: var(--muted);
            text-decoration: none;
            border-bottom: 2px solid transparent;
            white-space: nowrap;
            transition: color 140ms ease, border-color 140ms ease;
        }
        .brain-subnav-tab:hover { color: var(--text); }
        .brain-subnav-tab.active {
            color: #4BB7A3;
            border-bottom-color: #4BB7A3;
        }

        /* V16.1: casefile section tabs (This Alert / Symbol History /
           Live Book). Tightened to JetBrains Mono uppercase like the
           marketing chip-scale; was Inter 13px which crowded the chip
           row above. Same idiom as .brain-subnav. */
        .casefile-tabs {
            display: flex;
            gap: 2px;
            padding: 0;
            margin: 12px 0 8px;
            border-bottom: 1px solid var(--line);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .casefile-tabs::-webkit-scrollbar { display: none; }
        .casefile-tab {
            display: inline-flex;
            align-items: center;
            padding: 8px 14px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--muted);
            background: transparent;
            border: none;
            border-bottom: 2px solid transparent;
            white-space: nowrap;
            cursor: pointer;
            transition: color 140ms ease, border-color 140ms ease;
        }
        .casefile-tab:hover { color: var(--text); }
        .casefile-tab.active {
            color: #4BB7A3;
            border-bottom-color: #4BB7A3;
        }
        .casefile-tabpanel { display: block; }
        .casefile-tabpanel.hidden { display: none; }

        /* V16.1: external named hyperlinks ("Bloomberg →" etc.) inside
           casefile copy. Mint accent, gentle hover lift on the arrow. */
        a.external-link {
            color: #4BB7A3;
            font-weight: 600;
            text-decoration: none;
            border-bottom: 1px dotted rgba(75, 183, 163, 0.45);
            transition: border-color 140ms ease, color 140ms ease;
            white-space: nowrap;
        }
        a.external-link:hover,
        a.external-link:focus-visible {
            color: #63d1ba;
            border-bottom-color: rgba(99, 209, 186, 0.85);
            outline: none;
        }

        /* ============================================================== */
        /* V16.1 — .emi-card                                              */
        /* Universal alert / watchlist card. One template for both pages: */
        /* pills + symbol + TRADE-tier badge + thesis + catalyst column   */
        /* + right-side stats + optional leverage row + tags + footer.    */
        /* Sub-sections render only when their data is present (catalyst, */
        /* leverage row, tags) so a stocks-only alert renders clean and   */
        /* an options-bearing alert lights up the leverage row.           */
        /* ============================================================== */
        .emi-feed,
        #alertsFeedV2 { display: grid; gap: 14px; }
        .emi-card {
            position: relative;
            display: grid;
            gap: 16px;
            padding: 22px 28px 18px;
            background: var(--surface-card);
            border: 1px solid var(--line);
            border-radius: 16px;
            transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
        }
        .emi-card:hover {
            border-color: var(--line-strong);
            transform: translateY(-1px);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
        }
        /* Tier accent stripe on the left edge. */
        .emi-card::before {
            content: "";
            position: absolute;
            left: 0;
            top: 16px;
            bottom: 16px;
            width: 3px;
            border-radius: 0 2px 2px 0;
            background: var(--emi-tier, #4BB7A3);
        }
        .emi-card[data-tier="watch"]    { --emi-tier: var(--muted-strong, #c9edf5); }
        .emi-card[data-tier="trade"]    { --emi-tier: #4BB7A3; }
        .emi-card[data-tier="moonshot"] { --emi-tier: #ffb454; }

        /* Top pill row — STOCKS · LONG · TIER A · OPEN, square mono uppercase. */
        .emi-card-pills { display: flex; flex-wrap: wrap; gap: 6px; }
        .emi-card-pill {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            padding: 3px 9px;
            border: 1px solid var(--line-strong);
            border-radius: 3px;
            color: var(--muted);
            background: var(--surface-card-soft);
        }
        .emi-card-pill--tier {
            color: #4BB7A3;
            border-color: rgba(75, 183, 163, 0.32);
            background: rgba(75, 183, 163, 0.10);
        }
        .emi-card-pill--status {
            color: var(--text);
            border-color: var(--line-strong);
            background: var(--surface-card-soft);
        }

        /* Body grid: identity / catalyst / stats. Single column under 920px. */
        .emi-card-body {
            display: grid;
            grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
            gap: 24px;
            align-items: start;
        }
        .emi-card-identity { display: grid; gap: 8px; min-width: 0; }
        .emi-card-id-head {
            display: flex;
            align-items: baseline;
            gap: 10px;
            flex-wrap: wrap;
        }
        .emi-card-symbol {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 28px;
            font-weight: 700;
            letter-spacing: -0.025em;
            color: var(--text);
            line-height: 1.05;
            margin: 0;
        }
        /* "TRADE" tier badge sitting next to the symbol. */
        .emi-card-tier-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 10px;
            border-radius: 999px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: #0b1d22;
            background: #4BB7A3;
        }
        .emi-card-tier-badge[data-tier="watch"]    { color: var(--text); background: var(--surface-card-soft); border: 1px solid var(--line-strong); }
        .emi-card-tier-badge[data-tier="moonshot"] { color: #0b1d22; background: #ffb454; }
        .emi-card-tier-badge .material-symbols-rounded { font-size: 12px; }
        .emi-card-meta-mono {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            color: var(--muted);
            letter-spacing: 0.04em;
        }
        .emi-card-thesis {
            margin: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            line-height: 1.55;
            color: var(--text);
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* Catalyst column — left rule, mono eyebrow, body copy. */
        .emi-card-catalyst {
            border-left: 1px solid var(--line);
            padding-left: 18px;
            display: grid;
            gap: 6px;
            min-width: 0;
        }
        .emi-card-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: #4BB7A3;
        }
        .emi-card-eyebrow .material-symbols-rounded { font-size: 14px; }
        .emi-card-catalyst-body {
            margin: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 13.5px;
            line-height: 1.55;
            color: var(--muted-strong, #c9edf5);
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* Right-side stat strip. Auto-flow horizontally with mono labels.
           Vertical hairline on the LEFT so the divider is always present
           even when the alert has no catalyst sentence to show. */
        .emi-card-stats {
            display: grid;
            grid-auto-flow: column;
            grid-auto-columns: minmax(72px, max-content);
            column-gap: 22px;
            row-gap: 6px;
            align-items: start;
            border-left: 1px solid var(--line);
            padding-left: 22px;
        }
        .emi-card-stat { display: grid; gap: 2px; min-width: 0; }
        .emi-card-stat-label {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--muted);
        }
        .emi-card-stat-value {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 17px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.1;
        }
        .emi-card-stat-value.positive { color: #4BB7A3; }
        .emi-card-stat-value.negative { color: var(--danger, #EF5350); }

        /* Sparkline placeholder slot (under the stats row). */
        .emi-card-spark {
            grid-column: 1 / -1;
            margin-top: 2px;
            height: 32px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
        }
        .emi-card-spark svg { flex: 0 0 auto; }

        /* Optional leverage row (Bull Call Spread · 2026-04-11 · Entry $15.20). */
        .emi-card-leverage {
            display: flex;
            flex-wrap: wrap;
            gap: 18px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            color: var(--muted);
            padding-top: 12px;
            border-top: 1px solid var(--line);
            align-items: center;
        }
        .emi-card-leverage-strategy {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text);
            font-weight: 600;
        }
        .emi-card-leverage-strategy .material-symbols-rounded { font-size: 14px; color: var(--muted); }
        .emi-card-leverage span strong { color: var(--text); font-weight: 500; }

        /* Signal tag chips (base_breakout, RSI hot, Options flow, news). */
        .emi-card-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .emi-card-tag {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 999px;
            background: var(--surface-card-soft);
            border: 1px solid var(--line);
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 11.5px;
            font-weight: 500;
            color: var(--muted);
            max-width: 360px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .emi-card-tag .material-symbols-rounded { font-size: 13px; color: var(--muted); }

        /* Footer row: star + timestamp on the left, Casefile CTA on the right.
           Hairline divider above so the footer reads as a clear band. */
        .emi-card-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            padding-top: 12px;
            border-top: 1px solid var(--line);
        }
        .emi-card-foot-left {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            color: var(--muted);
            letter-spacing: 0.05em;
        }
        .emi-card-star {
            width: 32px;
            height: 32px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
        }
        .emi-card-star:hover,
        .emi-card-star.is-followed,
        .emi-card-star[aria-pressed="true"] {
            color: #4BB7A3;
            border-color: rgba(75, 183, 163, 0.32);
            background: rgba(75, 183, 163, 0.10);
        }
        .emi-card-star .material-symbols-rounded { font-size: 18px; }
        .emi-card-star.is-followed .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

        .emi-card-empty,
        .emi-card-locked {
            padding: 22px 28px;
            border: 1px dashed var(--line);
            border-radius: 16px;
            color: var(--muted);
            font-size: 14px;
            text-align: center;
        }

        /* Single-column collapse for narrower viewports. */
        @media (max-width: 1024px) {
            .emi-card-body { grid-template-columns: minmax(0, 1fr) auto; }
            .emi-card-catalyst { grid-column: 1 / -1; padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--line); }
        }
        @media (max-width: 720px) {
            .emi-card { padding: 18px 20px 14px; }
            .emi-card-body { grid-template-columns: 1fr; }
            .emi-card-stats {
                grid-auto-flow: row;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                grid-auto-columns: auto;
                column-gap: 14px;
                padding-top: 12px;
                padding-left: 0;
                border-top: 1px solid var(--line);
                border-left: 0;
            }
        }

        /* V16.1 mobile flatten: drop the casefile-dialog box and the inner
           casefile-panel boxes on phone widths so the chart uses the full
           screen. Three nested boxes (page → dialog → panel → chart) ate
           ~35% of phone width to padding alone. The slim chrome (chart,
           snapshot, blocks) reads as a vertical flow against the page bg. */
        @media (max-width: 768px) {
            /* Outer dialog: passthrough on mobile. */
            .popup-page .casefile-dialog,
            .casefile-backdrop.route-inline .casefile-dialog,
            .casefile-dialog {
                padding: 0 !important;
                background: transparent !important;
                border: 0 !important;
                box-shadow: none !important;
                border-radius: 0 !important;
                gap: 14px !important;
            }
            /* Inner panels (chart, snapshot, lifecycle): flatten — keep a
               thin top hairline as the only separator so the eye still
               groups the section. */
            .casefile-panel {
                padding: 14px 0 0 !important;
                background: transparent !important;
                border: 0 !important;
                border-top: 1px solid var(--line) !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                overflow: visible !important;
            }
            /* First panel doesn't need the top divider. */
            .casefile-grid > .casefile-panel:first-child,
            .casefile-tabpanel > .casefile-panel:first-of-type { border-top: 0 !important; padding-top: 0 !important; }
            .casefile-grid { gap: 14px !important; }
            /* Chart wrap: let it use the full width. */
            .casefile-chart-wrap { min-height: 360px; }
            .casefile-chart-stage { min-height: 320px; border-radius: 12px; }
            .casefile-chart-wrap.chart-expanded { min-height: 480px; }
            .casefile-chart-wrap.chart-expanded .casefile-chart-stage { min-height: 460px; }
            /* Tabs scroll horizontally already, but tighten padding. */
            .casefile-tabs { margin: 8px 0 6px; }
            /* kv-row collapses: label on top, value below — already in the
               560px rule, but include here so the mobile-customer width
               (390-720) doesn't double-up the label column. */
            .kv-row { grid-template-columns: minmax(110px, max-content) 1fr; }
        }

        .watchlist-feed { display: grid; gap: 14px; }
        .watchlist-card {
            position: relative;
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
            padding: 24px 28px;
            background: var(--surface-card);
            border: 1px solid var(--line);
            border-radius: 16px;
            transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
        }
        .watchlist-card:hover {
            border-color: var(--line-strong);
            transform: translateY(-1px);
            box-shadow: 0 12px 24px rgba(0,0,0,0.18);
        }
        .watchlist-card::before {
            content: "";
            position: absolute;
            left: 0;
            top: 18px;
            bottom: 18px;
            width: 3px;
            border-radius: 0 2px 2px 0;
            background: #4BB7A3;
        }
        .watchlist-card[data-tier="watch"]::before { background: var(--muted-strong, #c9edf5); }
        .watchlist-card[data-tier="moonshot"]::before { background: #ffb454; }
        .watchlist-card-head {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .watchlist-card-pill {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            padding: 3px 8px;
            border: 1px solid var(--line-strong);
            border-radius: 3px;
            color: var(--muted);
            background: var(--surface-card-soft);
        }
        .watchlist-card-pill--tier {
            color: #4BB7A3;
            border-color: rgba(75, 183, 163, 0.32);
            background: rgba(75, 183, 163, 0.10);
        }
        .watchlist-card-pill--status {
            color: var(--text);
            border-color: var(--line-strong);
        }
        .watchlist-card-pill--starred {
            margin-left: auto;
            color: #4BB7A3;
            border-color: rgba(75, 183, 163, 0.18);
            background: transparent;
        }
        .watchlist-card-body {
            display: grid;
            grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1fr);
            gap: 24px;
            align-items: start;
        }
        .watchlist-card-identity { display: grid; gap: 6px; min-width: 0; }
        .watchlist-card-symbol {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 26px;
            font-weight: 700;
            letter-spacing: -0.025em;
            color: var(--text);
            line-height: 1.05;
        }
        .watchlist-card-name {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-style: italic;
            font-size: 14px;
            color: var(--muted);
            font-weight: 400;
        }
        .watchlist-card-thesis {
            margin: 6px 0 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            line-height: 1.55;
            color: var(--text);
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .watchlist-card-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 12px 18px;
            align-content: start;
            padding-left: 18px;
            border-left: 1px solid var(--line);
        }
        .watchlist-card-stat { display: grid; gap: 2px; min-width: 0; }
        .watchlist-card-stat-label {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--muted);
        }
        .watchlist-card-stat-value {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 17px;
            font-weight: 600;
            color: var(--text);
            line-height: 1.1;
        }
        .watchlist-card-stat-value.positive { color: var(--accent-strong, #4BB7A3); }
        .watchlist-card-stat-value.negative { color: var(--danger, #EF5350); }
        .watchlist-card-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            padding-top: 16px;
            border-top: 1px solid var(--line);
        }
        .watchlist-card-actions { display: flex; align-items: center; gap: 10px; }
        .watchlist-card-empty,
        .watchlist-card-locked {
            padding: 22px 28px;
            border: 1px dashed var(--line);
            border-radius: 16px;
            color: var(--muted);
            font-size: 14px;
            text-align: center;
        }

        /* Tighten grid to single column on narrow viewports. */
        @media (max-width: 920px) {
            .watchlist-card-body { grid-template-columns: 1fr; }
            .watchlist-card-stats {
                padding-left: 0;
                border-left: 0;
                border-top: 1px solid var(--line);
                padding-top: 16px;
            }
        }

        /* V16.1 #3: "View all →" links inside truncated panels. Visually
           lighter than a primary CTA — meant to read like a footer-style
           cross-link, not a standalone button. */
        a.view-all-link {
            color: #4BB7A3;
            text-decoration: none;
            font-weight: 600;
            white-space: nowrap;
            transition: color 140ms ease;
        }
        a.view-all-link:hover,
        a.view-all-link:focus-visible {
            color: #63d1ba;
            outline: none;
        }

        /* ============================================================== */
        /* V16.1 — Casefile slim header + unboxed narrative blocks         */
        /* Aligned with marketing-site tokens (.eyebrow / .pill scale).    */
        /* ============================================================== */

        /* Slim breadcrumb row: Dashboard / Casefile / SYMBOL · status pill */
        .casefile-pageheader {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 0;
            margin: 6px 0 12px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--muted);
            flex-wrap: wrap;
        }
        .casefile-breadcrumb {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 28px;
        }
        .casefile-breadcrumb-link {
            color: var(--muted);
            text-decoration: none;
            transition: color 140ms ease;
        }
        .casefile-breadcrumb-link:hover { color: var(--text); }
        .casefile-breadcrumb-sep { color: var(--muted); opacity: 0.6; }
        .casefile-breadcrumb-current,
        .casefile-breadcrumb-detail {
            color: var(--text);
            font-weight: 600;
        }

        /* #4 Fullscreen icon, top-right of the chart wrap. */
        .casefile-chart-fullscreen {
            position: absolute;
            top: 10px;
            right: 12px;
            z-index: 11;
            width: 28px;
            height: 28px;
            border-radius: 8px;
            display: grid;
            place-items: center;
            background: var(--surface-card-soft);
            border: 1px solid var(--line);
            color: var(--muted);
            font-size: 14px;
            cursor: pointer;
            line-height: 1;
            transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
        }
        .casefile-chart-fullscreen:hover,
        .casefile-chart-fullscreen:focus-visible {
            color: var(--text);
            border-color: var(--line-strong);
            outline: none;
        }

        /* #6 Unboxed narrative block: headline + sub + body. The 16px
           top/bottom padding gives every block-level divider line 16px
           breathing room on each side, per the V16.1 spacing rule. */
        .casefile-block {
            display: grid;
            gap: 6px;
            padding: 16px 0;
            border: 0;
            background: transparent;
            box-shadow: none;
        }
        .casefile-block + .casefile-block {
            border-top: 1px solid var(--line);
        }
        /* The last block before the next boxed panel (Lifecycle Timeline)
           gets a real gap so the closing copy doesn't kiss the box edge. */
        .casefile-block:last-of-type {
            padding-bottom: 24px;
        }
        /* #5 Typography rule: headlines in Inter, sub-line in JetBrains Mono */
        .casefile-block-title,
        .casefile-panel-title {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 18px;
            font-weight: 600;
            letter-spacing: -0.015em;
            line-height: 1.2;
            margin: 0;
            color: var(--text);
        }
        .casefile-block-sub,
        .casefile-panel-sub {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--muted);
            margin: 0 0 4px;
            line-height: 1.5;
        }
        .casefile-block-body {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            line-height: 1.65;
            color: var(--text);
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .casefile-block-body strong { color: var(--text); font-weight: 600; }

        /* V16.1 — key/value row. Replaces <strong>Entry:</strong> style.
           Mint mono uppercase label + Inter value. Same specs as the
           marketing site eyebrow (10px JetBrains Mono 600 0.16em uppercase
           rgb(75, 183, 163)). Used in casefile Stock Plan / Options
           Variant blocks. */
        .kv-row {
            display: grid;
            grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
            column-gap: 18px;
            row-gap: 2px;
            align-items: baseline;
            padding: 8px 0;
            border-bottom: 1px dotted transparent;
        }
        .kv-row + .kv-row { border-top: 1px solid rgba(75, 183, 163, 0.06); }
        .kv-label {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 600;
            line-height: 16px;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: #4BB7A3;
            white-space: nowrap;
        }
        .kv-value {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 14px;
            font-weight: 400;
            line-height: 1.55;
            color: var(--text);
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .kv-value strong { color: var(--text); font-weight: 600; }
        .kv-value .pct { color: var(--muted); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; margin-left: 6px; letter-spacing: 0.06em; }
        /* Single-column on tight viewports — label sits on top, value below. */
        @media (max-width: 560px) {
            .kv-row { grid-template-columns: 1fr; }
        }

        /* Panel head consistency for the still-boxed Chart + Trade Snapshot. */
        .casefile-panel-head {
            display: grid;
            gap: 6px;
            margin-bottom: 4px;
        }

        .customer-dashboard {
            display: grid;
            gap: 18px;
        }
        .customer-edge-panel {
            padding: 22px;
        }
        .customer-edge-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .customer-live-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
            gap: 18px;
            align-items: start;
        }
        .customer-live-sidebar,
        .customer-card-feed,
        .customer-watch-preview,
        .customer-pulse-list,
        .customer-proof-list {
            display: grid;
            gap: 12px;
        }
        .customer-live-feed-panel {
            min-width: 0;
        }
        .customer-live-feed-panel .emi-feed {
            gap: 12px;
        }
        .customer-live-feed-panel .alert-card {
            padding: 16px;
        }
        .customer-live-feed-panel .alert-card-catalyst {
            display: none;
        }
        .customer-pulse-item,
        .customer-watch-row {
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-card-soft);
            padding: 12px;
        }
        .customer-pulse-item {
            display: grid;
            gap: 4px;
        }
        .customer-pulse-item strong {
            color: var(--text);
            font-size: 20px;
            line-height: 1.1;
        }
        .customer-pulse-item span:last-child {
            color: var(--muted);
            font-size: 12.5px;
            line-height: 1.4;
        }
        .customer-watch-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            color: var(--text);
            text-decoration: none;
        }
        .customer-watch-row:hover,
        .customer-watch-row:focus-visible {
            border-color: var(--line-strong);
            outline: none;
        }
        .customer-watch-row strong {
            display: block;
            color: var(--accent-bright);
            font-family: var(--emi-number-font);
            font-size: 14px;
            letter-spacing: 0;
        }
        .customer-watch-row small {
            display: block;
            margin-top: 3px;
            color: var(--muted);
            font-size: 12px;
        }
        .customer-watch-row-arrow {
            color: var(--accent);
            font-family: var(--emi-number-font);
        }
        .customer-chart-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
            margin-top: 14px;
        }
        .customer-score-card,
        .customer-weather-card {
            min-height: 232px;
        }
        .customer-chart-card {
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-card-soft);
            padding: 14px;
            min-width: 0;
        }
        .customer-chart-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }
        .customer-chart-head strong {
            color: var(--text);
            font-size: 14px;
            font-weight: 600;
        }
        .customer-donut-wrap {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
            align-items: center;
            justify-items: center;
            min-height: 236px;
        }
        .customer-donut {
            width: 148px;
            height: 148px;
            border-radius: 50%;
            background: conic-gradient(var(--surface-muted-strong) 0 360deg);
            position: relative;
            box-shadow: inset 0 0 0 1px var(--line);
        }
        .customer-donut::after {
            content: "";
            position: absolute;
            inset: 32px;
            border-radius: 50%;
            background: var(--panel);
            border: 1px solid var(--line);
        }
        .customer-chart-legend {
            display: grid;
            gap: 6px;
            min-width: 0;
            width: min(280px, 100%);
        }
        .customer-chart-legend-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            color: var(--muted);
            font-size: 12px;
        }
        .customer-chart-legend-row span:first-child {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-width: 0;
        }
        .customer-chart-swatch {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex: 0 0 auto;
        }
        .customer-line-chart,
        .customer-radar-chart {
            width: 100%;
            height: 118px;
            display: block;
        }
        .customer-line-chart-large {
            height: 236px;
        }
        .customer-line-chart .axis,
        .customer-radar-chart .grid {
            stroke: var(--line);
            stroke-width: 1;
            fill: none;
        }
        .customer-line-chart .score-fill {
            fill: rgba(75, 183, 163, 0.12);
        }
        .customer-line-chart .score-line,
        .customer-radar-chart .shape-line {
            stroke: var(--accent-bright);
            stroke-width: 2;
            fill: none;
        }
        .customer-line-chart .score-dot {
            fill: var(--accent-bright);
            stroke: var(--panel);
            stroke-width: 2;
        }
        .alert-card-instrument-note {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.4;
            margin: -2px 0 2px;
        }
        .customer-radar-chart .shape-fill {
            fill: rgba(75, 183, 163, 0.20);
            stroke: var(--accent-bright);
            stroke-width: 2;
        }
        .customer-radar-chart text {
            fill: var(--muted);
            font-family: var(--emi-number-font);
            font-size: 8px;
            letter-spacing: 0.08em;
        }
        .customer-instrument-mix,
        .customer-weather {
            display: grid;
            gap: 10px;
        }
        .customer-instrument-row {
            display: grid;
            gap: 6px;
        }
        .customer-instrument-row > div:first-child {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 10px;
        }
        .customer-instrument-row strong {
            color: var(--text);
            font-size: 13px;
        }
        .customer-instrument-row span {
            color: var(--muted);
            font-size: 12px;
        }
        .customer-instrument-track {
            height: 8px;
            border-radius: 999px;
            background: rgba(138, 164, 174, 0.18);
            overflow: hidden;
        }
        .customer-instrument-track i {
            display: block;
            height: 100%;
            border-radius: inherit;
            background: var(--accent);
        }
        .customer-weather-state {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .customer-weather-state strong {
            color: var(--text);
            font-size: 15px;
        }
        .customer-weather-state span:last-child,
        .customer-weather-summary {
            color: var(--muted);
            font-size: 12.5px;
            line-height: 1.45;
        }
        .customer-weather-summary {
            margin: 0;
        }
        .customer-weather-metrics {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
        }
        .customer-weather-metrics div,
        .customer-weather-tilts span {
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-muted);
            padding: 9px;
            min-width: 0;
        }
        .customer-weather-metric.good {
            border-color: rgba(75, 183, 163, 0.35);
            background: var(--accent-soft);
        }
        .customer-weather-metric.warn {
            border-color: rgba(255, 180, 84, 0.38);
            background: var(--warning-soft);
        }
        .customer-weather-metric.bad {
            border-color: rgba(239, 83, 80, 0.35);
            background: var(--danger-soft);
        }
        .customer-weather-metric.good strong { color: var(--accent-strong); }
        .customer-weather-metric.warn strong { color: var(--warning-strong); }
        .customer-weather-metric.bad strong { color: var(--danger-strong); }
        .customer-weather-metrics span,
        .customer-weather-tilts strong {
            display: block;
            color: var(--muted);
            font-size: 10px;
            font-family: var(--emi-number-font);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            margin-bottom: 4px;
        }
        .customer-weather-metrics strong {
            color: var(--text);
            font-size: 13px;
            line-height: 1.2;
        }
        .customer-weather-tilts {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            color: var(--muted-strong);
            font-size: 12px;
            line-height: 1.35;
        }
        .customer-weather-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .customer-weather-chips span {
            border: 1px solid var(--line);
            border-radius: 999px;
            color: var(--muted-strong);
            background: var(--surface-card-soft);
            padding: 4px 8px;
            font-size: 11px;
        }
        .customer-rank-tabs {
            display: inline-flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: flex-end;
        }
        .customer-rank-tabs button {
            border: 1px solid var(--line);
            border-radius: 999px;
            background: var(--surface-card-soft);
            color: var(--muted-strong);
            min-height: 30px;
            padding: 6px 10px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
        }
        .customer-rank-tabs button.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #0b1d22;
        }
        .customer-proof-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-card-soft);
            padding: 12px;
            color: var(--text);
            text-decoration: none;
        }
        .customer-proof-row:hover,
        .customer-proof-row:focus-visible {
            border-color: var(--line-strong);
            outline: none;
        }
        .customer-proof-row strong,
        .customer-proof-row em {
            display: block;
            color: var(--accent-bright);
            font-family: var(--emi-number-font);
            font-size: 14px;
            font-style: normal;
        }
        .customer-proof-row small {
            display: block;
            margin-top: 3px;
            color: var(--muted);
            font-size: 12px;
        }
        .customer-proof-row > span:last-child {
            text-align: right;
            flex: 0 0 auto;
        }
        /* V16.1: Customer-Live score row.
           Stays readable when shrunk to phone width via auto-fit. */
        .customer-watch-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            gap: 12px;
            margin-top: 16px;
        }
        .customer-watch-stat {
            border: 1px solid var(--line);
            border-radius: 14px;
            padding: 16px 18px;
            background: var(--surface-card-soft);
            display: grid;
            gap: 4px;
        }
        .customer-watch-stat .metric-label {
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.18em;
            color: var(--muted);
            margin: 0;
        }
        .customer-watch-stat .metric-value {
            font-family: "Inter", "Avenir Next", Avenir, sans-serif;
            font-size: clamp(22px, 2vw, 30px);
            font-weight: 600;
            line-height: 1.05;
            margin: 2px 0 0;
            color: var(--text);
        }
        .customer-watch-stat .metric-note {
            font-size: 12.5px;
            color: var(--muted);
            margin: 0;
            line-height: 1.4;
        }
        @media (max-width: 980px) {
            .customer-live-grid {
                grid-template-columns: 1fr;
            }
            .customer-chart-grid {
                grid-template-columns: 1fr;
            }
            .customer-rank-tabs {
                justify-content: flex-start;
                width: 100%;
            }
        }
        @media (max-width: 720px) {
            .customer-edge-panel {
                padding: 18px 14px;
            }
            .customer-edge-actions {
                width: 100%;
            }
            .customer-edge-actions .button {
                flex: 1 1 140px;
                justify-content: center;
            }
            .customer-donut-wrap {
                min-height: 190px;
            }
            .customer-donut {
                width: 120px;
                height: 120px;
            }
            .customer-donut::after {
                inset: 26px;
            }
            .customer-weather-metrics,
            .customer-weather-tilts {
                grid-template-columns: 1fr;
            }
            .customer-proof-row {
                align-items: flex-start;
            }
        }

        body[data-active-page="home"] #dashboardTabChromePanel,
        body[data-active-page="home"] #profitReadinessSection,
        body[data-active-page="home"] #emiBookKpiGrid,
        body[data-active-page="home"] #emiInsightsSection,
        body[data-active-page="home"] #emiBookSection,
        body[data-active-page="home"] #liveBlockersSection,
        body[data-active-page="home"] #emiRadarSection,
        body[data-active-page="home"] #traderPmSection,
        body[data-active-page="home"] #worldStateSection,
        body[data-active-page="home"] #agentOpsSection,
        body[data-active-page="home"] #alertsSection,
        body[data-active-page="home"] #marketIntelSection,
        body[data-active-page="home"] #marketIntelDetailSection,
        body[data-active-page="market-intel"] #customerDashboard,
        body[data-active-page="market-intel"] #dashboardTabChromePanel,
        body[data-active-page="market-intel"] #profitReadinessSection,
        body[data-active-page="market-intel"] #emiBookKpiGrid,
        body[data-active-page="market-intel"] #emiInsightsSection,
        body[data-active-page="market-intel"] #emiBookSection,
        body[data-active-page="market-intel"] #liveBlockersSection,
        body[data-active-page="market-intel"] #emiRadarSection,
        body[data-active-page="market-intel"] #traderPmSection,
        body[data-active-page="market-intel"] #worldStateSection,
        body[data-active-page="market-intel"] #agentOpsSection,
        body[data-active-page="market-intel"] #alertsSection,
        body[data-active-page="brain"] #customerDashboard,
        body[data-active-page="brain"] #marketIntelSection,
        body[data-active-page="brain"] #marketIntelDetailSection {
            display: none !important;
        }
        body[data-active-page="brain"] #traderPmSection.brain-agent-hidden,
        body[data-active-page="brain"] #worldStateSection.brain-agent-hidden,
        body[data-active-page="brain"] #agentOpsSection.brain-agent-hidden {
            display: none !important;
        }
        .brain-agent-tabs .tab-strip {
            justify-content: flex-start;
        }
        .brain-agent-tabs .tab-button {
            border: 1px solid var(--line);
        }

        /* V16.1: Admin-only collapsible block (replaces a static panel
           with a <details> when wrapped in `.admin-collapsible`). Keeps the
           panel chrome but adds a chevron and clickable summary row. */
        .admin-collapsible {
            padding: 0;
            overflow: hidden;
        }
        .admin-collapsible-summary {
            list-style: none;
            cursor: pointer;
            padding: 18px 22px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 14px;
            user-select: none;
        }
        .admin-collapsible-summary::-webkit-details-marker { display: none; }
        .admin-collapsible-summary:hover { background: var(--surface-soft); }
        .admin-collapsible-arrow {
            transition: transform 200ms ease;
            color: var(--muted);
        }
        .admin-collapsible[open] > .admin-collapsible-summary .admin-collapsible-arrow {
            transform: rotate(180deg);
        }
        .admin-collapsible[open] > .admin-collapsible-summary {
            border-bottom: 1px solid var(--line);
        }
        .admin-collapsible > .section-head { padding: 18px 22px 0; }
        .admin-collapsible > .profit-dashboard { padding: 0 22px 22px; }
        .utility-meta {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .utility-inline-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .detail-list {
            display: grid;
            gap: 12px;
        }
        .utility-profile-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
            gap: 18px;
            align-items: start;
        }
        .utility-form {
            display: grid;
            gap: 14px;
        }
        .utility-form-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .utility-form-field {
            display: grid;
            gap: 6px;
        }
        .utility-form-field.full {
            grid-column: 1 / -1;
        }
        .utility-form-field label {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-weight: 700;
        }
        .utility-form-field input,
        .utility-form-field select,
        .utility-form-field textarea {
            width: 100%;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--text);
            padding: 12px 14px;
            font-size: 14px;
            line-height: 1.4;
            transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
        }
        .utility-form-field textarea {
            resize: vertical;
            min-height: 84px;
        }
        .utility-form-field input:focus-visible,
        .utility-form-field select:focus-visible,
        .utility-form-field textarea:focus-visible {
            outline: none;
            border-color: rgba(75, 183, 163, 0.6);
            box-shadow: 0 0 0 3px rgba(75, 183, 163, 0.12);
        }
        .utility-form-field input[disabled],
        .utility-form-field select[disabled],
        .utility-form-field textarea[disabled] {
            opacity: 0.7;
            cursor: not-allowed;
        }
        .utility-toggle-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 14px;
            padding: 14px 16px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
        }
        .utility-toggle-copy {
            display: grid;
            gap: 4px;
        }
        .utility-toggle-title {
            font-size: 14px;
            font-weight: 600;
            line-height: 1.3;
        }
        .utility-toggle-note {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
        }
        .utility-switch {
            width: 18px;
            height: 18px;
            accent-color: #4BB7A3;
            margin-top: 2px;
            flex: 0 0 auto;
        }
        .utility-form-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }
        .utility-message {
            min-height: 18px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
        }
        .utility-message.error {
            color: #ff7b8d;
        }
        .utility-message.success {
            color: #7BE0C8;
        }
        .utility-avatar-card {
            display: grid;
            gap: 16px;
        }
        .utility-avatar-stack {
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }
        .utility-avatar-preview {
            width: 92px;
            height: 92px;
            border-radius: 999px;
            border: 1px solid rgba(123, 224, 200, 0.16);
            background: rgba(75, 183, 163, 0.14);
            display: grid;
            place-items: center;
            overflow: hidden;
            color: #e9fbff;
            font-size: 28px;
            font-weight: 800;
            letter-spacing: -0.02em;
            flex: 0 0 auto;
        }
        .utility-avatar-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .utility-avatar-copy {
            display: grid;
            gap: 6px;
            min-width: 220px;
            flex: 1 1 auto;
        }
        .utility-avatar-title {
            font-size: 16px;
            font-weight: 700;
            line-height: 1.2;
        }
        .utility-avatar-meta {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.5;
        }
        .utility-file-input {
            display: none;
        }
        .security-card {
            display: grid;
            gap: 16px;
        }
        .detail-row {
            display: grid;
            gap: 5px;
            padding: 14px 16px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
        }
        .detail-label {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-weight: 700;
        }
        .detail-value {
            font-size: 16px;
            line-height: 1.35;
            font-weight: 600;
        }
        .plan-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 14px;
        }
        .plan-card {
            display: grid;
            gap: 12px;
            padding: 18px;
            border-radius: 22px;
            border: 1px solid var(--line);
            background: var(--surface-card);
        }
        .plan-card.featured {
            border-color: rgba(75, 183, 163, 0.44);
            background:
                linear-gradient(180deg, rgba(75, 183, 163, 0.14), rgba(75, 183, 163, 0.04)),
                var(--surface-card);
        }
        .plan-featured-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 999px;
            background: rgba(75, 183, 163, 0.14);
            border: 1px solid rgba(75, 183, 163, 0.24);
            color: #7BE0C8;
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-weight: 700;
            letter-spacing: 0.16em;
            text-transform: uppercase;
        }
        .plan-topline {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }
        .plan-name {
            margin: 0;
            font-size: 18px;
            line-height: 1.15;
            letter-spacing: -0.03em;
        }
        .plan-price {
            font-size: 26px;
            font-weight: 700;
            letter-spacing: -0.04em;
            line-height: 1;
        }
        .plan-scope-row,
        .plan-feature-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .plan-scope-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 999px;
            background: var(--surface-muted);
            border: 1px solid var(--line);
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-weight: 700;
        }
        .plan-feature {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.45;
        }
        .plan-promo-copy {
            color: var(--text);
            font-size: 13px;
            line-height: 1.55;
        }
        .subscription-shell,
        .subscription-manager {
            display: grid;
            gap: 16px;
        }
        .subscription-card {
            display: grid;
            gap: 20px;
            padding: 24px;
            border-radius: 24px;
            border: 1px solid var(--line);
            background:
                linear-gradient(180deg, rgba(75, 183, 163, 0.08), rgba(75, 183, 163, 0.02)),
                var(--surface-card);
        }
        .subscription-card-topline {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 20px;
            flex-wrap: wrap;
        }
        .subscription-kicker {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-weight: 700;
        }
        .subscription-name {
            margin: 6px 0 0;
            font-size: 28px;
            line-height: 1;
            letter-spacing: -0.04em;
        }
        .subscription-subcopy {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.6;
            max-width: 620px;
        }
        .subscription-price-stack {
            display: grid;
            justify-items: end;
            gap: 6px;
            text-align: right;
        }
        .subscription-price {
            font-size: 36px;
            line-height: 0.95;
            letter-spacing: -0.05em;
            font-weight: 700;
        }
        .subscription-detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
        }
        .subscription-detail-card {
            display: grid;
            gap: 6px;
            padding: 16px 18px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
        }
        .subscription-pill-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .subscription-detail-value {
            color: var(--text);
            font-size: 16px;
            line-height: 1.35;
            font-weight: 600;
        }
        .subscription-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .billing-builder-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
            gap: 18px;
            align-items: start;
        }
        .billing-builder-panel,
        .billing-preview-panel {
            display: grid;
            gap: 14px;
            padding: 22px;
            border-radius: 24px;
            border: 1px solid var(--line);
            background: var(--surface-card);
        }
        .billing-builder-head,
        .billing-preview-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }
        .billing-builder-copy {
            display: grid;
            gap: 6px;
        }
        .billing-builder-title {
            margin: 0;
            font-size: 16px;
            line-height: 1.2;
            letter-spacing: -0.02em;
        }
        .billing-builder-note {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.55;
        }
        .billing-selection-count {
            color: var(--muted);
            font-size: 11px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            font-weight: 700;
            white-space: nowrap;
        }
        .billing-desk-list {
            display: grid;
            gap: 0;
        }
        .billing-desk-row {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr) auto auto;
            align-items: center;
            gap: 14px;
            padding: 18px 0;
            border-bottom: 1px solid var(--line);
        }
        .billing-desk-row:last-child {
            border-bottom: 0;
        }
        .billing-desk-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: grid;
            place-items: center;
            background: var(--surface-card-soft);
            border: 1px solid var(--line);
            color: var(--accent);
            font-size: 12px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .billing-desk-copy {
            display: grid;
            gap: 4px;
            min-width: 0;
        }
        .billing-desk-title {
            margin: 0;
            font-size: 16px;
            line-height: 1.2;
            letter-spacing: -0.02em;
        }
        .admin-account-grid {
            display: grid;
            grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
            gap: 18px;
            align-items: start;
        }
        .admin-create-user,
        .admin-users-shell {
            display: grid;
            gap: 14px;
            padding: 22px;
            border-radius: 24px;
            border: 1px solid var(--line);
            background: var(--surface-card);
        }
        .admin-users-shell-wide {
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
        }
        .admin-scope-fieldset {
            margin: 0;
            padding: 0;
            border: 0;
            display: grid;
            gap: 10px;
        }
        .admin-scope-fieldset legend {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-weight: 700;
            padding: 0;
        }
        .admin-scope-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .admin-scope-grid.compact {
            gap: 6px;
            margin-top: 10px;
        }
        .admin-scope-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 34px;
            padding: 7px 10px;
            border-radius: 8px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--text);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
            cursor: pointer;
            user-select: none;
        }
        .admin-scope-chip.compact {
            min-height: 28px;
            padding: 5px 8px;
            font-size: 11px;
        }
        .admin-scope-chip input {
            width: 14px;
            height: 14px;
            margin: 0;
            accent-color: #4BB7A3;
        }
        .admin-table-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        .admin-users-toolbar {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 14px;
            flex-wrap: wrap;
        }
        .admin-users-search {
            flex: 1 1 320px;
        }
        .admin-users-search input {
            width: min(420px, 100%);
        }
        .admin-users-page-controls {
            justify-content: flex-end;
        }
        .admin-inline-select,
        .admin-inline-date {
            border-radius: 8px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--text);
            padding: 8px 10px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 12px;
            line-height: 1.2;
        }
        .admin-row-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .admin-users-table-wrap {
            overflow-x: auto;
            overflow-y: visible;
        }
        .admin-modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 120;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 72px 18px 32px;
            background: rgba(7, 16, 20, 0.62);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            overflow-y: auto;
        }
        .admin-modal-backdrop.active {
            display: flex;
        }
        body.modal-open {
            overflow: hidden;
        }
        .admin-modal {
            width: min(760px, 100%);
            display: grid;
            gap: 18px;
            padding: 24px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--surface-card);
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
        }
        .admin-modal-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }
        .admin-modal-head h2 {
            margin: 4px 0 0;
            font-size: 24px;
            line-height: 1.12;
            letter-spacing: -0.02em;
        }
        .admin-modal .admin-create-user {
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
        }
        .billing-desk-note {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .billing-desk-price {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.2;
            white-space: nowrap;
        }
        .billing-preview-panel {
            background:
                linear-gradient(180deg, rgba(75, 183, 163, 0.12), rgba(75, 183, 163, 0.02)),
                var(--surface-card);
        }
        .billing-preview-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 8px 12px;
            border-radius: 999px;
            background: rgba(75, 183, 163, 0.16);
            border: 1px solid rgba(75, 183, 163, 0.24);
            color: #7BE0C8;
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-weight: 700;
            letter-spacing: 0.16em;
            text-transform: uppercase;
        }
        .billing-preview-total {
            display: flex;
            align-items: flex-end;
            gap: 8px;
        }
        .billing-preview-currency {
            color: var(--muted);
            font-size: 20px;
            line-height: 1;
            padding-bottom: 8px;
        }
        .billing-preview-value {
            font-size: 64px;
            line-height: 0.9;
            letter-spacing: -0.06em;
            font-weight: 700;
        }
        .billing-preview-period {
            color: var(--muted);
            font-size: 16px;
            line-height: 1;
            padding-bottom: 8px;
        }
        .billing-preview-subcopy {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.55;
        }
        .billing-preview-breakdown {
            display: grid;
            gap: 10px;
            padding: 16px 0;
            border-top: 1px solid var(--line);
            border-bottom: 1px solid var(--line);
        }
        .billing-breakdown-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.35;
        }
        .billing-breakdown-row.total {
            color: var(--text);
            font-weight: 700;
        }
        .billing-breakdown-row.discount {
            color: var(--accent);
        }
        .billing-preview-actions {
            display: grid;
            gap: 10px;
        }
        .billing-preview-footnotes {
            display: grid;
            gap: 8px;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .asset-status-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
            border: 1px solid var(--line);
            background: var(--surface-soft);
            color: var(--muted);
        }
        .asset-status-pill.active {
            background: rgba(75, 183, 163, 0.14);
            border-color: rgba(75, 183, 163, 0.28);
            color: #7BE0C8;
        }
        .asset-status-pill.available {
            background: rgba(233, 251, 255, 0.06);
        }
        .asset-manager-note {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .asset-manager-support {
            color: var(--muted);
            font-size: 12px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .bundle-upgrade-strip {
            margin-top: 16px;
        }
        .bundle-upgrade-card {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 18px;
            align-items: center;
            padding: 22px 24px;
            border-radius: 24px;
            border: 1px solid rgba(75, 183, 163, 0.26);
            background:
                linear-gradient(90deg, rgba(75, 183, 163, 0.16), rgba(75, 183, 163, 0.04)),
                var(--surface-card);
        }
        .bundle-upgrade-copy {
            display: grid;
            gap: 8px;
        }
        .bundle-upgrade-title {
            margin: 0;
            font-size: 22px;
            line-height: 1.05;
            letter-spacing: -0.03em;
        }
        .bundle-upgrade-price {
            display: grid;
            gap: 6px;
            justify-items: end;
            text-align: right;
        }
        .bundle-upgrade-value {
            font-size: 32px;
            line-height: 0.95;
            letter-spacing: -0.05em;
            font-weight: 700;
        }
        .bundle-upgrade-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .signal-feed-list {
            display: grid;
            gap: 14px;
        }
        .signal-feed-card {
            display: grid;
            gap: 14px;
            padding: 20px;
            border-radius: 22px;
            border: 1px solid var(--line);
            background: var(--surface-card);
        }
        .signal-feed-card.locked {
            opacity: 0.78;
        }
        .signal-feed-topline {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 14px;
            flex-wrap: wrap;
        }
        .signal-feed-head {
            display: grid;
            gap: 8px;
        }
        .signal-feed-title-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .signal-feed-symbol {
            margin: 0;
            font-size: 22px;
            line-height: 1;
            letter-spacing: -0.04em;
        }
        .signal-direction-pill,
        .signal-tier-pill,
        .signal-asset-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid var(--line);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .signal-direction-pill.long {
            color: #7BE0C8;
            background: rgba(75, 183, 163, 0.14);
            border-color: rgba(75, 183, 163, 0.24);
        }
        .signal-direction-pill.short {
            color: #ff9baa;
            background: rgba(255, 123, 141, 0.12);
            border-color: rgba(255, 123, 141, 0.22);
        }
        .signal-tier-pill,
        .signal-asset-pill {
            color: var(--muted);
            background: var(--surface-card-soft);
        }
        .signal-feed-snippet {
            color: var(--text);
            font-size: 14px;
            line-height: 1.6;
            max-width: 720px;
        }
        .signal-feed-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .signal-follow-button {
            min-width: 116px;
        }
        .signal-follow-button.is-followed {
            background: rgba(75, 183, 163, 0.16);
            border-color: rgba(75, 183, 163, 0.24);
            color: var(--text);
        }
        .signal-feed-meta {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .signal-feed-price-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 10px;
        }
        .signal-feed-price-card {
            display: grid;
            gap: 6px;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
        }
        .signal-feed-price-label {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .signal-feed-price-value {
            color: var(--text);
            font-size: 15px;
            line-height: 1.25;
            font-weight: 600;
        }
        .signal-empty-state {
            display: grid;
            gap: 8px;
            padding: 24px;
            border-radius: 22px;
            border: 1px dashed var(--line);
            background: var(--surface-card-soft);
        }
        .signal-empty-title {
            margin: 0;
            font-size: 18px;
            line-height: 1.15;
            letter-spacing: -0.03em;
        }
        .signal-empty-copy {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.6;
        }
        .utility-head-with-controls {
            align-items: flex-start;
            gap: 18px;
        }
        .alerts-toolbar {
            display: grid;
            gap: 12px;
            justify-items: end;
        }
        .segmented-control {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
        }
        .segmented-control-button {
            border: 0;
            background: transparent;
            color: var(--muted);
            border-radius: 999px;
            padding: 10px 14px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
            cursor: pointer;
        }
        .segmented-control-button.active {
            color: var(--bg);
            background: var(--accent);
        }
        .utility-search {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .utility-search input {
            min-width: 280px;
            padding: 12px 14px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--text);
            font: inherit;
        }
        .journal-feed {
            display: grid;
            gap: 18px;
        }
        .journal-day-separator {
            position: sticky;
            top: 92px;
            z-index: 1;
            display: flex;
            justify-content: center;
            margin: 6px 0 -4px;
        }
        .journal-day-separator span {
            padding: 7px 14px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: color-mix(in srgb, var(--surface-card) 92%, transparent);
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
            backdrop-filter: blur(10px);
        }
        .journal-entry {
            display: grid;
            grid-template-columns: 40px minmax(0, 1fr);
            gap: 14px;
            padding: 20px 0 0;
            border-top: 1px solid var(--line);
        }
        .journal-entry:first-child {
            border-top: 0;
            padding-top: 0;
        }
        .journal-entry-gutter {
            display: flex;
            justify-content: center;
        }
        .journal-entry-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            border-radius: 10px;
            background: var(--accent);
            color: #081318;
            font-size: 14px;
            font-weight: 800;
        }
        .journal-entry-main {
            display: grid;
            gap: 10px;
            min-width: 0;
        }
        .journal-entry-headline {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
        }
        .journal-entry-origin {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .journal-entry-title {
            margin: 0;
            color: var(--text);
            font-size: 26px;
            line-height: 1.08;
            letter-spacing: -0.04em;
        }
        .journal-entry-meta,
        .journal-entry-prices {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            color: var(--muted);
            font-size: 13px;
        }
        .journal-entry-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 6px 10px;
            border-radius: 999px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--muted);
        }
        .journal-entry-pill.trades {
            color: #7BE0C8;
            border-color: rgba(75, 183, 163, 0.28);
            background: rgba(75, 183, 163, 0.12);
        }
        .journal-entry-pill.watchlist {
            color: #d7e6ef;
            border-color: rgba(200, 216, 228, 0.22);
            background: rgba(200, 216, 228, 0.1);
        }
        .journal-entry-body {
            display: grid;
            gap: 10px;
            color: var(--text);
            font-size: 15px;
            line-height: 1.72;
        }
        .journal-entry-paragraph {
            margin: 0;
        }
        .journal-entry-body a {
            color: var(--accent);
            text-decoration: none;
            font-weight: 600;
        }
        .journal-entry-body a:hover,
        .journal-entry-body a:focus-visible {
            text-decoration: underline;
        }
        .journal-entry-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
            padding-top: 4px;
        }
        .follow-star-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 40px;
            height: 40px;
            padding: 0 14px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            color: var(--muted);
            cursor: pointer;
            transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
        }
        .follow-star-button.compact {
            width: 34px;
            min-width: 34px;
            height: 34px;
            padding: 0;
        }
        .follow-star-button:hover,
        .follow-star-button:focus-visible {
            color: var(--text);
            border-color: rgba(75, 183, 163, 0.28);
            transform: translateY(-1px);
        }
        .follow-star-button.is-followed {
            color: var(--accent-bright);
            border-color: rgba(75, 183, 163, 0.32);
            background: rgba(75, 183, 163, 0.10);
        }
        .follow-star-glyph {
            font-size: 14px;
            font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
        }
        .follow-star-button.is-followed .follow-star-glyph {
            font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
        }
        .follow-star-copy {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            font-weight: 700;
        }
        .table-follow-inline {
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr);
            gap: 10px;
            align-items: flex-start;
        }
        .following-table-wrap {
            overflow-x: auto;
        }
        .following-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }
        .following-table th,
        .following-table td {
            padding: 14px 12px;
            vertical-align: top;
            border-top: 1px solid var(--line);
        }
        .following-table thead th {
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            text-align: left;
            border-top: 0;
        }
        .following-table tbody tr:first-child td {
            border-top: 1px solid var(--line);
        }
        html:not([data-theme="dark"]) .segmented-control-button.active {
            color: #ffffff;
            background: #081318;
        }
        html:not([data-theme="dark"]) .journal-day-separator span {
            background: rgba(255, 255, 255, 0.92);
        }
        html:not([data-theme="dark"]) .journal-entry-badge {
            color: #ffffff;
        }
        html:not([data-theme="dark"]) .follow-star-button.is-followed {
            color: var(--accent-strong);
            border-color: rgba(75, 183, 163, 0.32);
            background: rgba(75, 183, 163, 0.14);
        }
        html:not([data-theme="dark"]) .asset-status-pill.active {
            color: #089981;
            background: rgba(8, 153, 129, 0.12);
            border-color: rgba(8, 153, 129, 0.18);
        }
        @media (max-width: 960px) {
            .billing-builder-grid,
            .admin-account-grid,
            .bundle-upgrade-card {
                grid-template-columns: 1fr;
            }
            .billing-desk-row {
                grid-template-columns: auto minmax(0, 1fr);
            }
            .billing-desk-price,
            .billing-desk-row .scope-toggle {
                grid-column: 2;
            }
            .subscription-price-stack,
            .bundle-upgrade-price {
                justify-items: start;
                text-align: left;
            }
        }
        .prefs-table {
            width: 100%;
            border-collapse: collapse;
        }
        .prefs-table th,
        .prefs-table td {
            padding: 14px 12px;
            border-bottom: 1px solid var(--line);
            text-align: left;
            vertical-align: middle;
        }
        .prefs-table th {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.16em;
            font-weight: 700;
        }
        .prefs-event {
            display: grid;
            gap: 4px;
        }
        .prefs-event-title {
            font-weight: 600;
            font-size: 14px;
            line-height: 1.3;
        }
        .prefs-event-meta {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.4;
        }
        .prefs-toggle {
            width: 18px;
            height: 18px;
            accent-color: #4BB7A3;
            cursor: pointer;
        }
        .prefs-note {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .prefs-status {
            min-height: 18px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.4;
        }
        .prefs-status.error {
            color: #ff7b8d;
        }
        .prefs-status.success {
            color: #7BE0C8;
        }
        .funnel-stack {
            display: grid;
            gap: 14px;
        }
        .bar-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .learning-brief-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 14px;
        }
        .learning-brief-card {
            display: grid;
            gap: 12px;
            padding: 18px;
            border-radius: 22px;
            border: 1px solid var(--line);
            background: var(--surface-card);
        }
        .learning-brief-topline {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .learning-brief-kicker {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: var(--muted);
        }
        .learning-brief-title {
            font-size: 24px;
            line-height: 1.15;
            font-weight: 800;
            color: var(--text);
        }
        .learning-brief-copy {
            color: var(--text);
            font-size: 15px;
            line-height: 1.55;
        }
        .learning-brief-points {
            margin: 0;
            padding-left: 18px;
            color: var(--muted);
            display: grid;
            gap: 8px;
            line-height: 1.45;
        }
        .learning-brief-footer {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.45;
            border-top: 1px solid var(--line);
            padding-top: 10px;
        }
        .bar-chart {
            display: flex;
            align-items: end;
            gap: 10px;
            min-height: 180px;
            padding: 10px 6px 4px;
        }
        .bar-item {
            flex: 1 1 0;
            min-width: 0;
            display: grid;
            gap: 8px;
            align-items: end;
            justify-items: center;
        }
        .bar-track {
            width: 100%;
            height: 120px;
            display: flex;
            align-items: end;
            justify-content: center;
            padding: 0 4px;
        }
        .bar-fill {
            width: 100%;
            border-radius: 14px 14px 6px 6px;
            min-height: 8px;
            background: linear-gradient(180deg, var(--tv-up) 0%, rgba(var(--tv-up-rgb), 0.55) 100%);
            transform-origin: bottom center;
            animation: barGrow 620ms ease;
            transition: filter 140ms ease, transform 140ms ease;
        }
        .bar-fill.warn {
            background: linear-gradient(180deg, #d7a248 0%, rgba(215, 162, 72, 0.55) 100%);
        }
        .bar-fill.bad {
            background: linear-gradient(180deg, var(--tv-down) 0%, rgba(var(--tv-down-rgb), 0.50) 100%);
        }
        .bar-item:hover .bar-fill,
        .bar-item:focus-within .bar-fill {
            filter: brightness(1.08);
            transform: scaleY(1.02);
        }
        .bar-label {
            color: var(--muted);
            font-size: 11px;
            text-align: center;
            line-height: 1.35;
        }
        .bar-value {
            color: var(--text);
            font-size: 12px;
            font-weight: 700;
        }
        .funnel-row {
            display: grid;
            gap: 8px;
        }
        .funnel-meta {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
            font-size: 13px;
            color: var(--muted);
        }
        .funnel-label {
            font-weight: 700;
            color: var(--text);
        }
        .funnel-track {
            position: relative;
            overflow: hidden;
            height: 10px;
            border-radius: 999px;
            background: var(--surface-muted-strong);
        }
        .funnel-fill {
            position: absolute;
            inset: 0 auto 0 0;
            width: calc(var(--fill, 0) * 1%);
            border-radius: inherit;
            background: linear-gradient(90deg, rgba(var(--tv-up-rgb), 0.72), rgba(var(--tv-up-rgb), 1));
            transform-origin: left center;
            animation: funnelGrow 640ms ease;
        }
        .funnel-fill.warn {
            background: linear-gradient(90deg, rgba(181, 122, 16, 0.72), rgba(181, 122, 16, 1));
        }
        .funnel-fill.bad {
            background: linear-gradient(90deg, rgba(var(--tv-down-rgb), 0.7), rgba(var(--tv-down-rgb), 1));
        }
        .tiny-tag {
            display: inline-flex;
            align-items: center;
            padding: 4px 9px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            background: var(--surface-muted);
            color: var(--muted);
        }
        .tiny-tag.good {
            background: var(--accent-soft);
            color: var(--accent-strong);
            box-shadow: inset 0 0 0 1px rgba(75, 183, 163, 0.28);
        }
        .tiny-tag.warn {
            background: var(--warning-soft);
            color: var(--warning-strong);
            box-shadow: inset 0 0 0 1px rgba(184, 138, 55, 0.28);
        }
        .tiny-tag.bad {
            background: var(--danger-soft);
            color: var(--danger-strong);
            box-shadow: inset 0 0 0 1px rgba(216, 101, 115, 0.28);
        }
        html[data-theme="dark"] .tiny-tag.good {
            box-shadow: inset 0 0 0 1px rgba(123, 224, 200, 0.30);
        }
        html[data-theme="dark"] .tiny-tag.warn {
            box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.30);
        }
        html[data-theme="dark"] .tiny-tag.bad {
            box-shadow: inset 0 0 0 1px rgba(255, 126, 137, 0.30);
        }
        .section-head {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
            margin-bottom: 14px;
        }
        .section-head h2 {
            margin: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 20px;
            font-weight: 700;
            letter-spacing: -0.03em;
        }
        @keyframes funnelGrow {
            from {
                transform: scaleX(0);
                opacity: 0.45;
            }
            to {
                transform: scaleX(1);
                opacity: 1;
            }
        }
        @keyframes barGrow {
            from {
                transform: scaleY(0.1);
                opacity: 0.35;
            }
            to {
                transform: scaleY(1);
                opacity: 1;
            }
        }
        @keyframes chartFadeIn {
            from {
                opacity: 0;
                transform: translateY(6px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .control-row, .pagination-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }
        .control-row {
            justify-content: flex-end;
        }
        .control-group {
            display: grid;
            gap: 6px;
        }
        .control-group span {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-weight: 700;
            letter-spacing: 0.2em;
            text-transform: uppercase;
        }
        .control-group select,
        .control-group input {
            border: 1px solid var(--line);
            background: var(--surface-input);
            color: var(--text);
            border-radius: 14px;
            padding: 10px 12px;
            font: inherit;
            min-width: 124px;
        }
        .control-group input {
            min-width: 220px;
        }
        .pagination-bar {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .broker-card {
            display: grid;
            gap: 14px;
        }
        .broker-top {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
        }
        .broker-top h3 {
            margin: 0;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 20px;
            font-weight: 700;
            letter-spacing: -0.03em;
        }
        .micro-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }
        .micro-stat {
            border: 1px solid var(--line);
            border-radius: 14px;
            padding: 14px;
            background: var(--surface-soft);
        }
        .micro-stat span {
            display: block;
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            margin-bottom: 8px;
        }
        .micro-stat strong {
            font-size: 18px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-weight: 700;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .table-wrap {
            border-radius: var(--radius);
            overflow-x: auto;
            overflow-y: visible;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        .symbol-review-table {
            table-layout: fixed;
        }
        .symbol-review-table th,
        .symbol-review-table td {
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .table-inline-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }
        .table-inline-actions .button {
            padding: 8px 10px;
        }
        th, td {
            padding: 14px 16px;
            text-align: left;
            border-bottom: 1px solid var(--line);
            vertical-align: top;
            font-size: 14px;
        }
        th {
            color: var(--muted);
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            font-weight: 700;
            background: var(--surface-subtle);
        }
        tr:last-child td {
            border-bottom: none;
        }
        .symbol {
            font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-weight: 700;
        }
        td, th {
            font-variant-numeric: tabular-nums;
        }
        .positive { color: var(--accent); }
        .negative { color: var(--danger); }
        .muted { color: var(--muted); }
        .tiny {
            font-size: 12px;
            color: var(--muted);
        }
        .tag {
            display: inline-flex;
            align-items: center;
            padding: 5px 10px;
            border-radius: 999px;
            background: var(--surface-muted);
            font-size: 11px;
            font-weight: 700;
        }
        .tag.good {
            background: var(--accent-soft);
            color: var(--accent-strong);
            box-shadow: inset 0 0 0 1px rgba(75, 183, 163, 0.28);
        }
        .tag.bad {
            background: var(--danger-soft);
            color: var(--danger-strong);
            box-shadow: inset 0 0 0 1px rgba(216, 101, 115, 0.28);
        }
        .tag.warn {
            background: var(--warning-soft);
            color: var(--warning-strong);
            box-shadow: inset 0 0 0 1px rgba(184, 138, 55, 0.28);
        }
        html[data-theme="dark"] .tag.good {
            box-shadow: inset 0 0 0 1px rgba(123, 224, 200, 0.30);
        }
        html[data-theme="dark"] .tag.bad {
            box-shadow: inset 0 0 0 1px rgba(255, 126, 137, 0.30);
        }
        html[data-theme="dark"] .tag.warn {
            box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.30);
        }
        .footnote {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.6;
        }
        .sort-button {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: none;
            background: transparent;
            color: inherit;
            font: inherit;
            font-size: inherit;
            font-weight: inherit;
            letter-spacing: inherit;
            text-transform: inherit;
            padding: 0;
            cursor: pointer;
        }
        .sort-button:hover {
            color: var(--text);
        }
        .sort-indicator {
            min-width: 10px;
            color: var(--text);
            opacity: 0.72;
        }
        .tooltip-anchor {
            cursor: help;
            text-decoration-line: underline;
            text-decoration-style: dotted;
            text-decoration-thickness: 1px;
            text-decoration-color: rgba(102, 113, 127, 0.7);
            text-underline-offset: 0.24em;
        }
        .tooltip-anchor:hover,
        .tooltip-anchor:focus-visible {
            text-decoration-color: rgba(27, 43, 52, 0.8);
            outline: none;
        }
        .sort-button.tooltip-anchor {
            display: inline-flex;
        }
        .casefile-trigger {
            border: none;
            background: transparent;
            padding: 0;
            margin: 0;
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
        }
        .casefile-trigger:hover .symbol {
            color: var(--accent);
        }
        .symbol-cell {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .casefile-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(27, 43, 52, 0.42);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
            z-index: 50;
        }
        .casefile-backdrop.active {
            display: flex;
        }
        .casefile-dialog {
            width: min(1320px, 100%);
            max-height: calc(100vh - 36px);
            overflow: auto;
            border-radius: 24px;
            background: var(--surface-dialog);
            border: 1px solid var(--line);
            box-shadow: 0 18px 48px rgba(27, 43, 52, 0.14);
            padding: 20px 22px 22px;
            display: grid;
            gap: 18px;
        }
        .casefile-head {
            display: flex;
            justify-content: space-between;
            gap: 18px;
            align-items: flex-start;
        }
        .casefile-title {
            display: grid;
            gap: 8px;
        }
        .casefile-title h2 {
            margin: 0;
            font-size: clamp(24px, 3vw, 38px);
            line-height: 1.05;
            letter-spacing: -0.04em;
            font-weight: 600;
        }
        .casefile-meta {
            color: var(--muted);
            font-size: 14px;
            line-height: 1.5;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.01em;
        }
        .casefile-controls {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
            justify-content: flex-end;
        }
        .chart-range {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px;
            border-radius: 999px;
            background: var(--surface-chip);
            border: 1px solid var(--line);
        }
        .chart-button {
            border: none;
            background: transparent;
            border-radius: 999px;
            padding: 9px 14px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-weight: 700;
            font-size: 11px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--muted);
            cursor: pointer;
        }
        body:not([data-active-page="brain"]):not([data-active-page="emiwatch"]):not([data-active-page="learning"]):not([data-active-page="broker"]):not([data-active-page="zhp"]) #dashboardTabChromePanel {
            display: none !important;
        }
        .chart-button.active {
            background: var(--button-active-bg);
            color: var(--button-active-text);
        }
        .casefile-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
            gap: 16px;
            /* V16.1: stretch so chart panel + Trade Snapshot bottom edges
               line up. Whichever side is taller drives the row height; the
               other panel grows to match. */
            align-items: stretch;
            min-width: 0;
        }
        .casefile-panel {
            border-radius: 20px;
            background: var(--surface-card);
            border: 1px solid var(--line);
            /* V16.1 spacing rule: 32px between content and box edge. */
            padding: 32px;
            display: grid;
            gap: 14px;
            align-content: start;
            min-width: 0;
            overflow: hidden;
        }
        .casefile-panel h3 {
            margin: 0;
            font-size: 16px;
            letter-spacing: -0.02em;
            font-weight: 600;
        }
        .casefile-interval-bar {
            position: absolute;
            top: 10px;
            left: 12px;
            z-index: 10;
            display: flex;
            gap: 2px;
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 3px 5px;
            box-shadow: 0 6px 18px rgba(27,43,52,0.12);
        }
        html[data-theme="dark"] .casefile-interval-bar {
            background: rgba(31, 50, 60, 0.94);
        }
        .ci-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-family: inherit;
            font-size: 11px;
            font-weight: 600;
            color: var(--muted);
            padding: 5px 9px;
            border-radius: 7px;
            transition: background 100ms, color 100ms;
            line-height: 1;
            white-space: nowrap;
        }
        .ci-btn:hover {
            color: var(--text);
            background: var(--accent-soft);
        }
        .ci-btn.ci-active {
            color: var(--accent);
            background: var(--accent-soft);
        }
        .casefile-chart-wrap {
            position: relative;
            min-height: 540px;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
        }
        .casefile-chart-wrap.chart-expanded {
            min-height: 740px;
        }
        .casefile-chart-stage {
            width: 100%;
            min-height: 520px;
            min-width: 0;
            max-width: 100%;
            border-radius: 16px;
            background: var(--surface-chart);
            border: 1px solid rgba(75, 183, 163, 0.14);
            overflow: hidden;
            contain: layout paint;
        }
        html[data-theme="dark"] .casefile-chart-stage {
            background: rgba(31, 50, 60, 0.78);
            border-color: rgba(123, 224, 200, 0.16);
        }
        .casefile-chart-wrap.chart-expanded .casefile-chart-stage {
            min-height: 720px;
        }
        .casefile-chart-stage svg {
            animation: chartFadeIn 220ms ease;
        }
        .casefile-chart-stage > div,
        .casefile-chart-stage canvas {
            max-width: 100% !important;
        }
        .casefile-chart-tooltip {
            position: absolute;
            top: 14px;
            left: 14px;
            min-width: 180px;
            max-width: 260px;
            pointer-events: none;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(27, 43, 52, 0.92);
            color: #e9fbff;
            box-shadow: 0 10px 28px rgba(27, 43, 52, 0.28);
            font-size: 12px;
            line-height: 1.45;
            opacity: 0;
            transform: translateY(8px);
            transition: opacity 120ms ease, transform 120ms ease;
        }
        .casefile-chart-tooltip.active {
            opacity: 1;
            transform: translateY(0);
        }
        .casefile-kpis {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
        }
        .casefile-stat {
            min-width: 0;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            padding: 18px;
            display: grid;
            align-content: start;
            gap: 8px;
            min-width: 0;
        }
        .casefile-stat-value-block {
            display: flex;
            flex-direction: column;
            min-width: 0;
            gap: 6px;
        }
        .casefile-stat .metric-label {
            font-size: 10px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--muted);
            margin-bottom: 0;
            line-height: 1.2;
        }
        .casefile-stat .metric-value {
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: clamp(17px, 1.35vw, 28px);
            font-weight: 600;
            line-height: 1.08;
            margin: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .casefile-stat .metric-note {
            font-size: 13px;
            color: var(--muted);
            margin: 0;
            line-height: 1.45;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .casefile-copy {
            color: var(--muted);
            line-height: 1.65;
            font-size: 14px;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .casefile-copy strong {
            color: var(--text);
        }
        .casefile-timeline {
            display: grid;
            gap: 10px;
            max-height: 420px;
            overflow: auto;
            padding-right: 4px;
        }
        .casefile-timeline-item {
            border-radius: 14px;
            border: 1px solid var(--line);
            background: var(--surface-card-soft);
            padding: 12px 14px;
            display: grid;
            gap: 4px;
        }
        .casefile-timeline-head {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            align-items: center;
            font-size: 13px;
        }
        .casefile-timeline-note {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.5;
        }
        .casefile-empty {
            min-height: 260px;
            display: grid;
            place-items: center;
            color: var(--muted);
            text-align: center;
            padding: 30px;
        }
        .casefile-chip-row {
            display: flex;
            flex-wrap: nowrap;
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .casefile-chip-row::-webkit-scrollbar {
            display: none;
        }
        /* V16.1 #3: chips re-tuned to match the marketing-site .pill scale —
           JetBrains Mono uppercase, smaller padding, square-ish (3px radius). */
        .casefile-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 8px;
            border-radius: 3px;
            background: var(--surface-chip);
            border: 1px solid var(--line-strong);
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            font-weight: 600;
            white-space: nowrap;
            flex: 0 0 auto;
            min-height: 22px;
        }
        html:not([data-theme="dark"]) h1,
        html:not([data-theme="dark"]) .section-head h2,
        html:not([data-theme="dark"]) .casefile-title h2 {
            color: var(--text);
            font-weight: 500;
        }
        html:not([data-theme="dark"]) .metric-value,
        html:not([data-theme="dark"]) .casefile-stat .metric-value {
            color: var(--text);
            font-weight: 600;
        }
        html:not([data-theme="dark"]) .button,
        html:not([data-theme="dark"]) .tab-button,
        html:not([data-theme="dark"]) .theme-button,
        html:not([data-theme="dark"]) .route-chip,
        html:not([data-theme="dark"]) .tag,
        html:not([data-theme="dark"]) .casefile-chip {
            color: var(--text);
        }
        html:not([data-theme="dark"]) .button.primary,
        html:not([data-theme="dark"]) .tab-button.active,
        html:not([data-theme="dark"]) .theme-button.active,
        html:not([data-theme="dark"]) .route-chip.active {
            color: var(--button-active-text);
        }
        /* casefile-cta is always black-on-mint — no theme override needed. */
        html:not([data-theme="dark"]) .tag.good,
        html:not([data-theme="dark"]) .tiny-tag.good,
        html:not([data-theme="dark"]) .casefile-chip.good {
            color: var(--accent-strong);
        }
        html:not([data-theme="dark"]) .tag.warn,
        html:not([data-theme="dark"]) .tiny-tag.warn,
        html:not([data-theme="dark"]) .casefile-chip.warn {
            color: var(--warning-strong);
        }
        html:not([data-theme="dark"]) .tag.bad,
        html:not([data-theme="dark"]) .tiny-tag.bad,
        html:not([data-theme="dark"]) .casefile-chip.negative,
        html:not([data-theme="dark"]) .casefile-chip.bad {
            color: var(--danger-strong);
        }
        html:not([data-theme="dark"]) .casefile-meta,
        html:not([data-theme="dark"]) .metric-note,
        html:not([data-theme="dark"]) .subcopy,
        html:not([data-theme="dark"]) .tiny,
        html:not([data-theme="dark"]) .muted {
            color: var(--muted);
        }
        .casefile-chip.good {
            color: var(--accent-strong);
            border-color: rgba(8, 153, 129, 0.32);
            background: rgba(8, 153, 129, 0.18);
        }
        .casefile-chip.warn {
            color: var(--warning-strong);
            border-color: rgba(181, 122, 16, 0.32);
            background: rgba(181, 122, 16, 0.18);
        }
        .casefile-chip.negative,
        .casefile-chip.bad {
            color: var(--danger-strong);
            border-color: rgba(242, 54, 69, 0.32);
            background: rgba(242, 54, 69, 0.18);
        }
        html[data-theme="dark"] .casefile-chip.good {
            color: var(--accent-strong);
            border-color: rgba(123, 224, 200, 0.34);
            background: rgba(123, 224, 200, 0.16);
        }
        html[data-theme="dark"] .casefile-chip.warn {
            color: var(--warning-strong);
            border-color: rgba(255, 180, 84, 0.34);
            background: rgba(255, 180, 84, 0.16);
        }
        html[data-theme="dark"] .casefile-chip.negative,
        html[data-theme="dark"] .casefile-chip.bad {
            color: var(--danger-strong);
            border-color: rgba(255, 126, 137, 0.34);
            background: rgba(255, 126, 137, 0.16);
        }
        .postgame-trigger {
            border: none;
            background: transparent;
            padding: 0;
            margin: 0;
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
        }
        .postgame-trigger:hover {
            color: var(--accent);
        }
        .inspect-trigger {
            border: none;
            background: transparent;
            padding: 0;
            margin: 0;
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
        }
        .inspect-trigger:hover,
        .inspect-trigger:focus-visible {
            color: var(--accent);
        }
        .inspect-trigger .tag,
        .inspect-trigger .tiny-tag {
            pointer-events: none;
        }
        .inspect-table-row {
            cursor: pointer;
        }
        .inspect-table-row:hover td {
            background: rgba(8, 153, 129, 0.04);
        }
        html[data-theme="dark"] .inspect-table-row:hover td {
            background: rgba(8, 153, 129, 0.12);
        }
        .inspect-bar-button {
            border: none;
            background: transparent;
            padding: 0;
            margin: 0;
            color: inherit;
            font: inherit;
            width: 100%;
            cursor: pointer;
        }
        .inspect-bar-button:focus-visible {
            outline: 2px solid rgba(8, 153, 129, 0.35);
            outline-offset: 4px;
            border-radius: 14px;
        }
        .lane-review-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(27, 43, 52, 0.36);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
            z-index: 45;
        }
        .lane-review-backdrop.active {
            display: flex;
        }
        .lane-review-dialog {
            width: min(1240px, 100%);
            max-height: calc(100vh - 36px);
            overflow: auto;
            border-radius: 24px;
            background: var(--surface-dialog);
            border: 1px solid var(--line);
            box-shadow: 0 28px 70px rgba(27, 43, 52, 0.24);
            padding: 22px;
            display: grid;
            gap: 18px;
        }
        .lane-review-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
            gap: 16px;
        }
        .lane-review-panel {
            border-radius: 20px;
            background: var(--surface-card);
            border: 1px solid var(--line);
            padding: 18px;
            display: grid;
            gap: 14px;
        }
        .lane-review-kpis {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
        }
        .lane-review-buckets {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .lane-review-bucket {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 999px;
            background: var(--surface-card-strong);
            border: 1px solid var(--line);
            font-size: 11px;
            font-weight: 700;
            color: var(--muted);
        }
        .realized-review-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(27, 43, 52, 0.38);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
            z-index: 47;
        }
        .realized-review-backdrop.active {
            display: flex;
        }
        .realized-review-dialog {
            width: min(1280px, 100%);
            max-height: calc(100vh - 36px);
            overflow: auto;
            border-radius: 24px;
            background: var(--surface-dialog);
            border: 1px solid var(--line);
            box-shadow: 0 28px 70px rgba(27, 43, 52, 0.24);
            padding: 22px;
            display: grid;
            gap: 18px;
        }
        .route-detail-host {
            display: grid;
            gap: 18px;
        }
        .route-detail-panel {
            display: grid;
            gap: 18px;
        }
        .casefile-backdrop.route-inline,
        .lane-review-backdrop.route-inline,
        .realized-review-backdrop.route-inline {
            position: static;
            inset: auto;
            background: transparent;
            backdrop-filter: none;
            padding: 0;
            z-index: auto;
        }
        .casefile-backdrop.route-inline.active,
        .lane-review-backdrop.route-inline.active,
        .realized-review-backdrop.route-inline.active {
            display: block;
        }
        .casefile-backdrop.route-inline .casefile-dialog,
        .lane-review-backdrop.route-inline .lane-review-dialog,
        .realized-review-backdrop.route-inline .realized-review-dialog {
            width: 100%;
            max-height: none;
            border-radius: 0;
            background: transparent;
            border: none;
            box-shadow: none;
            padding: 0;
        }
        .casefile-backdrop.route-inline [id$="CloseButton"],
        .lane-review-backdrop.route-inline [id$="CloseButton"],
        .realized-review-backdrop.route-inline [id$="CloseButton"] {
            display: none;
        }
        .popup-page {
            display: block;
            width: 100%;
            margin-top: 22px;
        }
        .popup-page .casefile-dialog,
        .popup-page .lane-review-dialog,
        .popup-page .realized-review-dialog {
            width: 100%;
            max-height: none;
            border-radius: 24px;
            background: var(--surface-dialog);
            border: 1px solid var(--line);
            box-shadow: none;
            padding: 22px;
            display: grid;
            gap: 18px;
            overflow: visible;
            margin: 0;
        }
        .popup-page [id$="CloseButton"] {
            display: none;
        }
        @media (max-width: 1320px) {
            .profit-command-grid {
                grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
            }
            .profit-primary-panel {
                grid-column: 1 / -1;
            }
            .profit-radar {
                grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1fr);
            }
        }
        @media (max-width: 940px) {
            .profit-command-grid,
            .profit-secondary-strip,
            .profit-radar {
                grid-template-columns: 1fr;
            }
            .profit-radar-svg {
                max-width: 290px;
            }
        }
        @media (max-width: 1180px) {
            .topbar {
                position: static;
                flex-direction: column;
                align-items: stretch;
                padding: 8px 16px 0;
            }
            .topbar-brand,
            .topbar-actions,
            .topbar-nav {
                justify-content: center;
            }
            .topbar-brand {
                text-align: center;
            }
            .topbar-nav {
                padding-left: 0;
                gap: 22px;
            }
            .topbar-link {
                min-height: auto;
                padding: 10px 0 14px;
            }
            .topbar-actions {
                flex-wrap: wrap;
                padding-bottom: 12px;
            }
            .topbar-dropdown {
                left: 50%;
                right: auto;
                transform: translateX(-50%);
            }
            .summary-grid, .broker-grid, .risk-grid, .profit-grid, .bar-grid, .learning-brief-grid {
                grid-template-columns: 1fr 1fr;
            }
            .profit-primary-metrics {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .utility-grid,
            .utility-profile-grid,
            .utility-form-grid {
                grid-template-columns: 1fr;
            }
            .casefile-grid {
                grid-template-columns: 1fr;
            }
            .lane-review-grid, .lane-review-kpis {
                grid-template-columns: 1fr;
            }
        }
        @media (max-width: 760px) {
            .shell {
                width: min(100% - 18px, 100%);
            }
            .topbar {
                padding: 8px 14px 0;
            }
            .topbar-brand {
                text-align: center;
            }
            .topbar-nav,
            .topbar-actions {
                justify-content: flex-start;
            }
            .topbar-nav {
                gap: 16px;
            }
            .topbar-actions {
                padding-bottom: 12px;
            }
            .summary-grid, .broker-grid, .micro-grid, .risk-grid, .profit-grid, .bar-grid, .learning-brief-grid {
                grid-template-columns: 1fr;
            }
            .profit-primary-metrics,
            .profit-secondary-strip {
                grid-template-columns: 1fr;
            }
            .profit-card-head {
                flex-direction: column;
                align-items: flex-start;
            }
            .masthead-top, .section-head {
                flex-direction: column;
                align-items: flex-start;
            }
            th:nth-child(n+5), td:nth-child(n+5) {
                display: none;
            }
            .casefile-head, .casefile-controls {
                flex-direction: column;
                align-items: flex-start;
            }
            .casefile-kpis {
                grid-template-columns: 1fr;
            }
        }

        /* ============================================================== */
        /*  Mobile topbar — compact row with hamburger + avatar-only       */
        /*  Overrides the 1180px column stacking for narrow viewports.     */
        /* ============================================================== */
        .topbar-hamburger {
            display: none;
            width: 38px;
            height: 38px;
            border-radius: 12px;
            border: 1px solid var(--line);
            background: var(--surface-control);
            color: var(--text);
            cursor: pointer;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        .topbar-hamburger:hover { border-color: var(--line-strong); }
        .topbar-hamburger .material-symbols-rounded {
            font-size: 22px;
            line-height: 1;
        }
        .topbar-mobile-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(8, 18, 22, 0.55);
            backdrop-filter: blur(3px);
            z-index: 45;
        }
        body.topbar-nav-open .topbar-mobile-backdrop { display: block; }

        @media (max-width: 1180px) {
            .topbar {
                position: sticky;
                top: 0;
                z-index: 50;
                flex-direction: row !important;
                align-items: center !important;
                justify-content: space-between !important;
                padding: 10px 14px !important;
                gap: 10px;
                background: var(--bg);
                backdrop-filter: blur(14px);
                -webkit-backdrop-filter: blur(14px);
                border-bottom: 1px solid var(--line);
            }
            .topbar-hamburger { display: inline-flex; order: 0; }
            .topbar-brand {
                order: 1;
                text-align: left !important;
                justify-content: flex-start !important;
                gap: 0 !important;
                padding: 0 !important;
                flex: 0 0 auto;
            }
            .topbar-brand-copy { display: none !important; }
            .topbar-logo {
                width: 32px;
                height: 32px;
                font-size: 15px;
            }

            /* collapse nav into a dropdown sheet */
            .topbar-nav {
                order: 10;
                position: fixed;
                top: 66px;
                left: 10px;
                right: 10px;
                max-width: 360px;
                margin: 0 auto;
                flex-direction: column !important;
                gap: 4px !important;
                padding: 10px !important;
                background: var(--surface-dialog);
                border: 1px solid var(--line);
                border-radius: 16px;
                box-shadow: 0 18px 40px rgba(8, 18, 22, 0.35);
                z-index: 50;
                transform: translateY(-8px);
                opacity: 0;
                pointer-events: none;
                transition: transform 180ms ease, opacity 180ms ease;
                max-height: calc(100vh - 90px);
                overflow-y: auto;
            }
            body.topbar-nav-open .topbar-nav {
                transform: translateY(0);
                opacity: 1;
                pointer-events: auto;
            }
            .topbar-nav .topbar-link {
                justify-content: flex-start;
                padding: 12px 14px !important;
                border-radius: 10px;
                min-height: 44px;
                width: 100%;
                font-size: 15px;
                letter-spacing: 0.08em;
                border: 1px solid transparent;
            }
            .topbar-nav .topbar-link:hover,
            .topbar-nav .topbar-link.active {
                background: var(--surface-muted);
                border-color: var(--line);
            }

            /* right side: icons + avatar-only */
            .topbar-actions {
                order: 2;
                flex-wrap: nowrap !important;
                padding: 0 !important;
                gap: 6px !important;
                margin-left: auto;
            }
            .topbar-actions .icon-button {
                width: 38px;
                height: 38px;
                min-width: 38px;
            }
            .topbar-account-shell .account-button {
                padding: 0 !important;
                border-radius: 999px !important;
                min-width: 38px;
                min-height: 38px;
            }
            .topbar-account-shell .account-copy {
                display: none !important;
            }
            .topbar-account-shell .account-avatar {
                width: 34px;
                height: 34px;
                font-size: 13px;
            }
            /* trim the refresh button on very narrow viewports to save space */
        }

        @media (max-width: 400px) {
            .topbar { padding: 8px 10px !important; gap: 6px; }
            .topbar-actions { gap: 4px !important; }
            .topbar-actions .icon-button { width: 36px; height: 36px; min-width: 36px; }
            /* optional: hide refresh — user can pull-to-refresh / navigate */
            #refreshButton { display: none; }
        }
        /* ============================================================
           EMI ALIGN — END-OF-FILE OVERRIDES (final)
           Two themes:
             • dark  (default)  — marketing-site palette (#1B2B34 etc)
             • light             — marketing palette inverted to cream/dark
           Both share: solid borders, 8/12px radii, Inter+JBM type scale,
           mint accent, TradingView red/green for charts.
           ============================================================ */

        /* ---- SHARED TOKENS (theme-agnostic) ---- */
        :root {
            --tv-up:       #26A69A;
            --tv-up-rgb:   38, 166, 154;
            --tv-down:     #EF5350;
            --tv-down-rgb: 239, 83, 80;
            --radius: 8px;
        }

        /* ============================================================
           STRUCTURAL OVERRIDES (theme-agnostic — use vars from above)
           ============================================================ */

        /* Page chrome */
        html { background: var(--bg); }
        body {
            background: var(--bg);
            color: var(--text);
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "system-ui", sans-serif;
            font-size: 17px;
            line-height: 1.55;
            -webkit-font-smoothing: antialiased;
        }
        body.dashboard-access-locked {
            background:
                linear-gradient(rgba(27,43,52,0.55), rgba(27,43,52,0.55)),
                url("./dashboard-bg.jpg") center center / cover fixed no-repeat;
        }
        html[data-theme="light"] body.dashboard-access-locked {
            background:
                linear-gradient(rgba(245,251,252,0.78), rgba(245,251,252,0.78)),
                url("./dashboard-bg.jpg") center center / cover fixed no-repeat;
        }

        /* ---- Topbar — match marketing-site nav ---- */
        :root .topbar,
        html:not([data-theme="light"]) .topbar {
            background: rgba(27, 43, 52, 0.78) !important;
            border-bottom: 1px solid var(--line) !important;
            backdrop-filter: saturate(140%) blur(16px);
        }
        html[data-theme="light"] .topbar {
            background: rgba(255, 255, 255, 0.82) !important;
            border-bottom: 1px solid var(--line) !important;
            backdrop-filter: saturate(140%) blur(16px);
        }
        .topbar-brand-copy { color: var(--text) !important; }
        .topbar-link { color: var(--muted) !important; }
        .topbar-link:hover,
        .topbar-link:focus-visible,
        .topbar-link.active { color: var(--text) !important; }
        .topbar-link.active { box-shadow: inset 0 -2px 0 var(--accent) !important; }
        .topbar-dropdown {
            background: var(--panel) !important;
            border: 1px solid var(--line) !important;
            color: var(--text) !important;
        }
        .topbar .icon-button { color: var(--muted) !important; }
        .topbar .icon-button:hover,
        .topbar .icon-button:focus-visible { color: var(--text) !important; }
        .topbar .button {
            background: transparent !important;
            border-color: var(--line) !important;
            color: var(--text) !important;
        }
        .topbar .button:hover {
            background: var(--surface-muted) !important;
            border-color: var(--line-strong) !important;
        }

        /* ---- Radii — tighten across the board ---- */
        .panel,
        .masthead,
        .metric,
        .table-wrap,
        .token-pane,
        .access-gate-card,
        .utility-card,
        .casefile-card,
        .casefile-stage,
        .surface-card,
        .surface-chart,
        .casefile-chart-stage { border-radius: 12px !important; }

        .button,
        .tab-button,
        .theme-button,
        .route-chip,
        .casefile-chip,
        .casefile-cta,
        .control-group select,
        .control-group input,
        .token-pane input,
        .token-toggle,
        .chart-range,
        .segmented-control-button,
        .casefile-interval-bar button,
        input,
        select,
        textarea { border-radius: 8px !important; }

        .tag,
        .tiny-tag,
        .access-gate-chip,
        .notification-status,
        .account-meta,
        .eyebrow-pill { border-radius: 999px !important; }

        .topbar-logo { border-radius: 6px !important; }

        /* ---- Solid borders ---- */
        .panel,
        .masthead,
        .metric,
        .table-wrap,
        .token-pane,
        .casefile-card,
        .access-gate-card { border-color: var(--line) !important; }

        /* ---- Type scale (marketing-site parity) ---- */
        h1, .h1 {
            font-weight: 700 !important;
            font-size: clamp(28px, 4vw, 40px) !important;
            line-height: 1.05;
            letter-spacing: -0.025em;
            color: var(--text) !important;
        }
        h2, .h2 {
            font-weight: 600 !important;
            font-size: clamp(22px, 2.4vw, 28px) !important;
            line-height: 1.15;
            letter-spacing: -0.02em;
            color: var(--text) !important;
        }
        .eyebrow,
        .kicker,
        [class*="eyebrow"] {
            font-family: 'JetBrains Mono', ui-monospace, monospace !important;
            font-size: 11px !important;
            letter-spacing: 0.2em !important;
            text-transform: uppercase !important;
            color: var(--muted) !important;
        }
        .mono { font-family: 'JetBrains Mono', ui-monospace, monospace !important; }

        /* ---- Primary CTA ---- */
        .button.primary,
        .casefile-cta,
        button.casefile-cta,
        [data-open-casefile-from-executive],
        [data-open-casefile-from-symbol-review] {
            background: var(--accent) !important;
            color: #0b1d22 !important;
            border: 1px solid transparent !important;
            font-weight: 600 !important;
        }
        html[data-theme="light"] .button.primary,
        html[data-theme="light"] .casefile-cta {
            color: #FFFFFF !important;
        }
        .button.primary:hover,
        .casefile-cta:hover {
            background: var(--accent-strong) !important;
        }

        /* ---- Secondary buttons / chips ---- */
        .button:not(.primary):not(.casefile-cta):not(.icon-button) {
            background: transparent !important;
            border: 1px solid var(--line) !important;
            color: var(--text) !important;
        }
        .button:not(.primary):not(.casefile-cta):not(.icon-button):hover {
            background: var(--surface-muted) !important;
            border-color: var(--line-strong) !important;
        }

        .tab-button,
        .route-chip,
        .chart-range,
        .casefile-chip {
            background: transparent !important;
            border: 1px solid var(--line) !important;
            color: var(--muted) !important;
        }
        .tab-button.active,
        .route-chip.active,
        .chart-range.active {
            background: var(--surface-muted-strong) !important;
            color: var(--text) !important;
            border-color: var(--line-strong) !important;
        }

        /* ---- Semantic tag colors ---- */
        .tag.good,
        .tiny-tag.good,
        .casefile-chip.good {
            color: var(--accent-strong) !important;
            border-color: rgba(75, 183, 163, 0.35) !important;
            background: var(--accent-soft) !important;
        }
        .tag.warn,
        .tiny-tag.warn,
        .casefile-chip.warn {
            color: var(--warning-strong) !important;
            border-color: rgba(255, 180, 84, 0.35) !important;
            background: var(--warning-soft) !important;
        }
        .tag.bad,
        .tiny-tag.bad,
        .casefile-chip.bad,
        .casefile-chip.negative {
            color: var(--danger-strong) !important;
            border-color: rgba(239, 83, 80, 0.35) !important;
            background: var(--danger-soft) !important;
        }

        /* ---- Surfaces ---- */
        .panel,
        .masthead,
        .metric,
        .table-wrap,
        .token-pane {
            background: var(--panel) !important;
            border: 1px solid var(--line) !important;
            box-shadow: var(--shadow) !important;
        }
        html:not([data-theme="light"]) .panel,
        html:not([data-theme="light"]) .masthead,
        html:not([data-theme="light"]) .metric,
        html:not([data-theme="light"]) .table-wrap,
        html:not([data-theme="light"]) .token-pane { box-shadow: none !important; }

        /* ---- Inputs ---- */
        input, select, textarea {
            background: var(--surface-input) !important;
            border: 1px solid var(--line) !important;
            color: var(--text) !important;
        }
        input:focus, select:focus, textarea:focus {
            border-color: var(--accent) !important;
            outline: none;
        }
        input::placeholder { color: var(--muted) !important; }

        /* ---- Casefile surfaces ---- */
        .casefile-card,
        .casefile-stage,
        .casefile-chart-stage {
            background: var(--panel) !important;
            border: 1px solid var(--line) !important;
        }
        .casefile-interval-bar {
            background: var(--surface-chip) !important;
            border: 1px solid var(--line) !important;
        }

        /* ---- Notifications ---- */
        .notification-item {
            background: var(--bg) !important;
            border: 1px solid var(--line) !important;
        }
        .notification-item.unread {
            border-color: rgba(75, 183, 163, 0.4) !important;
            background: var(--accent-soft) !important;
        }
        .notification-title,
        .notification-item-title { color: var(--text) !important; }
        .notification-subtitle,
        .notification-item-body { color: var(--muted) !important; }
        .notification-item-time,
        .notification-status { color: var(--muted) !important; }

        /* ---- Account button ---- */
        .account-button {
            background: transparent !important;
            border: 1px solid var(--line) !important;
            color: var(--text) !important;
        }
        .account-button:hover {
            background: var(--surface-muted) !important;
            border-color: var(--line-strong) !important;
        }
        .account-label { color: var(--text) !important; }
        .account-meta { color: var(--muted) !important; }
        .account-avatar {
            background: var(--accent) !important;
            color: #0b1d22 !important;
        }
        html[data-theme="light"] .account-avatar { color: #FFFFFF !important; }

        /* ---- Dividers / tables ---- */
        hr,
        .divider,
        .panel-divider { border-color: var(--line) !important; }
        table th,
        table td { border-color: var(--line) !important; }

        /* ---- Preview header language + compact filters ---- */
        .section-head h2[data-eyebrow] {
            font-size: 20px !important;
            line-height: 1.08 !important;
            letter-spacing: -0.02em !important;
        }
        .section-head h2[data-eyebrow]::before {
            content: attr(data-eyebrow);
            display: block;
            margin: 0 0 5px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.2em;
            line-height: 1.2;
            text-transform: uppercase;
            color: var(--muted);
        }
        .control-row,
        .pagination-actions {
            gap: 8px;
        }
        .control-group {
            gap: 4px;
        }
        .control-group span {
            font-size: 9px;
            letter-spacing: 0.2em;
        }
        .control-group select,
        .control-group input {
            min-height: 34px;
            min-width: 96px;
            max-width: 160px;
            padding: 6px 10px;
            font-size: 12px;
            line-height: 1.25;
        }
        .control-group input {
            min-width: 200px;
            max-width: 240px;
        }
        .book-panel-head {
            align-items: flex-start;
            margin-bottom: 0;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--line);
        }
        #emiBookSection .book-panel-head h2[data-eyebrow] {
            font-size: 16px !important;
        }
        #emiBookSection .book-panel-head .tiny {
            max-width: 560px;
            font-size: 12px;
            line-height: 1.45;
        }
        .control-row.compact-controls {
            gap: 10px;
            align-items: end;
        }
        .book-control-row {
            display: grid;
            grid-template-columns: repeat(5, max-content);
        }
        #emiBookSection .control-group select {
            min-width: 84px;
        }
        #emiBookTierScopeSelect {
            min-width: 126px !important;
        }
        .book-table-toolbar {
            align-items: center;
            margin: 0;
            padding: 12px 0;
            border-bottom: 1px solid var(--line);
        }
        .book-table-toolbar .tiny {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 11px;
            line-height: 1.45;
        }
        .book-pagination-actions {
            gap: 8px;
            justify-content: flex-end;
        }
        .book-search-input {
            width: 220px;
            min-height: 34px;
            padding: 6px 10px;
            border-radius: 8px;
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 12px;
            line-height: 1.25;
        }
        .book-pagination-actions .button {
            padding: 6px 12px !important;
            font-size: 12px !important;
            font-weight: 600 !important;
        }
        .book-pagination-actions #emiBookPageMeta {
            white-space: nowrap;
        }
        #emiBookSection .table-wrap {
            border-top: 0 !important;
            border-radius: 0 0 12px 12px !important;
        }
        .panel > .section-head h2,
        .route-detail-panel > .section-head h2,
        .casefile-panel > .section-head h2 {
            font-size: 20px !important;
            line-height: 1.08 !important;
            letter-spacing: -0.02em !important;
        }
        .section-head h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            line-height: 1.15;
            letter-spacing: -0.01em;
            color: var(--text);
        }
        .metric-value {
            letter-spacing: -0.02em !important;
            font-variant-numeric: tabular-nums;
        }
        .metric-value.metric-value-data {
            font-feature-settings: "tnum" 1;
        }
        .table-wrap table:not(.book-table) {
            width: 100%;
            border-collapse: collapse;
            font-variant-numeric: tabular-nums;
        }
        .table-wrap table:not(.book-table) th,
        .table-wrap table:not(.book-table) td {
            padding: 12px 14px;
            border-bottom: 1px solid var(--line);
            vertical-align: top;
        }
        .table-wrap table:not(.book-table) th {
            background: transparent !important;
            color: var(--muted);
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0.2em;
            line-height: 1.2;
            text-transform: uppercase;
        }
        .table-wrap table:not(.book-table) td {
            color: var(--text);
            font-size: 14px;
            line-height: 1.45;
        }
        .table-wrap table:not(.book-table) tbody tr:hover td {
            background: var(--surface-subtle);
        }
        .table-wrap td.data-number-cell {
            font-family: "JetBrains Mono", ui-monospace, monospace !important;
            font-size: inherit;
            line-height: 1.45;
            letter-spacing: 0;
        }
        .table-wrap td.data-number-cell .tiny {
            font-family: "JetBrains Mono", ui-monospace, monospace;
        }
        .table-wrap .symbol,
        .table-wrap .casefile-trigger .symbol,
        .table-wrap .inspect-trigger {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.03em;
        }
        .table-wrap .tag,
        .table-wrap .tiny-tag {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
        }
        .table-wrap .tiny {
            font-size: 11px;
            line-height: 1.45;
        }

        /* ============================================================
           EMI Book tables — live implementation of design-preview
           section 13. Applies the dp-wl-table / asset-link /
           status-pill vocabulary to generated dashboard tables.
           ============================================================ */
        .book-table {
            width: 100%;
            border-collapse: collapse;
            font-variant-numeric: tabular-nums;
        }
        .book-table th,
        .book-table td {
            padding: 12px 14px;
            text-align: left;
            border-bottom: 1px solid var(--line);
            vertical-align: top;
        }
        .book-table th {
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--muted);
            font-weight: 500;
            background: transparent;
        }
        .book-table tbody tr:hover td {
            background: var(--surface-subtle);
        }
        .book-asset-link,
        .casefile-trigger.book-asset-link {
            color: var(--accent-bright);
            text-decoration: none;
            font-weight: 700;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            letter-spacing: 0.03em;
        }
        .book-asset-link:hover,
        .book-asset-link:focus-visible,
        .casefile-trigger.book-asset-link:hover,
        .casefile-trigger.book-asset-link:focus-visible {
            color: var(--text);
            text-decoration: underline;
            outline: none;
        }
        html[data-theme="light"] .book-asset-link,
        html[data-theme="light"] .casefile-trigger.book-asset-link {
            color: var(--accent-strong);
        }
        .emi-book-symbol-cell {
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr);
            gap: 10px;
            align-items: start;
        }
        .emi-book-symbol-copy {
            display: grid;
            gap: 2px;
            min-width: 0;
        }
        .book-row-meta {
            color: var(--muted);
            font-size: 11px;
            line-height: 1.45;
        }
        .book-casefile-link {
            color: var(--accent-bright);
            text-decoration: none;
            font-size: 11px;
            font-weight: 600;
            line-height: 1.35;
        }
        .book-casefile-link:hover,
        .book-casefile-link:focus-visible {
            color: var(--text);
            text-decoration: underline;
            outline: none;
        }
        .book-status-pill {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 999px;
            font-family: "JetBrains Mono", ui-monospace, monospace;
            font-size: 10px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            background: var(--surface-chip);
            color: var(--muted-strong);
            border: 1px solid transparent;
            font-weight: 700;
        }
        .book-status-pill.ongoing {
            color: var(--accent-strong);
            background: var(--accent-soft);
        }
        .book-status-pill.pending {
            color: var(--warning-strong);
            background: var(--warning-soft);
        }
        .book-status-pill.good,
        .book-status-pill.requested {
            color: var(--accent-bright);
            background: var(--accent-soft);
            border-color: rgba(75, 183, 163, 0.4);
        }
        .book-status-pill.bad {
            color: var(--danger-strong);
            background: var(--danger-soft);
            border-color: rgba(239, 83, 80, 0.35);
        }
        .book-num-up {
            color: var(--tv-up) !important;
            font-weight: 700;
        }
        .book-num-down {
            color: var(--tv-down) !important;
            font-weight: 700;
        }
        .emi-book-table td:nth-child(n+4),
        .book-asset-table td:nth-child(n+2) {
            font-family: "JetBrains Mono", ui-monospace, monospace;
        }
        @media (max-width: 720px) {
            .section-head h2[data-eyebrow] {
                font-size: 18px !important;
            }
            .book-control-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }
            #emiBookSection .control-group select {
                width: 100%;
                max-width: none;
            }
            .book-pagination-actions {
                width: 100%;
                justify-content: flex-start;
            }
            .book-search-input {
                width: 100%;
            }
            .emi-book-symbol-cell {
                grid-template-columns: 30px minmax(0, 1fr);
            }
            .book-table th,
            .book-table td {
                padding: 11px 12px;
            }
        }

        /* ============================================================
           V16.1 — alert-card (lifted from design-preview.html dp-alert)
           Universal card for Watchlist + Alerts. Matches the Claude
           Design preview spec — three tiers, avatar, ticker+name+conf+time
           +star, tier pill, asset chips, thesis with mint <em>, optional
           catalyst panel, prices+sparkline+progress, optional leverage
           detail (instrument head + legs + econ row), action buttons.
           ============================================================ */
        .alert-card {
            display: grid;
            grid-template-columns: 56px 1fr;
            gap: 16px;
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 18px;
            position: relative;
        }
        .alert-card::before {
            content: "";
            position: absolute;
            left: 0; top: 14px; bottom: 14px;
            width: 3px;
            border-radius: 0 2px 2px 0;
            background: var(--tier-color, var(--accent-bright));
        }
        .alert-card[data-tier="trade"]    { --tier-color: var(--accent-bright); }
        .alert-card[data-tier="watch"]    { --tier-color: var(--muted-strong); }
        .alert-card[data-tier="moonshot"] { --tier-color: var(--warning); }
        .alert-card-avatar {
            width: 44px; height: 44px;
            border-radius: 10px;
            background: var(--accent-soft);
            color: var(--accent-strong);
            display: grid; place-items: center;
            font-family: "JetBrains Mono", monospace;
            font-weight: 700;
            font-size: 18px;
        }
        .alert-card[data-tier="moonshot"] .alert-card-avatar {
            background: var(--warning-soft);
            color: var(--warning-strong);
        }
        .alert-card-row1 {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .alert-card-row1 > div:first-child {
            min-width: 0;
        }
        .alert-card-top-actions {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            margin-left: auto;
            white-space: nowrap;
        }
        .alert-card-ticker {
            font-family: "JetBrains Mono", monospace;
            font-weight: 700;
            font-size: 18px;
            color: var(--text);
            letter-spacing: 0.04em;
        }
        .alert-card-name {
            color: var(--muted);
            font-size: 13px;
            margin-left: 8px;
        }
        .alert-card-time {
            font-family: "JetBrains Mono", monospace;
            font-size: 11px;
            color: var(--muted);
            letter-spacing: 0.1em;
        }
        .alert-card-conf {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 36px;
            padding: 3px 8px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent-strong);
            font-family: "JetBrains Mono", monospace;
            font-weight: 700;
            font-size: 12px;
        }
        .alert-card[data-tier="watch"] .alert-card-conf {
            background: var(--surface-muted);
            color: var(--muted-strong);
        }
        .alert-card[data-tier="moonshot"] .alert-card-conf {
            background: var(--warning-soft);
            color: var(--warning-strong);
        }
        .alert-card-tierpill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px 3px 8px;
            border-radius: 999px;
            font-family: "JetBrains Mono", monospace;
            font-size: 10px;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            font-weight: 700;
            background: var(--tier-color, var(--accent-bright));
            color: #0b1d22;
        }
        .alert-card-tierpill[data-tier="watch"] {
            background: transparent;
            color: var(--accent-bright);
            border: 1px solid var(--accent-bright);
        }
        html[data-theme="light"] .alert-card-tierpill[data-tier="watch"] {
            color: var(--accent-strong);
            border-color: var(--accent-strong);
        }
        .alert-card-tierpill[data-tier="moonshot"] { color: #2a1a05; }
        .alert-card-tierpill::before {
            content: "●";
            font-size: 8px;
        }
        .alert-card-meta {
            display: flex;
            gap: 8px;
            margin: 10px 0;
            color: var(--muted);
            font-size: 12px;
            align-items: center;
            flex-wrap: wrap;
        }
        .alert-card-meta .alert-card-dot {
            width: 3px; height: 3px;
            border-radius: 999px;
            background: var(--muted);
            opacity: 0.5;
        }
        .alert-card-thesis {
            color: var(--text);
            font-size: 14.5px;
            line-height: 1.55;
            margin: 8px 0 12px;
        }
        .alert-card-thesis em {
            font-style: normal;
            color: var(--accent-bright);
            font-weight: 600;
        }
        .alert-card-catalyst {
            background: var(--surface-muted);
            border: 1px solid var(--line);
            border-radius: 8px;
            padding: 10px 12px;
            margin: 8px 0;
        }
        .alert-card-catalyst-kicker {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: "JetBrains Mono", monospace;
            font-size: 10px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--accent);
            font-weight: 600;
            margin-bottom: 4px;
        }
        .alert-card-catalyst-body {
            color: var(--muted-strong);
            font-size: 13px;
            line-height: 1.5;
            margin: 0;
        }
        .alert-card-rail {
            display: grid;
            grid-template-columns: 1fr 140px;
            gap: 16px;
            align-items: end;
            padding-top: 10px;
            border-top: 1px solid var(--line);
            margin-top: 8px;
        }
        .alert-card-prices {
            display: flex;
            align-items: baseline;
            gap: 10px;
            font-family: "JetBrains Mono", monospace;
        }
        .alert-card-prices .num { font-size: 18px; font-weight: 600; color: var(--text); }
        .alert-card-prices .arrow { color: var(--muted); }
        .alert-card-prices .upside { color: var(--tv-up); font-weight: 700; }
        .alert-card-prices.down .upside { color: var(--tv-down); }
        .alert-card-rail-labels {
            display: flex;
            gap: 14px;
            font-size: 10px;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--muted);
            margin-top: 4px;
        }
        .alert-card-spark { width: 100%; height: 28px; }
        .alert-card-spark path { fill: none; stroke: var(--accent-bright); stroke-width: 1.6; }
        .alert-card-spark.down path { stroke: var(--tv-down); }
        .alert-card-spark.warn path  { stroke: var(--warning-strong); }
        .alert-card-progress {
            height: 4px;
            background: var(--surface-muted-strong);
            border-radius: 999px;
            overflow: hidden;
            margin-top: 6px;
        }
        .alert-card-progress::after {
            content: "";
            display: block;
            width: var(--progress, 48%);
            height: 100%;
            background: var(--accent);
            border-radius: 999px;
        }
        .alert-card-progress.warning::after {
            background: var(--warning);
        }
        .alert-card-progress-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            color: var(--muted);
            margin-top: 4px;
            display: block;
        }

        /* Leverage / instrument detail (Bull Call Spread, Long Calls, etc.) */
        .alert-card-instrument {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px dashed var(--line);
            display: grid;
            gap: 10px;
        }
        .alert-card-instrument-head {
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: "JetBrains Mono", monospace;
            font-size: 12px;
            color: var(--text);
            font-weight: 600;
        }
        .alert-card-instrument-icon {
            width: 22px; height: 22px;
            border-radius: 6px;
            background: var(--accent-soft);
            color: var(--accent-strong);
            display: grid; place-items: center;
            font-size: 12px;
            font-weight: 700;
        }
        .alert-card[data-tier="moonshot"] .alert-card-instrument-icon {
            background: var(--warning-soft);
            color: var(--warning-strong);
        }
        .alert-card-instrument-head em {
            font-style: normal;
            color: var(--accent-bright);
        }
        .alert-card[data-tier="moonshot"] .alert-card-instrument-head em {
            color: var(--warning-strong);
        }
        .alert-card-legs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .alert-card-legs[data-single="true"] { grid-template-columns: 1fr; }
        .alert-card-leg {
            background: var(--surface-muted);
            border: 1px solid var(--line);
            border-radius: 8px;
            padding: 10px 12px;
            display: grid;
            gap: 4px;
        }
        .alert-card-leg-tag {
            font-family: "JetBrains Mono", monospace;
            font-size: 9px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            font-weight: 700;
        }
        .alert-card-leg-tag.buy { color: var(--tv-up); }
        .alert-card-leg-tag.sell { color: var(--tv-down); }
        .alert-card-leg-strike {
            font-family: "JetBrains Mono", monospace;
            font-size: 14px;
            color: var(--text);
            font-weight: 600;
        }
        .alert-card-leg-symbol {
            font-family: "JetBrains Mono", monospace;
            font-size: 11px;
            color: var(--muted);
        }
        .alert-card-econ {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            font-family: "JetBrains Mono", monospace;
        }
        .alert-card-econ-cell {
            padding: 8px 10px;
            background: var(--surface-muted);
            border: 1px solid var(--line);
            border-radius: 6px;
        }
        .alert-card-econ-label {
            font-size: 9px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--muted);
            margin-bottom: 4px;
        }
        .alert-card-econ-val {
            font-size: 14px;
            color: var(--text);
            font-weight: 600;
        }
        .alert-card-econ-val.up { color: var(--tv-up); }
        .alert-card-econ-val.down { color: var(--tv-down); }

        /* Futures-specific exit ladder */
        .alert-card-ladder {
            display: grid;
            gap: 6px;
        }
        .alert-card-ladder-row {
            display: grid;
            grid-template-columns: 36px 1fr auto auto;
            gap: 10px;
            align-items: center;
            padding: 8px 10px;
            background: var(--surface-muted);
            border-radius: 6px;
            font-family: "JetBrains Mono", monospace;
            font-size: 12px;
        }
        .alert-card-ladder-tier {
            font-weight: 700;
            color: var(--accent-bright);
            text-align: center;
        }
        .alert-card-ladder-tier.stop { color: var(--tv-down); }
        .alert-card-ladder-tier.liq { color: var(--warning-strong); }
        .alert-card-ladder-price {
            color: var(--text);
            font-weight: 600;
        }
        .alert-card-ladder-pct {
            color: var(--tv-up);
            font-weight: 600;
        }
        .alert-card-ladder-pct.down { color: var(--tv-down); }
        .alert-card-ladder-action {
            font-size: 9px;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--muted);
        }

        /* Footer action row */
        .alert-card-actions {
            display: flex;
            gap: 8px;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid var(--line);
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
        }
        .alert-card-actions-left {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .alert-card-actions .alert-card-btn { padding: 7px 14px; font-size: 13px; }
        .alert-card-actions .alert-card-btn.primary {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--accent);
            color: #0b1d22;
            border-color: transparent;
            font-weight: 600;
            text-decoration: none;
        }
        .alert-card-actions .alert-card-btn.primary::after {
            content: "→";
            font-family: "JetBrains Mono", monospace;
        }
        .alert-card-actions .alert-card-btn.primary:hover { background: var(--accent-strong); }
        html[data-theme="light"] .alert-card-actions .alert-card-btn.primary { color: #fff; }
        .alert-card-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid var(--line);
            background: transparent;
            color: var(--text);
            font-family: Inter, -apple-system, "system-ui", sans-serif;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            transition: background 120ms ease, border-color 120ms ease;
        }
        .alert-card-btn:hover { background: var(--surface-muted); border-color: var(--line-strong); }
        .alert-card-btn:disabled,
        .alert-card-btn[aria-disabled="true"] {
            cursor: not-allowed;
            color: var(--muted-strong);
            background: var(--surface-muted);
            border-color: var(--line);
            opacity: 0.68;
        }
        .alert-card-btn:disabled:hover,
        .alert-card-btn[aria-disabled="true"]:hover {
            background: var(--surface-muted);
            border-color: var(--line);
        }
        .alert-card-tooltip-wrap {
            position: relative;
            display: inline-flex;
        }
        .alert-card-tooltip-wrap[data-tooltip]:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 0;
            bottom: calc(100% + 8px);
            width: max-content;
            max-width: min(280px, 70vw);
            padding: 7px 9px;
            border-radius: 6px;
            border: 1px solid var(--line);
            background: var(--surface);
            color: var(--text);
            box-shadow: var(--shadow-soft);
            font-size: 11px;
            line-height: 1.35;
            z-index: 10;
        }
        .alert-card-icon-only {
            width: 32px; height: 32px;
            display: grid; place-items: center;
            border-radius: 8px;
            border: 1px solid var(--line);
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            font-size: 13px;
            transition: color 120ms ease, border-color 120ms ease;
        }
        .alert-card-icon-only:hover { color: var(--text); border-color: var(--line-strong); }
        .alert-card-icon-only.is-followed {
            color: var(--accent-bright);
            border-color: var(--accent-bright);
            background: rgba(75, 183, 163, 0.10);
        }

        /* Single column on phone */
        @media (max-width: 720px) {
            .alert-card { grid-template-columns: 1fr; padding: 16px 14px; }
            .alert-card-avatar { display: none; }
            .alert-card-row1 {
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto;
                align-items: start;
                gap: 8px;
                flex-wrap: nowrap;
            }
            .alert-card-top-actions {
                align-items: start;
                gap: 6px;
            }
            .alert-card-top-actions .alert-card-time {
                display: none;
            }
            .alert-card-rail { grid-template-columns: 1fr; }
            .alert-card-legs { grid-template-columns: 1fr; }
            .alert-card-econ { grid-template-columns: repeat(2, 1fr); }
            .alert-card-ladder-row {
                grid-template-columns: 32px 1fr;
            }
            .alert-card-ladder-pct,
            .alert-card-ladder-action {
                justify-self: start;
            }
        }

        /* ============================================================
           Numeric typography contract
           Design-preview tables keep all primary numeric values on one
           shared mono scale. Generated dashboard rows now inherit that
           same contract everywhere the data-typography decorator marks a
           cell, and in the EMI-book tables that render explicit mono cells.
           ============================================================ */
        :root {
            --emi-number-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            --emi-table-number-size: 14px;
            --emi-table-number-line-height: 1.45;
            --emi-table-number-weight: 400;
            --emi-table-number-emphasis-weight: 600;
            --emi-table-number-tracking: 0;
            --emi-table-note-size: 11px;
        }

        .mono,
        .data-number-cell,
        .metric-value-data,
        .book-num-up,
        .book-num-down,
        .positive,
        .negative {
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }

        .table-wrap tbody td.data-number-cell,
        .table-wrap tbody td.mono,
        .table-wrap tbody td.positive,
        .table-wrap tbody td.negative,
        .table-wrap tbody td.book-num-up,
        .table-wrap tbody td.book-num-down,
        .book-table tbody td.mono,
        .emi-book-table tbody td:nth-child(n+4),
        .book-asset-table tbody td:nth-child(n+2) {
            font-family: var(--emi-number-font) !important;
            font-size: var(--emi-table-number-size) !important;
            line-height: var(--emi-table-number-line-height) !important;
            letter-spacing: var(--emi-table-number-tracking) !important;
            font-weight: var(--emi-table-number-weight) !important;
            white-space: normal;
        }

        .table-wrap tbody td.positive,
        .table-wrap tbody td.negative,
        .table-wrap tbody td.book-num-up,
        .table-wrap tbody td.book-num-down,
        .book-table tbody td.book-num-up,
        .book-table tbody td.book-num-down {
            font-weight: var(--emi-table-number-emphasis-weight) !important;
        }

        .book-row-meta,
        .table-wrap tbody td.data-number-cell .tiny,
        .table-wrap tbody td.mono .tiny,
        .table-wrap tbody td.positive .tiny,
        .table-wrap tbody td.negative .tiny {
            font-family: var(--emi-number-font);
            font-size: var(--emi-table-note-size) !important;
            line-height: var(--emi-table-number-line-height);
            letter-spacing: var(--emi-table-number-tracking);
            font-weight: 400;
        }

        .emi-card-stat-value,
        .watchlist-card-stat-value,
        .signal-feed-price-value,
        .alert-card-prices .num,
        .alert-card-econ-val,
        .kv-value {
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }
