
        /* [DESIGN_SYSTEM_TOKEN_DEFINITION] 
           Defines the semantic color palette for both light and dark operational modes.
        */
        :root {
            color-scheme: light dark;
            --bg: #F8F9FA;
            --card: #FFFFFF;
            --card-rgb: 255, 255, 255;
            --surface: #FFFFFF;
            --blue: #4F6EF7;
            --blue-bg: rgba(79,110,247,0.06);
            --blue-light: rgba(79,110,247,0.06);
            --text: #1C1C1E;
            --text-muted: #636366;
            --muted: #8E8E93;
            --border: rgba(0,0,0,0.08);
            --divider: rgba(0,0,0,0.12);
            --red: #FF3B30;
            --red-bg: rgba(255,59,48,0.06);
            --green: #34C759;
            --green-bg: rgba(52,199,89,0.06);
            --orange: #FF9500;
            --orange-bg: rgba(255,149,0,0.06);
            --input-bg: #F5F5F7;
            --input-border: rgba(0,0,0,0.08);
            --input-focus-ring: rgba(79,110,247,0.10);
            --card-shadow:
                0 1px 3px rgba(0,0,0,0.02),
                0 8px 24px rgba(0,0,0,0.04);
        }

        /* [THEME_ADAPTATION: DARK_MODE] 
           Inverts tokens to maintain accessibility and visual consistency in low-light environments.
        */
        body.dark {
            --bg: #000000;
            --card: #1C1C1E;
            --card-rgb: 28, 28, 30;
            --surface: #1C1C1E;
            --border: rgba(255,255,255,0.08);
            --divider: rgba(255,255,255,0.15);
            --text: #FFFFFF;
            --text-muted: #8E8E93;
            --muted: #8E8E93;
            --card-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 4px 20px rgba(0,0,0,0.3);
            --blue: #6B8AFF;
            --blue-bg: rgba(107,138,255,0.10);
            --red-bg: rgba(255,59,48,0.10);
            --green-bg: rgba(52,199,89,0.10);
            --orange-bg: rgba(255,149,0,0.10);
            --input-bg: #1A1A1C;
            --input-border: rgba(255,255,255,0.06);
            --input-focus-ring: rgba(107,138,255,0.12);
        }

        /* [CORE_LAYOUT_RESET] */
        * { 
            box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; 
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE/Edge */
        }
        *::-webkit-scrollbar { display: none; /* Chrome/Safari/Webkit */ }
        html { height: 100%; }

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100dvh;
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
            transition: background 0.3s, color 0.3s;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed; inset: 0;
            background-color: var(--bg);
            background-image:
                linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
            background-size: 40px 40px;
            z-index: 0;
            pointer-events: none;
        }

        body.dark::before {
            background-image:
                linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
        }

        body::after {
            content: '';
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            height: 100px;
            background: var(--bg);
            z-index: -1;
            pointer-events: none;
        }

        /* [LAYOUT_GRID_SYSTEM] 
           Handles responsive behavior between desktop (sidebar) and mobile (bottom-nav) views.
        */
        .app-shell {
            display: grid;
            grid-template-columns: 270px 1fr;
            height: 100dvh;
            overflow: hidden;
            position: relative;
            z-index: 1;
        }

        @media (max-width: 1024px) {
            .app-shell { grid-template-columns: 1fr; height: auto; min-height: 100dvh; overflow: visible; }
            .sidebar { display: none !important; }
            .mobile-nav { display: flex !important; }
            .main-stage { padding-bottom: 120px; height: auto; overflow: visible; }
            body { overflow-y: auto; height: auto; }
        }

        /* [UI_COMPONENT: MOBILE_NAVIGATION] */
        .mobile-nav {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: rgba(var(--card-rgb), 0.8);
            backdrop-filter: blur(20px) saturate(160%);
            -webkit-backdrop-filter: blur(20px) saturate(160%);
            border-top: 1px solid var(--border);
            display: none; justify-content: space-around; align-items: center;
            padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 2000;
            box-shadow: 0 -1px 0 rgba(255,255,255,0.05) inset;
        }
        body.dark .mobile-nav { background: rgba(var(--card-rgb), 0.8); border-top: 1px solid rgba(255,255,255,0.1); }
        .m-nav-item {
            display: flex; flex-direction: column; align-items: center; gap: 6px;
            color: var(--muted); font-size: 0.6875rem; font-weight: 700;
            text-transform: none; letter-spacing: -0.2px;
            user-select: none; cursor: pointer; opacity: 0.6;
            transition: all 0.2s;
        }
        .m-nav-item.active { color: var(--text); opacity: 1; }
        .m-nav-item svg { width: 24px; height: 24px; stroke-width: 2.2; }
        .m-nav-item.active svg { color: var(--blue); }

        /* [UI_COMPONENT: SIDEBAR] 
           Primary desktop navigation containing workspace and account controls.
        */
        .sidebar {
            background: var(--card);
            border-right: 1px solid var(--border);
            padding: 32px 20px;
            display: flex;
            height: 100dvh;
            flex-direction: column;
            overflow-y: auto;
            gap: 6px;
            z-index: 100;
            width: 270px;
            position: relative;
        }

        .sidebar-logo {
            display: flex; align-items: center; gap: 12px;
            padding: 0 12px; margin-bottom: 32px;
        }


        .nav-group-label {
            font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
            color: var(--muted); opacity: 0.8;
            padding: 0 12px; margin: 20px 0 8px;
        }

        .nav-item {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 16px; border-radius: 10px;
            font-size: 0.9375rem; font-weight: 600; color: var(--muted);
            cursor: pointer; transition: all 0.2s cubic-bezier(0.2,0,0,1); user-select: none;
            border: 1px solid transparent;
        }
        .nav-item:hover { background: var(--bg); color: var(--text); }
        .nav-item.active {
            background: var(--blue-bg); color: var(--blue);
        }
        body.dark .nav-item.active { background: var(--blue-bg); color: var(--blue); }
        .nav-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 2; }

        /* [UI_COMPONENT: CREDITS_WIDGET] 
           Visual indicator of business subscription health and lead quotas.
        */
        .credits-pill {
            margin: auto 0 0;
            background: var(--bg);
            border-radius: 14px;
            padding: 20px;
            border: 1px solid var(--border);
        }
        .credits-pill .plan-header {
            display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
        }
        .credits-pill .plan-badge {
            font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
            padding: 4px 12px; border-radius: 99px;
            background: var(--card); border: 1px solid var(--border);
            color: var(--text);
        }
        .credits-pill .bar-track { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
        .credits-pill .bar-fill { height: 100%; border-radius: 99px; background: var(--blue); transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1); }
        .credits-pill .count { font-size: 1.5625rem; font-weight: 900; letter-spacing: -0.8px; line-height: 1; }
        .credits-pill .count span { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-left: 4px; }

        .logout-btn {
            display: flex; align-items: center; gap: 10px;
            padding: 12px 16px; border-radius: 10px; border: none; background: none;
            font-family: inherit; font-size: 0.9375rem; font-weight: 600;
            color: var(--red); cursor: pointer; width: 100%;
            transition: all 0.2s;
        }
        .logout-btn:hover { background: var(--red-bg); }

        .sidebar-bug-link {
            display: block; text-align: center;
            font-size: 0.75rem; font-weight: 600; color: var(--muted);
            text-decoration: none; padding: 8px;
            transition: color 0.15s;
        }
        .sidebar-bug-link:hover { color: var(--text); }

        /* [UI_COMPONENT: MAIN_STAGE] 
           The primary scrollable area where views are rendered and transitioned.
        */
        .main-stage { display: flex; flex-direction: column; overflow-y: auto; min-width: 0; -webkit-overflow-scrolling: touch; }

        .topbar {
            display: flex; align-items: center; justify-content: space-between;
            padding: 32px 40px 20px; flex-shrink: 0; gap: 16px;
        }
        @media (max-width: 1024px) {
            .topbar { padding: 24px 24px 12px; }
        }
        .topbar-left h1 {
            font-size: 1.8125rem; font-weight: 900; letter-spacing: -1px; line-height: 1.15;
        }
        .topbar-left p { font-size: 0.875rem; color: var(--muted); margin-top: 2px; font-weight: 500; }
        .topbar-right { display: flex; align-items: center; gap: 12px; }

        .icon-btn {
            width: 48px; height: 48px; border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--card);
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); color: var(--text);
            box-shadow: 0 1px 2px rgba(0,0,0,0.04);
        }
        .icon-btn:hover { background: var(--bg); transform: translateY(-1px); }
        .icon-btn svg { width: 20px; height: 20px; stroke-width: 2; }

        /* [UI_COMPONENT: VIEW_SECTIONS] 
           Containers for specific application logic (Pipeline, Archive, Settings).
        */
        .view-section { display: none; flex: 1; flex-direction: column; overflow: visible; padding: 0 40px 200px; min-width: 0; min-height: 0; }
        #view-settings { flex: none; padding: 0; }
        @media (max-width: 1024px) {
            .view-section { padding: 0 24px 0; }
            #view-settings { padding: 0; }
        }
        .view-section.active { display: flex; animation: fadeUp 0.35s cubic-bezier(0.2,0,0,1); }
        @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

        /* [CRM_SINGLE_LIST] */
        .status-tab {
            padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--border);
            background: var(--card); color: var(--muted); font-size: 0.75rem; font-weight: 800;
            text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer;
            transition: all 0.2s;
        }
        .status-tab:hover { background: var(--bg); color: var(--text); }
        .status-tab.active { background: #000; color: #fff; border-color: #000; }
        body.dark .status-tab.active { background: var(--blue); border-color: var(--blue); }

        /* [LEAD_CARD: Status-colored edge + subtle card tint, rigid grid] */
        .lead-row {
            display: grid;
            grid-template-columns: 52px 1fr auto auto;
            grid-template-rows: auto auto auto auto;
            gap: 0 16px;
            background: var(--card); border-radius: 16px;
            padding: 18px 20px; margin-bottom: 14px;
            border: 1px solid var(--border);
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
            transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
            user-select: none; position: relative;
        }
        .lead-row:hover { border-color: rgba(0,0,0,0.12); box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
        .lead-row.selected { border: 2.5px solid var(--blue) !important; background: #EEF0FF; }
        body.dark .lead-row.selected { background: #1E2240; }
        .lead-row::before {
            content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px;
            width: 4px; border-radius: 0 4px 4px 0;
            transition: background 0.2s;
        }
        .lead-row.status-pending::before { background: var(--blue); }
        .lead-row.status-contacted::before { background: var(--orange); }
        .lead-row.status-archived::before { background: var(--muted); }
        .lead-row.status-locked::before { background: var(--red); }

        /* Card tint — solid gradient from the status edge (no transparency) */
        .lead-row.status-pending { background: linear-gradient(to right, #EEF2FF 0%, var(--card) 22%); }
        .lead-row.status-contacted { background: linear-gradient(to right, #FFF7ED 0%, var(--card) 22%); }
        .lead-row.status-archived { background: var(--card); }
        .lead-row.status-locked { background: linear-gradient(to right, #FFF0F0 0%, var(--card) 22%); }
        body.dark .lead-row.status-pending { background: linear-gradient(to right, #1A1D33 0%, var(--card) 22%); }
        body.dark .lead-row.status-contacted { background: linear-gradient(to right, #201912 0%, var(--card) 22%); }
        body.dark .lead-row.status-locked { background: linear-gradient(to right, #2C1414 0%, var(--card) 22%); }

        /* Thumbnail — fixed square */
        .lead-row-thumb {
            grid-row: 1;
            width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
            background: #000; position: relative; flex-shrink: 0;
        }
        .lead-row-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
        .lead-row-thumb .play-btn {
            position: absolute; inset: 0; margin: auto;
            width: 26px; height: 26px; background: rgba(255,255,255,0.2);
            backdrop-filter: blur(8px); border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: #fff; cursor: pointer;
        }
        .lead-row-thumb .play-btn svg { width: 12px; height: 12px; }

        /* Info block — name + phone on row 1, description on row 2 */
        .lead-row-info {
            grid-column: 2; grid-row: 1;
            min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px;
        }
        .lead-row-name {
            font-size: 1.0625rem; font-weight: 700; color: var(--text);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .lead-row-phone {
            font-size: 0.875rem; color: var(--text); opacity: 0.65; font-weight: 500;
        }
        .lead-row-desc {
            font-size: 0.875rem; color: var(--text); opacity: 0.55; line-height: 1.4;
            display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
            overflow: hidden;
            cursor: pointer; user-select: none;
            transition: opacity 0.15s;
            grid-column: 1 / -1; grid-row: 2;
            margin-top: 10px;
        }
        .lead-row-desc:hover { opacity: 0.7; }
        .lead-row-desc:active { opacity: 0.85; }
        .lead-row-desc.expanded { -webkit-line-clamp: none; }

        /* Status badge — tinted pill with colored dot, consistent shape for all statuses */
        .lead-row-status {
            font-size: 0.8125rem; font-weight: 600;
            display: flex; align-items: center; gap: 7px;
            padding: 3px 12px; border-radius: 7px;
            white-space: nowrap;
        }
        .lead-row-status::before {
            content: ''; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
        }
        .lead-row-status.status-pending { background: var(--blue-bg); color: var(--blue); }
        .lead-row-status.status-contacted { background: var(--orange-bg); color: var(--orange); }
        .lead-row-status.status-archived { background: var(--bg); color: var(--muted); }
        .lead-row-status.status-locked { background: var(--red-bg); color: var(--red); }
        .lead-row-status.status-pending::before { background: var(--blue); }
        .lead-row-status.status-contacted::before { background: var(--orange); }
        .lead-row-status.status-archived::before { background: var(--muted); }
        .lead-row-status.status-locked::before { background: var(--red); }

        /* Time label — right of status, with optional recency dot */
        .lead-row-time {
            font-size: 0.8125rem; font-weight: 500; color: var(--muted);
            white-space: nowrap;
        }
        /* Meta row — status + time, left-aligned under the description on desktop */
        .lead-row-meta {
            grid-column: 1 / -1; grid-row: 3;
            display: flex; align-items: center; gap: 12px;
            justify-content: flex-start; margin-top: 10px;
        }
        /* Actions bar — full width, row 3 */
        .lead-row-actions {
            grid-column: 1 / -1; grid-row: 4;
            display: flex; gap: 8px; align-items: center;
            flex-wrap: wrap; padding-top: 14px;
            border-top: 1px solid var(--border); margin-top: 12px;
        }

        .row-btn {
            height: 34px; padding: 0 16px; border-radius: 8px; border: none;
            background: #000; color: #fff;
            font-size: 0.8125rem; font-weight: 700;
            cursor: pointer; display: flex; align-items: center; gap: 6px;
            transition: all 0.2s; white-space: nowrap;
        }
        body.dark .row-btn { background: #fff; color: #000; }
        .row-btn:active { transform: scale(0.96); }
        .row-btn.green { background: var(--green); color: #fff; }
        .row-btn.blue { background: var(--blue); color: #fff; }
        .row-btn.orange { background: var(--orange); color: #fff; }
        .row-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
        body.dark .row-btn.ghost { background: transparent; color: var(--muted); }

        .row-btn-icon {
            width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
            background: var(--card); color: var(--text);
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; transition: all 0.2s; flex-shrink: 0;
        }
        .row-btn-icon:hover { background: var(--bg); }
        .row-btn-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }
        body.dark .row-btn-icon { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
        body.dark .row-btn-icon:hover { background: rgba(255,255,255,0.12); }
        .row-btn-icon.scheduled { color: var(--orange); }

        /* (schedule strip removed — ICS download is now an icon button in the actions bar) */

        /* Mobile: simpler stacking */
        @media (max-width: 768px) {
            .lead-row {
                grid-template-columns: 44px 1fr;
                gap: 0 12px;
                padding: 14px 16px;
            }
            .lead-row-thumb { grid-row: 1; width: 44px; height: 44px; }
            .lead-row-info { grid-column: 2; grid-row: 1; }
            .lead-row-desc { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; }
            .lead-row-meta {
                grid-column: 1 / -1; grid-row: 3;
                display: flex; align-items: center; justify-content: space-between;
                gap: 12px; margin-top: 8px;
            }
            .lead-row-actions { grid-row: 4; }
            /* .lead-row-schedule removed */
        }

        /* (schedule modal removed — ICS is generated client-side) */

        /* [UI_UPGRADE: CONTROLS & TRIAGE] */
        .freshness-badge {
            font-size: 0.75rem; font-weight: 700; color: var(--blue);
            display: inline-block; background: var(--blue-bg);
            padding: 2px 10px; border-radius: 6px;
        }

        .filter-pill {
            padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--border);
            background: var(--card); color: var(--muted); font-size: 0.75rem; font-weight: 800;
            text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; transition: all 0.2s;
        }
        .filter-pill.active { background: #000; color: #fff; border-color: #000; }
        body.dark .filter-pill.active { background: var(--blue); border-color: var(--blue); }

        .batch-bar {
            position: fixed; bottom: 24px; left: 50%;
            transform: translateX(-50%) translateY(200px);
            background: var(--card); border: 1px solid var(--border);
            padding: 14px 18px; border-radius: 16px; z-index: 1000;
            box-shadow: 0 20px 60px rgba(0,0,0,0.15);
            transition: transform 0.4s cubic-bezier(0.2,0,0,1), opacity 0.3s;
            opacity: 0; pointer-events: none;
            width: auto; min-width: 340px; max-width: 94vw;
        }
        .batch-bar.open { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
        .batch-bar-inner { display: flex; flex-direction: column; gap: 10px; }
        .batch-bar-top {
            display: flex; align-items: center; justify-content: space-between; gap: 12px;
        }
        .batch-bar-count {
            font-size: 0.9375rem; font-weight: 800; color: var(--text);
            display: flex; align-items: center; gap: 8px;
        }
        .batch-bar-count .dot {
            width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0;
        }
        .batch-bar-breakdown {
            font-size: 0.75rem; font-weight: 600; color: var(--muted);
        }
        .batch-bar-links {
            display: flex; gap: 12px; align-items: center; margin-left: auto;
        }
        .batch-bar-link {
            font-size: 0.75rem; font-weight: 700; color: var(--blue);
            cursor: pointer; background: none; border: none; font-family: inherit;
            transition: opacity 0.15s;
        }
        .batch-bar-link:hover { opacity: 0.7; }
        .batch-bar-actions {
            display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
            padding-top: 10px; border-top: 1px solid var(--border);
        }
        @media (max-width: 600px) {
            .batch-bar { min-width: 0; left: 12px; right: 12px; transform: translateY(200px); }
            .batch-bar.open { transform: translateY(0); }
        }

        /* [UI_COMPONENT: SMS_MODAL] */
        .template-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
        .template-btn {
            width: 100%; padding: 16px; border-radius: 16px; border: 1.5px solid var(--border);
            background: var(--bg); color: var(--text); font-size: 0.875rem; font-weight: 600;
            text-align: left; cursor: pointer; transition: all 0.2s; line-height: 1.4;
        }
        .template-btn:hover { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
        .template-btn:active { transform: scale(0.98); }

        /* [UI_COMPONENT: SETTINGS_ENGINE] */
        .settings-group {
            background: var(--card);
            border-radius: 12px;
            border: 1px solid var(--border);
            overflow: hidden;
        }
        .settings-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 18px; min-height: 50px;
            border-bottom: 1px solid var(--border);
            transition: background 0.15s;
        }
        .settings-item:last-child { border-bottom: none; }
        .settings-item.clickable { cursor: pointer; }
        .settings-item.clickable:hover { background: var(--bg); }
        .settings-item.clickable:active { background: var(--blue-bg); }
        .settings-item-label {
            font-size: 1rem; font-weight: 500; color: var(--text);
            letter-spacing: -0.2px;
        }
        .settings-item-value {
            font-size: 1rem; font-weight: 400; color: var(--text-muted);
            text-align: right; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap;
        }
        .settings-item-value.mono {
            font-family: ui-monospace, SFMono-Regular, monospace;
            background: var(--bg); padding: 2px 8px; border-radius: 5px;
            font-size: 0.875rem; font-weight: 500; border: 1px solid var(--border);
            color: var(--text);
        }
        .settings-item-end {
            display: flex; align-items: center; gap: 2px; flex-shrink: 0;
        }
        .settings-chevron {
            width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; opacity: 0.3;
            transition: opacity 0.15s;
        }
        .settings-item.clickable:hover .settings-chevron { opacity: 0.6; }
        .settings-toggle-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 18px; min-height: 50px;
        }

        /* [UI_COMPONENT: SETTINGS_CARD] */
        .settings-card {
            background: var(--card);
            border-radius: 16px;
            border: 1px solid var(--border);
            padding: 24px;
            margin: 20px 40px 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.02);
            scroll-margin-top: 80px;
        }
        .settings-card:last-child { margin-bottom: 40px; }
        .settings-card-header {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            margin-bottom: 20px;
        }
        .settings-card-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: var(--blue-bg);
            color: var(--blue);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .settings-card-icon svg {
            width: 20px;
            height: 20px;
            stroke-width: 2;
        }
        .settings-card-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.3px;
            margin-bottom: 2px;
            line-height: 1.3;
        }
        .settings-card-desc {
            font-size: 0.8125rem;
            color: var(--muted);
            font-weight: 500;
            line-height: 1.4;
        }

        @media (max-width: 1024px) {
            .settings-card {
                margin: 16px 24px 0;
            }
            .settings-card:last-child { margin-bottom: 120px; }
        }

        /* [UI_COMPONENT: SHUTDOWN_EXPORT] */
        .sx-hint {
            font-size: 0.8125rem; color: var(--muted); font-weight: 500;
            line-height: 1.45; margin-top: 12px;
        }
        .sx-summary {
            display: flex; align-items: center; justify-content: space-between;
            gap: 12px; margin-bottom: 12px;
        }
        .sx-summary-count {
            font-size: 0.9375rem; font-weight: 700; color: var(--text);
            letter-spacing: -0.2px;
        }
        .sx-summary-count strong { color: var(--blue); }
        .sx-refresh {
            background: none; border: none; font-family: inherit;
            font-size: 0.75rem; font-weight: 700; color: var(--muted);
            cursor: pointer; padding: 4px 6px; border-radius: 6px;
            transition: color 0.15s, background 0.15s;
        }
        .sx-refresh:hover { color: var(--text); background: var(--bg); }
        .sx-toolbar {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            padding: 10px 12px; border: 1px solid var(--border);
            border-radius: 12px; background: var(--bg); margin-bottom: 12px;
        }
        .sx-check {
            display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
            font-size: 0.8125rem; font-weight: 700; color: var(--text);
            user-select: none;
        }
        .sx-check input {
            position: absolute; opacity: 0; width: 0; height: 0;
        }
        .sx-box {
            width: 18px; height: 18px; border-radius: 5px;
            border: 1.5px solid var(--border); background: var(--card);
            display: inline-flex; align-items: center; justify-content: center;
            transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
            flex-shrink: 0;
        }
        .sx-box svg {
            width: 11px; height: 11px; stroke: #fff; stroke-width: 3;
            fill: none; opacity: 0; transition: opacity 0.12s;
        }
        .sx-check input:checked + .sx-box {
            background: var(--blue); border-color: var(--blue);
        }
        .sx-check input:checked + .sx-box svg { opacity: 1; }
        .sx-check input:focus-visible + .sx-box {
            box-shadow: 0 0 0 3px var(--input-focus-ring);
        }
        .sx-spacer { flex: 1; }
        .sx-count { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
        .sx-copy {
            background: none; border: 1px solid var(--border);
            font-family: inherit; font-size: 0.75rem; font-weight: 700;
            color: var(--text); padding: 8px 12px; border-radius: 9px;
            cursor: pointer; transition: background 0.15s;
        }
        .sx-copy:hover { background: var(--card); }
        .sx-list {
            max-height: 340px; overflow-y: auto;
            border: 1px solid var(--border); border-radius: 12px;
            scrollbar-width: thin;
        }
        .sx-list::-webkit-scrollbar { display: block; width: 8px; }
        .sx-list::-webkit-scrollbar-thumb {
            background: var(--border); border-radius: 99px;
        }
        .sx-row {
            display: flex; align-items: center; gap: 12px;
            padding: 11px 14px; border-bottom: 1px solid var(--border);
            transition: background 0.15s;
        }
        .sx-row:last-child { border-bottom: none; }
        .sx-row:hover { background: var(--bg); }
        .sx-row.done { background: var(--blue-bg); }
        .sx-row-main { flex: 1; min-width: 0; }
        .sx-row-name {
            font-size: 0.875rem; font-weight: 600; color: var(--text);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .sx-row-date {
            font-size: 0.75rem; font-weight: 500; color: var(--muted);
            margin-top: 2px;
        }
        .sx-dl {
            width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
            border: 1px solid var(--border); background: var(--card);
            color: var(--text); display: inline-flex; align-items: center;
            justify-content: center; cursor: pointer;
            transition: border-color 0.15s, color 0.15s, background 0.15s;
        }
        .sx-dl:hover {
            border-color: var(--blue); color: var(--blue); background: var(--blue-bg);
        }
        .sx-dl svg { width: 16px; height: 16px; stroke-width: 2; }
        .sx-note {
            font-size: 0.75rem; color: var(--muted); font-weight: 500;
            line-height: 1.5; margin-top: 10px;
        }
        .sx-empty {
            font-size: 0.875rem; color: var(--muted); font-weight: 500;
            padding: 4px 0 12px;
        }
        .sx-error {
            font-size: 0.8125rem; color: var(--red); font-weight: 600;
        }
        .sx-actions {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
        }

        .settings-label {
            display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted);
            text-transform: uppercase; letter-spacing: 0.10em;
            margin-bottom: 10px; margin-top: 22px;
        }
        .settings-label:first-child { margin-top: 0; }
        .settings-input {
            width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
            border: 1px solid var(--input-border);
            background: var(--input-bg); color: var(--text);
            font-family: inherit; font-size: 1rem; font-weight: 400;
            transition: border-color 0.15s, box-shadow 0.15s;
            -webkit-appearance: none; appearance: none;
        }
        .settings-input::placeholder { color: var(--muted); opacity: 0.5; }
        .settings-input:focus {
            outline: none;
            border-color: var(--blue);
            box-shadow: 0 0 0 3px var(--input-focus-ring);
        }

        .btn-primary-sm {
            padding: 0 20px; height: 40px;
            background: var(--text); color: var(--bg);
            border: none; border-radius: 10px;
            font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.1px;
            cursor: pointer; transition: all 0.15s;
            display: inline-flex; align-items: center; justify-content: center;
            -webkit-appearance: none; appearance: none; user-select: none;
            text-align: center; line-height: 1;
        }
        .btn-primary-sm:hover { opacity: 0.85; }
        .btn-primary-sm:active { transform: scale(0.97); opacity: 0.8; }
        .btn-primary-sm:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
        .btn-primary-sm.primary-accent {
            background: var(--blue); color: #fff;
        }
        .btn-primary-sm.primary-accent:hover { opacity: 0.9; }
        body.dark .btn-primary-sm { background: #fff; color: #000; }
        body.dark .btn-primary-sm.primary-accent { background: var(--blue); color: #fff; }

        .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
        .toggle-label { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
        .switch { position: relative; display: inline-block; width: 44px; height: 24px; }
        .switch input { display: none; }
        .slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--border); transition: .2s; border-radius: 24px; }
        .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .2s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
        input:checked + .slider { background-color: var(--green); }
        body.dark input:checked + .slider { background-color: var(--blue); }
        input:checked + .slider:before { transform: translateX(20px); }

        /* .danger-btn moved to Apple-style block below */

        /* [UI_COMPONENT: NOTIFICATION_SYSTEM]
           Base toast styles + containers live in shared.css (single source of truth).
           The portal only offsets the top-right chip so it clears the topbar. */
        #toast-container { top: 112px; right: 40px; }
        @media (max-width: 1024px) { #toast-container { top: 88px; right: 24px; } }

        /* [UI_COMPONENT: MODAL_ENGINE] */
        .modal-backdrop {
            position: fixed; inset: 0; background: rgba(0,0,0,0.5);
            backdrop-filter: blur(16px); z-index: 500;
            display: none; align-items: center; justify-content: center; padding: 20px;
            transition: all 0.3s;
        }
        .modal-backdrop.open { display: flex; }
        .modal {
            background: var(--card); border-radius: 16px; padding: 28px;
            width: 100%; max-width: 440px; border: 1px solid var(--border);
            box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 0 24px 80px rgba(0,0,0,0.15);
            animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1);
            position: relative;
        }
        body.dark .modal {
            box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 80px rgba(0,0,0,0.4);
        }
        @keyframes popIn { from { opacity:0; transform:scale(0.96) translateY(12px); } to { opacity:1; transform:scale(1) translateY(0); } }
        
        .modal-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.3px; color: var(--text); margin-bottom: 2px; }
        .modal-sub { font-size: 0.9375rem; color: var(--muted); margin-bottom: 24px; font-weight: 500; line-height: 1.4; }
        
        .modal-input {
            width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
            border: 1px solid var(--input-border);
            background: var(--input-bg); color: var(--text);
            font-family: inherit; font-size: 1rem; font-weight: 400;
            transition: border-color 0.15s, box-shadow 0.15s;
            margin-bottom: 18px;
            -webkit-appearance: none; appearance: none;
        }
        .modal .apple-btn {
            padding: 0 14px;
        }
        .modal-input::placeholder { color: var(--muted); opacity: 0.5; }
        .modal-input:focus {
            outline: none;
            border-color: var(--blue);
            box-shadow: 0 0 0 3px var(--input-focus-ring);
        }
        
        /* [UI_COMPONENT: PASSWORD_TOGGLE] */
        .pass-wrapper { position: relative; margin-bottom: 18px; }
        .pass-wrapper .modal-input { margin-bottom: 0; padding-right: 44px; }
        .toggle-password {
            position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
            cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center;
            transition: color 0.15s; z-index: 10; width: 38px; height: 38px; border-radius: 8px;
        }
        .toggle-password:hover { color: var(--text); }
        .toggle-password svg { width: 18px; height: 18px; stroke-width: 2; }

        .modal-group {
            margin-bottom: 0;
        }
        .modal-group:last-child { margin-bottom: 0; }
        .modal-group-label {
            font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
            letter-spacing: 0.10em; color: var(--muted); margin-bottom: 18px;
        }
        .modal-divider {
            height: 1px; background: var(--border);
            margin: 24px 0 24px;
        }

        .delete-header {
            text-align: center; margin-bottom: 24px;
        }
        .delete-icon {
            width: 48px; height: 48px; background: var(--red-bg);
            border-radius: 12px; display: flex; align-items: center; justify-content: center;
            color: var(--red); margin: 0 auto 14px;
        }
        .delete-confirm-box {
            background: var(--bg); padding: 16px 20px; border-radius: 12px;
            margin-bottom: 24px; border: 1px solid var(--border);
        }

        .template-btn {
            width: 100%; padding: 16px 20px; border-radius: 12px; border: 1px solid var(--border);
            background: var(--card); color: var(--text); text-align: left;
            font-size: 0.9375rem; font-weight: 600; margin-bottom: 10px;
            cursor: pointer; transition: all 0.15s;
        }
        .template-btn:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
        .template-btn:active { transform: scale(0.985); }

        /* [MINIMAL: SETTINGS_DIVIDER] */
        .settings-divider {
            height: 1px;
            background: var(--border);
            margin: 0 0 36px;
        }

        /* [MINIMAL: SECTION_HEADER] */
        .settings-section-header {
            margin-bottom: 18px;
        }

        /* [MINIMAL: BUTTON] */
        .apple-btn {
            display: inline-flex; align-items: center; justify-content: center;
            padding: 0 24px; height: 44px; border-radius: 10px;
            border: none; background: var(--blue);
            color: #fff; font-family: inherit; font-size: 1rem; font-weight: 600;
            cursor: pointer; transition: all 0.15s;
            -webkit-appearance: none; appearance: none; user-select: none;
            text-align: center; line-height: 1;
        }
        .apple-btn:hover { opacity: 0.9; }
        .apple-btn:active { transform: scale(0.97); }
        .apple-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
        .apple-btn.secondary {
            background: transparent; color: var(--text);
            border: 1px solid var(--border); box-shadow: none;
        }
        .apple-btn.secondary:hover { background: var(--bg); opacity: 1; }
        .apple-btn.destructive { background: var(--red); }

        /* [MINIMAL: HELPER_TEXT] */
        .apple-helper {
            font-size: 0.8125rem; color: var(--muted); font-weight: 500;
            margin-top: -12px; margin-bottom: 18px; line-height: 1.4;
        }
        .apple-helper.warning { color: var(--orange); }

        /* [MINIMAL: DELETE_CHECKBOX] */
        .delete-check-label {
            display: flex; align-items: flex-start; gap: 12px;
            font-size: 0.9375rem; font-weight: 500; color: var(--text);
            cursor: pointer; line-height: 1.5;
        }
        .delete-check-label input[type="checkbox"] {
            margin-top: 2px; width: 18px; height: 18px;
            accent-color: var(--red); flex-shrink: 0; cursor: pointer;
        }

        /* [MINIMAL: DELETE] */
        .delete-header { text-align: center; margin-bottom: 20px; }
        .delete-icon {
            width: 44px; height: 44px; background: var(--red-bg);
            border-radius: 10px; display: flex; align-items: center; justify-content: center;
            color: var(--red); margin: 0 auto 12px;
        }
        .delete-confirm-box {
            background: var(--bg); padding: 14px 18px; border-radius: 10px;
            margin-bottom: 20px; border: 1px solid var(--border);
        }

        .danger-btn {
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            padding: 0 24px; height: 46px;
            background: var(--red); color: #fff;
            border: none; border-radius: 10px;
            font-weight: 600; font-size: 1rem; cursor: pointer;
            transition: all 0.15s;
            -webkit-appearance: none; appearance: none;
        }
        .danger-btn:hover { opacity: 0.9; }
        .danger-btn:active { transform: scale(0.97); }
        .danger-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

        .spinning svg { animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        #refresh-btn.hidden { display: none; }

        /* [MINIMAL: CODE_BLOCK] */
        .code-block {
            background: var(--input-bg); color: var(--text-muted); border-radius: 10px;
            padding: 14px; font-family: ui-monospace, SFMono-Regular, monospace;
            font-size: 0.6875rem; line-height: 1.5; overflow-x: auto;
            white-space: pre; word-break: normal;
            border: 1px solid var(--border); margin-bottom: 14px;
            -webkit-overflow-scrolling: touch;
        }
        body.dark .code-block { color: #A0A0B0; }

        /* [MINIMAL: WIDGET_LINK] */
        .widget-link-card {
            background: var(--card); border-radius: 12px;
            border: 1px solid var(--border); padding: 16px;
            margin-top: 16px;
        }
        .widget-link-label {
            font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
            letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px;
        }
        .widget-link-row {
            display: flex; align-items: center; gap: 10px;
        }
        .widget-link-url {
            flex: 1; font-family: ui-monospace, SFMono-Regular, monospace;
            font-size: 0.875rem; color: var(--text); font-weight: 600;
            padding: 10px 14px; background: var(--input-bg);
            border-radius: 8px; border: 1px solid var(--border);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .widget-link-copy-btn {
            display: inline-flex; align-items: center; justify-content: center;
            padding: 8px; border-radius: 8px;
            border: 1px solid var(--border); background: var(--card);
            font-family: inherit; font-size: 0.875rem; font-weight: 600;
            color: var(--text); cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
            min-width: 36px; min-height: 36px;
        }
        .widget-link-copy-btn:hover { background: var(--bg); border-color: var(--muted); }
        .widget-link-desc { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; line-height: 1.5; font-weight: 500; }

        .widget-link-qr-row {
            display: flex; align-items: center; gap: 14px;
            margin-top: 10px; padding-top: 10px;
            border-top: 1px solid var(--border-light);
        }
        .widget-link-qr-canvas {
            background: #fff; padding: 6px;
            border-radius: 10px; border: 1px solid var(--border);
            line-height: 0; overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            transition: transform 0.2s cubic-bezier(0.2,0,0,1);
            flex-shrink: 0;
            width: fit-content;
        }
        .widget-link-qr-canvas:hover { transform: scale(1.03); }
        .widget-link-qr-canvas canvas {
            width: 80px; height: 80px; display: block;
        }
        .widget-link-qr-actions {
            display: flex; flex-direction: column; gap: 6px;
        }
        .widget-link-qr-btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 14px; border-radius: 8px;
            border: 1px solid var(--border); background: var(--card);
            font-family: inherit; font-size: 0.8125rem; font-weight: 600;
            color: var(--text); cursor: pointer; white-space: nowrap;
            transition: background 0.15s, border-color 0.15s;
        }
        .widget-link-qr-btn:hover { background: var(--bg); border-color: var(--muted); }
        .widget-link-qr-btn svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--blue); }
        .widget-link-qr-hint { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; font-weight: 500; }

        .skeleton-pulse {
            background: linear-gradient(90deg, var(--bg) 25%, rgba(128,128,128,0.08) 50%, var(--bg) 75%);
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.2s ease-in-out infinite;
            border-radius: 8px;
        }
        @keyframes skeleton-shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .skeleton-row {
            display: flex; align-items: center; gap: 14px;
            padding: 16px 18px; border-bottom: 1px solid var(--border);
        }
        .skeleton-thumb { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
        .skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
        .skeleton-line { height: 12px; }
        .skeleton-line.w-30 { width: 30%; }
        .skeleton-line.w-50 { width: 50%; }
        .skeleton-line.w-70 { width: 70%; }
        .skeleton-line-sm { height: 10px; width: 20%; }


        /* ============================================================
           ONBOARDING DESIGN SYSTEM
           Welcome modal, theme picker, spotlight tour, coach bubbles
           z-index hierarchy: modal-backdrop 500, batch-bar 1000,
           mobile-nav 2000, onboarding 5000+
           ============================================================ */

        /* --- Onboarding Backdrop ---
           Fixed full-viewport dim overlay with backdrop blur.
           z-index: 5000 — above mobile-nav (2000), batch-bar (1000), modal-backdrop (500).
        */
        .onboarding-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 5000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }
        .onboarding-backdrop.open { display: flex; }
        body.dark .onboarding-backdrop { background: rgba(0, 0, 0, 0.7); }

        /* --- Welcome Card ---
           Centered card matching .settings-card / .modal aesthetic.
           border-radius: 20px, border, shadow, bg var(--card).
        */
        .onboarding-welcome {
            background: var(--card);
            border-radius: 20px;
            border: 1px solid var(--border);
            padding: 36px 32px;
            width: 100%;
            max-width: 420px;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 0 24px 80px rgba(0,0,0,0.15);
            animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1);
            text-align: center;
            position: relative;
        }
        body.dark .onboarding-welcome {
            box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 80px rgba(0,0,0,0.4);
        }

        .onboarding-welcome h2 {
            font-size: 1.375rem;
            font-weight: 800;
            letter-spacing: -0.5px;
            color: var(--text);
            margin-bottom: 6px;
        }
        .onboarding-welcome p {
            font-size: 0.9375rem;
            color: var(--muted);
            font-weight: 500;
            line-height: 1.5;
            margin-bottom: 28px;
        }

        /* --- Theme Picker Container --- */
        .theme-picker {
            display: flex;
            gap: 12px;
            margin-bottom: 28px;
        }

        /* --- Theme Option Cards ---
           Two selectable preference cards (Light / Dark) with icon + label.
           Selected state ring using var(--blue); hover state.
        */
        .theme-option {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            padding: 20px 16px;
            border-radius: 14px;
            border: 2px solid var(--border);
            background: var(--bg);
            color: var(--muted);
            font-size: 0.875rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.2,0,0,1);
            user-select: none;
        }
        .theme-option:hover {
            border-color: var(--blue);
            background: var(--blue-bg);
            color: var(--text);
        }
        .theme-option.selected {
            border-color: var(--blue);
            background: var(--blue-bg);
            color: var(--blue);
            box-shadow: 0 0 0 3px var(--input-focus-ring);
        }
        .theme-option svg {
            width: 28px;
            height: 28px;
            stroke-width: 1.8;
        }

        /* --- Welcome Actions --- */
        .onboarding-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .onboarding-continue-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 24px;
            height: 44px;
            border-radius: 10px;
            border: none;
            background: var(--blue);
            color: #fff;
            font-family: inherit;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s;
            width: 100%;
        }
        .onboarding-continue-btn:hover { opacity: 0.9; }
        .onboarding-continue-btn:active { transform: scale(0.97); }
        .onboarding-continue-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

        .onboarding-skip-link {
            font-size: 0.8125rem;
            font-weight: 600;
            color: var(--muted);
            cursor: pointer;
            background: none;
            border: none;
            font-family: inherit;
            text-decoration: none;
            transition: color 0.15s;
        }
        .onboarding-skip-link:hover { color: var(--text); }

        /* --- Tour Overlay ---
           Fixed full-viewport transparent layer. JS toggles pointer-events.
        */
        .tour-overlay {
            position: fixed;
            inset: 0;
            z-index: 5000;
            pointer-events: none;
        }

        /* --- Spotlight ---
           Highlight ring around tour target. Positioned absolute (JS sets top/left/width/height).
           Box-shadow: 4px ring in var(--blue) + large soft dim via9999px spread.
        */
        .spotlight {
            position: absolute;
            border-radius: 12px;
            box-shadow:
                0 0 0 4px var(--blue),
                0 0 0 9999px rgba(0,0,0,0.45);
            transition: all 0.35s cubic-bezier(0.2,0,0,1);
            pointer-events: none;
        }
        body.dark .spotlight {
            box-shadow:
                0 0 0 4px var(--blue),
                0 0 0 9999px rgba(0,0,0,0.65);
        }

        /* --- Coach Bubble ---
           Tooltip card positioned viewport-relative by JS.
           Arrow pointing at target; uses var(--card)/var(--text)/var(--blue)/var(--muted).
        */
        .coach-bubble {
            position: fixed;
            z-index: 5001;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 20px 24px;
            max-width: 340px;
            min-width: 260px;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.03), 0 16px 48px rgba(0,0,0,0.12);
            animation: fadeUp 0.3s cubic-bezier(0.2,0,0,1);
            pointer-events: auto;
        }
        body.dark .coach-bubble {
            box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 16px 48px rgba(0,0,0,0.4);
        }

        .coach-bubble-step {
            font-size: 0.6875rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .coach-bubble-title {
            font-size: 0.9375rem;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.2px;
            margin-bottom: 4px;
        }

        .coach-bubble-subtitle {
            font-size: 0.8125rem;
            color: var(--muted);
            font-weight: 500;
            line-height: 1.5;
            margin-bottom: 16px;
        }

        /* --- Coach Bubble Arrow ---
           CSS triangle pointing at target. Position set by JS via data-pos attribute.
        */
        .coach-bubble-arrow {
            position: absolute;
            width: 12px;
            height: 12px;
            background: var(--card);
            border: 1px solid var(--border);
            transform: rotate(45deg);
            z-index: -1;
        }
        .coach-bubble-arrow[data-pos="top"] {
            bottom: -7px;
            left: 50%;
            margin-left: -6px;
            border-top: none;
            border-left: none;
        }
        .coach-bubble-arrow[data-pos="bottom"] {
            top: -7px;
            left: 50%;
            margin-left: -6px;
            border-bottom: none;
            border-right: none;
        }
        .coach-bubble-arrow[data-pos="left"] {
            right: -7px;
            top: 50%;
            margin-top: -6px;
            border-bottom: none;
            border-left: none;
        }
        .coach-bubble-arrow[data-pos="right"] {
            left: -7px;
            top: 50%;
            margin-top: -6px;
            border-top: none;
            border-right: none;
        }

        /* --- Coach Bubble Actions ---
           Prev/Next/Finish buttons styled like .row-btn pattern.
           Skip link right-aligned.
        */
        .coach-bubble-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .coach-btn-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 18px;
            height: 34px;
            border-radius: 8px;
            border: none;
            background: var(--blue);
            color: #fff;
            font-family: inherit;
            font-size: 0.8125rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .coach-btn-primary:hover { opacity: 0.9; }
        .coach-btn-primary:active { transform: scale(0.96); }

        .coach-btn-ghost {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 14px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--muted);
            font-family: inherit;
            font-size: 0.8125rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .coach-btn-ghost:hover { background: var(--bg); color: var(--text); }
        .coach-btn-ghost:active { transform: scale(0.96); }

        .coach-skip {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--muted);
            cursor: pointer;
            background: none;
            border: none;
            font-family: inherit;
            padding: 0;
            margin-left: auto;
            transition: color 0.15s;
        }
        .coach-skip:hover { color: var(--text); }

        /* ============================================================
           RESPONSIVE: ONBOARDING (1024px breakpoint)
           Coach bubbles bottom-anchored, near-full-width.
           Welcome card max-width 94vw.
           ============================================================ */
        @media (max-width: 1024px) {
            .onboarding-welcome {
                max-width: 94vw;
                padding: 28px 24px;
            }

            .coach-bubble {
                position: fixed;
                bottom: 100px;
                left: 50%;
                transform: translateX(-50%);
                right: auto;
                top: auto;
                max-width: 94vw;
                min-width: 0;
                width: 94vw;
            }
            .coach-bubble-arrow { display: none; }
        }
