/*
 * Metacloud - Modern Progressive Disclosure UI
 * Clean. Spacious. Hierarchical.
 */

:root {
    /* Core palette - refined and accessible */
    --ink: #18181b;
    --ink-secondary: #3f3f46;
    --ink-muted: #71717a;
    --ink-faint: #a1a1aa;

    --surface: #ffffff;
    --surface-raised: #fafafa;
    --surface-sunken: #f4f4f5;
    --surface-hover: #f0f0f2;

    --border: #e4e4e7;
    --border-light: #f0f0f2;

    /* Accent - primary blue */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: #eff6ff;
    --accent-text: #1d4ed8;

    /* Status colors - softer, more refined */
    --success: #22c55e;
    --success-soft: #f0fdf4;
    --success-text: #15803d;

    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --warning-text: #b45309;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-soft: #fef2f2;
    --danger-text: #b91c1c;

    --info: #6366f1;
    --info-soft: #eef2ff;
    --info-text: #4338ca;

    /* Typography scale */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.375rem;
    --font-2xl: 1.75rem;
    --font-3xl: 2.25rem;
    --font-4xl: 3rem;

    /* Line heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Effects */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --transition-fast: 100ms ease;
    --transition: 150ms ease;
    --transition-slow: 200ms ease;

    /* Legacy aliases (used in inline template styles) */
    --steel: var(--border);
    --paper: var(--surface);
    --paper-warm: var(--surface-sunken);
    --paper-dark: var(--surface-sunken);
    --accent-light: var(--accent-soft);
    --radius: var(--radius-md);
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-base);
    line-height: var(--leading-relaxed);
    color: var(--ink);
    background: var(--surface-sunken);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--ink);
}

h1 { font-size: var(--font-2xl); }
h2 { font-size: var(--font-xl); }
h3 { font-size: var(--font-lg); }
h4 { font-size: var(--font-base); font-weight: 600; }

p {
    color: var(--ink-secondary);
    line-height: var(--leading-relaxed);
}

.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }

.section-title {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-4);
}

/* ============================================
   LINKS
   ============================================ */

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

a:hover {
    color: var(--accent-hover);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink);
    font-weight: 600;
    font-size: var(--font-base);
    text-decoration: none;
}

.header-logo:hover {
    color: var(--ink);
}

.header-logo img {
    width: 26px;
    height: 26px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-link-item {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--ink-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.nav-link-item:hover {
    color: var(--ink);
    background: var(--surface-hover);
}

.nav-link-item.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: var(--space-2);
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius-md);
}

.nav-toggle:hover {
    color: var(--accent);
    background: var(--surface-hover);
}

.nav-backdrop {
    display: none;
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-6);
}

.container-narrow {
    max-width: 480px;
}

.container-wide {
    max-width: 1000px;
}

/* ============================================
   BUTTONS
   ============================================ */

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: inherit;
    font-size: var(--font-sm);
    font-weight: 500;
    line-height: 1;
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--ink);
    color: var(--surface);
    white-space: nowrap;
}

button:hover, .btn:hover {
    background: var(--ink-secondary);
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--ink-faint);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-ghost {
    background: transparent;
    color: var(--ink-secondary);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--ink);
}

.btn-link {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.btn-link:hover {
    background: transparent;
    color: var(--accent-hover);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-base);
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-secondary);
}

.btn-outline-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--ink-faint);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent);
    color: white;
}

/* ============================================
   FORMS
   ============================================ */

.form-control {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: var(--font-base);
    line-height: var(--leading-normal);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder {
    color: var(--ink-faint);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--ink);
}

.form-text {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--font-xs);
    color: var(--ink-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: var(--leading-relaxed);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-check-input {
    margin-right: var(--space-2);
    accent-color: var(--accent);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.card-body {
    padding: var(--space-8);
}

.card:hover {
    border-color: var(--ink-faint);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flashes {
    list-style: none;
    position: fixed;
    top: 72px;
    right: var(--space-6);
    z-index: 1000;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.flashes li {
    padding: var(--space-4) var(--space-5);
    background: var(--ink);
    color: var(--surface);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    animation: flash-slide-in 0.3s ease;
}

.flashes li.success, .flashes li[class*="success"] {
    background: var(--success);
}

.flashes li.error, .flashes li[class*="error"], .flashes li[class*="danger"] {
    background: var(--danger);
}

.flashes li.warning, .flashes li[class*="warning"] {
    background: var(--warning);
    color: var(--ink);
}

@keyframes flash-slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 500;
    line-height: 1.5;
}

.badge-primary {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.badge-success {
    background: var(--success-soft);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger-text);
}

.badge-info {
    background: var(--info-soft);
    color: var(--info-text);
}

.badge-neutral {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 var(--space-2);
    background: var(--accent-soft);
    color: var(--accent-text);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 500;
    white-space: nowrap;
}

.status-pending { background: var(--warning-soft); color: var(--warning-text); }
.status-running { background: var(--accent-soft); color: var(--accent-text); }
.status-implementing { background: var(--accent-soft); color: var(--accent-text); }
.status-reviewing { background: var(--warning-soft); color: var(--warning-text); }
.status-reviewed { background: var(--success-soft); color: var(--success-text); }
.status-completed { background: var(--success-soft); color: var(--success-text); }
.status-merged { background: var(--success-soft); color: var(--success-text); }
.status-deployed { background: var(--info-soft); color: var(--info-text); }
.status-closed { background: var(--surface-sunken); color: var(--ink-muted); }
.status-stalled { background: #fff3cd; color: #856404; }
.status-failed { background: var(--danger-soft); color: var(--danger-text); }

/* ============================================
   PROGRESSIVE DISCLOSURE
   ============================================ */

.disclosure {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.disclosure-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.disclosure-header:hover {
    background: var(--surface-hover);
}

.disclosure-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--ink);
}

.disclosure-icon {
    font-size: var(--font-xs);
    color: var(--ink-muted);
    transition: transform var(--transition);
}

.disclosure[open] .disclosure-icon {
    transform: rotate(90deg);
}

.disclosure-content {
    padding: 0 var(--space-5) var(--space-5);
}

details summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] > summary {
    margin-bottom: var(--space-3);
}

.l3-content {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-size: var(--font-sm);
    color: var(--ink-secondary);
}

/* ============================================
   CODE & PRE
   ============================================ */

pre {
    background: var(--surface-sunken);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--font-sm);
    line-height: 1.7;
    border: 1px solid var(--border-light);
}

code {
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

p code, li code, td code {
    background: var(--surface-sunken);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--ink);
}

.code-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-xs);
    color: var(--ink-muted);
}

.code-block pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: var(--surface);
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--ink-muted);
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-sunken);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.align-middle {
    vertical-align: middle;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
}

.tab {
    display: inline-flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--ink-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.nav-tabs {
    border-bottom: 2px solid var(--border);
    gap: 0;
    margin-bottom: var(--space-6);
}

.nav-item {
    margin-bottom: -2px;
}

.nav-link {
    display: block;
    padding: var(--space-3) var(--space-5);
    color: var(--ink-muted);
    font-weight: 500;
    font-size: var(--font-sm);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--ink);
    background: transparent;
    border-bottom-color: var(--ink-faint);
}

.nav-link.active {
    color: var(--accent);
    background: transparent;
    border-bottom-color: var(--accent);
}

.tab-content {
    padding-top: var(--space-6);
}

.tab-pane {
    display: none;
}

.tab-pane.show.active {
    display: block;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    color: var(--ink-muted);
    margin-bottom: var(--space-6);
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-sm);
    color: var(--ink-muted);
    margin-bottom: var(--space-6);
}

.breadcrumb a {
    color: var(--ink-muted);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--ink-faint);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.page-header-content {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: var(--font-2xl);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-2);
}

.page-description {
    color: var(--ink-muted);
    font-size: var(--font-base);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* ============================================
   PROGRESS & LOADING
   ============================================ */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar-container {
    height: 4px;
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-indeterminate {
    height: 100%;
    width: 30%;
    background: var(--accent);
    border-radius: var(--radius-full);
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* HTMX loading */
.htmx-request {
    opacity: 0.6;
    transition: opacity 200ms;
}

/* ============================================
   GUEST BANNER
   ============================================ */

.guest-banner {
    background: var(--warning-soft);
    color: var(--warning-text);
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--warning);
}

.guest-banner .btn {
    background: var(--warning);
    color: white;
}

.guest-banner .btn:hover {
    background: var(--warning-text);
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
}

.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    overflow: visible;
    padding: var(--space-3) var(--space-5);
    background: var(--accent);
    color: white;
    border-radius: 0 0 var(--radius-md) 0;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   PROJECT CARDS — Grid Layout
   ============================================ */

.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: var(--space-5);
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-name {
    font-weight: 600;
    font-size: var(--font-lg);
    color: var(--ink);
    margin-bottom: var(--space-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-url {
    font-size: var(--font-sm);
    color: var(--accent);
    margin-bottom: var(--space-3);
}

.project-description {
    color: var(--ink-secondary);
    font-size: var(--font-sm);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    flex: 1;
}

.project-meta {
    font-size: var(--font-xs);
    color: var(--ink-muted);
}

/* ============================================
   TASK CARDS
   ============================================ */

.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.task-card {
    display: block;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}

.task-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.task-card .task-description {
    font-weight: 500;
    color: var(--ink);
    margin-bottom: var(--space-2);
    line-height: var(--leading-normal);
}

.task-card .task-meta {
    font-size: var(--font-xs);
    color: var(--ink-muted);
}

.task-status {
    font-size: var(--font-xs);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ============================================
   JOBS
   ============================================ */

.jobs-section {
    margin-top: var(--space-8);
}

.job-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-3);
}

.job-card[data-status="running"] {
    border-left: 3px solid var(--accent);
}

.job-card[data-status="completed"] {
    border-left: 3px solid var(--success);
}

.job-card[data-status="failed"] {
    border-left: 3px solid var(--danger);
}

.job-card[data-status="pending"] {
    border-left: 3px solid var(--warning);
}

.job-title {
    font-weight: 500;
    color: var(--ink);
    font-size: var(--font-sm);
}

.error-box {
    background: var(--danger-soft);
    color: var(--danger-text);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    margin-top: var(--space-4);
}

.logs-box {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
    overflow: hidden;
}

.logs-header {
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--ink-muted);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.logs-content {
    font-size: var(--font-xs);
    padding: var(--space-4);
    margin: 0;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--surface-sunken);
    border: none;
    border-radius: 0;
}

/* ============================================
   REVIEW RESULTS
   ============================================ */

.review-result {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    border: 1px solid var(--border);
    margin-top: var(--space-4);
}

.review-verdict {
    font-weight: 600;
    font-size: var(--font-sm);
    margin-bottom: var(--space-3);
}

.verdict-approve { color: var(--success-text); }
.verdict-request_changes { color: var(--warning-text); }
.verdict-comment { color: var(--accent-text); }

.review-summary {
    font-size: var(--font-sm);
    color: var(--ink-secondary);
    margin: var(--space-3) 0;
}

.review-issues {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.review-issue {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--font-sm);
    padding: var(--space-3);
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
}

.issue-message {
    flex: 1;
    color: var(--ink);
}

.issue-line {
    font-family: monospace;
    font-size: var(--font-xs);
    color: var(--ink-muted);
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-container {
    max-width: 420px;
    margin: var(--space-12) auto;
    padding: 0 var(--space-6);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-sm);
}

.auth-title {
    font-size: var(--font-2xl);
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-errors {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--danger-text);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    font-size: var(--font-sm);
}

.auth-errors p {
    margin: 0;
    color: var(--danger-text);
}

.auth-errors p + p {
    margin-top: var(--space-2);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    font-size: var(--font-sm);
    color: var(--ink-muted);
}

/* ============================================
   ACCOUNT PAGE
   ============================================ */

.account-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
}

.account-section-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(-1 * var(--space-3));
    margin-right: calc(-1 * var(--space-3));
}

.row > * {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.col-sm-2 {
    flex: 0 0 auto;
    width: 25%;
}

.col-sm-10 {
    flex: 0 0 auto;
    width: 75%;
}

.col-form-label {
    padding-top: calc(var(--space-3) + 1px);
    padding-bottom: calc(var(--space-3) + 1px);
    font-weight: 500;
    color: var(--ink);
    font-size: var(--font-sm);
}

/* ============================================
   ERROR PAGES
   ============================================ */

.error-page {
    text-align: center;
    padding: var(--space-16) var(--space-6);
}

.error-icon {
    font-size: 5rem;
    margin-bottom: var(--space-6);
    opacity: 0.6;
}

.error-title {
    font-size: var(--font-3xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.error-text {
    font-size: var(--font-lg);
    color: var(--ink-muted);
    margin-bottom: var(--space-8);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.error-hint {
    font-size: var(--font-sm);
    color: var(--ink-muted);
}

/* ============================================
   CONFIG PAGES
   ============================================ */

.config-list {
    display: flex;
    flex-direction: column;
}

.config-item {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}

.config-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.config-item:first-child {
    padding-top: 0;
}

.config-badge {
    font-size: var(--font-xs);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-left: var(--space-2);
    font-weight: 500;
}

.config-badge-project {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.config-badge-account {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

/* ============================================
   UTILITIES
   ============================================ */

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-self-center { align-self: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-1 { flex: 1; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-6); }
.mt-6 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-6); }
.mb-6 { margin-bottom: var(--space-8); }
.me-2 { margin-right: var(--space-2); }
.me-3 { margin-right: var(--space-3); }
.me-4 { margin-right: var(--space-4); }
.me-auto { margin-right: auto; }
.my-3 { margin-top: var(--space-3); margin-bottom: var(--space-3); }
.my-5 { margin-top: var(--space-6); margin-bottom: var(--space-6); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-6); }
.pt-5 { padding-top: var(--space-6); }
.py-5 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.fw-bold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fw-normal { font-weight: 400; }
.font-monospace { font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; }

.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }
.text-info { color: var(--accent-text); }

.w-100 { width: 100%; }
.col-auto { flex: 0 0 auto; width: auto; }
.g-2 { gap: var(--space-2); }

.responsive-table {
    width: 100%;
    overflow-x: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    :root {
        --font-4xl: 2.5rem;
        --font-3xl: 2rem;
        --font-2xl: 1.5rem;
    }

    .container {
        padding: var(--space-8) var(--space-5);
    }

    .header {
        padding: 0 var(--space-5);
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        justify-content: flex-start;
    }

    .col-sm-2,
    .col-sm-10 {
        width: 100%;
    }

    .col-form-label {
        padding-top: 0;
        padding-bottom: var(--space-2);
    }

    .card-body {
        padding: var(--space-6);
    }
}

@media (max-width: 640px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-3) 0;
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .nav-link-item {
        padding: var(--space-4) var(--space-6);
        border-radius: 0;
    }

    body.nav-open .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }

    .flashes {
        right: var(--space-4);
        left: var(--space-4);
        max-width: none;
    }

    .auth-card {
        padding: var(--space-8);
    }

    .account-section {
        padding: var(--space-6);
    }
}

@media (max-width: 480px) {
    .btn-sm {
        padding: var(--space-2) var(--space-3);
    }

    .task-card {
        padding: var(--space-4);
    }

    .project-card {
        padding: var(--space-5);
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: var(--space-4);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
    }

    .responsive-table td {
        display: block;
        text-align: right;
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--border-light);
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--ink-muted);
        font-size: var(--font-xs);
    }
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.hero {
    text-align: center;
    padding: var(--space-16) 0 var(--space-12);
}

.hero h1 {
    font-size: var(--font-4xl);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-6);
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-xl);
    color: var(--ink-secondary);
    line-height: var(--leading-relaxed);
    max-width: 600px;
    margin: 0 auto var(--space-10);
}

.hero-form {
    max-width: 540px;
    margin: 0 auto;
}

.hero-form textarea {
    width: 100%;
    padding: var(--space-5);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--font-lg);
    font-family: inherit;
    line-height: var(--leading-relaxed);
    resize: vertical;
    margin-bottom: var(--space-4);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface);
}

.hero-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-form button {
    width: 100%;
}

.landing-section {
    padding: var(--space-12) 0;
    border-top: 1px solid var(--border);
}

.landing-section h2 {
    text-align: center;
    font-size: var(--font-2xl);
    margin-bottom: var(--space-4);
}

.landing-section > p {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-8);
    font-size: var(--font-lg);
    line-height: var(--leading-relaxed);
}

/* Public projects */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--space-4);
}

.public-project-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.public-project-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.project-time {
    font-size: var(--font-xs);
    color: var(--ink-muted);
    margin-top: var(--space-2);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: var(--space-8);
    margin-top: var(--space-8);
}

.feature {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
}

.feature h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-3);
}

.feature p {
    font-size: var(--font-sm);
    color: var(--ink-secondary);
    line-height: var(--leading-relaxed);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: var(--space-8);
    margin-top: var(--space-8);
}

.step {
    text-align: center;
    padding: var(--space-4);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-5);
    font-weight: 600;
    font-size: var(--font-lg);
}

.step h3 {
    margin-bottom: var(--space-3);
}

.step p {
    font-size: var(--font-sm);
    color: var(--ink-secondary);
    line-height: var(--leading-relaxed);
}

/* Email capture */
.email-capture {
    text-align: center;
    background: var(--surface);
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.subscribe-form {
    display: flex;
    gap: var(--space-3);
    max-width: 420px;
    margin: var(--space-6) auto 0;
}

.subscribe-form input {
    flex: 1;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-family: inherit;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.subscribe-note {
    font-size: var(--font-xs);
    color: var(--ink-muted);
    margin-top: var(--space-3);
}

/* Final CTA */
.final-cta {
    text-align: center;
    padding: var(--space-12) 0;
}

.final-cta h2 {
    margin-bottom: var(--space-6);
}

/* Footer */
.landing-footer {
    text-align: center;
    padding: var(--space-8) 0;
    color: var(--ink-muted);
    font-size: var(--font-sm);
    border-top: 1px solid var(--border);
}

.landing-footer a {
    color: var(--ink-secondary);
}

@media (max-width: 640px) {
    .hero {
        padding: var(--space-10) 0 var(--space-8);
    }

    .hero h1 {
        font-size: var(--font-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-lg);
    }

    .subscribe-form {
        flex-direction: column;
    }

    .email-capture {
        padding: var(--space-8);
    }
}

/* ============================================
   COLLAPSIBLE JOB ITEMS
   ============================================ */

.jobs-section {
    margin-top: var(--space-6);
}

.jobs-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.job-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    margin-bottom: var(--space-3);
    overflow: hidden;
}

.job-header {
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.job-body {
    padding: 0 var(--space-5) var(--space-5);
}

.job-item[data-status="running"] {
    border-left: 3px solid var(--accent);
}

.job-item[data-status="completed"] {
    border-left: 3px solid var(--success);
}

.job-item[data-status="failed"] {
    border-left: 3px solid var(--danger);
}

.job-item[data-status="pending"] {
    border-left: 3px solid var(--warning);
}

.suggestion-code {
    font-size: var(--font-xs);
    margin-top: var(--space-3);
    max-height: 200px;
    overflow: auto;
    background: var(--surface-sunken);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* ============================================
   BRANCH INFO (L3)
   ============================================ */

.branch-info {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin-top: var(--space-4);
}

.branch-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-sm);
    color: var(--ink-muted);
    margin-bottom: var(--space-3);
}

.branch-info-links {
    display: flex;
    gap: var(--space-4);
}

.branch-info-links details {
    font-size: var(--font-sm);
}

.branch-info-links details summary {
    color: var(--accent);
    cursor: pointer;
}

.branch-info-links details summary:hover {
    text-decoration: underline;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-sm);
    color: var(--ink-muted);
    margin-bottom: var(--space-6);
}

.back-link:hover {
    color: var(--accent);
}

/* ============================================
   SHOWCASE PAGE
   ============================================ */

.showcase-hero {
    text-align: center;
    padding: var(--space-12) 0 var(--space-8);
}

.showcase-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: var(--space-3);
}

.showcase-subtitle {
    font-size: var(--font-lg);
    color: var(--ink-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
    padding-bottom: var(--space-12);
}

.showcase-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.showcase-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.showcase-screenshot {
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) 0;
    border-bottom: 1px solid var(--border);
}

.showcase-screenshot img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s;
}

.showcase-card:hover .showcase-screenshot img {
    transform: scale(1.02);
}

.showcase-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-4);
}

.showcase-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.showcase-icon {
    font-size: 1.8rem;
}

.showcase-card-header h2 {
    font-size: var(--font-xl);
    font-weight: 700;
    margin: 0;
}

.showcase-desc {
    color: var(--ink-muted);
    font-size: var(--font-sm);
    line-height: 1.5;
    flex-grow: 1;
}

.showcase-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.showcase-tag {
    background: var(--bg);
    color: var(--ink-muted);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--font-xs);
    font-weight: 500;
}

.showcase-actions {
    display: flex;
    gap: var(--space-3);
    padding-top: var(--space-2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-muted);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.showcase-cta {
    text-align: center;
    padding: var(--space-12) 0;
    border-top: 1px solid var(--border);
}

.showcase-cta h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-3);
}

.showcase-cta p {
    color: var(--ink-muted);
    font-size: var(--font-lg);
    margin-bottom: var(--space-6);
}

/* ============================================
   ONBOARDING (empty project list)
   ============================================ */

.onboarding {
    max-width: 640px;
    margin: var(--space-8) auto;
}

.onboarding-welcome {
    text-align: center;
    margin-bottom: var(--space-8);
}

.onboarding-welcome h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.onboarding-welcome p {
    color: var(--ink-muted);
    font-size: var(--font-lg);
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.onboarding-step {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.onboarding-step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-lg);
}

.onboarding-step-body h3 {
    font-size: var(--font-lg);
    font-weight: 700;
    margin: 0 0 var(--space-1);
}

.onboarding-step-body p {
    color: var(--ink-muted);
    font-size: var(--font-sm);
    margin: 0;
    line-height: 1.5;
}

.onboarding-cta {
    text-align: center;
    margin-bottom: var(--space-6);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-lg);
}

.onboarding-hint {
    color: var(--ink-muted);
    font-size: var(--font-xs);
    margin-top: var(--space-3);
    font-style: italic;
}

.onboarding-examples {
    text-align: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.onboarding-examples-label {
    color: var(--ink-muted);
    font-size: var(--font-sm);
    margin-bottom: var(--space-3);
}

/* ============================================
   MOBILE FIXES
   ============================================ */

@media (max-width: 480px) {
    /* Nav: prevent text wrapping, tighter spacing */
    .nav-link-item {
        white-space: nowrap;
        padding: var(--space-2) var(--space-2);
        font-size: var(--font-xs);
        min-height: 44px;
    }
    
    .d-flex.gap-3 {
        gap: var(--space-1) !important;
    }
    
    /* Showcase: prevent card overflow */
    .showcase-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--space-4);
    }
    
    .showcase-screenshot img {
        height: 160px;
    }
    
    .showcase-hero h1 {
        font-size: 1.8rem;
    }
    
    .showcase-subtitle {
        font-size: var(--font-sm);
        padding: 0 var(--space-4);
    }
    
    /* Auth forms: full-width button */
    .auth-card .btn {
        width: 100%;
    }
    
    /* Chat widget: ensure not clipped */
    .chat-fab {
        right: 16px !important;
        bottom: 80px !important; /* Move up to avoid pipeline stepper */
        z-index: 999 !important;
    }
}

/* ============================================
   UPGRADE BANNER
   ============================================ */

.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--font-sm);
}

@media (max-width: 480px) {
    .upgrade-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   PIPELINE STEPPER
   ============================================ */

.pipeline-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--space-4) var(--space-2);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    position: relative;
    min-width: 60px;
}

.step-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    transition: all 0.3s ease;
}

.step-label {
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--ink-muted);
}

.step-connector {
    flex: 1;
    height: 2px;
    min-width: 20px;
    max-width: 60px;
    background: var(--border);
    margin-bottom: 18px; /* align with icon center */
    transition: background 0.3s ease;
}

.connector-done {
    background: var(--accent);
}

/* States */
.step-completed .step-icon {
    background: #dcfce7;
    border: 2px solid #16a34a;
    position: relative;
}
.step-completed .step-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #16a34a;
    font-size: 1.2rem;
    font-weight: bold;
}
.step-completed .step-label {
    color: #16a34a;
    font-weight: 600;
}

.step-active .step-icon {
    background: #dbeafe;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    animation: pulse 2s infinite;
}
.step-active .step-label {
    color: var(--accent);
    font-weight: 600;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.1); }
    100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
}

.step-failed .step-icon {
    background: #fee2e2;
    border: 2px solid #dc2626;
    position: relative;
}
.step-failed .step-icon::after {
    content: '✗';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: bold;
}
.step-failed .step-label {
    color: #dc2626;
}

.step-waiting .step-icon {
    opacity: 0.4;
    background: var(--surface-sunken);
    border: 2px solid var(--border);
}
.step-waiting .step-label {
    opacity: 0.4;
}

/* Pulse animation for active step */
.step-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -65%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2px solid var(--accent);
    animation: step-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes step-pulse {
    0% { transform: translate(-50%, -65%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -65%) scale(1.5); opacity: 0; }
}

@media (max-width: 480px) {
    .pipeline-step {
        padding: var(--space-1) var(--space-2);
        min-width: 50px;
    }
    .step-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    .step-label {
        font-size: 0.65rem;
    }

    /* PROJECT VIEW MOBILE FIXES */
    
    /* Task dependency graph - add horizontal scroll */
    .mermaid,
    .task-graph,
    .dependency-graph {
        overflow-x: auto !important;
        max-width: 100vw;
    }
    
    /* Action buttons - better mobile grouping */
    .page-header-actions {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: var(--space-2) !important;
        justify-content: flex-start;
    }
    
    .page-header-actions .btn {
        flex: 0 0 auto;
        min-width: auto;
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-xs);
    }
    
    /* Description text expansion */
    .page-description {
        overflow: hidden;
        max-height: 4.5em; /* ~3 lines */
        position: relative;
    }
    
    .page-description.expanded {
        max-height: none;
    }
    
    .page-description:not(.expanded)::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 60px;
        height: 1.5em;
        background: linear-gradient(to right, transparent, var(--surface) 80%);
        pointer-events: none;
    }
    
    .description-expand-btn {
        margin-top: var(--space-2);
        font-size: var(--font-xs);
        color: var(--accent);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }
}

/* ============================================
   PRO BADGE
   ============================================ */

.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7c3aed;
    background: linear-gradient(135deg, #ede9fe 0%, #f3e8ff 100%);
    border: 1px solid #c4b5fd;
    border-radius: var(--radius-full);
}
