/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    color-scheme: light;

    /* Core palette — oklch for perceptual uniformity */
    --bg: oklch(96.5% 0.004 264);
    --surface: oklch(100% 0 0);
    --text: oklch(13% 0.005 264);
    --text-secondary: oklch(58% 0.008 264);
    --separator: oklch(40% 0.01 264 / 0.12);

    /* Surface elevation (NEW — semantic layering) */
    --surface-1: oklch(100% 0 0);
    --surface-2: oklch(98.5% 0.003 264);
    --surface-3: oklch(96.5% 0.004 264);

    /* Glass accent (NEW — for cards/modals; use only where WCAG-AA is met) */
    --glass-bg: oklch(100% 0 0 / 0.72);
    --glass-border: oklch(100% 0 0 / 0.18);

    /* Accent — blue */
    --accent: oklch(55% 0.22 264);
    --accent-hover: oklch(50% 0.22 264);
    --accent-active: oklch(44% 0.22 264);
    --accent-light: oklch(55% 0.22 264 / 0.10);

    /* Semantic colors */
    --success: oklch(68% 0.20 142);
    --success-hover: oklch(62% 0.20 142);
    --success-light: oklch(68% 0.20 142 / 0.10);
    --warning: oklch(72% 0.19 60);
    --warning-hover: oklch(65% 0.19 60);
    --warning-light: oklch(72% 0.19 60 / 0.10);
    --danger: oklch(60% 0.24 27);
    --danger-hover: oklch(54% 0.24 27);
    --danger-light: oklch(60% 0.24 27 / 0.10);
    --purple: oklch(58% 0.22 308);
    --purple-light: oklch(58% 0.22 308 / 0.10);
    --pink: oklch(60% 0.24 358);
    --pink-light: oklch(60% 0.24 358 / 0.10);
    --teal: oklch(78% 0.14 208);
    --teal-light: oklch(78% 0.14 208 / 0.10);
    --indigo: oklch(52% 0.22 280);
    --indigo-light: oklch(52% 0.22 280 / 0.10);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;

    /* Typography scale — strict 8-step hierarchy */
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 15px;
    --fs-xl: 16px;
    --fs-2xl: 18px;
    --fs-3xl: 22px;
    --fs-4xl: 28px;
    --fs-5xl: 34px;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;
    --lh-tight: 1.3;
    --lh-snug: 1.4;
    --lh-normal: 1.5;
    --lh-relaxed: 1.6;

    /* Spacing scale — multiples of 4 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Border radius scale */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Shadow elevation — 5 levels, soft multi-layer (issue #62 + #235) */
    --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.04), 0 0 1px oklch(0% 0 0 / 0.03);
    --shadow-sm: 0 1px 4px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
    --shadow-md: 0 4px 16px oklch(0% 0 0 / 0.07), 0 2px 6px oklch(0% 0 0 / 0.04), 0 0 1px oklch(0% 0 0 / 0.04);
    --shadow-lg: 0 8px 28px oklch(0% 0 0 / 0.09), 0 4px 10px oklch(0% 0 0 / 0.05), 0 0 1px oklch(0% 0 0 / 0.04);
    --shadow-xl: 0 20px 48px oklch(0% 0 0 / 0.11), 0 8px 20px oklch(0% 0 0 / 0.07), 0 0 1px oklch(0% 0 0 / 0.04);
    --shadow-btn: 0 1px 3px oklch(0% 0 0 / 0.06), 0 0 1px oklch(0% 0 0 / 0.04);
    --shadow-btn-hover: 0 3px 10px oklch(0% 0 0 / 0.11), 0 1px 4px oklch(0% 0 0 / 0.06);
    --shadow-focus: 0 0 0 3px var(--accent-light);

    /* Motion */
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 300ms;
    --duration-fast: 150ms;
    --duration-base: 200ms;
    --duration-slow: 300ms;
}

[data-theme="dark"] {
    color-scheme: dark;

    /* Core palette */
    --bg: oklch(8% 0.005 264);
    --surface: oklch(13% 0.005 264);
    --text: oklch(100% 0 0);
    --text-secondary: oklch(62% 0.008 264);
    --separator: oklch(55% 0.01 264 / 0.40);

    /* Surface elevation */
    --surface-1: oklch(14% 0.006 264);
    --surface-2: oklch(17% 0.006 264);
    --surface-3: oklch(20% 0.007 264);

    /* Glass accent */
    --glass-bg: oklch(13% 0.005 264 / 0.80);
    --glass-border: oklch(100% 0 0 / 0.10);

    /* Accent — stays vivid in dark */
    --accent-light: oklch(55% 0.22 264 / 0.20);
    --success-light: oklch(68% 0.20 142 / 0.20);
    --warning-light: oklch(72% 0.19 60 / 0.20);
    --danger-light: oklch(60% 0.24 27 / 0.20);
    --purple-light: oklch(58% 0.22 308 / 0.20);
    --pink-light: oklch(60% 0.24 358 / 0.20);
    --teal-light: oklch(78% 0.14 208 / 0.20);
    --indigo-light: oklch(52% 0.22 280 / 0.20);

    /* Softer shadows in dark mode — multi-layer, low opacity (issue #62 + #235) */
    --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.28), 0 0 1px oklch(0% 0 0 / 0.18);
    --shadow-sm: 0 1px 4px oklch(0% 0 0 / 0.32), 0 1px 2px oklch(0% 0 0 / 0.22);
    --shadow-md: 0 4px 16px oklch(0% 0 0 / 0.38), 0 2px 6px oklch(0% 0 0 / 0.24), 0 0 1px oklch(0% 0 0 / 0.18);
    --shadow-lg: 0 8px 28px oklch(0% 0 0 / 0.44), 0 4px 10px oklch(0% 0 0 / 0.28), 0 0 1px oklch(0% 0 0 / 0.18);
    --shadow-xl: 0 20px 48px oklch(0% 0 0 / 0.52), 0 8px 20px oklch(0% 0 0 / 0.32), 0 0 1px oklch(0% 0 0 / 0.18);
    --shadow-btn: 0 1px 3px oklch(0% 0 0 / 0.28), 0 0 1px oklch(0% 0 0 / 0.18);
    --shadow-btn-hover: 0 3px 10px oklch(0% 0 0 / 0.40), 0 1px 4px oklch(0% 0 0 / 0.24);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
    font-size: inherit;
    color: inherit;
}
input, textarea, select {
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    width: 100%;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { resize: vertical; min-height: 100px; }
a { color: var(--accent); text-decoration: none; }

/* ================================================================
   LAYOUT
   ================================================================ */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}
.app-container.leadgen-wide {
    max-width: 100%;
    padding: 20px 32px;
}
@media (max-width: 600px) {
    .app-container { padding: 16px; padding-bottom: 80px; }
}

/* ================================================================
   TYPOGRAPHY
   ================================================================ */
.page-title {
    font-family: var(--font-display);
    font-size: var(--fs-5xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.5px;
    margin-bottom: var(--space-2);
    line-height: var(--lh-tight);
}
.page-subtitle {
    font-size: var(--fs-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    line-height: var(--lh-normal);
}
.section-title {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.3px;
    margin-bottom: var(--space-5);
    line-height: var(--lh-tight);
}

/* ================================================================
   CARD
   ================================================================ */
.card {
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    border: 1px solid var(--separator);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-weight: 600;
    font-size: 16px;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    box-shadow: var(--shadow-btn);
    letter-spacing: 0.01em;
}
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
    box-shadow: var(--shadow-btn-hover);
}
.btn-primary:active { transform: scale(0.98); box-shadow: var(--shadow-btn); }
.btn-secondary {
    background: var(--accent-light);
    color: var(--accent);
}
.btn-secondary:hover {
    background: oklch(55% 0.22 264 / 0.15);
    box-shadow: var(--shadow-btn-hover);
}
.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
}
.btn-danger:hover {
    background: oklch(60% 0.24 27 / 0.15);
    box-shadow: var(--shadow-btn-hover);
}
.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: var(--radius-md); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ================================================================
   DASHBOARD TILES
   ================================================================ */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-5);
}
@media (max-width: 768px) {
    .tiles-grid { gap: var(--space-4); }
}
@media (max-width: 400px) {
    .tiles-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}
.tile {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile:active { transform: scale(0.97); }
.tile-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.tile-icon.blue { background: var(--accent-light); }
.tile-icon.green { background: var(--success-light); }
.tile-icon.orange { background: var(--warning-light); }
.tile-icon.purple { background: var(--purple-light); }
.tile-icon.pink { background: var(--pink-light); }
.tile-icon.teal { background: var(--teal-light); }
.tile-icon.indigo { background: var(--indigo-light); }
.tile-icon.red { background: var(--danger-light); }
.tile-icon.gray { background: var(--separator); }
.tile-icon svg { width: 28px; height: 28px; display: block; flex-shrink: 0; }
.tile-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.tile .lock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--warning-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
.tile.locked { opacity: 0.7; }

/* ================================================================
   TOP BAR
   ================================================================ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all var(--duration) var(--ease);
}
.back-btn:hover { background: oklch(55% 0.22 264 / 0.15); }
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--duration) var(--ease);
}
.theme-toggle:hover { box-shadow: var(--shadow-md); }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ================================================================
   AUTH SCREENS
   ================================================================ */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
    text-align: center;
}
.auth-box {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}
.auth-box h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}
.auth-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}
.auth-box .form-group { margin-bottom: 16px; text-align: left; }
.auth-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 12px;
    display: none;
}
.auth-error.visible { display: block; }

/* Site thumbnail with year badge */
.site-thumbnail-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.site-thumbnail-wrap img {
    display: block;
    max-width: 380px;
    width: 100%;
    height: auto;
}
.year-badge {
    position: absolute;
    top: 12px;
    right: -8px;
    background: linear-gradient(135deg, #CC0000 0%, #B8002A 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: var(--fw-extrabold);
    letter-spacing: 0.5px;
    padding: 6px 16px 6px 12px;
    border-radius: var(--radius-xs) 0 0 var(--radius-xs);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
    text-transform: uppercase;
    z-index: 1;
}
.year-badge::before {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-top: 6px solid #c0392b;
}
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
    .year-badge { animation: none; }
}

/* ================================================================
   ONBOARDING INLINE
   ================================================================ */
.onboarding-card {
    background: var(--accent-light);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.onboarding-card h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 18px;
}
.onboarding-card .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 500px) {
    .onboarding-card .form-row { flex-direction: column; }
}
.onboarding-card input {
    background: var(--surface);
}

/* ================================================================
   TOGGLE / SEGMENTED CONTROL
   ================================================================ */
.segmented-control {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 20px;
}
.segmented-btn {
    flex: 1;
    padding: 8px 16px;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease);
    text-align: center;
}
.segmented-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ================================================================
   STEPS / CHECKLIST
   ================================================================ */
.week-group {
    margin-bottom: var(--space-5);
}
.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}
.week-header:hover { box-shadow: var(--shadow-md); }
.week-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.week-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
}
.week-badge.current {
    background: var(--accent);
    color: white;
}
.week-title { font-weight: 600; font-size: 15px; }
.week-progress {
    font-size: 13px;
    color: var(--text-secondary);
}
.week-chevron {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform var(--duration) var(--ease);
}
.week-group.expanded .week-chevron { transform: rotate(90deg); }
.week-steps {
    display: none;
    padding: var(--space-3) 0 0 0;
}
.week-group.expanded .week-steps { display: block; }
.step-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    transition: all var(--duration) var(--ease);
}
.step-item:hover { background: var(--accent-light); }
.step-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all var(--duration) var(--ease);
}
.step-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.step-checkbox.checked::after { content: '\2713'; font-size: 12px; font-weight: 700; }
.step-text { font-size: 15px; line-height: 1.4; }
.step-item.completed .step-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Framework view */
.framework-group { margin-bottom: 20px; }
.framework-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--separator);
}

/* ================================================================
   HABITS
   ================================================================ */
.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}
.habit-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.habit-check {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.habit-check.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.habit-check.checked::after { content: '\2713'; font-size: 13px; font-weight: 700; }
.habit-name { font-size: 15px; font-weight: 500; }
.habit-streak {
    font-size: 12px;
    color: var(--warning);
    font-weight: 600;
}
.habit-count-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.habit-count-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}
.habit-count-val {
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.add-habit-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.add-habit-row input { flex: 1; }

/* ================================================================
   NOTES
   ================================================================ */
.note-entry {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.note-timestamp {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.note-content { font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.note-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}
.note-entry:hover .note-delete { opacity: 1; }

/* ================================================================
   PIPELINE / CRM
   ================================================================ */
.pipeline-stages {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.pipeline-stage {
    min-width: 240px;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.stage-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stage-count {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
}
.deal-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.deal-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.deal-meta { font-size: 12px; color: var(--text-secondary); }
.deal-amount { color: var(--success); font-weight: 600; }

/* ================================================================
   ARCHETYPES
   ================================================================ */
.archetype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.archetype-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 2px solid transparent;
}
.archetype-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.archetype-card.selected { border-color: var(--accent); }
.archetype-emoji { font-size: 36px; margin-bottom: 12px; }
.archetype-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.archetype-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.archetype-detail {
    margin-top: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}
.archetype-detail h4 { margin-bottom: 8px; color: var(--accent); }
.archetype-detail ul {
    list-style: none;
    padding: 0;
}
.archetype-detail li {
    padding: 8px 0;
    border-bottom: 1px solid var(--separator);
    font-size: 14px;
}
.archetype-detail li:last-child { border-bottom: none; }

/* ================================================================
   LEAP
   ================================================================ */
.leap-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.leap-letter {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.leap-content h4 { font-size: 16px; margin-bottom: 4px; }
.leap-content p { font-size: 14px; color: var(--text-secondary); }

.scenario-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.scenario-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.scenario-text { font-size: 14px; line-height: 1.5; }
.objection-item {
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.objection-q { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.objection-a {
    font-size: 14px;
    color: var(--text-secondary);
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--separator);
}
.objection-item.open .objection-a { display: block; }

/* ================================================================
   REFERENCE CARDS
   ================================================================ */
.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.ref-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.ref-card-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}
.ref-card-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ================================================================
   ACCOUNTABILITY
   ================================================================ */
.acc-form-group { margin-bottom: 20px; }
.acc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.commitment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.commitment-row input { flex: 1; }
.commitment-score {
    display: flex;
    gap: 4px;
}
.score-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.score-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.acc-history-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.acc-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ================================================================
   ADMIN
   ================================================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--separator);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--separator);
}
.admin-table tr:hover td { background: var(--accent-light); }
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
}
.badge-free { background: var(--accent-light); color: var(--accent); }
.badge-vip { background: var(--warning-light); color: var(--warning); }
.badge-admin { background: var(--danger-light); color: var(--danger); }
.badge-pending { background: var(--purple-light); color: var(--purple); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-denied { background: var(--danger-light); color: var(--danger); }

/* ================================================================
   TOAST
   ================================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--surface-1);
    color: var(--text);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--separator);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s var(--ease);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(20px); }
}
@keyframes tourFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   USER MENU DROPDOWN
   ================================================================ */
.user-menu {
    position: relative;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 180px;
    z-index: 100;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}
.user-dropdown-item:hover { background: var(--bg); }
.user-dropdown-item.danger { color: var(--danger); }

/* ================================================================
   VIP APPLY MODAL
   ================================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0% 0 0 / 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: var(--surface-1);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--separator);
}
.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ================================================================
   LOADING SPINNER
   ================================================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--separator);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   DEAL DETAIL MODAL
   ================================================================ */
.deal-detail-section { margin-bottom: 20px; }
.deal-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.interaction-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--separator);
    font-size: 14px;
}
.interaction-item:last-child { border-bottom: none; }
.interaction-date { font-size: 12px; color: var(--text-secondary); }

/* Hidden */
.hidden { display: none !important; }

/* Scroll */
.scroll-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* MY WHY */
.why-prompts {
    background: var(--accent-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}
.why-prompts h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}
.why-prompts ul {
    list-style: disc;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}
.why-prompts li { margin-bottom: 4px; }

/* Trends chart simple */
.trend-bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    margin-top: 12px;
}
.trend-col {
    flex: 1;
    background: var(--accent-light);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height var(--duration) var(--ease);
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--separator);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s var(--ease);
}
.progress-bar-fill.complete {
    background: var(--success);
}
.progress-bar-lg {
    height: 12px;
    border-radius: 6px;
    margin: 12px 0;
}
.progress-bar-lg .progress-bar-fill {
    border-radius: 6px;
}

/* ================================================================
   COIN / REWARD SYSTEM
   ================================================================ */
.coins-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--warning-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
}
.coin-earned {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    z-index: 10001;
    animation: coinPop 0.5s var(--ease);
}
@keyframes coinPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.coin-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ================================================================
   BRAND HEADER
   ================================================================ */
.brand-header {
    text-align: center;
    margin-bottom: 24px;
}
.brand-header img {
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}
.brand-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Week complete badge */
.week-badge.done {
    background: var(--success);
    color: white;
}
.week-header.week-complete {
    border-left: 3px solid var(--success);
}

/* All habits done celebration */
.habit-day-complete {
    background: var(--success) !important;
    color: #fff !important;
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.form-label {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-sm { margin-top: 8px; }
.mb-md { margin-bottom: 16px; }

/* ================================================================
   CURRICULUM REVIEW (Admin)
   ================================================================ */
.curriculum-review .cr-step {
    transition: border-left var(--duration) var(--ease);
}
.curriculum-review .cr-step.cr-agree {
    border-left: 3px solid var(--success);
}
.curriculum-review .cr-step.cr-disagree {
    border-left: 3px solid var(--danger);
    background: var(--danger-light);
}
.cr-duration-input {
    text-align: center;
}
.cr-duration-input::-webkit-inner-spin-button { opacity: 1; }
.cr-move-week {
    background: var(--bg);
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    color: var(--text);
}

/* Duration badges on steps (student view) */
.step-duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
    background: var(--separator);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}
.step-parallel-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: var(--fw-semibold);
    color: var(--teal);
    background: var(--teal-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Timeline summary card (student view) */
.timeline-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.timeline-stat {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.timeline-stat-value {
    font-size: 22px;
    font-weight: 800;
}
.timeline-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Missing stat classes (referenced in admin panel) */
.stat-item {
    text-align: center;
    padding: 12px;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ================================================================
   CURRICULUM EDITOR — Drag & Drop, Inline Edit
   ================================================================ */

/* Drag handle */
.cr-drag-handle {
    cursor: grab;
    padding: 8px 4px;
    color: var(--text-secondary);
    opacity: 0.35;
    transition: opacity 0.15s;
    user-select: none;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.cr-drag-handle:hover,
.cr-drag-handle:active {
    opacity: 1;
    cursor: grabbing;
}

/* Ghost (placeholder) while dragging */
.cr-step-ghost {
    opacity: 0.4;
    background: var(--accent-light) !important;
    border: 2px dashed var(--accent) !important;
    border-radius: var(--radius-md);
}
.cr-step-dragging {
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0.9;
}

/* Step card — enhanced for editor */
.cr-step-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--separator);
    margin-bottom: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cr-step-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.cr-step-card.cr-agree {
    border-left: 3px solid var(--success);
}
.cr-step-card.cr-disagree {
    border-left: 3px solid var(--danger);
}

/* Step number badge */
.cr-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Inline editable text */
.cr-editable-text {
    cursor: text;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
    font-size: 14px;
    line-height: 1.4;
    min-height: 24px;
    overflow-wrap: break-word;
}
.cr-editable-text:hover {
    background: var(--accent-light);
    border-color: var(--separator);
}
.cr-editable-text.editing {
    background: transparent;
    border-color: transparent;
}

/* Inline edit input */
.cr-inline-input {
    width: 100%;
    padding: 4px 6px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--surface);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-light);
    resize: vertical;
    min-height: 28px;
}

/* Step controls row */
.cr-step-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
}

/* Step meta row (notes, comments) */
.cr-step-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

/* Delete button */
.cr-delete-btn {
    color: var(--text-secondary);
    opacity: 0.4;
    transition: opacity 0.15s, color 0.15s;
    padding: 4px;
    border-radius: 4px;
    font-size: 14px;
}
.cr-delete-btn:hover {
    opacity: 1;
    color: var(--danger);
    background: var(--danger-light);
}

/* Add step button */
.cr-add-step-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: 2px dashed var(--separator);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    cursor: pointer;
}
.cr-add-step-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* Add week button */
.cr-add-week-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    cursor: pointer;
}
.cr-add-week-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* Week title editable */
.cr-week-title-edit {
    cursor: text;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}
.cr-week-title-edit:hover {
    background: var(--accent-light);
    border-color: var(--separator);
}

/* Save indicator */
.cr-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    pointer-events: none;
}
.cr-save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Compact input for duration etc in editor */
.cr-compact-input {
    width: 60px;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 4px;
}
.cr-compact-select {
    width: auto;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}
.cr-compact-text {
    flex: 1;
    min-width: 100px;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* Week delete button */
.cr-week-delete {
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.week-header:hover .cr-week-delete {
    opacity: 0.6;
}
.cr-week-delete:hover {
    opacity: 1 !important;
    color: var(--danger);
    background: var(--danger-light);
}

/* ================================================================
   LEAD GEN — TABS (underline style)
   ================================================================ */
.leadgen-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: var(--space-8);
    border-bottom: 1px solid var(--separator);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.leadgen-credit-badge {
    margin-left: auto;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--separator);
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, color 0.15s ease;
}
.leadgen-credit-badge.low {
    color: var(--danger);
    background: var(--danger-light);
    border-color: var(--danger);
}
.leadgen-tabs::-webkit-scrollbar { display: none; }
.leadgen-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
    letter-spacing: 0.01em;
}
.leadgen-tab:hover { color: var(--text); }
.leadgen-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ================================================================
   LEAD GEN — SECTION HEADER
   ================================================================ */
.leadgen-section-header {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.leadgen-section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ================================================================
   LEAD GEN — CARDS (professional)
   ================================================================ */
.leadgen-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
    border: 1px solid var(--separator);
}
.leadgen-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.leadgen-card-clickable { cursor: pointer; }
.leadgen-card-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light), var(--shadow-sm);
}
.leadgen-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.leadgen-card-body { flex: 1; min-width: 0; }
.leadgen-card-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    line-height: 1.3;
}
.leadgen-card-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    line-height: 1.4;
}
.leadgen-card-meta-sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.4;
}
.leadgen-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.leadgen-card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
    padding-top: 8px;
    border-top: 1px solid var(--separator);
}
.leadgen-card-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 8px;
}

/* ================================================================
   LEAD GEN — STATUS BADGES
   ================================================================ */
.leadgen-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.leadgen-status-badge .status-icon { font-size: 10px; line-height: 1; }
.leadgen-status-badge.pending { background: rgba(142, 142, 147, 0.1); color: #8E8E93; border-color: rgba(142, 142, 147, 0.2); }
.leadgen-status-badge.researching { background: var(--accent-light); color: var(--accent); border-color: rgba(0, 122, 255, 0.2); }
.leadgen-status-badge.complete { background: var(--success-light); color: var(--success); border-color: rgba(52, 199, 89, 0.2); }
.leadgen-status-badge.error { background: var(--danger-light); color: var(--danger); border-color: rgba(255, 59, 48, 0.2); }
@keyframes leadgen-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.leadgen-status-badge.researching .status-icon {
    display: inline-block;
    animation: leadgen-spin 1.2s linear infinite;
}

/* ================================================================
   LEAD GEN — ACTION BAR (toolbar style)
   ================================================================ */
.leadgen-action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.leadgen-action-bar .btn {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--separator);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: all 0.12s var(--ease);
    text-decoration: none;
    cursor: pointer;
}
.leadgen-action-bar .btn:hover {
    background: var(--bg);
    border-color: var(--text-secondary);
}
.leadgen-action-bar .btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}
.leadgen-action-bar .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.leadgen-action-bar .btn-accent {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    font-weight: 600;
}
.leadgen-action-bar .btn-accent:hover {
    background: #2ab34d;
    border-color: #2ab34d;
}
.leadgen-action-bar-separator {
    width: 1px;
    height: 24px;
    background: var(--separator);
    margin: 0 4px;
}

/* ================================================================
   LEAD GEN — PROGRESS BANNER
   ================================================================ */
.leadgen-progress-banner {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--separator);
    box-shadow: var(--shadow-sm);
}
.leadgen-progress-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.leadgen-progress-banner-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.leadgen-progress-banner-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}
.leadgen-progress-banner-failed {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
}

/* ================================================================
   LEAD GEN — PROGRESS BAR
   ================================================================ */
.leadgen-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--separator);
    border-radius: 2px;
    overflow: hidden;
}
.leadgen-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s var(--ease);
}
.leadgen-progress-bar-fill.complete { background: var(--success); }

/* ================================================================
   LEAD GEN — EMPTY STATES
   ================================================================ */
.leadgen-empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--separator);
}
.leadgen-empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
    display: block;
}
.leadgen-empty-state .empty-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.leadgen-empty-state .empty-desc {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 24px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ================================================================
   LEAD GEN — SPREADSHEET IMPORT FORM
   ================================================================ */
.spreadsheet-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.spreadsheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}
.spreadsheet thead {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.spreadsheet th {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border-bottom: 1px solid var(--separator);
    white-space: nowrap;
    user-select: none;
}
.spreadsheet th .required {
    color: var(--danger);
    font-weight: 700;
}
.spreadsheet td {
    padding: 0;
    border-bottom: 1px solid var(--separator);
    vertical-align: middle;
}
.spreadsheet tbody tr {
    transition: background 0.1s ease;
}
.spreadsheet tbody tr:hover {
    background: rgba(0, 122, 255, 0.03);
}
.spreadsheet tbody tr:last-child td {
    border-bottom: none;
}
.spreadsheet .row-num {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg);
    border-right: 1px solid var(--separator);
    user-select: none;
}
.spreadsheet input {
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}
.spreadsheet input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}
.spreadsheet input:focus {
    border-bottom-color: var(--accent);
    background: var(--accent-light);
}
.spreadsheet .row-remove {
    padding: 8px;
    text-align: center;
}
.spreadsheet .row-remove button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    opacity: 0;
}
.spreadsheet tbody tr:hover .row-remove button {
    opacity: 1;
}
.spreadsheet .row-remove button:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Leadgen-specific button variants */
.leadgen-btn-outline {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.leadgen-btn-outline:hover { background: var(--accent-light); }
.leadgen-btn-warning {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--warning);
    background: var(--warning);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.leadgen-btn-warning:hover { opacity: 0.9; }
.leadgen-btn-delete {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
    font-weight: 500;
}
.leadgen-btn-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-light);
}
.leadgen-card-researching {
    font-size: 12px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.leadgen-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--separator);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s ease;
    cursor: pointer;
}
.leadgen-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* btn-link for add row */
.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.12s ease;
}
.btn-link:hover { color: var(--accent-hover); }

/* ================================================================
   LEAD GEN — ARCHETYPE CARDS
   ================================================================ */
.leadgen-archetype-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.leadgen-archetype-card {
    border: 2px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s var(--ease);
    background: var(--surface);
}
.leadgen-archetype-card:hover {
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.leadgen-archetype-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--accent-light);
}
.leadgen-archetype-card .archetype-emoji { font-size: 28px; display: block; margin-bottom: 8px; }
.leadgen-archetype-card .archetype-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.leadgen-archetype-card .archetype-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.3; }
.leadgen-archetype-card[data-archetype="lifestyle"] { border-color: rgba(90, 200, 250, 0.3); }
.leadgen-archetype-card[data-archetype="lifestyle"].selected { border-color: #5AC8FA; background: rgba(90, 200, 250, 0.08); box-shadow: 0 0 0 3px rgba(90, 200, 250, 0.15); }
.leadgen-archetype-card[data-archetype="distressed"] { border-color: rgba(255, 149, 0, 0.3); }
.leadgen-archetype-card[data-archetype="distressed"].selected { border-color: #FF9500; background: rgba(255, 149, 0, 0.08); box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.15); }
.leadgen-archetype-card[data-archetype="empire"] { border-color: rgba(175, 82, 222, 0.3); }
.leadgen-archetype-card[data-archetype="empire"].selected { border-color: #AF52DE; background: rgba(175, 82, 222, 0.08); box-shadow: 0 0 0 3px rgba(175, 82, 222, 0.15); }
.leadgen-archetype-card[data-archetype="reluctant"] { border-color: rgba(142, 142, 147, 0.3); }
.leadgen-archetype-card[data-archetype="reluctant"].selected { border-color: #8E8E93; background: rgba(142, 142, 147, 0.08); box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.15); }

/* ================================================================
   LEAD GEN — LETTER PANEL
   ================================================================ */
.leadgen-letter-panel {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--separator);
}
.leadgen-letter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--separator);
}
.leadgen-letter-panel-header h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}
.leadgen-letter-panel-header .letter-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.leadgen-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--separator);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: leadgen-spin 0.8s linear infinite;
}
.leadgen-letter-content {
    font-family: Georgia, 'Times New Roman', serif;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.75;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid var(--separator);
}

/* ================================================================
   LEAD GEN — TOOLBAR
   ================================================================ */
.leadgen-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid var(--separator);
    margin-top: 4px;
}
.leadgen-toolbar .btn {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--separator);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: all 0.12s var(--ease);
    text-decoration: none;
    cursor: pointer;
}
.leadgen-toolbar .btn:hover { background: var(--bg); border-color: var(--text-secondary); }
.leadgen-toolbar .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.leadgen-toolbar .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ================================================================
   LEAD GEN — FEEDBACK INPUT (chat-style)
   ================================================================ */
.leadgen-feedback-box { margin-top: 16px; margin-bottom: 4px; }
.leadgen-feedback-box label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; color: var(--text); }
.leadgen-feedback-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--bg);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 8px 8px 8px 16px;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.leadgen-feedback-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.leadgen-feedback-input textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    font-size: 14px;
    line-height: 1.4;
    padding: 6px 0;
    outline: none;
    color: var(--text);
}
.leadgen-feedback-input textarea::placeholder { color: var(--text-secondary); }
.leadgen-feedback-input textarea:focus { box-shadow: none; border: none; }
.leadgen-feedback-input .btn { flex-shrink: 0; padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }

/* ================================================================
   LEAD GEN — VERSION HISTORY
   ================================================================ */
.leadgen-version-list {
    margin-top: 16px;
    border-top: 1px solid var(--separator);
    padding-top: 16px;
}
.leadgen-version-list summary {
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.leadgen-version-item {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--separator);
}
.leadgen-version-item .version-label { font-weight: 600; font-size: 12px; margin-bottom: 4px; color: var(--text); }
.leadgen-version-item .version-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 80px;
    overflow: hidden;
    line-height: 1.5;
}

/* ================================================================
   LEAD GEN — FOLLOW-UPS
   ================================================================ */
.leadgen-followup-section {
    margin-top: 16px;
    border-top: 1px solid var(--separator);
    padding-top: 16px;
}
.leadgen-followup-section .section-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.leadgen-followup-card {
    background: var(--bg);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
}
.leadgen-followup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.leadgen-followup-header .followup-title { font-weight: 600; font-size: 13px; }
.leadgen-followup-header .followup-meta { display: flex; gap: 8px; align-items: center; }
.leadgen-followup-header .followup-delay {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--separator);
}
.leadgen-followup-body {
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* ================================================================
   LEAD GEN — LETTER SIDEBAR
   ================================================================ */
.leadgen-letters-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    min-height: 400px;
}
.leadgen-sidebar { display: flex; flex-direction: column; gap: 6px; }
.leadgen-sidebar-lead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.12s var(--ease);
}
.leadgen-sidebar-lead:hover { border-color: var(--text-secondary); background: var(--bg); }
.leadgen-sidebar-lead.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 2px var(--accent-light);
}
.leadgen-sidebar-lead .lead-name { font-weight: 600; font-size: 13px; }
.leadgen-sidebar-lead .lead-letter-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.leadgen-sidebar-lead .lead-letter-badge.has-letter { background: var(--success-light); color: var(--success); }
.leadgen-sidebar-lead .lead-letter-badge.no-letter { background: var(--separator); color: var(--text-secondary); }

/* ================================================================
   LEAD GEN — RESEARCH SUMMARY
   ================================================================ */
.leadgen-research-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--separator);
    line-height: 1.5;
}

/* ================================================================
   LEAD GEN — RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .spreadsheet-container { max-height: 400px; }
    .leadgen-letters-layout { grid-template-columns: 1fr; }
    .leadgen-sidebar {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 8px;
    }
    .leadgen-sidebar-lead { min-width: 140px; flex-shrink: 0; }
    .leadgen-archetype-grid { grid-template-columns: 1fr; }
    .leadgen-tabs { gap: 0; }
    .leadgen-tab { padding: 8px 12px; font-size: 12px; }
    .leadgen-letter-content { padding: 16px; font-size: 13px; }
    .leadgen-action-bar { padding: 8px 12px; }
    .leadgen-action-bar .btn { font-size: 12px; padding: 6px 10px; }
    .leadgen-action-bar-separator { display: none; }
}

/* ================================================================
   LEAD GEN — INLINE ADD ROW
   ================================================================ */
.leadgen-inline-add {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px dashed var(--separator);
    margin-top: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.leadgen-inline-add:focus-within {
    border-color: var(--accent);
    border-style: solid;
    background: var(--surface);
}
.leadgen-inline-add-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr 60px 1fr 1.2fr auto;
    gap: 0;
    align-items: center;
}
.leadgen-inline-add-row input {
    padding: 12px 14px;
    border: none;
    border-right: 1px solid var(--separator);
    background: transparent;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    outline: none;
    transition: background 0.12s ease;
}
.leadgen-inline-add-row input:last-of-type {
    border-right: none;
}
.leadgen-inline-add-row input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}
.leadgen-inline-add-row input:focus {
    background: var(--accent-light);
}
.leadgen-inline-add-actions {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    align-items: center;
}
.leadgen-inline-add-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, transform 0.1s ease;
    line-height: 1;
}
.leadgen-inline-add-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}
.leadgen-inline-add-btn:active {
    transform: scale(0.95);
}
.leadgen-inline-add-hint {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
    padding: 0 14px 8px;
    display: none;
}
.leadgen-inline-add:focus-within .leadgen-inline-add-hint {
    display: block;
}

/* ================================================================
   LEAD GEN — OVERFLOW MENU (three-dot dropdown)
   ================================================================ */
.leadgen-overflow-wrap {
    position: relative;
    display: inline-block;
}
.leadgen-overflow-trigger {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--separator);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    line-height: 1;
}
.leadgen-overflow-trigger:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-secondary);
}
.leadgen-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
    z-index: 100;
    padding: 6px;
    animation: leadgen-menu-in 0.12s ease;
}
.leadgen-overflow-menu.open {
    display: block;
}
@keyframes leadgen-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.leadgen-overflow-menu button,
.leadgen-overflow-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.1s ease;
    text-align: left;
}
.leadgen-overflow-menu button:hover,
.leadgen-overflow-menu a:hover {
    background: var(--bg);
}
.leadgen-overflow-menu .menu-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 14px;
}
.leadgen-overflow-menu .menu-divider {
    height: 1px;
    background: var(--separator);
    margin: 4px 0;
}

/* ================================================================
   LEAD GEN — EXPANDABLE RESEARCH DETAIL (accordion)
   ================================================================ */
.leadgen-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 0;
}
.leadgen-expand.open {
    max-height: 2000px;
    opacity: 1;
}
.leadgen-research-detail {
    padding: 16px 20px;
    border-top: 1px solid var(--separator);
}
.leadgen-research-detail h5 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 16px 0 8px;
}
.leadgen-research-detail h5:first-child {
    margin-top: 0;
}
.leadgen-research-detail p {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin: 0 0 12px;
}
.leadgen-research-detail .detail-summary {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
}
.leadgen-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.leadgen-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    white-space: nowrap;
}
.leadgen-tag.risk {
    background: var(--danger-light);
    color: var(--danger);
}
.leadgen-tag.archetype {
    background: rgba(175, 82, 222, 0.1);
    color: #AF52DE;
}
.leadgen-research-sources {
    margin-top: 8px;
}
.leadgen-research-sources a {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
    margin-bottom: 4px;
}
.leadgen-research-sources a:hover {
    text-decoration: underline;
}

/* Clickable card for expand */
.leadgen-card.expandable {
    cursor: pointer;
}
.leadgen-card.expandable:hover {
    border-color: var(--accent);
}
.leadgen-card .expand-chevron {
    display: inline-block;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    margin-left: 4px;
}
.leadgen-card.expanded .expand-chevron {
    transform: rotate(90deg);
}

/* ================================================================
   LEAD GEN — TABLE VIEW for leads
   ================================================================ */
.leadgen-table-wrap {
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.leadgen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.leadgen-table thead {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.leadgen-table th {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--separator);
    white-space: nowrap;
    user-select: none;
}
.leadgen-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--separator);
    color: var(--text);
    vertical-align: middle;
    font-size: 13px;
}
.leadgen-table tbody tr {
    transition: background 0.1s ease;
}
.leadgen-table tbody tr:hover {
    background: rgba(0, 122, 255, 0.04);
}
.leadgen-table tbody tr.leadgen-row-expanded {
    background: rgba(0, 122, 255, 0.03);
}
.leadgen-table tbody tr:last-child td {
    border-bottom: none;
}
.leadgen-table .td-name {
    font-weight: 600;
    color: var(--text);
}
.leadgen-table .td-actions {
    text-align: right;
    white-space: nowrap;
}
.leadgen-table .th-right {
    text-align: right;
}

/* Leadgen utility classes (replaces inline styles) */
.btn-xs { font-size: 12px !important; padding: 4px 12px !important; }
.cell-empty { opacity: 0.3; }
.btn-ml { margin-left: 4px; }
.row-link { cursor: pointer; }
.leadgen-spacer { flex: 1; }

/* Responsive inline add */
@media (max-width: 768px) {
    .app-container.leadgen-wide {
        padding: 16px;
    }
    .leadgen-inline-add-row {
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
    .leadgen-inline-add-row input {
        border-right: none;
        border-bottom: 1px solid var(--separator);
        padding: 10px 12px;
    }
    .leadgen-overflow-menu {
        min-width: 180px;
    }
    .leadgen-table th:nth-child(n+5),
    .leadgen-table td:nth-child(n+5) {
        display: none;
    }
}

/* Streaming progress */
.research-progress-container:empty { display: none; }
.research-stream {
    margin-top: 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.stream-status {
    padding: 8px 12px;
    background: var(--surface);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--separator);
}
.stream-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg);
}
.stream-entry {
    padding: 2px 4px;
    margin: 2px 0;
    border-radius: 3px;
    word-break: break-word;
}
.stream-entry.tool {
    color: var(--accent);
    background: rgba(0,122,255,0.05);
}
.stream-entry.text {
    color: var(--text-secondary);
}

/* Onboarding video modal */
.onboarding-video-modal {
    text-align: center;
    padding: 8px;
}
.onboarding-video-modal h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.onboarding-video-modal video {
    max-height: 60vh;
}

/* Onboarding chapter tabs */
.chapter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 12px 0 16px;
}
.chapter-tab {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}
.chapter-tab:hover {
    background: rgba(0, 122, 255, 0.18);
    transform: translateY(-1px);
}
.chapter-tab.active {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.chapter-tab.active:hover {
    background: var(--accent-hover);
}

/* ================================================================
   LEAD GEN — REMINDERS
   ================================================================ */
.leadgen-reminder-card {
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease;
}
.leadgen-reminder-card.overdue {
    border-left: 3px solid var(--danger);
}
.leadgen-reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.leadgen-reminder-lead {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.leadgen-reminder-due {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-light);
    color: var(--accent);
}
.leadgen-reminder-due.overdue {
    background: var(--danger-light);
    color: var(--danger);
}
.leadgen-reminder-body {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}
.leadgen-reminder-seq {
    font-weight: 500;
}
.leadgen-reminder-archetype {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--separator);
    font-size: 11px;
    text-transform: capitalize;
}
.leadgen-reminder-actions {
    display: flex;
    gap: 8px;
}

/* v=34 icons */
