/* ============================================================
   CuratedLabs — Design System v4.0
   Apple/macOS-inspired design with frosted glass, clean
   typography, and refined interactions.
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
    /* Colors — Light Mode (Apple System Colors) */
    --bg-0: #F5F5F7;
    --bg-1: #FFFFFF;
    --bg-2: #E8E8ED;
    --bg-3: #D2D2D7;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-border: rgba(255, 255, 255, 0.5);
    --bg-gradient: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);

    --text-0: #1D1D1F;
    --text-1: #1D1D1F;
    --text-2: #6E6E73;
    --text-3: #86868B;
    --text-inv: #ffffff;

    --border-0: #D2D2D7;
    --border-1: #C7C7CC;
    --border-focus: #007AFF;

    /* Accent Palette — Apple Blue */
    --accent: #007AFF;
    --accent-light: #4DA3FF;
    --accent-dark: #0055CC;
    --accent-bg: rgba(0, 122, 255, 0.08);
    --accent-border: rgba(0, 122, 255, 0.25);
    --accent-glow: rgba(0, 122, 255, 0.2);
    --accent-gradient: linear-gradient(135deg, #007AFF, #5AC8FA);

    --sage: #34C759;
    --sage-light: #5DD67B;
    --sage-bg: rgba(52, 199, 89, 0.1);
    --sage-border: rgba(52, 199, 89, 0.25);

    --coral: #FF6B6B;
    --coral-bg: rgba(255, 107, 107, 0.1);

    --blue: #007AFF;
    --blue-light: #4DA3FF;
    --blue-bg: rgba(0, 122, 255, 0.1);

    --red: #FF3B30;
    --red-bg: rgba(255, 59, 48, 0.08);

    --purple: #AF52DE;
    --purple-bg: rgba(175, 82, 222, 0.08);

    /* Layout */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing */
    --pad-sm: 8px;
    --pad: 12px;
    --pad-md: 16px;
    --pad-lg: 24px;
    --pad-xl: 32px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 24px 60px rgba(0,0,0,0.16);
    --shadow-glow: 0 0 0 3px rgba(0, 122, 255, 0.15);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --font-serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

    --fs-xs: 0.6875rem;   /* 11px */
    --fs-sm: 0.8125rem;   /* 13px */
    --fs-base: 0.9375rem; /* 15px */
    --fs-md: 1rem;        /* 16px */
    --fs-lg: 1.125rem;    /* 18px */
    --fs-xl: 1.375rem;    /* 22px */
    --fs-2xl: 1.75rem;    /* 28px */
    --fs-3xl: 2.25rem;    /* 36px */

    /* Animation */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration: 250ms;
    --duration-slow: 400ms;

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 50;
    --z-nav: 100;
    --z-modal: 200;
    --z-toast: 300;
    --z-cmd: 400;

    /* Nav */
    --nav-height: 52px;
    --sidebar-width: 260px;
}

/* === DARK THEME === */
[data-theme="dark"] {
    --bg-0: #000000;
    --bg-1: #1C1C1E;
    --bg-2: #2C2C2E;
    --bg-3: #3A3A3C;
    --bg-glass: rgba(28, 28, 30, 0.72);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --bg-gradient: linear-gradient(135deg, #000000 0%, #1C1C1E 100%);

    --text-0: #F5F5F7;
    --text-1: #E5E5EA;
    --text-2: #8E8E93;
    --text-3: #48484A;
    --text-inv: #000000;

    --border-0: #38383A;
    --border-1: #48484A;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
    --shadow-xl: 0 16px 64px rgba(0,0,0,0.7);
    --shadow-glow: 0 0 0 3px var(--accent-glow);

    --accent-bg: rgba(0, 122, 255, 0.15);
    --sage-bg: rgba(52, 199, 89, 0.15);
    --red-bg: rgba(255, 59, 48, 0.15);
    --blue-bg: rgba(0, 122, 255, 0.15);
    --purple-bg: rgba(175, 82, 222, 0.15);
}

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text-0);
    background: var(--bg-0);
    overflow-x: hidden;
}

h1, h2, h3, .serif { font-family: var(--font-sans); font-weight: 600; }
h1 { font-size: var(--fs-2xl); line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-lg); line-height: 1.35; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-bg); color: var(--accent); }

/* Skip link for accessibility */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: var(--fs-sm);
    z-index: 10000;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus {
    top: 12px;
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* Focus ring */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === WINDOW CHROME === */
.window-chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--bg-glass-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: calc(var(--z-nav) + 1);
    -webkit-app-region: drag;
}
.traffic-lights {
    display: flex;
    gap: 8px;
    align-items: center;
    -webkit-app-region: no-drag;
}
.traffic-lights span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}
.tl-close { background: #FF5F57; }
.tl-minimize { background: #FEBC2E; }
.tl-maximize { background: #28C840; }
.window-title {
    flex: 1;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: -0.01em;
}
.window-chrome-right {
    display: flex;
    align-items: center;
    gap: 8px;
    -webkit-app-region: no-drag;
}

/* === SIDEBAR NAVIGATION === */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--bg-glass-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: var(--z-nav);
    transition: transform var(--duration-slow) var(--ease-out);
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 8px;
}
.sidebar-brand {
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-0);
}
.sidebar-brand span { color: var(--accent); }
.sidebar-brand img { width: 22px; height: 22px; object-fit: contain; }
.sidebar-toggle-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-2);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
}
.sidebar-toggle-btn:hover { background: var(--bg-2); }

.sidebar-section {
    padding: 4px 12px;
}
.sidebar-section-label {
    text-transform: uppercase;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-3);
    padding: 16px 8px 6px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: var(--fs-sm);
    font-weight: 400;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease-out);
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
}
.sidebar-item svg { opacity: 0.7; flex-shrink: 0; }
.sidebar-item:hover { background: var(--bg-2); color: var(--text-0); }
.sidebar-item:hover svg { opacity: 1; }
.sidebar-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
    font-weight: 600;
}
.sidebar-item.active svg { opacity: 1; color: var(--accent); }
.sidebar-spacer { flex: 1; }
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--bg-glass-border);
}
.sidebar-footer .streak-badge {
    margin-bottom: 8px;
}
.sidebar-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-avatar-sidebar { position: relative; }
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: calc(var(--z-nav) - 1);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--accent);
}
.streak-fire { font-size: 14px; }
.streak-label { font-weight: 400; color: var(--text-2); }

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    transition: all var(--duration);
}
.icon-btn:hover { background: var(--bg-2); color: var(--text-0); }

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--bg-glass-border);
    z-index: var(--z-nav);
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out);
}
.mobile-nav.visible { transform: translateY(0); }
.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: 10px;
    font-family: var(--font-sans);
    transition: color var(--duration);
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn.active { color: var(--accent); position: relative; }
.mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}
.mobile-nav-btn span { font-weight: 500; }

/* === APP CONTAINER === */
.app { min-height: 100vh; }
.app.with-nav { padding-top: var(--nav-height); margin-left: var(--sidebar-width); }

.view {
    display: none;
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
    animation: viewEnter var(--duration-slow) var(--ease-out);
}
.view.active { display: block; }

@keyframes viewEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === BUTTONS === */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    transition: all var(--duration) var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:hover { filter: brightness(0.92); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-sm); }

.btn-secondary, .btn-outline {
    background: transparent;
    border: 1px solid var(--border-0);
    color: var(--text-1);
}
.btn-secondary:hover, .btn-outline:hover { border-color: var(--border-1); background: var(--bg-2); filter: none; }

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    padding: 8px 12px;
}
.btn-text:hover { text-decoration: underline; filter: none; }

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 8px 12px;
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-0); filter: none; }

.btn-danger {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
}
.btn-danger:hover { background: var(--red-bg); filter: none; }

.btn-sm { padding: 6px 12px; font-size: var(--fs-xs); }
.btn-lg { padding: 12px 24px; font-size: var(--fs-base); }

/* === FORM ELEMENTS === */
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 8px;
}
.required { color: var(--red); }
.form-hint { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 6px; }
.form-hint-inline { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }

.form-input, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-0);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text-0);
    transition: all var(--duration);
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }

.input-group {
    display: flex;
    gap: 0;
    position: relative;
}
.input-group .form-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-toggle {
    padding: 0 14px;
    border: 1.5px solid var(--border-0);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-2);
    cursor: pointer;
    color: var(--text-2);
    display: flex;
    align-items: center;
}
.input-toggle:hover { background: var(--bg-3); color: var(--text-0); }

/* Option Cards */
.option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.option-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.option-card {
    padding: 16px 12px;
    border: 2px solid var(--border-0);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-1);
    text-align: center;
    transition: all var(--duration) var(--ease-out);
    position: relative;
}
.option-card:hover { border-color: var(--text-3); transform: translateY(-1px); }
.option-card.selected {
    border-color: var(--accent);
    background: var(--accent-bg);
    box-shadow: var(--shadow-glow);
}
.option-card .icon { font-size: 22px; margin-bottom: 6px; }
.option-card .title { font-size: var(--fs-sm); font-weight: 600; }
.option-card .desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* Chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 10px 18px;
    border: 1.5px solid var(--border-0);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    cursor: pointer;
    background: var(--bg-1);
    color: var(--text-1);
    transition: all var(--duration) var(--ease-out);
    user-select: none;
}
.chip:hover { border-color: var(--text-3); }
.chip.selected {
    background: var(--text-0);
    border-color: var(--text-0);
    color: var(--text-inv);
}

/* === DISCOVERY VIEW === */
.discovery-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.discovery-header {
    text-align: center;
    padding: 56px 24px 24px;
}
.discovery-logo {
    font-family: var(--font-serif);
    font-size: var(--fs-2xl);
    font-weight: 600;
    margin-bottom: 8px;
}
.discovery-logo span { color: var(--accent); }
.discovery-tagline { color: var(--text-1); font-size: var(--fs-md); }
.discovery-sub { color: var(--text-3); font-size: var(--fs-sm); margin-top: 4px; }

.discovery-content {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 24px 120px;
    width: 100%;
}

/* Discovery Progress */
.discovery-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 0 20px;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-3);
    background: var(--bg-1);
    transition: all var(--duration-slow) var(--ease-out);
}
.step-label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-3);
    transition: color var(--duration);
}
.progress-connector {
    flex: 1;
    height: 2px;
    background: var(--border-0);
    margin: 0 8px;
    margin-bottom: 22px;
    transition: background var(--duration-slow);
}
.progress-step.active .step-num {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-bg);
}
.progress-step.active .step-label { color: var(--accent); }
.progress-step.done .step-num {
    border-color: var(--sage);
    background: var(--sage);
    color: #fff;
}
.progress-step.done .step-label { color: var(--sage); }
.progress-step.done + .progress-connector { background: var(--sage); }

/* Phase Animation */
.phase {
    display: none;
    animation: fadeSlideUp var(--duration-slow) var(--ease-out);
}
.phase.active { display: block; }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Phase exit animation */
@keyframes phaseOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.98); }
}
.phase.exiting {
    display: block;
    animation: phaseOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Option card selection pulse */
@keyframes selectionPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}
.option-card.selected {
    animation: selectionPulse 0.6s ease-out;
}

/* Discovery skeleton loaders */
.discovery-skeleton {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.discovery-skeleton .skeleton {
    height: 24px;
    border-radius: 8px;
}
.discovery-skeleton .skeleton:first-child { width: 30%; height: 14px; }
.discovery-skeleton .skeleton:nth-child(2) { width: 60%; height: 32px; }
.discovery-skeleton .skeleton:nth-child(3) { width: 100%; height: 120px; }

.phase-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.phase-title {
    font-size: var(--fs-2xl);
    margin-bottom: 32px;
    color: var(--text-0);
}

/* Discovery Nav (bottom) */
.discovery-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: linear-gradient(to top, var(--bg-0) 60%, transparent);
    display: flex;
    justify-content: space-between;
    max-width: 648px;
    margin: 0 auto;
}

/* === GENERATING VIEW === */
.generating-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.generating-content {
    max-width: 520px;
    width: 100%;
    text-align: center;
}
.gen-logo {
    font-family: var(--font-serif);
    font-size: var(--fs-md);
    color: var(--text-3);
    margin-bottom: 32px;
}
.gen-logo span { color: var(--accent); }
.generating-content h1 { margin-bottom: 8px; }
.gen-sub { color: var(--text-2); margin-bottom: 40px; }

/* Agent Cards */
.gen-agents {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}
.agent-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    text-align: left;
    transition: all var(--duration-slow) var(--ease-out);
}
.agent-card.active {
    border-color: var(--accent-border);
    background: var(--accent-bg);
}
.agent-card.done {
    border-color: var(--sage-border);
    background: var(--sage-bg);
}
.agent-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: var(--radius);
    background: var(--bg-2);
    flex-shrink: 0;
}
.agent-info { flex: 1; }
.agent-role { font-weight: 600; font-size: var(--fs-sm); }
.agent-task { font-size: var(--fs-xs); color: var(--text-3); }
.agent-status {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-3);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-2);
}
.agent-card.active .agent-status {
    color: var(--accent);
    background: rgba(0, 122, 255, 0.15);
    animation: pulseOpacity 1.5s ease-in-out infinite;
}
.agent-card.done .agent-status {
    color: var(--sage);
    background: rgba(90, 122, 90, 0.15);
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress */
.gen-progress { margin-bottom: 16px; }
.gen-progress-bar {
    height: 6px;
    background: var(--bg-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.gen-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--sage));
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}
.gen-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--text-3);
}
.gen-status {
    font-size: var(--fs-sm);
    color: var(--text-2);
    font-style: italic;
    margin-bottom: 32px;
}

/* Completion */
.completion-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    display: none;
    box-shadow: var(--shadow-lg);
}
.completion-card.active {
    display: block;
    animation: scaleUp var(--duration-slow) var(--ease-spring);
}
@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.completion-check {
    width: 64px;
    height: 64px;
    background: var(--sage);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: checkBounce var(--duration-slow) var(--ease-spring);
}
@keyframes checkBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.completion-card h2 { margin-bottom: 8px; }
.completion-card p { color: var(--text-2); margin-bottom: 24px; }
.completion-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

/* === GENERATION THEATER (v2.3) === */
.gen-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.generating-view { position: relative; }
.generating-content { position: relative; z-index: 1; }

/* Agent card stagger entrance */
.agent-card:nth-child(1) { animation: staggerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.agent-card:nth-child(2) { animation: staggerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
.agent-card:nth-child(3) { animation: staggerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both; }
.agent-card:nth-child(4) { animation: staggerSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both; }
@keyframes staggerSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Active agent pulse ring */
.agent-card.active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 2px solid var(--accent);
    animation: agentPulseRing 2s ease-in-out infinite;
    pointer-events: none;
}
.agent-card { position: relative; }
@keyframes agentPulseRing {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Completion spring animation */
.completion-card.active {
    animation: completionSpring 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes completionSpring {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    60% { transform: scale(1.03) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Status typewriter cursor */
.gen-status.typing::after {
    content: '|';
    animation: blink 0.7s step-end infinite;
    color: var(--accent);
    margin-left: 2px;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* Skeleton preview panel */
.gen-skeleton-preview {
    display: none;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
    animation: fadeSlideUp 0.5s ease-out;
}
.gen-skeleton-preview.visible { display: block; }
.skeleton-preview-header {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

/* === DASHBOARD === */
.dash-welcome {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-welcome h1 { font-size: var(--fs-xl); margin-bottom: 4px; }
.dash-welcome p { color: var(--text-2); font-size: var(--fs-sm); }
.dash-welcome-actions { display: flex; gap: 8px; }

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}
.dash-main { display: flex; flex-direction: column; gap: 20px; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--duration);
    border-left: 2px solid var(--accent);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Task completion animation */
.today-task.completed .task-check {
    animation: taskCheckPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes taskCheckPop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Goal ring animation */
.ring-fill {
    animation: goalRingFill 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes goalRingFill {
    from { stroke-dashoffset: var(--ring-circumference, 264); }
}

/* Pillar donut spin-in */
.pillar-donut {
    animation: donutSpinIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes donutSpinIn {
    from { transform: rotate(-90deg) scale(0.8); opacity: 0; }
    to { transform: rotate(0deg) scale(1); opacity: 1; }
}

/* Reveal delay helpers */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.stat-value { font-family: var(--font-sans); font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.stat-label {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 4px;
}

/* Today Section */
.today-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.today-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.today-header h2 {
    font-size: var(--fs-md);
    font-family: var(--font-sans);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.today-date { font-size: var(--fs-sm); color: var(--text-2); }
.today-body { padding: 16px; }

.today-task {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg-2);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    align-items: center;
}
.today-task:last-child { margin-bottom: 0; }
.today-task:hover { transform: translateX(4px); background: var(--bg-3); }
.today-task.completed { opacity: 0.5; }
.today-task.completed .task-title { text-decoration: line-through; }

.task-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    transition: all var(--duration);
}
.today-task.completed .task-check {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}
.task-content { flex: 1; min-width: 0; }
.task-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2px;
}
.task-title { font-size: var(--fs-sm); font-weight: 500; }
.task-meta { font-size: var(--fs-xs); color: var(--text-3); }
.task-action {
    font-size: var(--fs-xs);
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.no-tasks { text-align: center; padding: 32px; color: var(--text-3); font-size: var(--fs-sm); }

/* Tracker */
.tracker-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.tracker-header h3 {
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    font-weight: 600;
}
.tracker-stats { font-size: var(--fs-sm); color: var(--text-2); }
.tracker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tracker-day {
    text-align: center;
    padding: 10px 4px;
    border-radius: var(--radius);
    background: var(--bg-2);
    transition: all var(--duration);
}
.tracker-day.today { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-bg); }
.tracker-day.has-posts { background: var(--sage-bg); }
.tracker-day-name { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 4px; }
.tracker-day-num { font-family: var(--font-serif); font-size: var(--fs-md); }
.tracker-day-count { font-size: 9px; color: var(--sage); margin-top: 2px; }

/* Goal Ring */
.goal-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}
.goal-section h3 {
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    margin-bottom: 16px;
}
.goal-ring {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 14px;
}
.goal-ring svg { transform: rotate(-90deg); }
.goal-ring circle { fill: none; stroke-width: 8; }
.goal-ring .ring-bg { stroke: var(--bg-2); }
.goal-ring .ring-fill {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s var(--ease-out);
}
.goal-ring .ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.goal-ring .ring-value { font-family: var(--font-serif); font-size: var(--fs-xl); }
.goal-ring .ring-label { font-size: 9px; color: var(--text-3); }
.goal-text { font-size: var(--fs-sm); color: var(--text-2); }

/* Tips */
.tips-section {
    background: linear-gradient(135deg, var(--accent-bg), transparent);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
    padding: 18px;
}
.tips-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: var(--fs-sm);
    font-weight: 600;
}
.tip-card {
    background: var(--bg-1);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
}
.tip-card:last-child { margin-bottom: 0; }
.tip-cat { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.tip-text { font-size: var(--fs-sm); line-height: 1.5; color: var(--text-1); }

/* Quick Actions */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all var(--duration) var(--ease-out);
}
.quick-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-icon { font-size: 20px; margin-bottom: 6px; }
.quick-label { font-size: var(--fs-xs); font-weight: 600; }

/* Pillars */
.pillars-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.pillars-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pillars-header h3 {
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    font-weight: 600;
}
.pillar-list { padding: 8px; }
.pillar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--duration);
}
.pillar-item:hover { background: var(--bg-2); }
.pillar-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pillar-info { flex: 1; min-width: 0; }
.pillar-name { font-size: var(--fs-sm); font-weight: 500; }
.pillar-count { font-size: var(--fs-xs); color: var(--text-3); }

/* === VAULT / IDEAS === */
.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}
.vault-header h1 { font-size: var(--fs-xl); }
.vault-controls { display: flex; gap: 8px; align-items: center; }

.vault-search {
    position: relative;
    width: 240px;
}
.vault-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    background: var(--bg-1);
    color: var(--text-0);
}
.vault-search input:focus { outline: none; border-color: var(--accent); }
.vault-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
}
.vault-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    cursor: pointer;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--duration);
    position: relative;
}
.filter-chip:hover { color: var(--text-0); background: var(--bg-2); }
.filter-chip.active { background: var(--bg-1); color: var(--text-0); box-shadow: var(--shadow-sm); font-weight: 600; }

/* Kanban */
.kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    min-height: 300px;
}
.kanban-col {
    background: transparent;
    border-radius: var(--radius-lg);
    padding: 0 8px;
}
.kanban-col-header {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-col[data-status="fresh"] .kanban-col-header { border-color: var(--accent); }
.kanban-col[data-status="posted"] .kanban-col-header { border-color: var(--sage); }
.kanban-col[data-status="in_progress"] .kanban-col-header { border-color: var(--blue); }

.kanban-items { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }

.kanban-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--duration) var(--ease-out);
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.6; transform: scale(0.95); box-shadow: var(--shadow-lg); }
.kanban-card:active { cursor: grabbing; }

/* Kanban column drop feedback */
.kanban-col.drag-over {
    background: var(--accent-bg);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-lg);
}

/* Filter chip active indicator */
.filter-chip.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}
.filter-chip { position: relative; }

/* Modal section staggered reveals */
.modal-body .idea-section:nth-child(1) { animation: staggerSlideIn 0.4s ease 0.05s both; }
.modal-body .idea-section:nth-child(2) { animation: staggerSlideIn 0.4s ease 0.1s both; }
.modal-body .idea-section:nth-child(3) { animation: staggerSlideIn 0.4s ease 0.15s both; }
.modal-body .idea-section:nth-child(4) { animation: staggerSlideIn 0.4s ease 0.2s both; }
.modal-body .idea-section:nth-child(5) { animation: staggerSlideIn 0.4s ease 0.25s both; }

/* Hook copy animation */
@keyframes hookCopied {
    0% { background: var(--sage-bg); }
    100% { background: transparent; }
}
.hook-copied { animation: hookCopied 0.6s ease; }

/* Drawer panel */
.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-body {
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 60px);
}
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.3s;
    display: none;
}
.drawer-backdrop.open {
    display: block;
    opacity: 1;
}
.kanban-card .k-pillar {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
}
.kanban-card .k-title { font-size: var(--fs-sm); margin-bottom: 8px; line-height: 1.4; font-weight: 500; }
.kanban-card .k-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-3);
}
.kanban-card .k-format {
    padding: 2px 6px;
    background: var(--bg-2);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
}

/* Empty Kanban Column */
.kanban-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-3);
    font-size: var(--fs-xs);
    border: 2px dashed var(--border-0);
    border-radius: var(--radius);
}

/* === CALENDAR === */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-header h1 { font-size: var(--fs-xl); }
.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav button {
    padding: 8px 14px;
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    background: var(--bg-1);
    cursor: pointer;
    color: var(--text-1);
    font-family: var(--font-sans);
    transition: all var(--duration);
}
.calendar-nav button:hover { background: var(--bg-2); }
.calendar-month {
    font-family: var(--font-serif);
    font-size: var(--fs-base);
    min-width: 160px;
    text-align: center;
}
.calendar-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }

.calendar-sidebar {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.sidebar-title { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }
.sidebar-sub { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 14px; }

.drag-item {
    background: var(--bg-2);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 6px;
    cursor: grab;
    transition: all var(--duration);
}
.drag-item:hover { border-color: var(--accent); }
.drag-item:active { cursor: grabbing; }
.drag-item .d-pillar { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 2px; text-transform: uppercase; }
.drag-item .d-title { font-size: var(--fs-sm); }

.calendar-main {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-2);
}
.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
}
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-day {
    min-height: 80px;
    border-right: 1px solid var(--border-0);
    border-bottom: 1px solid var(--border-0);
    padding: 6px;
    transition: background var(--duration);
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day.today { background: transparent; }
.calendar-day.today .day-num { background: var(--accent); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
@keyframes calendarTodayPulse {
    0%, 100% { box-shadow: inset 0 0 0 1px var(--accent-border); }
    50% { box-shadow: inset 0 0 0 2px var(--accent); }
}
.calendar-day.other-month { opacity: 0.3; }
.calendar-day .day-num { font-size: var(--fs-xs); font-weight: 600; margin-bottom: 4px; }
.calendar-event {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    margin-bottom: 2px;
    background: var(--accent-bg);
    color: var(--accent);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.calendar-event:hover { opacity: 0.8; }
.calendar-day.drag-over { background: var(--accent-bg); box-shadow: inset 0 0 0 2px var(--accent); border: 1px dashed var(--accent); }

/* Calendar month transition */
.calendar-days { animation: calMonthFade 0.3s ease-out; }
@keyframes calMonthFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calendar event hover */
.calendar-event { transition: all var(--duration); }
.calendar-event:hover { opacity: 1; transform: scale(1.05); box-shadow: var(--shadow-sm); }

/* Calendar drag items */
.drag-item.card-lift { transition: all var(--duration) var(--ease-out); }
.drag-item:active { cursor: grabbing; transform: scale(1.02); box-shadow: var(--shadow-md); }

/* Calendar sidebar scroll fade */
.calendar-sidebar { position: relative; max-height: 500px; overflow-y: auto; }
.calendar-sidebar::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: block;
    height: 40px;
    background: linear-gradient(to top, var(--bg-1), transparent);
    pointer-events: none;
}

/* Queue priority color bars */
.queue-item.priority-high { border-left-color: var(--red); }
.queue-item.priority-medium { border-left-color: var(--accent); }
.queue-item.priority-low { border-left-color: var(--sage); }

/* Queue card lift */
.queue-item.card-lift { transition: all var(--duration) var(--ease-out); }

/* Queue completion animation */
.queue-item.completing {
    animation: queueComplete 0.4s ease-out forwards;
}
@keyframes queueComplete {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: 0; border: none; overflow: hidden; }
}

/* Queue stat cards */
.queue-stat-card.card-lift { transition: all var(--duration) var(--ease-out); }

/* === ANALYTICS === */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.analytics-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.analytics-card h3 {
    font-size: var(--fs-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    margin-bottom: 16px;
}
.analytics-card.full-width { grid-column: 1 / -1; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar {
    width: 4px;
    background: var(--accent-bg);
    border-radius: 2px;
    transition: height 0.5s var(--ease-out);
    position: relative;
}
.bar.active { background: var(--accent); background-image: var(--accent-gradient); }

/* Bar animated growth */
.bar.bar-animate {
    height: 0 !important;
    animation: barGrow 0.6s var(--ease-out) forwards;
}
@keyframes barGrow {
    from { height: 0; }
    to { height: var(--bar-height); }
}

/* Active bar glow */
.bar.bar-glow {
    box-shadow: 0 0 12px var(--accent-border), 0 0 24px rgba(0, 122, 255, 0.15);
}
.bar-label { font-size: 9px; color: var(--text-3); font-weight: 600; }
.bar-value { font-size: var(--fs-xs); font-weight: 600; }

.pillar-breakdown { display: flex; flex-direction: column; gap: 12px; }
.pillar-bar-item { display: flex; align-items: center; gap: 12px; }
.pillar-bar-label { font-size: var(--fs-sm); width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pillar-bar-track { flex: 1; height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.pillar-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s var(--ease-out);
}
.pillar-bar-pct { font-size: var(--fs-xs); color: var(--text-3); width: 36px; text-align: right; }

/* Heatmap hover */
.heatmap-cell { transition: transform var(--duration); }
.heatmap-cell:hover { transform: scale(1.4); z-index: 1; }

/* Achievement unlock spring */
.achievement-unlocked {
    animation: achieveUnlock 0.5s var(--ease-out);
}
@keyframes achieveUnlock {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Achievement locked shimmer on hover */
.achievement-locked { position: relative; overflow: hidden; }
.achievement-locked:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.08) 45%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.08) 55%, transparent 60%);
    animation: achieveShimmer 1s ease-in-out;
}
@keyframes achieveShimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Flow arrow pulse */
.flow-arrow::after {
    animation: flowPulse 2s ease-in-out infinite;
}
@keyframes flowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Analytics card entrance */
.analytics-grid.stagger-in > .analytics-card {
    animation: analyticsCardIn 0.4s var(--ease-out) both;
}
.analytics-grid.stagger-in > .analytics-card:nth-child(1) { animation-delay: 0s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(2) { animation-delay: 0.08s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(3) { animation-delay: 0.16s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(4) { animation-delay: 0.24s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(5) { animation-delay: 0.32s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(6) { animation-delay: 0.4s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(7) { animation-delay: 0.48s; }
.analytics-grid.stagger-in > .analytics-card:nth-child(8) { animation-delay: 0.56s; }
@keyframes analyticsCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Format tag hover */
.format-tag { transition: transform var(--duration), color var(--duration); display: inline-block; }
.format-tag:hover { transform: scale(1.15); color: var(--accent-light) !important; }

/* Level progress bar dot */
.level-progress-dot {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* === VOICE === */
.voice-page { max-width: 700px; margin: 0 auto; }
.voice-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }
.voice-header h1 { font-size: var(--fs-xl); }

.voice-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.voice-section-header {
    padding: 14px 20px;
    background: var(--bg-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.voice-section-body { padding: 20px; }
.voice-profile {
    font-size: var(--fs-base);
    line-height: 1.8;
    font-style: italic;
    color: var(--text-2);
    border-left: 3px solid var(--accent);
    padding-left: 16px;
}

.tone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.tone-item {
    text-align: center;
    padding: 14px;
    background: var(--bg-2);
    border-radius: var(--radius);
}
.tone-label { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; }
.tone-value { font-size: var(--fs-base); font-weight: 500; text-transform: capitalize; }

.word-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.word-tag {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 500;
}
.word-use { background: var(--sage-bg); color: var(--sage); }
.word-avoid { background: var(--red-bg); color: var(--red); text-decoration: line-through; }

/* === ROADMAP === */
.roadmap-page { max-width: 800px; margin: 0 auto; }
.roadmap-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }
.roadmap-header h1 { font-size: var(--fs-xl); }

.rm-section {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.rm-header {
    padding: 14px 20px;
    background: var(--bg-2);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.rm-body { padding: 20px; }

.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.schedule-day {
    text-align: center;
    padding: 14px 6px;
    background: var(--bg-2);
    border-radius: var(--radius);
    transition: all var(--duration);
}
.schedule-day.has-post { background: var(--accent-bg); border: 1px solid var(--accent-border); }
.schedule-day-name { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; }
.schedule-day-content { font-size: 10px; color: var(--text-2); }

.phase-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.phase-card {
    padding: 20px;
    background: var(--bg-2);
    border-radius: var(--radius);
    border-top: 3px solid var(--text-0);
    transition: all var(--duration);
}
.phase-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.phase-card:nth-child(2) { border-color: var(--accent); }
.phase-card:nth-child(3) { border-color: var(--sage); }
.phase-num { font-size: 9px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; }
.phase-name { font-size: var(--fs-base); font-family: var(--font-serif); margin-bottom: 4px; }
.phase-days { font-size: var(--fs-xs); color: var(--accent); margin-bottom: 8px; font-weight: 600; }
.phase-focus { font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn var(--duration) var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-1);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    animation: modalSlide var(--duration-slow) var(--ease-spring);
}
.modal-lg { max-width: 640px; }

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    position: sticky;
    top: 0;
    background: var(--bg-1);
    z-index: 1;
}
.modal-title { font-size: 17px; font-weight: 600; font-family: var(--font-sans); }
.modal-sub { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; }
.modal-header-actions { display: flex; gap: 4px; align-items: center; }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-2);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration);
}
.modal-close:hover { background: var(--bg-3); color: var(--text-0); }

.modal-body { padding: 24px; max-height: calc(85vh - 120px); overflow-y: auto; }
.modal-section { margin-bottom: 20px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 10px;
}

.hook-item {
    padding: 12px 14px;
    background: var(--bg-2);
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--duration);
    border: 1px solid transparent;
}
.hook-item:hover { background: var(--bg-3); border-color: var(--border-0); }
.hook-item.copied { background: var(--sage-bg); border-color: var(--sage-border); }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: var(--bg-1);
}

.idea-status-switcher { display: flex; gap: 4px; }
.status-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-0);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-1);
    color: var(--text-2);
    font-family: var(--font-sans);
    transition: all var(--duration);
}
.status-btn:hover { border-color: var(--text-3); }
.status-btn.active { background: var(--text-0); color: var(--text-inv); border-color: var(--text-0); }

/* Settings */
.settings-section { margin-bottom: 24px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-title { font-size: var(--fs-sm); font-family: var(--font-sans); font-weight: 600; margin-bottom: 12px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.shortcuts-list { display: flex; flex-direction: column; gap: 8px; }
.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-sm);
    color: var(--text-2);
}
kbd {
    padding: 3px 8px;
    background: var(--bg-2);
    border: 1px solid var(--border-0);
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-sans);
    color: var(--text-2);
}

/* === COMMAND PALETTE === */
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-cmd);
    display: none;
    justify-content: center;
    padding-top: 20vh;
}
.cmd-palette-overlay.active {
    display: flex;
    animation: fadeIn 150ms var(--ease-out);
}
.cmd-palette {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    animation: modalSlide 200ms var(--ease-spring);
}
.cmd-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-0);
}
.cmd-search svg { color: var(--text-3); flex-shrink: 0; }
.cmd-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: var(--fs-base);
    font-family: var(--font-sans);
    color: var(--text-0);
    outline: none;
}
.cmd-search input::placeholder { color: var(--text-3); }
.cmd-search kbd { flex-shrink: 0; }

.cmd-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.cmd-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 8px 10px 4px;
}
.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg-2); transform: translateX(4px); transition: all var(--duration) var(--ease-out); }
.cmd-item-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.cmd-item.selected .cmd-item-icon { background: var(--accent-bg); }
.cmd-item-text { flex: 1; }
.cmd-item-title { font-size: var(--fs-sm); font-weight: 500; }
.cmd-item-desc { font-size: var(--fs-xs); color: var(--text-3); }
.cmd-item-shortcut { font-size: var(--fs-xs); color: var(--text-3); }

.cmd-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border-0);
    display: flex;
    gap: 16px;
    font-size: var(--fs-xs);
    color: var(--text-3);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-sm);
    pointer-events: auto;
    animation: toastIn var(--duration-slow) var(--ease-spring);
    max-width: 360px;
}
.toast.removing { animation: toastOut var(--duration) var(--ease-out) forwards; }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { flex: 1; }
.toast-close {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-3);
    padding: 2px;
}
.toast { position: relative; overflow: hidden; }
.toast.success { border-left: 3px solid var(--sage); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    animation: toastProgressShrink linear forwards;
    width: 100%;
}
.toast.success .toast-progress { background: var(--sage); }
.toast.error .toast-progress { background: var(--red); }
.toast.info .toast-progress { background: var(--blue); }
@keyframes toastProgressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(20px) scale(0.95); }
}

/* === ERROR VIEW === */
.error-view {
    text-align: center;
    padding: 80px 24px;
    max-width: 420px;
    margin: 0 auto;
}
.error-icon { margin-bottom: 20px; color: var(--text-3); }
.error-view h2 { font-size: var(--fs-xl); margin-bottom: 8px; }
.error-view p { color: var(--text-2); margin-bottom: 24px; font-size: var(--fs-sm); line-height: 1.6; }
.error-actions { display: flex; gap: 10px; justify-content: center; }

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-card { height: 80px; margin-bottom: 10px; }
.skeleton-circle { border-radius: 50%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-side { order: -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .kanban { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; }
    .sidebar-toggle-btn { display: flex; }
    .window-chrome { padding-left: 12px; }
    .traffic-lights { display: none; }
    .window-chrome::before {
        content: '';
        display: block;
        width: 32px;
        height: 32px;
        cursor: pointer;
    }
    .mobile-nav { display: flex; }
    .app.with-nav { padding-bottom: 72px; margin-left: 0; }

    .view { padding: 20px 16px; }
    .dash-side { grid-template-columns: 1fr; }
    .dash-welcome { flex-direction: column; align-items: flex-start; gap: 12px; }

    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .kanban { grid-template-columns: 1fr; }
    .calendar-layout { grid-template-columns: 1fr; }
    .calendar-sidebar { display: none; }
    .phase-row, .tone-grid, .schedule-grid { grid-template-columns: repeat(2, 1fr); }

    .option-grid { grid-template-columns: repeat(2, 1fr); }
    .option-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

    .modal { margin: 8px; max-height: 90vh; }

    .toast-container { bottom: 88px; right: 16px; left: 16px; }
    .toast { max-width: 100%; }

    .cmd-palette-overlay { padding-top: 10vh; padding: 10vh 16px 0; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: var(--fs-xl); }
    .tracker-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .schedule-grid { grid-template-columns: repeat(3, 1fr); }
    .phase-row { grid-template-columns: 1fr; }
    .tone-grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr; }
    .vault-search { width: 100%; }
}

/* === BRAND SWITCHER === */
.brand-switcher {
    position: relative;
}

.brand-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}

.brand-current:hover {
    background: var(--bg-2);
}

.brand-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--text-inv);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-lg);
    flex-shrink: 0;
}

.brand-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--fs-base);
}

.brand-avatar-new {
    background: var(--bg-3);
    color: var(--text-2);
    border: 2px dashed var(--border-0);
}

.brand-info {
    min-width: 0;
}

.brand-name {
    font-weight: 600;
    font-size: var(--fs-base);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-meta {
    font-size: var(--fs-xs);
    color: var(--text-3);
}

.brand-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: var(--text-3);
}

.brand-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.brand-dropdown.open {
    display: block;
    animation: dropdown-in 0.15s ease-out;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.brand-option:hover {
    background: var(--bg-2);
}

.brand-option.active {
    background: var(--bg-2);
}

.brand-option.brand-new {
    border-top: 1px solid var(--border-0);
}

.brand-option-info {
    min-width: 0;
    flex: 1;
}

.brand-option-name {
    font-size: var(--fs-sm);
    font-weight: 500;
    text-transform: capitalize;
}

.brand-option-meta {
    font-size: var(--fs-xs);
    color: var(--text-3);
    text-transform: capitalize;
}

.brand-active-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* === ANALYTICS HEATMAP === */
.analytics-heatmap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    padding: 16px 0;
}

.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--bg-2);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.heatmap-cell:hover { transform: scale(1.15); box-shadow: var(--shadow-sm); }

.heatmap-cell.today {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.heatmap-legend {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-top: 12px;
}

.donut-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto;
}

/* === CONTENT PIPELINE === */
.flow-pipeline {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.flow-node {
    padding: 12px 16px;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
    background: var(--bg-2);
    color: var(--text-1);
    transition: all var(--duration) var(--ease-out);
    min-width: 100px;
    border: 1px solid var(--border-0);
}
.flow-node:hover {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.flow-arrow {
    font-size: 18px;
    color: var(--text-3);
    flex-shrink: 0;
}

/* === DASHBOARD HEATMAP === */
.streak-heatmap {
    display: grid;
    gap: 2px;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    transition: all var(--duration);
}

.heatmap-empty { background: var(--bg-2); }
.heatmap-low { background: rgba(52, 199, 89, 0.2); }
.heatmap-med { background: rgba(52, 199, 89, 0.5); }
.heatmap-high { background: var(--sage); }

.heatmap-day:hover { transform: scale(1.2); }

/* === HEALTH SCORE & CARDS === */
.health-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.health-ring {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.health-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.health-ring circle { fill: none; stroke-width: 6; }

.pillar-donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto;
}

.ai-insight {
    background: linear-gradient(135deg, var(--accent-bg), rgba(0, 122, 255, 0.04));
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all var(--duration) var(--ease-out);
}
.ai-insight:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.insight-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--accent);
}

.insight-text {
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: var(--text-1);
}

/* === VAULT VIEW === */
.vault-view-toggle {
    display: flex;
    gap: 6px;
}

.vault-sort {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vault-list {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    overflow: hidden;
}

.vault-list-row {
    border-bottom: 1px solid var(--border-0);
    transition: background var(--duration);
}
.vault-list-row:hover { background: var(--bg-2); }
.vault-list-row:last-child { border-bottom: none; }

.vault-list-cell {
    padding: 12px;
    font-size: var(--fs-sm);
    color: var(--text-1);
}

.vault-pillar-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.vault-select {
    accent-color: var(--accent);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.vault-batch-bar {
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.vault-summary {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 14px 16px;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

/* === VOICE SECTION === */
.voice-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all var(--duration);
}
.voice-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }

/* Voice shimmer border — disabled for clean Apple look */
.voice-shimmer { position: relative; }
.voice-shimmer::before { display: none; }

/* Vocabulary word hover */
.vocab-word { transition: all var(--duration) !important; }
.vocab-word:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-sm); }

.voice-copy-btn {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--fs-xs);
    color: var(--accent);
    transition: all var(--duration) var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.voice-copy-btn:hover {
    text-decoration: underline;
}

.tone-spectrum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.tone-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-0);
    transition: all var(--duration) var(--ease-out);
    background: var(--accent);
    cursor: pointer;
}
.tone-dot:hover { transform: scale(1.15); box-shadow: var(--shadow-sm); }

.voice-vocab-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--bg-2);
    border: 1px solid var(--border-0);
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.voice-vocab-tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent);
}

.voice-cheat-sheet {
    background: linear-gradient(135deg, var(--purple-bg), rgba(124, 108, 173, 0.04));
    border: 1px solid rgba(124, 108, 173, 0.2);
}

.sig-phrase {
    display: inline-block;
    padding: 8px 14px;
    background: var(--purple-bg);
    border: 1px solid rgba(124, 108, 173, 0.2);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.sig-phrase:hover {
    transform: translateY(-2px);
    border-color: var(--purple);
    box-shadow: var(--shadow-sm);
}

/* === ROADMAP TIMELINE === */
.roadmap-timeline {
    position: relative;
    padding: 20px 0 20px 60px;
}

.timeline-line {
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-0);
}

.timeline-node {
    position: absolute;
    left: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border-0);
    background: var(--bg-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all var(--duration) var(--ease-out);
}

.timeline-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.timeline-completed {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Timeline line grow animation */
.timeline-line {
    animation: timelineGrow 0.8s ease-out;
    transform-origin: top;
}
@keyframes timelineGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Strategy progress bar animated fill */
.progress-bar-animated {
    animation: progressFill 1s ease-out 0.3s forwards;
}
@keyframes progressFill {
    from { width: 0; }
    to { width: var(--target-width); }
}

/* Milestone check animation */
.milestone-check:checked {
    animation: milestoneCheck 0.3s ease-out;
}
@keyframes milestoneCheck {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Clock spin-in for best posting times */
.time-indicator {
    animation: clockSpinIn 0.8s ease-out;
}
@keyframes clockSpinIn {
    from { transform: rotate(-180deg) scale(0.5); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

.phase-card-v2 {
    padding: 20px;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    transition: all var(--duration) var(--ease-out);
    margin-bottom: 16px;
}
.phase-card-v2:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.phase-progress {
    height: 4px;
    background: var(--bg-2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}
.phase-progress::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width var(--duration-slow) var(--ease-out);
}

.milestone-check {
    accent-color: var(--accent);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.schedule-visual {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.time-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 0deg, var(--accent) 180deg, var(--bg-2) 180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-0);
    box-shadow: var(--shadow-sm);
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 1024px) {
    .flow-pipeline { flex-wrap: wrap; }
    .analytics-heatmap { overflow-x: auto; padding-bottom: 8px; }
}

@media (max-width: 768px) {
    .vault-list { display: block; overflow-x: auto; }
    .voice-card { padding: 16px; }
    .roadmap-timeline { padding-left: 40px; }
    .timeline-line { left: 18px; }
    .timeline-node { width: 40px; height: 40px; left: -8px; }
    .schedule-visual { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
    .analytics-heatmap { grid-template-columns: repeat(7, 1fr); }
    .schedule-visual { grid-template-columns: repeat(2, 1fr); }
    .tone-spectrum { flex-wrap: wrap; }
}

/* === VIEW TRANSITIONS === */
.view {
    transition: opacity var(--duration-slow) var(--ease-out);
}

.view.entering {
    animation: viewSlideIn var(--duration-slow) var(--ease-out);
}

.view.leaving {
    animation: viewSlideOut var(--duration) var(--ease-out);
}

@keyframes viewSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes viewSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

/* === MICRO-ANIMATIONS === */

/* Staggered children animations */
.stats-row > *:nth-child(1) { animation-delay: 0ms; }
.stats-row > *:nth-child(2) { animation-delay: 50ms; }
.stats-row > *:nth-child(3) { animation-delay: 100ms; }
.stats-row > *:nth-child(4) { animation-delay: 150ms; }

.kanban > *:nth-child(1) { animation-delay: 0ms; }
.kanban > *:nth-child(2) { animation-delay: 60ms; }
.kanban > *:nth-child(3) { animation-delay: 120ms; }
.kanban > *:nth-child(4) { animation-delay: 180ms; }

.analytics-grid > * {
    animation: cardEntrance var(--duration-slow) var(--ease-out) backwards;
}
.analytics-grid > *:nth-child(1) { animation-delay: 0ms; }
.analytics-grid > *:nth-child(2) { animation-delay: 60ms; }
.analytics-grid > *:nth-child(3) { animation-delay: 120ms; }
.analytics-grid > *:nth-child(4) { animation-delay: 180ms; }

.phase-row > *:nth-child(1) { animation-delay: 0ms; }
.phase-row > *:nth-child(2) { animation-delay: 80ms; }
.phase-row > *:nth-child(3) { animation-delay: 160ms; }

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Achievement icon floating animation */
.achievement-unlock {
    animation: achievementFloat var(--duration-slow) var(--ease-out);
}

@keyframes achievementFloat {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(-8px);
    }
}

/* Subtle shimmer on accent elements */
.accent-shimmer:hover {
    animation: accentShimmer var(--duration) var(--ease-out);
}

@keyframes accentShimmer {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

/* Smooth number transitions */
.stat-value {
    transition: all var(--duration-slow) var(--ease-out);
}

.stat-card {
    animation: cardEntrance var(--duration-slow) var(--ease-out) backwards;
}

/* Card entrance animations */
.kanban-card {
    animation: cardEntrance var(--duration-slow) var(--ease-out) backwards;
}

.kanban-card:nth-child(1) { animation-delay: 0ms; }
.kanban-card:nth-child(2) { animation-delay: 40ms; }
.kanban-card:nth-child(3) { animation-delay: 80ms; }
.kanban-card:nth-child(4) { animation-delay: 120ms; }
.kanban-card:nth-child(5) { animation-delay: 160ms; }

/* === DARK MODE ENHANCEMENTS === */

[data-theme="dark"] .kanban-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .kanban-card:hover {
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
}

[data-theme="dark"] .voice-card {
    border-color: var(--border-1);
    box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.1);
}

[data-theme="dark"] .voice-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .analytics-card {
    background: var(--bg-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .analytics-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .today-task:hover {
    background: var(--bg-3);
    box-shadow: inset 0 0 0 1px var(--accent-border);
}

[data-theme="dark"] .stat-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
}

[data-theme="dark"] .modal {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* === ACCESSIBILITY IMPROVEMENTS === */

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --text-0: #000000;
        --text-1: #1a1a1a;
        --border-0: #000000;
        --border-1: #1a1a1a;
    }

    [data-theme="dark"] {
        --text-0: #ffffff;
        --text-1: #ffffff;
        --border-0: #ffffff;
        --border-1: #ffffff;
    }

    .btn, .icon-btn, .chip, .option-card {
        border-width: 2px;
    }
}

/* Reduced motion support */
/* Dark mode smooth transitions */
body, .nav, .app, .view, .btn, .card, .stat-card, .analytics-card, .voice-card,
.modal-overlay, .modal-content, .cmd-palette, .toast, .queue-item, .queue-stat-card,
.calendar-main, .calendar-sidebar, .calendar-day, .kanban-card, .kanban-col,
.mobile-nav, .drawer, input, textarea, select {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    /* Force elements to final state */
    .reveal, .stagger-in > *, .bar-animate, .progress-bar-animated {
        opacity: 1 !important;
        transform: none !important;
    }
    .bar-animate {
        height: var(--bar-height) !important;
    }
    .progress-bar-animated {
        width: var(--target-width) !important;
    }
    .counter {
        /* counters should show final value immediately */
    }
}

/* Ensure all interactive elements have visible focus */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast focus ring for dark mode */
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] input:focus-visible {
    outline-color: var(--accent-light);
}

/* Minimum touch target sizes for mobile */
@media (pointer: coarse) {
    .btn,
    .icon-btn,
    .mobile-nav-btn,
    .chip,
    input,
    textarea,
    select,
    button {
        min-height: 48px;
        min-width: 48px;
    }

    .btn-sm {
        min-height: 44px;
        min-width: 44px;
    }

    .form-input, .form-textarea {
        min-height: 48px;
        padding: 14px 16px;
    }

    .task-check {
        width: 28px;
        height: 28px;
    }
}

/* Text contrast ratios meet WCAG AA standards */
.text-contrast-aa {
    color: var(--text-0);
}

/* === SKELETON LOADING ENHANCEMENTS === */

.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 80px;
    margin-bottom: 10px;
}

.skeleton-circle {
    border-radius: 50%;
}

/* Skeleton variations for different content */
.skeleton-stat-card {
    height: 120px;
    margin-bottom: 12px;
    border-radius: var(--radius);
}

.skeleton-kanban-card {
    height: 100px;
    margin-bottom: 8px;
    border-radius: var(--radius);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.skeleton-heading {
    height: 28px;
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-paragraph {
    height: 12px;
    margin-bottom: 6px;
}

.skeleton-paragraph:last-child {
    width: 80%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* === SCROLLBAR STYLING === */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
    background: var(--border-1);
    border-radius: 4px;
    transition: background var(--duration);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--border-1) var(--bg-2);
    scrollbar-width: thin;
}

/* === SELECTION & HIGHLIGHT STYLES === */

::selection {
    background: var(--accent-bg);
    color: var(--accent);
}

::placeholder {
    color: var(--text-3);
}

/* Search highlight */
.search-highlight {
    background: var(--accent-bg);
    color: var(--accent);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

/* Text selection indicator */
.text-selected {
    background: var(--accent-bg);
    padding: 2px 4px;
    border-radius: 2px;
}

/* === FORM FIELD ENHANCEMENTS === */

.field-error {
    display: block;
    font-size: var(--fs-xs);
    color: var(--red);
    margin-top: 6px;
    font-weight: 500;
}

.form-input.error,
.form-textarea.error {
    border-color: var(--red);
    background: var(--red-bg);
}

.form-input.error:focus,
.form-textarea.error:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-bg);
}

.form-input.success,
.form-textarea.success {
    border-color: var(--sage);
    background: var(--sage-bg);
}

.form-input.success:focus,
.form-textarea.success:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-bg);
}

.char-counter {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-top: 6px;
    text-align: right;
    transition: color var(--duration);
}

.char-counter.warning {
    color: var(--accent);
}

.char-counter.error {
    color: var(--red);
}

/* Form group validation states */
.form-group.error label {
    color: var(--red);
}

.form-group.success label {
    color: var(--sage);
}

.form-group.focused label {
    color: var(--accent);
}

/* === SETTINGS PAGE STYLES === */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.setting-card {
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--duration) var(--ease-out);
}

.setting-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
}

.setting-title {
    font-size: var(--fs-base);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-0);
}

.setting-desc {
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Slider control */
.slider-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-input {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration);
}

.slider-input::-webkit-slider-thumb:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-md);
    transform: scale(1.15);
}

.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration);
}

.slider-input::-moz-range-thumb:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-md);
    transform: scale(1.15);
}

.slider-value {
    font-size: var(--fs-sm);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    color: var(--accent);
}

/* Color picker */
.color-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-option {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.color-option.selected {
    border-color: var(--text-0);
    box-shadow: var(--shadow-lg);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Danger zone */
.danger-zone {
    background: var(--red-bg);
    border: 1px solid var(--red);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 32px;
}

.danger-zone-title {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--red);
    margin-bottom: 8px;
}

.danger-zone-desc {
    font-size: var(--fs-sm);
    color: var(--text-2);
    margin-bottom: 16px;
}

.danger-zone-action {
    display: flex;
    gap: 8px;
}

/* Toggle switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    width: 42px;
    height: 26px;
    background: var(--bg-3);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background var(--duration) var(--ease-out);
    border: none;
    padding: 0;
}

.toggle-switch.enabled {
    background: var(--sage);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left var(--duration) var(--ease-out);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.enabled::after {
    left: 18px;
}

/* === RESPONSIVE FORM TWEAKS === */

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .color-picker {
        gap: 8px;
    }

    .color-option {
        width: 40px;
        height: 40px;
    }

    .form-input, .form-textarea {
        font-size: 16px;
    }
}

/* === ADDITIONAL RESPONSIVE TWEAKS === */

/* Better tablet layout for kanban */
@media (max-width: 1024px) and (min-width: 769px) {
    .kanban {
        grid-template-columns: repeat(3, 1fr);
    }

}

/* Improved mobile card stacking */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .analytics-card.full-width {
        grid-column: 1;
    }

    .phase-row {
        grid-template-columns: 1fr;
    }

    .tone-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .stat-value {
        font-size: var(--fs-xl);
    }

    .stat-label {
        font-size: var(--fs-xs);
    }
}

/* Better touch scroll for horizontal sections */
@media (pointer: coarse) {
    .kanban,
    .analytics-grid,
    .vault-list,
    .schedule-grid {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .vault-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Smooth scrolling for all sections */
.scrollable-section {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Improved mobile navigation spacing */
@media (max-width: 480px) {
    .nav {
        padding: 0 16px;
    }

    .mobile-nav {
        height: 68px;
    }

    .mobile-nav-btn {
        padding: 6px;
    }

    .view {
        padding: 16px 12px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .btn {
        padding: 9px 16px;
    }

    .btn-sm {
        padding: 6px 12px;
    }
}

/* === ANIMATIONS FOR DISCOVERY FLOW === */

/* Slide out animation for phase transitions */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Slide in animation for phase transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce animation for option card selection */
@keyframes bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Pulse animation for active progress step */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 122, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}


/* === FORM SLIDER === */
.form-slider {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--bg-3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background var(--duration) var(--ease-out);
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--duration) var(--ease-out);
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.form-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
    transition: all var(--duration) var(--ease-out);
}

.form-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.form-slider:focus {
    background: var(--bg-2);
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: 1px solid #f59e0b;
    transition: all var(--duration) var(--ease-out);
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    box-shadow: var(--shadow-md);
}

/* === CONTENT QUEUE === */
.queue-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--pad-lg);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.queue-header h1 {
    font-size: var(--fs-3xl);
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-0);
}

.queue-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-2);
    margin: 0;
}

.queue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.queue-stat-card {
    padding: 16px;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-radius: var(--radius);
    text-align: center;
    transition: all var(--duration) var(--ease-out);
}

.queue-stat-card:hover {
    border-color: var(--border-1);
    box-shadow: var(--shadow-sm);
}

.queue-stat-value {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--text-0);
    margin-bottom: 4px;
}

.queue-stat-label {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 2px;
}

.queue-stat-sub {
    font-size: var(--fs-xs);
    color: var(--text-3);
}

.queue-timeline {
    margin-bottom: 24px;
}

.queue-section-label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px 0;
    padding-left: 12px;
}

.queue-section-divider {
    height: 1px;
    background: var(--border-0);
    margin: 20px 0;
}

.queue-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-1);
    border: 1px solid var(--border-0);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: all var(--duration) var(--ease-out);
    align-items: flex-start;
}

.queue-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-1);
}

.queue-item.today {
    border-left-color: var(--accent);
    background: var(--accent-bg);
}

.queue-item.this-week {
    border-left-color: var(--blue);
    background: var(--blue-bg);
}

.queue-item.urgent {
    border-left-color: var(--red);
    background: var(--red-bg);
}

.queue-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    cursor: grab;
    color: var(--text-3);
    border-radius: var(--radius-sm);
    transition: all var(--duration);
}

.queue-drag-handle:hover {
    background: var(--bg-2);
    color: var(--text-1);
}

.queue-item-content {
    flex: 1;
}

.queue-item-title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-0);
    margin-bottom: 8px;
    word-break: break-word;
}

.queue-item-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.queue-pillar-tag {
    font-size: var(--fs-xs);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 500;
    white-space: nowrap;
}

.queue-date-badge {
    font-size: var(--fs-xs);
    color: var(--text-2);
    padding: 4px 8px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.queue-status-badge {
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-status-badge[data-status="in_progress"] {
    background: var(--accent-bg);
    color: var(--accent);
}

.queue-status-badge[data-status="planned"] {
    background: var(--blue-bg);
    color: var(--blue);
}

.queue-status-badge[data-status="fresh"] {
    background: var(--sage-bg);
    color: var(--sage);
}

.queue-status-badge[data-status="posted"] {
    background: var(--purple-bg);
    color: var(--purple);
}

.queue-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.queue-item-actions .icon-btn {
    padding: 6px;
    color: var(--text-2);
    transition: all var(--duration);
}

.queue-item-actions .icon-btn:hover:not(:disabled) {
    color: var(--text-0);
    background: var(--bg-2);
}

.queue-item-actions .icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.queue-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-1);
    border: 2px dashed var(--border-0);
    border-radius: var(--radius);
}

.queue-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.queue-empty-title {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--text-0);
    margin-bottom: 8px;
}

.queue-empty-desc {
    font-size: var(--fs-md);
    color: var(--text-2);
    margin-bottom: 24px;
    max-width: 300px;
}

.queue-footer {
    display: flex;
    justify-content: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-0);
}

/* === ONBOARDING === */
.onboarding-overlay { position: fixed; inset: 0; z-index: 500; pointer-events: auto; }
.onboarding-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.onboarding-spotlight { /* cutout */ }
.onboarding-tooltip {
    position: absolute; background: var(--bg-1); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-xl); max-width: 320px; z-index: 501;
    animation: tooltipIn var(--duration-slow) var(--ease-spring);
}
.onboarding-tooltip-text { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-1); margin-bottom: 16px; }
.onboarding-step-counter { font-size: var(--fs-xs); color: var(--text-3); }
.onboarding-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* === INSIGHTS === */
.insights-grid { display: grid; gap: 12px; }
.insight-card {
    padding: 14px; background: var(--bg-1); border: 1px solid var(--border-0);
    border-radius: var(--radius); cursor: pointer; transition: all var(--duration);
    display: flex; gap: 12px; align-items: flex-start;
}
.insight-card:hover { transform: translateX(4px); border-color: var(--accent-border); }
.insight-priority-high { border-left: 3px solid var(--accent); }
.insight-priority-medium { border-left: 3px solid var(--blue); }
.insight-priority-low { border-left: 3px solid var(--border-0); }

/* === PLATFORM EXPORT === */
.export-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-0); padding-bottom: 8px; }
.export-tab { padding: 8px 16px; cursor: pointer; font-size: var(--fs-sm); border-radius: var(--radius) var(--radius) 0 0; transition: all var(--duration); }
.export-tab.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.export-content {
    background: var(--bg-2); border-radius: var(--radius);
    padding: 16px; font-family: var(--font-sans); font-size: var(--fs-sm);
    white-space: pre-wrap; line-height: 1.6; max-height: 300px; overflow-y: auto;
}
.export-copy-btn { margin-top: 12px; }

/* === PRINT === */
@media print {
    .nav, .mobile-nav, .toast-container, .cmd-palette-overlay { display: none !important; }
    .app { padding: 0 !important; }
    .view { max-width: 100%; padding: 0; }
    body { font-size: 12px; background: white; color: black; }
}
