/*
 * Skavinski Shared Shell - chrome, tokens, header, gates
 * Single source of truth for cross-property design consistency.
 * Consumed by: Trade Bias Tracker, TeploMap, Home Dashboard, Academy (future).
 */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    /* Canonical tokens (--skv-* prefix is the forward-facing API) */
    --skv-bg: #050505;
    --skv-panel: rgba(18,18,20,0.70);
    --skv-panel-dense: rgba(18,18,20,0.60);      /* TeploMap opt-out for heatmap legibility */
    --skv-glass: rgba(255,255,255,0.03);
    --skv-glass-hi: rgba(255,255,255,0.06);
    --skv-border: rgba(255,255,255,0.08);
    --skv-border-hover: rgba(255,255,255,0.12);

    --skv-text: #e9e9e9;
    --skv-text-muted: #9ca3af;
    --skv-text-dim: #6b7280;

    --skv-accent: #5C88B0;                       /* Alpine slate, brand primary - available, not currently wired into header */
    --skv-accent-dim: rgba(92,136,176,0.15);
    --skv-accent-glow: rgba(92,136,176,0.30);

    --skv-bull: #22c55e;
    --skv-bull-alt: #3da87a;
    --skv-bear: #ef4444;
    --skv-bear-alt: #f87171;
    --skv-warn: #f5a623;                         /* Canonical orange per CLAUDE.md - replaces yellow drift */
    --skv-gold: #ffd700;                         /* Reserved for premium micro-accents only (badges, VIP). Never header chrome. */

    /* Unified nav active-state recipe (slate, never gold). Applies to top-desktop,
       top-mobile, and side-rail active links so all three read identically. */
    --skv-active-fg: #7aa6cc;
    --skv-active-bg: rgba(255,255,255,0.06);
    --skv-active-ring: inset 0 0 0 1px rgba(255,255,255,0.12);
    --skv-active-bar: #5C88B0;

    /* Header chrome hairline (slate-tinted, replaces the old gold-dim border). */
    --skv-line: rgba(92,136,176,0.18);

    --skv-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --skv-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SF Mono', Menlo, monospace;

    --skv-blur: blur(12px);
    --skv-radius-sm: 6px;
    --skv-radius-md: 8px;
    --skv-radius-lg: 12px;
    --skv-radius-pill: 20px;

    --skv-header-h: 56px;
    --skv-nav-top-h: 56px;            /* side-nav migration: top-bar reserved height (mirrors --skv-header-h) */
    --skv-sidenav-w-expanded: 232px;  /* side-nav migration: expanded rail width (consumed Step 1+) */
    --skv-sidenav-w-collapsed: 64px;  /* side-nav migration: collapsed icon-rail width */
    --skv-sidenav-w: var(--skv-sidenav-w-expanded); /* .skv-nav-collapsed flips this to collapsed in Step 1+ */

    --skv-shadow-1: 0 4px 12px rgba(0,0,0,0.40);
    --skv-shadow-2: 0 8px 24px rgba(0,0,0,0.50);
    --skv-shadow-3: 0 12px 40px rgba(0,0,0,0.60);

    --skv-dur-quick: 150ms;
    --skv-dur-default: 280ms;
    --skv-ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* ---- Terminal Ramp (concept C): type scale, line-heights, spacing,
       layout, density. Additive; no consumer reads these until it adopts. ---- */
    --fs-micro: 9px;
    --fs-caption: 11px;
    --fs-data: 13px;
    --fs-body: 14px;
    --fs-md: 16px;
    --fs-lg: 20px;
    --fs-xl: 24px;
    --fs-display: 28px;
    --lh-tight: 1.15;
    --lh-snug: 1.3;
    --lh-normal: 1.5;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --skv-content-max: 1280px;
    --skv-gutter: 24px;
    --skv-gutter-mobile: 16px;
    --skv-row-h: 40px;

    /* Legacy aliases - existing app body CSS uses these names. Phase out over time. */
    --bg: var(--skv-bg);
    --panel: var(--skv-panel);
    --glass: var(--skv-glass-hi);
    --border: var(--skv-border);
    --muted: var(--skv-text-muted);
    --text: var(--skv-text);
    --good: var(--skv-bull);
    --green: var(--skv-bull);
    --bad: var(--skv-bear);
    --warn: var(--skv-warn);
    --gold: var(--skv-gold);
    --discord: #5865F2;
}

[data-theme="light"] {
    --skv-bg: #fafafa;
    --skv-panel: rgba(255,255,255,0.85);
    --skv-panel-dense: rgba(255,255,255,0.75);
    --skv-glass: rgba(0,0,0,0.02);
    --skv-glass-hi: rgba(0,0,0,0.03);
    --skv-border: rgba(0,0,0,0.08);
    --skv-border-hover: rgba(0,0,0,0.14);
    --skv-text: #18181b;
    --skv-text-muted: #71717a;
    --skv-text-dim: #a1a1aa;
    --skv-bull: #16a34a;
    --skv-bull-alt: #15803d;
    --skv-bear: #dc2626;
    --skv-bear-alt: #ef4444;
    --skv-warn: #ca8a04;
    --skv-gold: #b8860b;
}

/* ============================================================
   BASE RESET + BODY
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    background: var(--skv-bg);
    color: var(--skv-text);
    font-family: var(--skv-font);
    line-height: 1.4;
    padding: 0;
    min-height: 100vh;
}
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
    mix-blend-mode: overlay;
}
[data-theme="light"] body { transition: background-color 0.2s ease, color 0.2s ease; }
[data-theme="light"] body::before { opacity: 0.12; }

/* ============================================================
   AUTH LOADER (pre-Clerk-resolve spinner)
   ============================================================ */
.loader-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(92,136,176,0.3);
    border-radius: 50%; border-top-color: var(--skv-accent);
    animation: spin 0.8s linear infinite;
    display: inline-block; margin-right: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SHARED HEADER (#skv-header)
   ============================================================ */
#skv-header {
    --skv-gray-06: rgba(255,255,255,0.06);
    --skv-gray-20: rgba(255,255,255,0.2);
    --skv-gray-35: rgba(255,255,255,0.35);
    --skv-gray-50: rgba(255,255,255,0.5);
    --skv-gray-70: rgba(255,255,255,0.7);
    --skv-gray-95: rgba(255,255,255,0.95);
    height: var(--skv-header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--skv-line);
    background: rgba(5,5,5,0.95);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: var(--skv-blur);
    -webkit-backdrop-filter: var(--skv-blur);
    font-family: var(--skv-font);
    box-sizing: border-box;
}

/* On-scroll elevation: apps may toggle .scrolled on #skv-header (the dashboard does). */
#skv-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
[data-theme="light"] #skv-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
#skv-header * { box-sizing: border-box; }

#skv-header .skv-header-left { display: flex; align-items: center; gap: 12px; }
#skv-header .skv-brand {
    font-size: 18px; font-weight: 800; letter-spacing: 3px;
    background: linear-gradient(180deg, #ffffff 0%, #999 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; text-decoration: none;
}

/* Market Status Widget */
#skv-header .skv-ms {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; position: relative;
    padding: 4px 10px; border-radius: 6px;
    transition: background var(--skv-dur-quick) ease;
}
#skv-header .skv-ms:hover { background: rgba(255,255,255,0.04); }
#skv-header .skv-ms-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    position: relative;
    box-shadow:
        inset -1px -1px 2px rgba(0,0,0,0.4),
        inset 1px 1px 2px rgba(255,255,255,0.2),
        0 0 5px currentColor;
}
#skv-header .skv-ms-dot::after {
    content: ''; position: absolute;
    top: 1px; left: 1.5px;
    width: 2.5px; height: 1.5px;
    background: rgba(255,255,255,0.45);
    border-radius: 50%;
}
#skv-header .skv-ms-dot.open {
    background: radial-gradient(circle at 30% 30%, #4ade80, var(--skv-bull) 60%, #15803d);
    color: var(--skv-bull);
    animation: skv-ms-pulse 2s ease-in-out infinite;
}
#skv-header .skv-ms-dot.pre {
    background: radial-gradient(circle at 30% 30%, #fcd9a0, var(--skv-warn) 60%, #c2410c);
    color: var(--skv-warn);
    animation: skv-ms-pulse 3s ease-in-out infinite;
}
#skv-header .skv-ms-dot.after {
    background: radial-gradient(circle at 30% 30%, #fdba74, var(--skv-warn) 60%, #c2410c);
    color: var(--skv-warn);
}
#skv-header .skv-ms-dot.overnight {
    background: radial-gradient(circle at 30% 30%, #a5b4c6, #7a8a9e 60%, #4a5568);
    color: #7a8a9e;
    animation: skv-ms-pulse 3s ease-in-out infinite;
}
#skv-header .skv-ms-dot.closed {
    background: radial-gradient(circle at 30% 30%, #888, var(--skv-gray-35) 60%, #333);
    color: var(--skv-gray-35);
}
@keyframes skv-ms-pulse {
    /* opacity-only pulse: animating box-shadow forced a full repaint every frame
       (costly on weak mobile GPUs). The dot keeps its static glow from .skv-ms-dot. */
    0%,100% { opacity: 1; }
    50% { opacity: 0.6; }
}
/* Respect reduced-motion: stop the market-status pulse entirely. */
@media (prefers-reduced-motion: reduce) {
    #skv-header .skv-ms-dot.open,
    #skv-header .skv-ms-dot.pre,
    #skv-header .skv-ms-dot.overnight { animation: none; }
}
#skv-header .skv-ms-info { display: flex; flex-direction: column; gap: 1px; min-width: 120px; }
#skv-header .skv-ms-top { display: flex; align-items: center; gap: 6px; }
#skv-header .skv-ms-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
}
#skv-header .skv-ms-label.open { color: var(--skv-bull); }
#skv-header .skv-ms-label.pre { color: var(--skv-warn); }
#skv-header .skv-ms-label.after { color: var(--skv-warn); }
#skv-header .skv-ms-label.overnight { color: #7a8a9e; }
#skv-header .skv-ms-label.closed { color: var(--skv-gray-50); }
#skv-header .skv-ms-countdown {
    font-size: 9px; font-weight: 500; color: var(--skv-gray-50);
    font-family: var(--skv-mono); letter-spacing: 0;
}
#skv-header .skv-ms-timeline {
    height: 3px; border-radius: 2px; background: var(--skv-gray-06);
    position: relative; overflow: hidden;
}
#skv-header .skv-ms-timeline-fill {
    height: 100%; border-radius: 2px; transition: width 1s linear;
}
#skv-header .skv-ms-timeline-fill.open { background: linear-gradient(90deg, rgba(61,168,122,0.6), var(--skv-bull)); }
#skv-header .skv-ms-timeline-fill.pre { background: linear-gradient(90deg, rgba(245,166,35,0.5), var(--skv-warn)); }
#skv-header .skv-ms-timeline-fill.after { background: linear-gradient(90deg, rgba(245,166,35,0.5), var(--skv-warn)); }
#skv-header .skv-ms-timeline-fill.overnight { background: linear-gradient(90deg, rgba(122,138,158,0.5), #7a8a9e); }
#skv-header .skv-ms-timeline-fill.closed { background: var(--skv-gray-20); width: 100% !important; }

/* Market Status Popup */
#skv-header .skv-ms-popup {
    position: fixed;
    background: rgba(0,0,0,0.9); border: 1px solid var(--skv-border-hover);
    border-radius: 10px; padding: 14px 16px; min-width: 260px;
    box-shadow: var(--skv-shadow-3); backdrop-filter: blur(20px);
    z-index: 200; display: none;
    animation: skv-ms-popup-in 150ms ease forwards;
}
#skv-header .skv-ms-popup.open { display: block; }
@keyframes skv-ms-popup-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
#skv-header .skv-ms-popup-tz { font-size: 10px; color: var(--skv-gray-50); font-family: var(--skv-mono); margin-bottom: 10px; }
#skv-header .skv-ms-popup-time {
    font-size: 20px; font-weight: 700; color: var(--skv-gray-95);
    font-family: var(--skv-mono); margin-bottom: 14px;
    font-feature-settings: 'tnum' on;
}
#skv-header .skv-ms-popup-time .skv-ampm { font-size: 11px; font-weight: 500; color: var(--skv-gray-50); margin-left: 4px; }
#skv-header .skv-ms-next {
    font-size: 12px; color: var(--skv-text-muted); margin: -8px 0 12px 0;
    display: flex; align-items: center; gap: 6px;
}
#skv-header .skv-ms-next .ns-label { color: var(--skv-text-dim); }
#skv-header .skv-ms-next .ns-val { font-weight: 600; }
#skv-header .skv-ms-next .ns-val.open { color: var(--skv-bull); }
#skv-header .skv-ms-next .ns-val.pre { color: var(--skv-warn); }
#skv-header .skv-ms-next .ns-val.after { color: var(--skv-warn); }
#skv-header .skv-ms-next .ns-val.overnight { color: #7a8a9e; }
#skv-header .skv-ms-next .ns-val.closed { color: var(--skv-gray-50); }
#skv-header .skv-ms-schedule { display: flex; flex-direction: column; gap: 0; }
#skv-header .skv-ms-srow {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 0; border-bottom: 1px solid var(--skv-gray-06);
}
#skv-header .skv-ms-srow:last-child { border-bottom: none; }
#skv-header .skv-ms-srow-left { display: flex; align-items: center; gap: 8px; }
#skv-header .skv-ms-srow-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
#skv-header .skv-ms-srow-name { font-size: 11px; color: var(--skv-gray-70); }
#skv-header .skv-ms-srow.active .skv-ms-srow-name { color: var(--skv-gray-95); font-weight: 600; }
#skv-header .skv-ms-srow-times { font-size: 10px; color: var(--skv-gray-50); font-family: var(--skv-mono); }
#skv-header .skv-ms-srow.active .skv-ms-srow-times { color: var(--skv-gray-70); }
#skv-header .skv-day-timeline {
    height: 6px; border-radius: 3px; background: var(--skv-gray-06);
    margin: 12px 0 6px 0; position: relative; overflow: visible;
}
#skv-header .skv-day-seg { position: absolute; top: 0; height: 100%; border-radius: 3px; }
#skv-header .skv-day-seg.overnight { background: rgba(100,140,255,0.35); }
#skv-header .skv-day-seg.pre { background: rgba(245,166,35,0.45); }
#skv-header .skv-day-seg.rth { background: rgba(61,168,122,0.55); }
#skv-header .skv-day-seg.after { background: rgba(245,166,35,0.45); }
#skv-header .skv-day-needle {
    position: absolute; top: -3px; width: 2px; height: 12px;
    background: var(--skv-gray-95); border-radius: 1px;
    box-shadow: 0 0 4px rgba(255,255,255,0.3);
    transition: left 1s linear;
}
#skv-header .skv-day-labels {
    display: flex; justify-content: space-between;
    font-size: 8px; color: var(--skv-gray-35); font-family: var(--skv-mono);
    margin-top: 2px;
}

/* Header Navigation */
#skv-header .skv-nav {
    display: flex; align-items: center; gap: 6px; justify-self: center;
}
#skv-header .skv-nav a {
    font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--skv-text-muted);
    text-decoration: none; padding: 6px 10px;
    position: relative; transition: color 0.15s;
}
#skv-header .skv-nav a::after {
    content: ''; position: absolute; bottom: 0; left: 20%;
    width: 0; height: 1.5px; background: rgba(255,255,255,0.5);
    transition: width 0.2s ease; border-radius: 1px;
}
#skv-header .skv-nav a:hover { color: var(--skv-text); }
#skv-header .skv-nav a:hover:not(.active)::after { width: 60%; }
#skv-header .skv-nav a.active {
    color: var(--skv-active-fg);
    background: var(--skv-active-bg);
    box-shadow: var(--skv-active-ring), inset 0 -1.5px 0 var(--skv-active-bar);
    border-radius: 3px;
}
#skv-header .skv-nav a.active::after { width: 0; }
#skv-header .skv-nav a.active:hover { color: var(--skv-active-fg); }

/* Hamburger */
#skv-header .skv-hamburger {
    display: none;
    width: 44px; height: 44px; border: 1px solid var(--skv-border);
    border-radius: 8px; background: transparent; cursor: pointer;
    align-items: center; justify-content: center;
    color: var(--skv-text-muted); transition: all 0.15s;
}
#skv-header .skv-hamburger:hover { border-color: var(--skv-border-hover); color: var(--skv-text); }
#skv-header .skv-hamburger svg { width: 18px; height: 18px; }
#skv-header .skv-mobile-nav {
    display: none; position: fixed; top: var(--skv-header-h); left: 0; right: 0;
    background: rgba(8,8,12,0.97); border-bottom: 1px solid var(--skv-border);
    backdrop-filter: blur(20px); z-index: 99;
    padding: 8px 20px; flex-direction: column; gap: 2px;
    animation: skv-mobnav-in 150ms ease forwards;
}
#skv-header .skv-mobile-nav.open { display: flex; }
@keyframes skv-mobnav-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
#skv-header .skv-mobile-nav a {
    font-size: 13px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--skv-text-muted);
    text-decoration: none; padding: 14px 12px;
    border-radius: 6px; transition: all 0.15s;
    min-height: 44px; display: flex; align-items: center;
}
#skv-header .skv-mobile-nav a:hover { background: rgba(255,255,255,0.04); color: var(--skv-text); }
#skv-header .skv-mobile-nav a.active {
    color: var(--skv-active-fg);
    background: var(--skv-active-bg);
    box-shadow: var(--skv-active-ring), inset 0 -1.5px 0 var(--skv-active-bar);
}

/* Header Right */
#skv-header .skv-header-right { display: flex; align-items: center; gap: 12px; }

/* Notification Bell */
#skv-header .skv-notif-btn {
    width: 32px; height: 32px; border: 1px solid var(--skv-border);
    border-radius: 8px; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--skv-text-muted); position: relative; transition: all 0.15s;
}
#skv-header .skv-notif-btn:hover { border-color: var(--skv-border-hover); color: var(--skv-text); }
#skv-header .skv-notif-btn svg { width: 16px; height: 16px; }
#skv-header .skv-notif-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 16px; height: 16px; border-radius: 8px;
    background: var(--skv-accent); color: #fff;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; box-shadow: 0 0 6px rgba(92,136,176,0.4);
}
#skv-header .skv-notif-badge.hidden { display: none; }
@keyframes skv-bell-ring {
    0% { transform: rotate(0); } 15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); } 45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } 100% { transform: rotate(0); }
}
#skv-header .skv-notif-btn.skv-bell-ring svg { animation: skv-bell-ring 0.6s ease; }
@keyframes skv-notif-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
#skv-header .skv-notif-badge.skv-notif-bounce { animation: skv-notif-bounce 0.4s ease; }

/* Notification Panel */
#skv-header .skv-notif-panel {
    position: fixed; top: calc(var(--skv-header-h) + 8px); right: 20px;
    width: 360px; max-height: 480px;
    background: rgba(0,0,0,0.92); border: 1px solid var(--skv-border-hover);
    border-radius: 12px; backdrop-filter: blur(20px);
    box-shadow: var(--skv-shadow-3);
    z-index: 200; display: none;
    animation: skv-notif-in 150ms ease forwards;
}
#skv-header .skv-notif-panel.open { display: block; }
@keyframes skv-notif-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
#skv-header .skv-notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--skv-border);
}
#skv-header .skv-notif-panel-title {
    font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--skv-text);
}
#skv-header .skv-notif-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
#skv-header .skv-notif-action-btn {
    width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--skv-border);
    background: transparent; cursor: pointer; color: var(--skv-text-muted);
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
#skv-header .skv-notif-action-btn:hover { border-color: var(--skv-border-hover); color: var(--skv-text); }
#skv-header .skv-notif-panel-body { padding: 4px 0; overflow-y: auto; max-height: 380px; }
#skv-header .skv-notif-panel-body::-webkit-scrollbar { width: 4px; }
#skv-header .skv-notif-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
#skv-header .skv-notif-item-live {
    padding: 10px 16px; display: flex; gap: 10px; cursor: pointer;
    border-left: 3px solid transparent; transition: background 0.15s;
}
#skv-header .skv-notif-item-live:hover { background: rgba(255,255,255,0.03); }
#skv-header .skv-notif-item-live.unread { background: rgba(92,136,176,0.05); }
#skv-header .skv-notif-item-icon {
    width: 28px; height: 28px; border-radius: 6px;
    background: rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0; color: var(--skv-text-muted);
}
#skv-header .skv-notif-item-content { flex: 1; min-width: 0; }
#skv-header .skv-notif-item-title { font-size: 11px; color: var(--skv-text); font-weight: 500; line-height: 1.4; }
#skv-header .skv-notif-item-body { font-size: 10px; color: var(--skv-text-muted); margin-top: 2px; line-height: 1.4; }
#skv-header .skv-notif-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
#skv-header .skv-notif-time { font-size: 9px; color: var(--skv-gray-35); white-space: nowrap; }
#skv-header .skv-notif-dismiss {
    width: 18px; height: 18px; border: none; background: transparent;
    color: var(--skv-text-muted); cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; opacity: 0; transition: opacity 0.15s;
}
#skv-header .skv-notif-item-live:hover .skv-notif-dismiss { opacity: 1; }
#skv-header .skv-notif-dismiss:hover { color: var(--skv-text); background: rgba(255,255,255,0.06); }
#skv-header .skv-notif-empty {
    padding: 32px 16px; text-align: center; color: var(--skv-text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px;
}
#skv-header .skv-notif-prefs-panel { padding: 12px 16px; }
#skv-header .skv-notif-pref-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; font-size: 11px; color: var(--skv-text-dim);
}
#skv-header .skv-toggle { position: relative; width: 36px; height: 20px; display: inline-block; }
#skv-header .skv-toggle input { opacity: 0; width: 0; height: 0; }
#skv-header .skv-toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: rgba(255,255,255,0.1); border-radius: 10px; transition: 0.2s;
}
#skv-header .skv-toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: 0.2s;
}
#skv-header .skv-toggle input:checked + .skv-toggle-slider { background: #5C88B0; }
#skv-header .skv-toggle input:checked + .skv-toggle-slider::before { transform: translateX(16px); }
#skv-header .skv-notif-dd { position: relative; }
#skv-header .skv-notif-dd-trigger {
    color: #fff; font-size: 13px; font-weight: 500;
    font-family: var(--skv-font);
    cursor: pointer; padding: 2px 4px;
    user-select: none; -webkit-user-select: none;
}
#skv-header .skv-notif-dd-trigger:hover { color: var(--skv-active-fg); }
#skv-header .skv-notif-dd-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: rgba(18, 18, 20, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    padding: 6px; min-width: 140px; z-index: 2100;
    display: none; box-shadow: var(--skv-shadow-2);
}
#skv-header .skv-notif-dd-menu.open { display: block; }
#skv-header .skv-notif-dd-item {
    display: flex; align-items: center; height: 36px; padding: 0 12px;
    border-radius: 8px; color: #e6e6e6; cursor: pointer; font-size: 13px;
    font-family: var(--skv-font);
    margin: 0 4px; white-space: nowrap; transition: background 0.1s;
}
#skv-header .skv-notif-dd-item:hover { background: rgba(255,255,255,0.08); }
#skv-header .skv-notif-dd-item.active { background: rgba(92,136,176,0.16); color: #fff; }

/* Toast container */
.skv-toast-container {
    position: fixed; top: calc(var(--skv-header-h, 56px) + 12px); right: 20px;
    z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.skv-toast {
    width: 320px; background: rgba(10,10,10,0.95); border: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid rgba(92,136,176,0.5); border-radius: 10px;
    backdrop-filter: blur(20px); box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start;
    pointer-events: auto; transform: translateX(120%); transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0; position: relative; overflow: hidden;
}
.skv-toast.visible { transform: translateX(0); opacity: 1; }
.skv-toast.removing { transform: translateX(120%); opacity: 0; }
.skv-toast-content { flex: 1; min-width: 0; }
.skv-toast-title { font-size: 11px; font-weight: 600; color: #fff; }
.skv-toast-body { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 3px; }
.skv-toast-close {
    border: none; background: transparent; color: rgba(255,255,255,0.4);
    cursor: pointer; font-size: 16px; line-height: 1; padding: 0; flex-shrink: 0; transition: color 0.15s;
}
.skv-toast-close:hover { color: #fff; }
.skv-toast-progress {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
    background: rgba(92,136,176,0.3); border-radius: 0 0 0 10px;
}

/* Plan-ending banner: surfaces a scheduled cancellation (paid plan set to end
   at period end) with a one-tap route back to billing. Rendered by
   /static/skv-plan-banner.js into #skv-plan-banner-slot (or top of body).
   Warning semantic = orange; CTA = slate. Token-driven so it adapts to the
   light theme automatically. */
.skv-plan-banner {
    display: flex; align-items: center; gap: 12px;
    box-sizing: border-box; width: 100%; margin: 0 0 16px; padding: 12px 14px;
    border: 1px solid var(--skv-border, rgba(255,255,255,0.08));
    border-left: 3px solid var(--skv-warn, #f5a623);
    border-radius: var(--skv-radius-lg, 12px);
    background: var(--skv-glass-hi, rgba(255,255,255,0.06));
    backdrop-filter: var(--skv-blur, blur(12px));
    -webkit-backdrop-filter: var(--skv-blur, blur(12px));
    color: var(--skv-text, #e9e9e9);
    font-family: var(--skv-font, 'Inter', system-ui, sans-serif);
    font-size: 13px; line-height: 1.4;
    box-shadow: var(--skv-shadow-1, 0 4px 12px rgba(0,0,0,0.40));
}
.skv-plan-banner-icon { display: inline-flex; flex-shrink: 0; color: var(--skv-warn, #f5a623); align-self: flex-start; margin-top: 1px; }
.skv-plan-banner-msg { flex: 1; min-width: 0; color: var(--skv-text, #e9e9e9); }
.skv-plan-banner-main { display: block; }
.skv-plan-banner-sub { display: block; margin-top: 3px; font-size: 11px; line-height: 1.35; color: var(--skv-text-muted, #9ca3af); }
.skv-plan-banner-cta {
    flex-shrink: 0; cursor: pointer; border: none;
    background: var(--skv-accent, #5C88B0); color: #fff;
    font-family: inherit; font-size: 12px; font-weight: 600;
    padding: 7px 14px; border-radius: var(--skv-radius-pill, 20px);
    transition: background 0.15s, box-shadow 0.15s;
}
.skv-plan-banner-cta:hover {
    background: #6f9bc4;
    box-shadow: 0 0 0 3px var(--skv-accent-glow, rgba(92,136,176,0.30));
}
.skv-plan-banner-cta:focus-visible {
    outline: none; box-shadow: 0 0 0 3px var(--skv-accent-glow, rgba(92,136,176,0.30));
}
.skv-plan-banner-close {
    flex-shrink: 0; border: none; background: transparent;
    color: var(--skv-text-muted, #9ca3af); cursor: pointer;
    font-size: 20px; line-height: 1; padding: 0 2px; transition: color 0.15s;
}
.skv-plan-banner-close:hover { color: var(--skv-text, #e9e9e9); }
@media (max-width: 560px) {
    .skv-plan-banner { flex-wrap: wrap; }
    .skv-plan-banner-cta { flex-basis: 100%; order: 5; }
}

/* User Chip */
#skv-header .skv-user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 12px 3px 3px;
    border-radius: 20px; border: 1px solid var(--skv-border);
    cursor: pointer; transition: all 0.15s; background: transparent;
    position: relative;
}
#skv-header .skv-user-chip:hover {
    border-color: var(--skv-border-hover); background: rgba(255,255,255,0.03);
}
#skv-header .skv-user-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--skv-text-muted);
    overflow: hidden; flex-shrink: 0;
}
#skv-header .skv-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
#skv-header .skv-user-name {
    font-size: 12px; font-weight: 500; color: var(--skv-text-muted);
    transition: color 0.15s;
}
#skv-header .skv-user-chip:hover .skv-user-name { color: var(--skv-text); }

/* User dropdown menu (Profile, Ops admin link, Sign out) */
#skv-header .skv-user-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: rgba(18,18,20,0.92); backdrop-filter: blur(20px);
    border: 1px solid var(--skv-border-hover); border-radius: 10px;
    padding: 6px; min-width: 180px; z-index: 2100;
    display: none; box-shadow: var(--skv-shadow-2);
}
#skv-header .skv-user-menu.open { display: block; }
#skv-header .skv-user-menu a, #skv-header .skv-user-menu button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; height: 36px; padding: 0 12px;
    border-radius: 6px; color: var(--skv-text); cursor: pointer;
    font-size: 13px; font-family: var(--skv-font); font-weight: 500;
    background: transparent; border: none; text-align: left;
    text-decoration: none; transition: background 0.1s;
}
#skv-header .skv-user-menu a:hover, #skv-header .skv-user-menu button:hover { background: rgba(255,255,255,0.06); }
#skv-header .skv-user-menu a[hidden], #skv-header .skv-user-menu button[hidden] { display: none; }
#skv-header .skv-user-menu .skv-menu-divider { height: 1px; background: var(--skv-border); margin: 4px 0; }
#skv-header .skv-user-menu .skv-menu-item-admin { color: var(--skv-bear); }

/* Session progress bar */
#skv-header .skv-progress {
    position: absolute; bottom: 0; left: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(92,136,176,0.6), var(--skv-accent));
    transition: width 1s linear;
    border-radius: 0 1px 1px 0;
}
#skv-header .skv-progress.inactive { opacity: 0.15; }

/* Help Button */
#skv-header .skv-help-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--skv-border); background: transparent;
    color: var(--skv-text-muted); cursor: pointer;
    text-decoration: none; transition: all 0.15s;
}
#skv-header .skv-help-btn:hover {
    border-color: var(--skv-border-hover); color: var(--skv-text);
    background: rgba(255,255,255,0.04);
}
#skv-header .skv-help-btn svg { width: 16px; height: 16px; }

/* Theme toggle */
#skv-header .skv-theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--skv-border); background: transparent;
    color: var(--skv-text-muted); cursor: pointer;
    transition: all 0.15s;
}
#skv-header .skv-theme-toggle:hover {
    border-color: var(--skv-border-hover); color: var(--skv-text);
    background: rgba(255,255,255,0.04);
}
#skv-header .skv-theme-toggle svg { width: 16px; height: 16px; }
#skv-header .skv-theme-toggle .icon-sun { display: block; }
#skv-header .skv-theme-toggle .icon-moon { display: none; }
[data-theme="light"] #skv-header .skv-theme-toggle .icon-sun { display: none; }
[data-theme="light"] #skv-header .skv-theme-toggle .icon-moon { display: block; }
[data-theme="light"] #skv-header .skv-theme-toggle:hover { background: rgba(0,0,0,0.04); }

/* Responsive: industry-standard 960px breakpoint for 6-item nav; 480px condenses market-status */
@media (max-width: 960px) {
    #skv-header .skv-nav { display: none; }
    #skv-header .skv-hamburger { display: flex; }
    #skv-header .skv-ms-info { display: none; }
    #skv-header .skv-user-name { display: none; }
}
@media (max-width: 480px) {
    #skv-header { padding: 0 12px; }
    #skv-header .skv-brand { font-size: 15px; letter-spacing: 2px; }
    #skv-header .skv-theme-toggle { display: none; }
}
@media (max-width: 900px) {
    #skv-header .skv-notif-panel { width: calc(100vw - 24px); right: 12px; max-height: 60vh; }
    .skv-toast-container { right: 12px; left: 12px; }
    .skv-toast { width: auto; }
}

/* Touch targets: grow icon buttons to 44px on small viewports (icons keep their
   current svg glyph sizes, only the hit area grows). */
@media (max-width: 960px) {
    #skv-header .skv-notif-btn,
    #skv-header .skv-help-btn,
    #skv-header .skv-theme-toggle,
    #skv-header .skv-hamburger { width: 44px; height: 44px; }
    #skv-header .skv-rail-trigger { width: 44px; height: 44px; }
}

/* ===== HEADER LIGHT MODE ===== */
[data-theme="light"] #skv-header {
    --skv-line: rgba(92,136,176,0.22);
    --skv-gray-06: rgba(0,0,0,0.06);
    --skv-gray-20: rgba(0,0,0,0.2);
    --skv-gray-35: rgba(0,0,0,0.35);
    --skv-gray-50: rgba(0,0,0,0.5);
    --skv-gray-70: rgba(0,0,0,0.7);
    --skv-gray-95: rgba(0,0,0,0.85);
    background: rgba(250,250,250,0.95);
    border-bottom-color: var(--skv-line);
}
[data-theme="light"] #skv-header .skv-brand {
    background: linear-gradient(180deg, #18181b 0%, #71717a 100%);
    -webkit-background-clip: text; background-clip: text;
}
[data-theme="light"] #skv-header .skv-ms:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] #skv-header .skv-ms-popup {
    background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
[data-theme="light"] #skv-header .skv-ms-popup-time { color: #18181b; }
[data-theme="light"] #skv-header .skv-ms-popup-tz,
[data-theme="light"] #skv-header .skv-ms-next { color: #71717a; }
[data-theme="light"] #skv-header .skv-ms-srow { border-color: rgba(0,0,0,0.06); }
[data-theme="light"] #skv-header .skv-nav a { color: rgba(0,0,0,0.5); }
[data-theme="light"] #skv-header .skv-nav a:hover { color: rgba(0,0,0,0.85); background: rgba(0,0,0,0.04); }
[data-theme="light"] #skv-header .skv-nav a.active {
    color: #2f5d88;
    background: rgba(92,136,176,0.10);
}
[data-theme="light"] #skv-header .skv-nav a.active:hover { color: #2f5d88; }
[data-theme="light"] #skv-header .skv-hamburger { color: rgba(0,0,0,0.7); }
[data-theme="light"] #skv-header .skv-hamburger:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] #skv-header .skv-mobile-nav {
    background: rgba(250,250,250,0.97); border-color: rgba(0,0,0,0.06);
    backdrop-filter: blur(24px);
}
[data-theme="light"] #skv-header .skv-mobile-nav a { color: rgba(0,0,0,0.7); }
[data-theme="light"] #skv-header .skv-mobile-nav a:hover { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.85); }
[data-theme="light"] #skv-header .skv-mobile-nav a.active {
    background: rgba(92,136,176,0.10); color: #2f5d88;
}
[data-theme="light"] #skv-header .skv-notif-btn { color: rgba(0,0,0,0.5); }
[data-theme="light"] #skv-header .skv-notif-btn:hover { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.85); }
[data-theme="light"] #skv-header .skv-notif-panel {
    background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
[data-theme="light"] #skv-header .skv-user-chip:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] #skv-header .skv-user-avatar { background: rgba(0,0,0,0.05); }
[data-theme="light"] #skv-header .skv-user-menu {
    background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
[data-theme="light"] #skv-header .skv-user-menu a,
[data-theme="light"] #skv-header .skv-user-menu button { color: #18181b; }
[data-theme="light"] #skv-header .skv-user-menu a:hover,
[data-theme="light"] #skv-header .skv-user-menu button:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] #skv-header .skv-progress {
    background: linear-gradient(90deg, rgba(74,114,143,0.4), #4a728f);
}

/* ============================================================
   SIDE-NAV RAIL (v2) - canonical source for per-app replication
   ------------------------------------------------------------
   Activated by html[data-skv-nav-mode="side"]. The rail DOM lives inside
   #skv-header and is display:none by default, so TOP MODE is byte-identical
   to today (no rule below touches a non-side-scoped selector). Desktop rail
   is gated >=961px; mobile drawer <=960px (matches the existing top-mode
   hamburger breakpoint). Width collapse is driven by .skv-nav-collapsed on
   <html>. Active link = filled glass pill (NO left-edge bar / ::before).
   Slate (#5C88B0 / --skv-accent) is the only accent; gold stays a micro-accent.
   v2 additions (all still side-scoped / net-new .skv-rail* elements): rail-owned
   market-status popup (#skv-rail-ms-popup, a clone of the top widget), rail-owned account menu
   (.skv-rail-menu in .skv-rail-chip-wrap), Theme row aux (.skv-rail-link-aux),
   carets, and a side-scoped re-anchor of the shared #skv-notif-panel as a
   left fly-out near the foot bell.
   ============================================================ */

/* Rail width tokens (rail/expanded vs collapsed; mobile drawer width). */
html[data-skv-nav-mode="side"] {
    --skv-rail-w: 208px;
    --skv-rail-w-collapsed: 64px;
    --skv-rail-drawer-w: 280px;
    --skv-rail-slate: var(--skv-accent);
    --skv-rail-slate-bright: #7aa6cc;
    --skv-rail-slate-soft: rgba(92,136,176,0.16);
}
/* When the rail is collapsed, the shared width token tracks it so every
   var(--skv-rail-w) content offset follows the 64px rail (not 208px). */
html.skv-nav-collapsed[data-skv-nav-mode="side"] { --skv-rail-w: var(--skv-rail-w-collapsed); }
[data-theme="light"] html[data-skv-nav-mode="side"],
html[data-skv-nav-mode="side"][data-theme="light"] {
    --skv-rail-slate-bright: #2f5d88;
    --skv-active-fg: #2f5d88;
}

/* Rail is hidden in top mode (and whenever side mode is off). */
.skv-rail { display: none; }

/* SVG defaults inside the rail (stroked line icons, 20px). */
html[data-skv-nav-mode="side"] .skv-rail svg {
    width: 20px; height: 20px; flex: none;
    stroke: currentColor; fill: none;
    stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- shared rail interior (desktop rail + mobile drawer) ---------- */
html[data-skv-nav-mode="side"] .skv-rail {
    display: flex; flex-direction: column;
    height: 100%; width: 100%;
    background: var(--skv-bg);
    font-family: var(--skv-font);
}
html[data-skv-nav-mode="side"] .skv-rail-top {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 14px 10px;
}
html[data-skv-nav-mode="side"] .skv-rail-monogram {
    width: 30px; height: 30px; flex: none;
    border-radius: 8px; border: 1px solid var(--skv-border);
    display: none; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: var(--skv-text);
    background: var(--skv-glass);
}
html[data-skv-nav-mode="side"] .skv-rail-brand {
    font-weight: 800; letter-spacing: 2.5px; font-size: 15px;
    background: linear-gradient(180deg, #fff, #9aa3ad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap; overflow: hidden; text-decoration: none;
}
[data-theme="light"] html[data-skv-nav-mode="side"] .skv-rail-brand {
    background: linear-gradient(180deg, #18181b, #71717a);
    -webkit-background-clip: text; background-clip: text;
}

/* rail market-status: structural clone of the top-bar widget. The inner
   elements carry the canonical .skv-ms-* classes, and since the rail lives
   inside #skv-header the top widget's CSS applies verbatim (exact visual
   parity by construction). Only the button wrapper, popup anchoring, and
   collapsed behavior are rail-specific. Driven by msTick (skv-header.js),
   which mirrors the top clock's formats exactly. */
html[data-skv-nav-mode="side"] .skv-rail-ms {
    display: flex; align-items: center; gap: 8px;
    margin: 2px 12px 10px; padding: 4px 10px;
    border-radius: 6px; cursor: pointer;
    color: inherit; text-decoration: none; text-align: left;
    position: relative; width: calc(100% - 24px);
    background: transparent; border: 0;
    font: inherit; font-family: var(--skv-font);
    transition: background var(--skv-dur-quick, 0.15s) ease;
}
html[data-skv-nav-mode="side"] .skv-rail-ms:hover { background: rgba(255,255,255,0.04); }
html[data-skv-nav-mode="side"] .skv-rail-ms .skv-ms-info { flex: 1; min-width: 0; }
/* Anchor the cloned popup as a fly-out to the right of the rail row (the
   canonical #skv-header .skv-ms-popup is position:fixed and placed by
   toggleSkvMarketPopup, which the rail's delegate does not use). */
html[data-skv-nav-mode="side"] #skv-rail-ms-popup {
    position: absolute; left: calc(100% + 8px); top: 0;
    z-index: 1100; cursor: default; text-align: left;
}


/* rail nav (grouped links) */
html[data-skv-nav-mode="side"] .skv-rail-nav {
    flex: 1; overflow-y: auto; padding: 4px 12px;
}
html[data-skv-nav-mode="side"] .skv-rail-nav::-webkit-scrollbar { width: 0; }
html[data-skv-nav-mode="side"] .skv-rail-grp { margin-top: 12px; }
html[data-skv-nav-mode="side"] .skv-rail-grp:first-child { margin-top: 2px; }
html[data-skv-nav-mode="side"] .skv-rail-grp-label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px;
    color: var(--skv-text-dim); text-transform: uppercase;
    padding: 6px 10px 4px;
}
html[data-skv-nav-mode="side"] .skv-rail-link {
    display: flex; align-items: center; gap: 12px;
    height: 40px; padding: 0 10px; border-radius: 9px;
    color: var(--skv-text-muted); font-size: 13px; font-weight: 500;
    white-space: nowrap; overflow: hidden; position: relative;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
html[data-skv-nav-mode="side"] .skv-rail-link:hover {
    background: var(--skv-glass); color: var(--skv-text);
}
html[data-skv-nav-mode="side"] .skv-rail-link .lbl { overflow: hidden; }
/* ACTIVE = filled glass pill + slate tint (unified recipe). NO left-edge bar / ::before. */
html[data-skv-nav-mode="side"] .skv-rail-link.active {
    background: var(--skv-active-bg);
    box-shadow: var(--skv-active-ring), inset 0 -1.5px 0 var(--skv-active-bar);
    color: var(--skv-active-fg);
}
html[data-skv-nav-mode="side"] .skv-rail-link.active svg { color: var(--skv-active-fg); }

/* rail foot chrome */
html[data-skv-nav-mode="side"] .skv-rail-foot {
    border-top: 1px solid var(--skv-border);
    padding: 8px 12px 10px;
    display: flex; flex-direction: column; gap: 2px;
}
html[data-skv-nav-mode="side"] .skv-rail-foot-btn {
    display: flex; align-items: center; gap: 12px;
    height: 38px; padding: 0 10px; border-radius: 9px;
    color: var(--skv-text-muted); cursor: pointer;
    font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden;
    background: transparent; border: 0; text-align: left;
    font-family: var(--skv-font); text-decoration: none; position: relative;
}
html[data-skv-nav-mode="side"] .skv-rail-foot-btn:hover {
    background: var(--skv-glass); color: var(--skv-text);
}

/* Theme row (in the More group): right-aligned aux shows current mode.
   width:100% + border-box so the <button> stretches to the full rail
   width like the anchor rail-links and foot buttons; a bare button
   otherwise shrinks to its content and looks misaligned (narrower row). */
html[data-skv-nav-mode="side"] .skv-rail-theme-row {
    cursor: pointer; background: transparent; border: 0;
    font-family: var(--skv-font); text-align: left;
    width: 100%; box-sizing: border-box;
}
html[data-skv-nav-mode="side"] .skv-rail-link-aux {
    margin-left: auto; font-size: 10px; color: var(--skv-text-dim);
    font-family: var(--skv-mono); text-transform: uppercase; letter-spacing: 0.6px;
}

html[data-skv-nav-mode="side"] .skv-rail-chip-wrap {
    position: relative; margin-top: 4px;
}
html[data-skv-nav-mode="side"] .skv-rail-chip {
    display: flex; align-items: center; gap: 10px;
    height: 42px; padding: 5px 8px; border-radius: 11px;
    border: 1px solid var(--skv-border); width: 100%;
    cursor: pointer; text-decoration: none; color: inherit; position: relative;
    background: transparent; font-family: var(--skv-font);
}
html[data-skv-nav-mode="side"] .skv-rail-chip:hover {
    border-color: var(--skv-border-hover); background: var(--skv-glass);
}
html[data-skv-nav-mode="side"] .skv-rail-av {
    width: 28px; height: 28px; flex: none; border-radius: 50%;
    background: var(--skv-rail-slate-soft); color: var(--skv-rail-slate-bright);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; overflow: hidden;
}
html[data-skv-nav-mode="side"] .skv-rail-av img { width: 100%; height: 100%; object-fit: cover; }
html[data-skv-nav-mode="side"] .skv-rail-who {
    display: flex; flex-direction: column; line-height: 1.2; overflow: hidden;
}
html[data-skv-nav-mode="side"] .skv-rail-who-name { font-size: 12px; font-weight: 600; color: var(--skv-text); }
html[data-skv-nav-mode="side"] .skv-rail-who-sub { font-size: 10px; color: var(--skv-text-dim); }
html[data-skv-nav-mode="side"] .skv-rail-chip-caret {
    margin-left: auto; width: 14px; height: 14px; color: var(--skv-text-dim);
}

/* rail-owned account menu (self-contained; NET-NEW ids, never #skv-user-menu).
   Fly-out above the chip on desktop; re-anchored on mobile. */
html[data-skv-nav-mode="side"] .skv-rail-menu {
    position: absolute; left: 0; bottom: calc(100% + 6px); width: calc(var(--skv-rail-w) - 16px);
    background: rgba(12,12,14,0.97); border: 1px solid var(--skv-border);
    border-radius: 11px; padding: 6px; box-shadow: var(--skv-shadow-3, 0 18px 44px rgba(0,0,0,0.5));
    backdrop-filter: var(--skv-blur, blur(18px)); -webkit-backdrop-filter: var(--skv-blur, blur(18px));
    z-index: 1100; display: none; cursor: default;
}
[data-theme="light"] html[data-skv-nav-mode="side"] .skv-rail-menu {
    background: rgba(255,255,255,0.97);
}
html[data-skv-nav-mode="side"] .skv-rail-menu.open { display: block; }
html[data-skv-nav-mode="side"] .skv-rail-menu-item {
    display: flex; align-items: center; width: 100%; min-height: 34px;
    padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
    color: var(--skv-text-muted); font: 600 12px var(--skv-font);
    text-align: left; text-decoration: none; cursor: pointer;
}
html[data-skv-nav-mode="side"] .skv-rail-menu-item:hover {
    background: var(--skv-glass-hi); color: var(--skv-text);
}
html[data-skv-nav-mode="side"] .skv-rail-menu-divider {
    height: 1px; background: var(--skv-border); margin: 5px 6px;
}

html[data-skv-nav-mode="side"] .skv-rail-badge {
    margin-left: auto; background: var(--skv-rail-slate); color: #fff;
    font-size: 9.5px; font-weight: 700; min-width: 16px; height: 16px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}
html[data-skv-nav-mode="side"] .skv-rail-badge.hidden { display: none; }

html[data-skv-nav-mode="side"] .skv-rail-pin {
    margin: 4px 0 0; display: flex; align-items: center; justify-content: center;
    gap: 8px; height: 34px; border-radius: 9px;
    color: var(--skv-text-dim); cursor: pointer;
    border: 1px dashed var(--skv-border); background: transparent;
}
html[data-skv-nav-mode="side"] .skv-rail-pin:hover {
    color: var(--skv-text); border-color: var(--skv-border-hover);
}
html[data-skv-nav-mode="side"] .skv-rail-pin svg { width: 16px; height: 16px; }
/* Relocated collapse/expand control: a lightweight icon in the brand row (top of
   the rail) instead of a bordered button in the foot, reclaiming the foot row.
   Scoped to .skv-rail-top so any surface still rendering the pin in the foot
   (inline-markup static pages) keeps the base .skv-rail-pin styling above. */
html[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin {
    margin: 0 0 0 auto; height: 28px; width: 28px; gap: 0; flex: none;
    border: none; border-radius: 7px; color: var(--skv-text-dim);
    transition: background 0.12s, color 0.12s;
}
html[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin:hover {
    background: var(--skv-glass); color: var(--skv-text); border-color: transparent;
}
html[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin svg { width: 19px; height: 19px; }

/* ============================================================
   SIDE MODE - DESKTOP RAIL (>=961px)
   ============================================================ */
@media (min-width: 961px) {
    /* Turn the sticky top bar into a fixed full-height left rail. */
    html[data-skv-nav-mode="side"] #skv-header {
        display: block;
        height: 100vh; height: 100dvh;
        width: var(--skv-rail-w);
        padding: 0;
        border-bottom: none;
        border-right: 1px solid var(--skv-border);
        position: fixed; top: 0; left: 0; bottom: 0;
        background: var(--skv-bg);
        backdrop-filter: none; -webkit-backdrop-filter: none;
        z-index: 100;
        transition: width 0.2s var(--skv-ease-out);
        grid-template-columns: none;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] #skv-header { width: var(--skv-rail-w-collapsed); }

    /* Show the rail; hide every top-mode-only chrome element. */
    html[data-skv-nav-mode="side"] .skv-rail { display: flex; }
    html[data-skv-nav-mode="side"] #skv-header .skv-header-left,
    html[data-skv-nav-mode="side"] #skv-header .skv-nav,
    html[data-skv-nav-mode="side"] #skv-header .skv-hamburger,
    html[data-skv-nav-mode="side"] #skv-header .skv-header-right,
    html[data-skv-nav-mode="side"] #skv-header .skv-mobile-nav,
    html[data-skv-nav-mode="side"] #skv-header .skv-progress { display: none; }

    /* Collapsed rail: icons only, brand -> "S" monogram, group labels -> hairline dividers. */
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-brand { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-monogram { display: flex; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-ms {
        justify-content: center; margin: 2px 0 10px; width: auto;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] #skv-rail-ms .skv-ms-info { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-grp-label {
        opacity: 0; height: 1px; padding: 0; margin: 8px 12px 0;
        border-top: 1px solid var(--skv-border); overflow: hidden;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-grp-label span { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-link {
        justify-content: center; padding: 0;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-link .lbl,
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-link-aux { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-foot-btn {
        justify-content: center; padding: 0;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-foot-btn .lbl { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-chip {
        justify-content: center; padding: 5px; border-color: transparent;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-who,
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-chip-caret { display: none; }
    /* Collapsed (64px) rail: fly-outs anchor to the rail edge, not the row width. */
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-menu { left: calc(100% + 8px); bottom: 0; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] #skv-rail-ms-popup { top: 0; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-badge {
        position: absolute; top: 6px; right: 10px; margin: 0;
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-pin svg { transform: rotate(180deg); }
    /* Collapsed + pin-in-top: center the toggle and drop the "S" monogram so the
       toggle is the single top element; keep the panel icon un-rotated (it is a
       consistent sidebar toggle, not a directional chevron). :has() scopes this to
       surfaces that moved the pin to the top; pages still rendering the pin in the
       foot keep their monogram and foot pin untouched. */
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-top:has(.skv-rail-pin) { justify-content: center; padding-left: 0; padding-right: 0; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-top:has(.skv-rail-pin) .skv-rail-monogram { display: none; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin { margin: 0; }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin svg { transform: none; }

    /* Re-anchor the REAL shared notif panel as a left fly-out near the foot bell
       (top mode floats it top-right; in the rail it belongs beside the rail edge). */
    html[data-skv-nav-mode="side"] #skv-header .skv-notif-panel {
        top: auto; right: auto;
        left: calc(var(--skv-rail-w) + 10px); bottom: 16px;
        width: 320px; max-height: min(70vh, 480px);
    }
    html.skv-nav-collapsed[data-skv-nav-mode="side"] #skv-header .skv-notif-panel {
        left: calc(var(--skv-rail-w-collapsed) + 10px);
    }
}

/* The scrim + floating trigger are hidden unless side mode + mobile show them. */
.skv-rail-scrim, .skv-rail-trigger { display: none; }

/* ============================================================
   SIDE MODE - MOBILE DRAWER (<=960px)
   ------------------------------------------------------------
   #skv-header becomes a transparent full-viewport layer that does NOT move.
   Only .skv-rail (the drawer panel) slides in from the left; the scrim and
   the floating hamburger trigger are siblings that stay put. Keeping all of
   it inside #skv-header preserves the embed-suppression invariant.
   ============================================================ */
@media (max-width: 960px) {
    html[data-skv-nav-mode="side"] #skv-header {
        display: block;
        position: fixed; inset: 0;
        height: auto; width: auto;
        padding: 0; margin: 0;
        border: none; background: transparent;
        backdrop-filter: none; -webkit-backdrop-filter: none;
        grid-template-columns: none;
        pointer-events: none;            /* let page underneath stay interactive */
        z-index: 1000;
    }
    /* Hide every top-mode chrome element. */
    html[data-skv-nav-mode="side"] #skv-header .skv-header-left,
    html[data-skv-nav-mode="side"] #skv-header .skv-nav,
    html[data-skv-nav-mode="side"] #skv-header .skv-hamburger,
    html[data-skv-nav-mode="side"] #skv-header .skv-header-right,
    html[data-skv-nav-mode="side"] #skv-header .skv-mobile-nav,
    html[data-skv-nav-mode="side"] #skv-header .skv-progress { display: none; }

    /* Side-nav trigger: a slim chevron HANDLE pinned to the TOP-LEFT, hugging the
       left edge, that stays put as the page scrolls; tapping it slides the drawer
       open. Top-left (not vertically centered) so it never overlays the heatmap /
       strike data below. Replaces the old hamburger square (which read as a second
       menu button and crowded app toolbars). The chevron is an "expand the side
       panel" affordance. #skv-header in the selector overrides the 44px touch
       size rule above for this slim edge handle. */
    html[data-skv-nav-mode="side"] #skv-header .skv-rail-trigger {
        display: flex; pointer-events: auto;
        align-items: center; justify-content: center;
        position: fixed; left: var(--skv-safe-left); top: max(12px, var(--skv-safe-top));
        z-index: 1001;
        width: 24px; height: 28px; padding: 0;
        border-radius: 0 12px 12px 0;
        border: 1px solid rgba(92,136,176,0.40); border-left: none;
        background: rgba(18,20,24,0.78);
        backdrop-filter: var(--skv-blur); -webkit-backdrop-filter: var(--skv-blur);
        /* dark depth shadow + a soft slate (brand accent) glow so the handle is
           noticeable without being gaudy. */
        box-shadow: 2px 0 12px rgba(0,0,0,0.35), 0 0 12px var(--skv-accent-glow);
        color: var(--skv-active-fg); cursor: pointer;
        transition: background var(--skv-dur-quick, 0.15s) ease, box-shadow var(--skv-dur-quick, 0.15s) ease, color var(--skv-dur-quick, 0.15s) ease;
    }
    html[data-skv-nav-mode="side"] #skv-header .skv-rail-trigger:hover {
        background: rgba(26,29,34,0.9);
        box-shadow: 2px 0 14px rgba(0,0,0,0.4), 0 0 16px rgba(92,136,176,0.55);
    }
    [data-theme="light"] html[data-skv-nav-mode="side"] #skv-header .skv-rail-trigger {
        background: rgba(250,250,252,0.82);
    }
    /* Replace the bare <line> hamburger SVG with a CSS chevron-right (>): the
       slide-out affordance. Hide the SVG; draw the chevron with two borders. */
    html[data-skv-nav-mode="side"] .skv-rail-trigger svg { display: none; }
    html[data-skv-nav-mode="side"] .skv-rail-trigger::before {
        content: ''; width: 7px; height: 7px; margin-left: -3px;
        border-top: 2px solid currentColor; border-right: 2px solid currentColor;
        transform: rotate(45deg);
    }

    /* Scrim behind the open drawer. */
    html[data-skv-nav-mode="side"] .skv-rail-scrim {
        display: block; pointer-events: none;
        position: fixed; inset: 0; background: rgba(0,0,0,0.55);
        z-index: 1002; opacity: 0; transition: opacity 0.2s;
    }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-scrim {
        opacity: 1; pointer-events: auto;
    }

    /* The drawer panel itself slides; always expanded internally on mobile. */
    html[data-skv-nav-mode="side"] .skv-rail {
        display: flex; pointer-events: auto;
        position: fixed; top: 0; left: 0; bottom: 0;
        width: var(--skv-rail-drawer-w); max-width: 88vw;
        height: 100vh; height: 100dvh;
        border-right: 1px solid var(--skv-border);
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
        z-index: 1003;
        transform: translateX(-100%);
        transition: transform 0.22s var(--skv-ease-out);
    }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail { transform: translateX(0); }

    /* Mobile drawer is never desktop-collapsed: keep wordmark, hide monogram.
       The pin is hidden by default, but when the drawer is OPEN it doubles as the
       close (X) control, top-right of the drawer where dismissal is expected (the
       floating trigger is z-buried under the open panel and the scrim is only a
       thin strip). Wired to close (not collapse) in skv-header.js on skv-nav-open. */
    html[data-skv-nav-mode="side"] .skv-rail-monogram { display: none; }
    html[data-skv-nav-mode="side"] .skv-rail-pin { display: none; }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin {
        display: flex; position: relative;
        width: 40px; height: 40px; margin: 0 0 0 auto;
    }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin svg { display: none; }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin::before,
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin::after {
        content: ''; position: absolute; top: 50%; left: 50%;
        width: 18px; height: 2px; margin: -1px 0 0 -9px;
        background: currentColor; border-radius: 2px;
    }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin::before { transform: rotate(45deg); }
    html.skv-nav-open[data-skv-nav-mode="side"] .skv-rail-top .skv-rail-pin::after { transform: rotate(-45deg); }

    /* On mobile the fly-outs would overflow the 280px drawer; anchor them
       within the drawer width instead of beside it. */
    html[data-skv-nav-mode="side"] #skv-rail-ms-popup {
        left: 8px; right: 8px; top: calc(100% + 6px); width: auto; min-width: 0;
    }
    html[data-skv-nav-mode="side"] .skv-rail-menu {
        left: 8px; right: 8px; width: auto;
    }
    /* The real notif panel rides above the drawer (drawer z-index 1003). */
    html[data-skv-nav-mode="side"] #skv-header .skv-notif-panel {
        top: auto; right: auto;
        left: 12px; bottom: 12px;
        width: calc(min(var(--skv-rail-drawer-w), 88vw) - 24px);
        max-height: 60vh; z-index: 1004;
    }
}

/* Respect reduced motion: no width/slide/scrim animations. */
@media (prefers-reduced-motion: reduce) {
    html[data-skv-nav-mode="side"] #skv-header,
    html[data-skv-nav-mode="side"] .skv-rail,
    html[data-skv-nav-mode="side"] .skv-rail-scrim { transition: none; }
}

/* ============================================================
   AUTH GATES (signed-out + subscription-required)
   ============================================================ */
#authGatePage {
    display: none;
    position: fixed; inset: 0; z-index: 99999;
    background:
        radial-gradient(ellipse 70% 55% at 50% 10%, rgba(255,255,255,0.035), transparent 62%),
        radial-gradient(ellipse 42% 36% at 58% 42%, rgba(92,136,176,0.08), transparent 70%),
        radial-gradient(ellipse 70% 65% at 50% 54%, transparent 0%, rgba(0,0,0,0.68) 100%),
        linear-gradient(90deg, rgba(255,255,255,0.048) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.048) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.022) 1px, transparent 1px),
        #050505;
    background-size: 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px, 20px 20px, 20px 20px, 100% 100%;
    align-items: center; justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
#authGatePage.visible { display: flex; }
#authGatePage .gate-card { width: min(100%, 520px); text-align: center; padding: 0; }
#authGatePage .gate-brand {
    font-family: var(--skv-font, Inter, system-ui, sans-serif);
    font-size: clamp(42px, 10vw, 64px); font-weight: 800; line-height: 0.96; color: #fff;
    margin-bottom: 0.5rem; letter-spacing: 0;
}
#authGatePage .gate-sub {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem; font-weight: 700; color: rgba(250,250,250,0.32);
    margin-bottom: 1.5rem; letter-spacing: 0.14em; text-transform: uppercase;
}
#authGatePage .gate-box {
    background:
        radial-gradient(circle at 50% 0%, rgba(92,136,176,0.16), transparent 48%),
        rgba(8,8,9,0.88);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 8px; padding: 2.25rem; margin-bottom: 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
#authGatePage .gate-icon {
    width: 52px; height: 52px; margin: 0 auto 1.5rem;
    background: rgba(92,136,176,0.12); border: 1px solid rgba(92,136,176,0.26); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #9fc4e6;
}
#authGatePage .gate-icon svg { stroke: currentColor !important; }
#authGatePage .gate-title { font-size: 1.35rem; font-weight: 700; color: #fff; margin-bottom: 0.75rem; letter-spacing: 0; }
#authGatePage .gate-desc { color: rgba(250,250,250,0.62); line-height: 1.65; margin-bottom: 1.5rem; font-size: 0.95rem; }
#authGatePage .gate-signin {
    display: inline-flex; align-items: center; justify-content: center; min-width: 168px; min-height: 52px; padding: 0 2rem;
    background: #fff; color: #050505; font-weight: 700;
    border-radius: 8px; text-decoration: none; font-size: 0.95rem;
    cursor: pointer; border: 1px solid transparent; transition: background 0.2s ease, transform 0.2s ease;
}
#authGatePage .gate-signin:hover { opacity: 1; background: rgba(250,250,250,0.88); transform: translateY(-1px); }
#authGatePage .gate-plans {
    display: block; margin-top: 1rem;
    color: rgba(250,250,250,0.46); font-size: 0.85rem; text-decoration: none;
}
#authGatePage .gate-plans:hover { color: rgba(250,250,250,0.72); }

#subscriptionGate,
.sub-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    overflow-y: auto;
    background:
        radial-gradient(ellipse 70% 55% at 50% 10%, rgba(255,255,255,0.035), transparent 62%),
        radial-gradient(ellipse 42% 36% at 58% 42%, rgba(92,136,176,0.08), transparent 70%),
        radial-gradient(ellipse 70% 65% at 50% 54%, transparent 0%, rgba(0,0,0,0.68) 100%),
        linear-gradient(90deg, rgba(255,255,255,0.048) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.048) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.022) 1px, transparent 1px),
        #050505 !important;
    background-size: 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px, 20px 20px, 20px 20px, 100% 100% !important;
}
.sub-gate-inner,
.sub-gate-card { width: min(100%, 520px); max-width: 520px !important; text-align: center; }
#subscriptionGate > div,
.sub-gate-wrap {
    width: 100% !important;
    min-height: 100vh !important; display: flex !important; align-items: center !important;
    justify-content: center !important; padding: 2rem !important;
}
#subscriptionGate > div > div {
    width: min(100%, 520px) !important; max-width: 520px !important; text-align: center !important;
}
.sub-gate-brand,
#subscriptionGate > div > div > div:first-of-type {
    font-size: clamp(42px, 10vw, 64px) !important; font-weight: 800 !important;
    line-height: 0.96; color: #fff !important; margin-bottom: 0.5rem !important; letter-spacing: 0 !important;
}
.sub-gate-sub,
#subscriptionGate > div > div > div:nth-of-type(2) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem !important; font-weight: 700; color: rgba(250,250,250,0.32) !important;
    margin-bottom: 1.5rem !important; letter-spacing: 0.14em; text-transform: uppercase;
}
.sub-gate-box,
#subscriptionGate > div > div > div:nth-of-type(3) {
    background:
        radial-gradient(circle at 50% 0%, rgba(92,136,176,0.16), transparent 48%),
        rgba(8,8,9,0.88) !important;
    border: 1px solid rgba(255,255,255,0.13) !important;
    border-radius: 8px !important; padding: 2.25rem !important; margin-bottom: 1rem !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.sub-gate-icon,
#subscriptionGate > div > div > div:nth-of-type(3) > div:first-of-type {
    width: 52px !important; height: 52px !important; margin: 0 auto 1.5rem !important;
    background: rgba(92,136,176,0.12) !important; border: 1px solid rgba(92,136,176,0.26);
    border-radius: 8px !important; color: #9fc4e6 !important;
}
.sub-gate-icon svg,
#subscriptionGate > div > div > div:nth-of-type(3) > div:first-of-type svg { stroke: currentColor !important; }
.sub-gate-title,
#subscriptionGate h2 { font-size: 1.35rem !important; font-weight: 700 !important; color: #fff !important; margin-bottom: 0.75rem !important; }
.sub-gate-desc,
#subscriptionGate p:not(#gateUserInfo) { color: rgba(250,250,250,0.62) !important; line-height: 1.65 !important; margin-bottom: 1.5rem !important; }
.sub-gate-cta,
#subscriptionGate a[href*="/billing/plans"] {
    display: inline-flex !important; align-items: center; justify-content: center; min-height: 52px; padding: 0 2rem !important;
    background: #fff !important; color: #050505 !important; font-weight: 700 !important;
    border-radius: 8px !important; text-decoration: none !important; border: 1px solid transparent !important;
}
.sub-gate-cta:hover,
#subscriptionGate a[href*="/billing/plans"]:hover { opacity: 1 !important; background: rgba(250,250,250,0.88) !important; }
.sub-gate-manage,
.sub-gate-userinfo,
#subscriptionGate a[href*="/billing"]:not([href*="/plans"]),
#gateUserInfo { color: rgba(250,250,250,0.46) !important; }

[data-theme="light"] #authGatePage {
    background:
        radial-gradient(ellipse 70% 55% at 50% 10%, rgba(0,0,0,0.035), transparent 62%),
        radial-gradient(ellipse 42% 36% at 58% 42%, rgba(74,114,143,0.08), transparent 70%),
        radial-gradient(ellipse 70% 65% at 50% 54%, transparent 0%, rgba(255,255,255,0.74) 100%),
        linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,0,0,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,0,0,0.018) 1px, transparent 1px),
        #fafafa;
    background-size: 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px, 20px 20px, 20px 20px, 100% 100%;
}
[data-theme="light"] #authGatePage .gate-brand { color: #18181b; }
[data-theme="light"] #authGatePage .gate-sub { color: #a1a1aa; }
[data-theme="light"] #authGatePage .gate-box { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] #authGatePage .gate-title { color: #18181b; }
[data-theme="light"] #authGatePage .gate-desc { color: #52525b; }
[data-theme="light"] #authGatePage .gate-signin { background: #18181b; color: #fff; }
[data-theme="light"] #authGatePage .gate-signin:hover { background: #3f3f46; color: #fff; }
[data-theme="light"] #authGatePage .gate-plans { color: #71717a; }

[data-theme="light"] #subscriptionGate,
[data-theme="light"] .sub-gate-overlay {
    background:
        radial-gradient(ellipse 70% 55% at 50% 10%, rgba(0,0,0,0.035), transparent 62%),
        radial-gradient(ellipse 42% 36% at 58% 42%, rgba(74,114,143,0.08), transparent 70%),
        radial-gradient(ellipse 70% 65% at 50% 54%, transparent 0%, rgba(255,255,255,0.74) 100%),
        linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,0,0,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,0,0,0.018) 1px, transparent 1px),
        #fafafa !important;
    background-size: 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px, 20px 20px, 20px 20px, 100% 100% !important;
}
[data-theme="light"] .sub-gate-brand,
[data-theme="light"] #subscriptionGate > div > div > div:first-of-type { color: #18181b !important; }
[data-theme="light"] .sub-gate-sub,
[data-theme="light"] #subscriptionGate > div > div > div:nth-of-type(2) { color: #a1a1aa !important; }
[data-theme="light"] .sub-gate-box,
[data-theme="light"] #subscriptionGate > div > div > div:nth-of-type(3) { background: rgba(255,255,255,0.9) !important; border-color: rgba(0,0,0,0.1) !important; }
[data-theme="light"] .sub-gate-title,
[data-theme="light"] #subscriptionGate h2 { color: #18181b !important; }
[data-theme="light"] .sub-gate-desc,
[data-theme="light"] #subscriptionGate p:not(#gateUserInfo) { color: #52525b !important; }
[data-theme="light"] .sub-gate-cta,
[data-theme="light"] #subscriptionGate a[href*="/billing/plans"] { background: #18181b !important; color: #fff !important; }
[data-theme="light"] .sub-gate-manage,
[data-theme="light"] .sub-gate-userinfo,
[data-theme="light"] #subscriptionGate a[href*="/billing"]:not([href*="/plans"]),
[data-theme="light"] #gateUserInfo { color: #71717a !important; }

@media (max-width: 520px) {
    #authGatePage { padding: 20px; align-items: flex-start; padding-top: 92px; }
    #authGatePage .gate-box,
    .sub-gate-box { padding: 1.75rem !important; }
    #authGatePage .gate-signin,
    .sub-gate-cta { width: 100%; }
}

#subscriptionGate { display: none; }

.skv-app-content { padding: 12px; }

/* ============================================================
   KEYBOARD FOCUS (shared, slate) - single global recipe
   ------------------------------------------------------------
   Widened from the former #skv-header-scoped + rail-scoped rule to one
   global :focus-visible recipe (uses :where() so it adds zero specificity
   and any app rule can still override). Covers header links/buttons, rail
   links/foot-btns/chips/trigger, and every adopting app control. There must
   be exactly ONE focus recipe in this file.
   ============================================================ */
:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
    outline: 2px solid var(--skv-accent);
    outline-offset: 2px;
}

/* ============================================================
   CANONICAL FOOTER (.skv-footer)
   Shipped as a partial (shared/skv-footer.html); no page adopts it
   in this PR. Deep-black surface, slate-on-glass micro-label headers.
   ============================================================ */
.skv-footer {
    background: #030308;
    border-top: 1px solid var(--skv-border);
    color: var(--skv-text-muted);
    font-family: var(--skv-font);
    padding: 40px 24px 28px;
    margin-top: 48px;
}
.skv-footer-inner {
    max-width: 1180px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.skv-footer-col { display: flex; flex-direction: column; }
.skv-footer-col-head {
    font: 600 9px var(--skv-mono, ui-monospace);
    letter-spacing: 0.8px; text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 12px;
}
.skv-footer-link {
    color: var(--skv-text-muted); text-decoration: none;
    font-size: 13px; line-height: 1.5;
    padding: 4px 0;
    display: flex; align-items: center;
    transition: color 0.15s ease;
}
.skv-footer-link:hover { color: var(--skv-text); }
.skv-footer-bottom {
    max-width: 1180px; margin: 28px auto 0;
    padding-top: 20px; border-top: 1px solid var(--skv-border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.skv-footer-wordmark {
    font-size: 13px; font-weight: 800; letter-spacing: 2px;
    color: var(--skv-text); text-decoration: none;
}
.skv-footer-rights { font-size: 11px; color: var(--skv-text-dim); }
@media (max-width: 720px) {
    .skv-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (hover: none) and (pointer: coarse) {
    .skv-footer-link { min-height: 44px; padding: 8px 0; }
}

/* ============================================================
   GLASS + RAMP PRIMITIVES (concepts B + C)
   ------------------------------------------------------------
   One Glass (B) + Terminal Ramp (C) core. Every selector below is a
   NET-NEW class so live consumers (TeploMap, account, tracker, the 7
   One Shell apps) are byte-identical until they opt in by adopting these
   classes. The only non-class shell change in this round is the global
   :focus-visible consolidation (above) and the .skv-toggle generalization
   (the existing #skv-header .skv-toggle rules keep winning on specificity).
   Tokens (Terminal Ramp) live in the :root block near the top of this file.
   Bind to existing shell tokens only; introduce no new hues. Density is
   opt-in via [data-density="compact"] flipping --skv-row-h.
   ============================================================ */

/* ---- Density ---- */
[data-density="compact"] { --skv-row-h: 28px; }

/* ---- Type / text primitives ---- */
.skv-eyebrow {
    font: 600 var(--fs-micro)/1 var(--skv-mono);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--skv-text-dim);
}
.skv-mono-num {
    font-family: var(--skv-mono);
    font-variant-numeric: tabular-nums;
}

/* ---- Layout primitives ---- */
.skv-page {
    max-width: var(--skv-content-max);
    margin-inline: auto;
    padding-inline: var(--skv-gutter);
}
@media (max-width: 768px) {
    .skv-page { padding-inline: var(--skv-gutter-mobile); }
}
.skv-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ---- Card (One Glass) ---- */
.skv-card {
    background: linear-gradient(var(--skv-glass), var(--skv-glass)), var(--skv-panel);
    border: 1px solid var(--skv-border);
    border-radius: var(--skv-radius-lg);
    backdrop-filter: var(--skv-blur);
    -webkit-backdrop-filter: var(--skv-blur);
    box-shadow: var(--skv-shadow-1);
    transition: border-color 150ms var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1)),
                box-shadow 150ms,
                transform 150ms;
}
.skv-card:hover {
    border-color: var(--skv-border-hover);
    box-shadow: var(--skv-shadow-2);
    transform: translateY(-1px);
}
.skv-card--flat {
    background: var(--skv-glass);
    border: 1px solid var(--skv-border);
    border-radius: var(--skv-radius-md);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.skv-card--flat:hover {
    border-color: var(--skv-border);
    box-shadow: none;
    transform: none;
}

/* ---- Buttons ---- */
.skv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: transparent;
    border: 1px solid var(--skv-border);
    border-radius: var(--skv-radius-md);
    color: var(--skv-text-muted);
    padding: 8px 14px;
    font: 600 var(--fs-caption) var(--skv-font);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 150ms var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1)),
                color 150ms, background 150ms;
}
.skv-btn:hover {
    border-color: var(--skv-border-hover);
    color: #cdd6df;
}
.skv-btn--primary {
    background: var(--skv-accent-dim);
    border-color: var(--skv-accent-glow);
    color: #cfe1f1;
}
.skv-btn--primary:hover {
    background: rgba(92,136,176,0.22);
    border-color: var(--skv-accent-glow);
    color: #cfe1f1;
}
.skv-btn--danger {
    color: #f4a5a5;
    border-color: rgba(239,68,68,0.3);
}

/* ---- Tabs (pill geometry, slate active) ---- */
.skv-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: transparent;
    border: 1px solid var(--skv-border);
    border-radius: var(--skv-radius-pill);
    color: var(--skv-text-muted);
    padding: 8px 14px;
    font: 600 var(--fs-caption) var(--skv-font);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 150ms var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1)),
                color 150ms, background 150ms;
}
.skv-tab:hover {
    border-color: var(--skv-border-hover);
    color: #cdd6df;
}
.skv-tab.active,
.skv-tab[aria-selected="true"] {
    background: var(--skv-accent-dim);
    border-color: var(--skv-accent-glow);
    color: #cfe1f1;
}

/* ---- Inputs ---- */
.skv-input {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--skv-border);
    border-radius: var(--skv-radius-md);
    color: var(--skv-text);
    padding: 8px 12px;
    font: 400 var(--fs-body) var(--skv-font);
    transition: border-color 150ms var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1));
}
.skv-input:focus {
    border-color: var(--skv-accent-glow);
    outline: none;
}

/* ---- Toggle (unscoped generalization of the slate header toggle) ----
   The existing #skv-header .skv-toggle rules win on specificity, so header
   notif toggles are untouched; apps drop their forks and use this bare class.
   34x19 track, slate-dim track + glowing knob when on. */
.skv-toggle {
    position: relative;
    width: 34px;
    height: 19px;
    display: inline-block;
}
.skv-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.skv-toggle .skv-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    transition: background 0.2s var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1));
}
.skv-toggle .skv-toggle-slider::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s var(--skv-ease-out, cubic-bezier(0.22,1,0.36,1)),
                box-shadow 0.2s;
}
.skv-toggle input:checked + .skv-toggle-slider {
    background: var(--skv-accent-dim);
}
.skv-toggle input:checked + .skv-toggle-slider::before {
    transform: translateX(15px);
    background: #cfe1f1;
    box-shadow: 0 0 6px var(--skv-accent-glow);
}

/* ---- Light theme: lift glass surfaces and keep eyebrow readable ---- */
[data-theme="light"] .skv-card {
    background: linear-gradient(rgba(255,255,255,0.55), rgba(255,255,255,0.55)), var(--skv-panel);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .skv-card:hover {
    border-color: rgba(0,0,0,0.14);
}
[data-theme="light"] .skv-card--flat {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .skv-card--flat:hover {
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .skv-eyebrow { color: #6b7280; }
[data-theme="light"] .skv-btn { border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .skv-btn:hover { border-color: rgba(0,0,0,0.14); color: #2f3a44; }
[data-theme="light"] .skv-tab { border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .skv-tab:hover { border-color: rgba(0,0,0,0.14); color: #2f3a44; }
[data-theme="light"] .skv-input {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .skv-toggle .skv-toggle-slider { background: rgba(0,0,0,0.12); }

/* ============================================================
   PHONE CONTRACT (concept D)  -  responsive substrate
   ------------------------------------------------------------
   Additive, opt-in primitives for the small-screen contract:
   named breakpoints, a touch-target floor, a desktop-table ->
   stacked-card reflow, and a dvh / safe-area full-height helper.
   No existing rule above is altered; consumers opt in per element
   and re-pin their skv-shell.css link to ?v=20260608c.
   ============================================================ */
:root {
    /* Named breakpoints (mobile-first reference points). */
    --bp-phone: 480px;
    --bp-tablet: 768px;
    --bp-laptop: 960px;
    --bp-wide: 1280px;

    /* Touch-target floor: full 44px hit area while the visual glyph
       can stay as small as 18px. */
    --skv-touch-min: 44px;
    --skv-touch-glyph: 18px;

    /* Safe-area insets (notch / home-indicator). Resolve to 0px on
       devices without insets, so they are inert on desktop. */
    --skv-safe-top: env(safe-area-inset-top, 0px);
    --skv-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Touch floor: expand the hit area without growing the glyph.
   Applies only on small viewports AND on genuinely coarse pointers,
   so a desktop with a fine pointer keeps compact controls. ---- */
@media (max-width: 960px) {
    .skv-touch {
        min-width: var(--skv-touch-min);
        min-height: var(--skv-touch-min);
    }
}
@media (pointer: coarse) {
    .skv-touch {
        min-width: var(--skv-touch-min);
        min-height: var(--skv-touch-min);
    }
}

/* ---- Collapse table (headline D primitive).
   Desktop: a normal table / grid with a visible header row.
   Under the tablet breakpoint it reflows into stacked glass cards:
   the header hides, each row becomes a card, and each cell shows its
   own label via data-label="..." (set by the app on every <td>).
   The app marks the primary identity cell as the card's first child. ---- */
.skv-collapse-table {
    width: 100%;
    border-collapse: collapse;
}
@media (max-width: 768px) {
    .skv-collapse-table thead {
        display: none;
    }
    .skv-collapse-table tr {
        display: block;
        margin-bottom: var(--space-3);
        background: var(--skv-glass);
        border: 1px solid var(--skv-border);
        border-radius: var(--skv-radius-md);
        padding: var(--space-3);
    }
    .skv-collapse-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: var(--space-4);
        padding: 4px 0;
        border: 0;
        text-align: right;
    }
    .skv-collapse-table td::before {
        content: attr(data-label);
        font: 600 var(--fs-micro)/1 var(--skv-mono);
        letter-spacing: 0.8px;
        text-transform: uppercase;
        color: var(--skv-text-dim);
        text-align: left;
    }
    /* Primary identity cell: the app applies the class to the table and
       the first <td> in each row naturally reads as the card heading. */
    .skv-collapse-table td:where(:first-child) {
        font-weight: 600;
        color: var(--skv-text);
    }
}

/* ---- Light theme: lift the stacked-card surface so it reads on a
   pale background, matching the .skv-card light treatment above. ---- */
@media (max-width: 768px) {
    [data-theme="light"] .skv-collapse-table tr {
        background: rgba(0,0,0,0.02);
        border-color: rgba(0,0,0,0.08);
    }
}

/* ---- Full-height fix: prefer dvh (dynamic viewport height) so mobile
   URL-bar show/hide does not clip fixed full-height panels. The 100vh
   line is the fallback for engines without dvh; the 100dvh line wins
   where supported. Fixed bottom-docked elements should additionally add
   padding-bottom: var(--skv-safe-bottom) so content clears the home
   indicator. Example:
       .my-fixed-bottom-bar { padding-bottom: var(--skv-safe-bottom); }
   ---- */
.skv-vh-fix {
    height: 100vh;
    height: 100dvh;
}

/* ============================================================
   PHONE CONTRACT - mobile design system v1 (2026-06-18)
   ------------------------------------------------------------
   Extends the concept-D substrate above with the two primitives it was
   missing (a per-app bottom action bar and a bottom sheet), a dense-matrix
   horizontal-scroll container, and a card grid. All ADDITIVE and OPT-IN:
   no rule here alters an existing selector, so a page is byte-identical
   until it adds one of these classes and re-pins skv-shell.css to
   ?v=20260618a-de (TeploMap is the first adopter). Slate (--skv-accent
   #5C88B0) is the only accent; gold stays a rare micro-accent.
   Spec: docs/superpowers/specs/2026-06-17-master-mobile-design-system-design.md
   Prototype: /research/mobile-system.html
   ============================================================ */
:root {
    /* complete the safe-area set (top + bottom are defined in the block above) */
    --skv-safe-left: env(safe-area-inset-left, 0px);
    --skv-safe-right: env(safe-area-inset-right, 0px);

    /* alias: the one content breakpoint (= --bp-tablet). Read intent, not a raw number. */
    --bp-content: var(--bp-tablet);

    /* clearance for the floating site-nav trigger (#skv-rail-trigger ~44px at
       top/left 12px) so a top-left app toolbar never tucks under it. */
    --skv-navtrigger-clear: calc(44px + 12px + var(--skv-safe-left));

    /* bottom action bar geometry */
    --skv-actionbar-h: 56px;
    --skv-actionbar-pad-b: calc(8px + var(--skv-safe-bottom));
    --skv-actionbar-total: calc(var(--skv-actionbar-h) + var(--skv-actionbar-pad-b));
    --skv-actionbar-z: 100;

    /* bottom sheet */
    --skv-sheet-radius: 16px;
    --skv-sheet-z: 1100;
}

/* ---- Drawer polish: pad the rail interior past a landscape / installed-PWA
   notch (the floating trigger already clears it via the #skv-rail-trigger rule).
   Side mode + mobile only; resolves to 0px (inert) on non-notched devices. ---- */
@media (max-width: 960px) {
    html[data-skv-nav-mode="side"] .skv-rail {
        padding-top: var(--skv-safe-top);
        padding-left: var(--skv-safe-left);
    }
}

/* ---- Per-app bottom action bar. Fixed to the viewport bottom, glass, clears
   the home indicator. Opt in by rendering .skv-actionbar markup AND adding
   .skv-actionbar-pad to the page's scroll root. Hidden at >=961px where desktop
   chrome takes over. Max ~5 primary targets (a 6th -> a "More" .skv-sheet).
   EMBED: a surface that can be embedded must add its own
   `.embed .skv-actionbar { display:none }` (the bar lives outside #skv-header,
   so the rail's embed-suppression does not reach it). ---- */
.skv-actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--skv-actionbar-z);
    display: flex; align-items: center; gap: var(--space-2);
    height: var(--skv-actionbar-total);
    padding: 0 calc(12px + var(--skv-safe-right)) var(--skv-actionbar-pad-b) calc(12px + var(--skv-safe-left));
    background: var(--skv-panel-dense);
    backdrop-filter: var(--skv-blur); -webkit-backdrop-filter: var(--skv-blur);
    border-top: 1px solid var(--skv-border);
}
.skv-actionbar > * { min-width: 0; }                 /* long content clips inside the bar */
@media (min-width: 961px) { .skv-actionbar { display: none; } }
.skv-actionbar-pad { padding-bottom: var(--skv-actionbar-total); }   /* content clearance */

/* icon-over-label tab variant */
.skv-actionbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    flex: 1; min-width: var(--skv-touch-min); min-height: var(--skv-touch-min);
    border: 0; background: transparent; cursor: pointer;
    color: var(--skv-text-muted); font-family: var(--skv-font); font-size: var(--fs-micro); letter-spacing: 0.3px;
}
.skv-actionbar-item svg {
    width: var(--skv-touch-glyph); height: var(--skv-touch-glyph);
    stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.skv-actionbar-item.active { color: var(--skv-accent); }
.skv-actionbar-item.active svg { filter: drop-shadow(0 0 7px var(--skv-accent-glow)); }

/* segmented pill group variant (mode toggles). Active = slate, never gold. */
.skv-actionbar-seg {
    display: flex; align-items: center; gap: 2px; flex: none; padding: 2px;
    border: 1px solid var(--skv-border); border-radius: var(--skv-radius-pill); background: var(--skv-glass);
}
.skv-actionbar-seg button {
    min-width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer;
    border-radius: var(--skv-radius-pill); color: var(--skv-text-muted);
    font-family: var(--skv-mono); font-size: var(--fs-body); font-weight: 600;
}
.skv-actionbar-seg button.active {
    color: var(--skv-accent); background: var(--skv-accent-dim);
    filter: drop-shadow(0 0 6px var(--skv-accent-glow));
}

/* ---- Bottom sheet: the canonical mobile modal (<=768px). Toggle .is-open on
   BOTH the sheet and its scrim. Dismiss on scrim tap / Esc / downward drag. ---- */
.skv-sheet-scrim {
    position: fixed; inset: 0; z-index: calc(var(--skv-sheet-z) - 1);
    background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
    transition: opacity var(--skv-dur-default) ease;
}
.skv-sheet-scrim.is-open { opacity: 1; pointer-events: auto; }
.skv-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--skv-sheet-z);
    background: var(--skv-panel-dense);
    backdrop-filter: var(--skv-blur); -webkit-backdrop-filter: var(--skv-blur);
    border-top: 1px solid var(--skv-border);
    border-radius: var(--skv-sheet-radius) var(--skv-sheet-radius) 0 0;
    padding: 14px 16px calc(28px + var(--skv-safe-bottom));
    box-shadow: 0 -16px 40px rgba(0,0,0,0.5);
    transform: translateY(100%); transition: transform 0.25s var(--skv-ease-out);
}
.skv-sheet.is-open { transform: translateY(0); }
.skv-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.18); margin: 0 auto 14px; }
[data-theme="light"] .skv-sheet-handle { background: rgba(0,0,0,0.18); }

/* ---- Dense-matrix horizontal scroll (the documented table EXCEPTION). For
   2-D grids where stacking to cards destroys meaning (e.g. strike x expiry).
   Use .skv-collapse-table for record tables; reach for this only for matrices.
   Edge-fade signals more content off-screen; first column can be pinned. ---- */
.skv-scroll-x {
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.skv-scroll-x::-webkit-scrollbar { display: none; }
.skv-scroll-x--sticky1 table th:first-child,
.skv-scroll-x--sticky1 table td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--skv-bg);
    box-shadow: 1px 0 0 var(--skv-border);
}
.skv-scroll-x--sticky1 table thead th:first-child { z-index: 3; background: var(--skv-bg); }

/* ---- Card grid: declarative stacking ladder (1 -> 2 -> 3+ columns by width,
   no per-breakpoint media queries). Compose with the existing .skv-card. ---- */
.skv-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.skv-grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
