/* ═══════════════════════════════════════════════════════════════
   SnapWeb — Design System v2
   Aligned with SnapEdit: dark panels, SVG icons, IDE-like feel
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Primary */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --primary-bg: rgba(79, 70, 229, 0.12);
    --primary-glow: rgba(79, 70, 229, 0.2);

    /* Accent */
    --accent: #EC4899;
    --accent-light: #F472B6;

    /* Semantic */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.12);

    /* Dark Surfaces (SnapEdit-style) */
    --dark-900: #0F0F1A;
    --dark-800: #13131F;
    --dark-700: #1A1A2E;
    --dark-600: #1E1E30;
    --dark-500: #252540;
    --dark-400: #2D2D4A;
    --dark-300: #3A3A5C;

    /* Light Surfaces */
    --surface: #FFFFFF;
    --surface-alt: #F1F3F8;
    --surface-card: #FFFFFF;

    /* Dark Borders */
    --border-dark: rgba(255, 255, 255, 0.06);
    --border-dark-light: rgba(255, 255, 255, 0.03);
    --border-dark-active: rgba(79, 70, 229, 0.5);

    /* Light Borders */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-active: #4F46E5;

    /* Dark Text */
    --text-dark-primary: #E8E8F0;
    --text-dark-secondary: #9494B8;
    --text-dark-muted: #5E5E80;

    /* Light Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-accent: linear-gradient(135deg, #EC4899 0%, #F97316 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);

    /* Category Colors (SnapEdit-style) */
    --cat-discovery: #4F46E5;
    --cat-wireframe: #8B5CF6;
    --cat-copy: #EC4899;
    --cat-stack: #F59E0B;
    --cat-design: #10B981;
    --cat-review: #06B6D4;
    --cat-deploy: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);
    --shadow-card-hover: 0 8px 30px rgba(79, 70, 229, 0.12);

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 52px;
    --preview-min-width: 320px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s var(--ease);
    --transition-fast: all 0.15s var(--ease);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-900);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ── App Layout ────────────────────────────────────────────── */
.app {
    display: grid;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-columns: var(--sidebar-width) 4px 1fr;
    grid-template-areas:
        "header header header"
        "sidebar resize-sb main";
    height: 100vh;
    overflow: hidden;
}

/* ── Header (Dark — SnapEdit style) ────────────────────────── */
.header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: var(--dark-800);
    border-bottom: 1px solid var(--border-dark);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.logo-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark-primary);
    letter-spacing: -0.02em;
}

.logo-text span {
    color: var(--primary-light);
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-dark);
    flex-shrink: 0;
}

.project-name {
    font-size: 13px;
    color: var(--text-dark-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ── Header Stepper — visual pipeline indicator ────────── */
.header-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
    max-width: 520px;
    margin: 0 var(--space-lg);
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    position: relative;
}

.stepper-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all .25s ease;
    position: relative;
    z-index: 2;
}

.stepper-circle .stepper-check {
    display: none;
}

/* States */
.stepper-step.pending .stepper-circle {
    background: var(--dark-400);
    color: var(--text-dark-muted);
    border: 2px solid transparent;
}

.stepper-step.active .stepper-circle {
    background: var(--primary);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .3);
    animation: stepper-pulse 2s infinite;
}

@keyframes stepper-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, .1);
    }
}

.stepper-step.done .stepper-circle {
    background: var(--success);
    color: white;
    border: 2px solid transparent;
}

.stepper-step.done .stepper-circle .stepper-num {
    display: none;
}

.stepper-step.done .stepper-circle .stepper-check {
    display: block;
}

/* Connector lines */
.stepper-connector {
    width: 20px;
    height: 2px;
    background: var(--dark-400);
    flex-shrink: 0;
    transition: background .3s;
}

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

/* Tooltip label */
.stepper-step .stepper-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dark-muted);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    background: var(--dark-600);
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 10;
}

.stepper-step:hover .stepper-tooltip {
    opacity: 1;
}

.stepper-step.active .stepper-tooltip {
    color: var(--primary-light);
}

/* ── Header Right — actions ────────────────────────────── */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-approve-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
    font-family: inherit;
}

.header-approve-btn:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.header-approve-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.header-approve-btn svg {
    width: 14px;
    height: 14px;
}

/* Collapsed card status badge (unchanged) */
.collapsed-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: auto;
}

.collapsed-status-badge.badge-pending {
    background: rgba(107, 114, 128, .1);
    color: var(--text-muted);
}

.collapsed-status-badge.badge-approved {
    background: rgba(16, 185, 129, .1);
    color: var(--success);
}

.collapsed-status-badge.badge-editing {
    background: rgba(245, 158, 11, .1);
    color: var(--warning);
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    border: 1px solid var(--border-dark);
    background: transparent;
    color: var(--text-dark-secondary);
    transition: var(--transition-fast);
    padding: 0;
}

.header-btn:hover {
    border-color: var(--border-dark-active);
    color: var(--text-dark-primary);
    background: var(--dark-500);
}

.header-btn.primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.header-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.header-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Sidebar (Dark — SnapEdit style) ──────────────────────── */
.sidebar {
    grid-area: sidebar;
    background: var(--dark-700);
    border-right: 1px solid var(--border-dark);
    overflow-y: auto;
    padding: var(--space-md) 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 0 var(--space-sm);
    margin-bottom: var(--space-md);
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dark-muted);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-sm);
}

/* Step items */
.step-list {
    list-style: none;
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px var(--space-md);
    margin: 1px 0;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.step-item:hover {
    background: var(--dark-500);
}

.step-item.active {
    background: rgba(79, 70, 229, 0.15);
}

.step-item.active .step-label {
    color: var(--text-dark-primary);
    font-weight: 600;
}

.step-item.active .step-icon {
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Step status indicators */
.step-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.step-icon svg {
    width: 14px;
    height: 14px;
}

.step-item.pending .step-icon {
    background: var(--dark-400);
    color: var(--text-dark-muted);
}

.step-item.pending .step-icon svg {
    fill: var(--text-dark-muted);
    stroke: var(--text-dark-muted);
}

.step-item.active .step-icon svg {
    fill: white;
    stroke: white;
}

.step-item.done .step-icon {
    background: var(--success);
}

.step-item.done .step-icon svg {
    fill: white;
    stroke: white;
}

.step-item.rejected .step-icon {
    background: var(--error);
}

.step-item.rejected .step-icon svg {
    fill: white;
    stroke: white;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark-secondary);
    flex: 1;
}

.step-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.04em;
}

.step-status.hitl {
    background: var(--warning-bg);
    color: var(--warning);
}

.step-status.approved {
    background: var(--success-bg);
    color: var(--success);
}

.step-status.rejected {
    background: var(--error-bg);
    color: var(--error);
}

/* Connector line */
.step-connector {
    width: 2px;
    height: 8px;
    background: var(--dark-400);
    margin-left: 20px;
}

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

/* Skills section (footer of sidebar) */
.sidebar-footer {
    margin-top: auto;
    padding: var(--space-md);
    border-top: 1px solid var(--border-dark);
}

#active-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.skill-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-bg);
    color: var(--primary-light);
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
}

/* ── Main Panel (Light — canvas area) ─────────────────────── */
.main {
    grid-area: main;
    display: flex;
    overflow: hidden;
    background: var(--surface-alt);
    min-width: 0;
}

/* ── Resize Handles (IDE-style) ───────────────────────────── */
.resize-handle {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    background: transparent;
    transition: background 0.15s ease;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: transparent;
    transition: background 0.15s ease;
    border-radius: 1px;
}

.resize-handle:hover::after,
.resize-handle.active::after {
    background: var(--primary);
}

.resize-handle:hover,
.resize-handle.active {
    background: rgba(99, 102, 241, 0.06);
}

.resize-handle-sidebar {
    grid-area: resize-sb;
    width: 4px;
}

.resize-handle-props {
    width: 4px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    min-width: 0;
}

/* Constrain content width for readability — UX best practice */
#step-content {
    max-width: 720px;
    margin: 0 auto;
}

/* Step header */
.step-header {
    margin-bottom: 20px;
}

.step-phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.step-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.step-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Form cards */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.form-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-card-hover);
}

.form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.form-card-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.card-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.form-card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: var(--primary-bg);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Form inputs */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--error);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.6;
}

/* Tag input */
.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 42px;
    cursor: text;
    transition: var(--transition-fast);
    background: var(--surface);
}

.tag-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
}

.tag-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.tag-remove:hover {
    opacity: 1;
}

.tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 100px;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
}

/* Radio cards */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.radio-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--surface);
}

.radio-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.radio-card.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.radio-card.selected .radio-indicator {
    border-color: var(--primary);
}

.radio-card.selected .radio-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.radio-card-content h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 1px;
}

.radio-card-content p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Checkbox cards */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px var(--space-md);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
}

.checkbox-card:hover {
    border-color: var(--primary-light);
}

.checkbox-card.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.checkbox-card.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Properties Panel (Dark — SnapEdit/Webflow/Framer style) ── */
.props-panel {
    width: 320px;
    min-width: 280px;
    background: var(--dark-700);
    border-left: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.props-panel.collapsed {
    width: 0;
    min-width: 0;
    border-left: none;
    overflow: hidden;
}

.props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-dark);
    flex-shrink: 0;
}

.props-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dark-primary);
    letter-spacing: 0.08em;
}

.props-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    background: transparent;
    color: var(--text-dark-muted);
    cursor: pointer;
    transition: all .15s;
}

.props-toggle:hover {
    color: var(--text-dark-primary);
    background: var(--dark-500);
    border-color: var(--border-dark-active);
}

/* Segmented tabs — SnapEdit style pill switcher */
.props-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 12px;
    background: var(--dark-800);
    border-bottom: 1px solid var(--border-dark);
    flex-shrink: 0;
}

.props-tab {
    flex: 1;
    padding: 7px 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-dark-muted);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.props-tab:hover {
    color: var(--text-dark-secondary);
    background: rgba(255, 255, 255, .04);
}

.props-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

/* Scrollable content body */
.props-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ── Property Group ────────────────────────────────────── */
.props-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-dark);
}

.props-group:last-child {
    border-bottom: none;
}

.props-group-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dark-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 16px 8px;
}

/* ── Property Row — list item with icon ────────────────── */
.props-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid rgba(255, 255, 255, .03);
}

.props-row:last-child {
    border-bottom: none;
}

.props-row:hover {
    background: rgba(255, 255, 255, .04);
}

.props-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--dark-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
}

.props-row-icon svg {
    width: 16px;
    height: 16px;
}

.props-row-icon.green {
    color: var(--success);
}

.props-row-icon.orange {
    color: var(--warning);
}

.props-row-icon.blue {
    color: var(--primary-light);
}

.props-row-icon.purple {
    color: #a78bfa;
}

.props-row-content {
    flex: 1;
    min-width: 0;
}

.props-row-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark-primary);
    line-height: 1.3;
}

.props-row-sub {
    font-size: 11px;
    color: var(--text-dark-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.props-row-chevron {
    color: var(--text-dark-muted);
    opacity: .4;
    flex-shrink: 0;
    transition: opacity .12s;
}

.props-row:hover .props-row-chevron {
    opacity: .8;
}

.props-row-chevron svg {
    width: 14px;
    height: 14px;
}

/* ── Section list (numbered like SnapEdit) ─────────────── */
.props-section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    transition: background .12s;
    border-bottom: 1px solid rgba(255, 255, 255, .03);
}

.props-section-item:last-child {
    border-bottom: none;
}

.props-section-item:hover {
    background: rgba(255, 255, 255, .04);
}

.props-section-num {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.props-section-info {
    flex: 1;
    min-width: 0;
}

.props-section-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark-primary);
}

.props-section-desc {
    font-size: 11px;
    color: var(--text-dark-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Empty state ──────────────────────────────────────── */
.props-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 12px;
}

.props-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--dark-500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark-muted);
    opacity: .5;
}

.props-empty-icon svg {
    width: 22px;
    height: 22px;
}

.props-empty h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark-secondary);
    margin: 0;
}

.props-empty p {
    font-size: 11px;
    color: var(--text-dark-muted);
    line-height: 1.5;
    margin: 0;
    max-width: 200px;
}

/* ── Status badge in props ────────────────────────────── */
.props-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
}

.props-status.pending {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
}

.props-status.done {
    background: rgba(16, 185, 129, .15);
    color: #34d399;
}

.props-status.active {
    background: rgba(99, 102, 241, .15);
    color: #818cf8;
}

/* ── Key-value pair in props ──────────────────────────── */
.props-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .03);
}

.props-kv:last-child {
    border-bottom: none;
}

.props-kv-key {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark-muted);
}

.props-kv-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}
}

.preview-placeholder p {
    font-size: 12px;
    color: var(--text-dark-muted);
    line-height: 1.6;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-md);
}

/* ── HITL Action Bar ───────────────────────────────────────── */
.hitl-bar {
    display: none;
    position: fixed;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-700);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 10px var(--space-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    gap: var(--space-sm);
    align-items: center;
    animation: slideUp 0.3s var(--ease);
    backdrop-filter: blur(20px);
}

.hitl-bar.visible {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.hitl-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark-secondary);
    white-space: nowrap;
}

.hitl-bar .hitl-input {
    flex: 1;
    min-width: 180px;
    padding: 7px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    background: var(--dark-500);
    color: var(--text-dark-primary);
    transition: var(--transition-fast);
}

.hitl-bar .hitl-input:focus {
    border-color: var(--primary);
}

.hitl-bar .hitl-input::placeholder {
    color: var(--text-dark-muted);
}

.hitl-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.hitl-btn svg {
    width: 14px;
    height: 14px;
}

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

.hitl-btn.approve:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.hitl-btn.reject {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.hitl-btn.reject:hover {
    background: var(--error-bg);
}

/* ── Step Navigation ───────────────────────────────────────── */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

.step-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}

.step-nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.step-nav-btn.next {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.step-nav-btn.next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.step-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Scrollbar (Dark) ──────────────────────────────────────── */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--dark-400);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

/* ── Responsive ────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   ONBOARDING OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--dark-900);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.onboarding-overlay.hidden {
    display: none;
}

.onboarding-card {
    background: var(--dark-700);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 40px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

.onboarding-header {
    text-align: center;
    margin-bottom: 32px;
}

.onboarding-header .logo {
    justify-content: center;
    margin-bottom: 12px;
}

.onboarding-subtitle {
    color: var(--text-dark-muted);
    font-size: 14px;
    line-height: 1.5;
}

.onb-field {
    margin-bottom: 16px;
}

.onb-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.onb-field input,
.onb-field select,
.onb-field textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--dark-800);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
}

.onb-field input:focus,
.onb-field select:focus,
.onb-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.onb-field textarea {
    resize: vertical;
    min-height: 80px;
}

.onb-optional {
    font-weight: 400;
    color: var(--text-dark-muted);
    text-transform: none;
    letter-spacing: 0;
}

.onb-hint {
    font-size: 12px;
    color: var(--text-dark-muted);
    margin: 0 0 10px;
    line-height: 1.4;
}

.onb-upload-zone {
    border: 2px dashed var(--dark-400);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    color: var(--text-dark-muted);
    transition: border-color .2s, background .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.onb-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, .05);
}

.onb-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.onb-upload-formats {
    font-size: 11px;
    opacity: .5;
}

.onb-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.onb-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dark-500);
    color: var(--text-dark-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.onb-file-tag button {
    background: none;
    border: none;
    color: var(--text-dark-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.onb-launch {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s, transform .1s;
    margin-top: 8px;
}

.onb-launch:hover {
    background: var(--primary-light);
}

.onb-launch:active {
    transform: scale(.98);
}

.onb-launch:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   AGENT MESSAGE BUBBLE — Light workspace
   ═══════════════════════════════════════════════════════════════ */

.agent-message {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.agent-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
}

.agent-text {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.agent-text strong {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   STEP RATIONALE — Light
   ═══════════════════════════════════════════════════════════════ */

.step-rationale {
    background: rgba(79, 70, 229, 0.04);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.step-rationale-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.step-rationale-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   AGENT OUTPUT CARD — Light
   ═══════════════════════════════════════════════════════════════ */

.agent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.agent-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-alt);
}

.agent-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.agent-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--primary-bg);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.agent-card-body {
    padding: 18px;
}

/* ── Editable Field — Light ─────────────────────────── */

.editable-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.editable-field:hover {
    border-color: #CBD5E1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.editable-field.editing {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
    background: var(--surface);
}

.editable-field.edited {
    border-left: 3px solid var(--primary);
}

.field-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.field-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 20px;
}

.field-value.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.field-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    outline: none;
    padding: 0;
}

.field-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
}

.field-badge-ai {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(79, 70, 229, .1);
    color: var(--primary);
    border-radius: 3px;
    font-weight: 600;
}

/* ── User Notes Area ────────────────────────────────── */

.user-notes-card {
    background: var(--surface);
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color .2s;
}

.user-notes-card:focus-within {
    border-color: var(--primary);
    border-style: solid;
}

.user-notes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-notes-header svg {
    color: var(--primary);
}

.user-notes-body {
    padding: 14px 18px;
}

.user-notes-textarea {
    width: 100%;
    min-height: 80px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.user-notes-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.user-notes-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Generating State — Light ──────────────────────── */

.generating-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.generating-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.generating-state h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 8px;
}

.generating-state p {
    font-size: 13px;
}

/* ── Approved State ─────────────────────────────────── */

.approved-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Section Reorder List — Light ──────────────────── */

.section-reorder-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-reorder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: grab;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.section-reorder-item:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.section-reorder-item.dragging {
    opacity: .5;
    border-color: var(--primary);
}

.section-num {
    width: 24px;
    height: 24px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-grip {
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: grab;
}

.section-info {
    flex: 1;
}

.section-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Lo-fi Wireframe Previews ──────────────────────── */

.section-lofi {
    flex-shrink: 0;
    margin-left: auto;
}

.lofi-preview {
    width: 80px;
    height: 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.lofi-block {
    background: #cbd5e1;
    border-radius: 1px;
}

.lofi-block.lofi-h1 {
    background: #64748b;
}

.lofi-block.lofi-h2 {
    background: #94a3b8;
}

.lofi-block.lofi-p {
    background: #e2e8f0;
}

.lofi-block.lofi-btn {
    background: var(--primary);
    opacity: .6;
}

.lofi-block.lofi-logo {
    width: 14px;
    height: 8px;
    border-radius: 2px;
    background: #e2e8f0;
}

.lofi-card {
    width: 20px;
    height: 18px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
}

.lofi-step-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    font-size: 6px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lofi-connector {
    width: 8px;
    height: 1px;
    background: #cbd5e1;
}

.lofi-price-col {
    width: 18px;
    height: 22px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
}

.lofi-price-col.lofi-price-featured {
    height: 26px;
    border-color: var(--primary);
    background: var(--primary-bg);
    margin-top: -2px;
}

.lofi-faq-row {
    height: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    margin-bottom: 2px;
}

.lofi-half {
    width: 28px;
    height: 20px;
    background: #f8fafc;
    border-radius: 2px;
}

.lofi-testimonial {
    width: 28px;
    height: 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
}

/* ── Section Variant Swap ──────────────────────────── */

.section-swap-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.section-swap-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.variant-picker {
    display: none;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    animation: fadeIn .15s ease;
}

.section-reorder-item {
    position: relative;
}

.variant-picker-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.variant-picker-options {
    display: flex;
    gap: 6px;
}

.variant-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.variant-option:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.variant-option.variant-selected {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.variant-option .lofi-preview {
    width: 64px;
    height: 40px;
}

.variant-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.variant-option.variant-selected .variant-label {
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stack-recommend {
    padding: 14px 16px;
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, .15);
    border-radius: 8px;
    margin-bottom: 14px;
}

.stack-recommend-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.stack-recommend-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .props-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }

    .sidebar {
        display: none;
    }

    .header-center {
        display: none;
    }

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

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

/* ═════════════════════════════════════════════════════════════
   NEW: Onboarding Row Layout
   ═════════════════════════════════════════════════════════════ */

.onb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .onb-row {
        grid-template-columns: 1fr;
    }
}

/* ═════════════════════════════════════════════════════════════
   NEW: Context Section (visually dominant)
   ═════════════════════════════════════════════════════════════ */

.onb-context-section {
    margin-top: var(--space-lg);
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
}

.onb-context-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.onb-context-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.onb-context-textarea {
    width: 100%;
    min-height: 160px;
    padding: var(--space-md);
    border: 2px dashed var(--primary-bg);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    transition: var(--transition-fast);
}

.onb-context-textarea:focus {
    outline: none;
    border-color: var(--primary);
    border-style: solid;
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: white;
}

.onb-context-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.7;
}

/* ═════════════════════════════════════════════════════════════
   NEW: Process Infographic (3 steps)
   ═════════════════════════════════════════════════════════════ */

.onb-process-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.onb-process-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.onb-process-num {
    font-size: 18px;
    color: var(--primary);
}

.onb-process-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.onb-process-arrow {
    font-size: 16px;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .onb-process-info {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .onb-process-arrow {
        transform: rotate(90deg);
    }
}

/* ═════════════════════════════════════════════════════════════
   NEW: Card Rationale
   ═════════════════════════════════════════════════════════════ */

.card-rationale {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px var(--space-md);
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-rationale-icon {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
}

/* ═════════════════════════════════════════════════════════════
   NEW: Collapsible Agent Cards
   ═════════════════════════════════════════════════════════════ */

.agent-card-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 40px !important;
}

.agent-card-header::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.2s var(--ease);
}

.agent-card.collapsed .agent-card-header::after {
    transform: translateY(-50%) rotate(-90deg);
}

.agent-card .agent-card-body,
.agent-card .card-rationale,
.agent-card .card-footer {
    transition: max-height 0.3s var(--ease), opacity 0.2s var(--ease), padding 0.3s var(--ease);
    overflow: hidden;
}

.agent-card.collapsed .agent-card-body,
.agent-card.collapsed .card-rationale,
.agent-card.collapsed .card-footer {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

/* ═════════════════════════════════════════════════════════════
   NEW: Per-Card Footer (HITL)
   ═════════════════════════════════════════════════════════════ */

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.card-footer.approved {
    background: rgba(16, 185, 129, 0.06);
    border-top-color: rgba(16, 185, 129, 0.2);
}

.card-footer.editing {
    background: rgba(245, 158, 11, 0.06);
    border-top-color: rgba(245, 158, 11, 0.2);
}

.card-footer-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.02em;
}

.card-status-badge.approved {
    background: var(--success);
    color: white;
}

.card-comment-row {
    display: flex;
    gap: 8px;
}

.card-comment-input {
    flex: 1;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.card-comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.card-comment-input::placeholder {
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.card-action-btn:hover {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.card-action-btn.approve-btn {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.card-action-btn.approve-btn:hover {
    background: #059669;
    border-color: #059669;
}

.card-action-btn.regen-btn:hover {
    color: var(--warning);
    border-color: var(--warning);
}

/* ═════════════════════════════════════════════════════════════
   NEW: Card Status Borders
   ═════════════════════════════════════════════════════════════ */

.agent-card.card-approved {
    border-color: var(--success);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15),
        0 2px 8px rgba(16, 185, 129, 0.08);
}

.agent-card.card-editing {
    border-color: var(--warning);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(245, 158, 11, 0.08);
}

.agent-card.card-regenerating {
    border-color: var(--primary);
    opacity: 0.7;
    pointer-events: none;
    animation: pulse-card 1s ease-in-out infinite;
}

@keyframes pulse-card {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═════════════════════════════════════════════════════════════
   NEW: Floating Action Bar (replaces old HITL bar)
   ═════════════════════════════════════════════════════════════ */

.floating-action-bar {
    position: fixed;
    bottom: 24px;
    left: calc(var(--sidebar-width) + 24px);
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--dark-800);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 90;
    backdrop-filter: blur(12px);
}

.fab-status-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fab-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.fab-pill.pill-pending {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-dark-muted);
}

.fab-pill.pill-approved {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.fab-pill.pill-editing {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.fab-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.fab-next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.fab-next-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

@media (max-width: 768px) {
    .floating-action-bar {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

/* ═════════════════════════════════════════════════════════════
   NEW: Generation Stepper
   ═════════════════════════════════════════════════════════════ */

.generation-stepper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--space-lg);
    max-width: 400px;
    margin: 0 auto;
}

.gen-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    transition: var(--transition);
}

.gen-step.done {
    color: var(--success);
}

.gen-step.active {
    color: var(--primary);
    font-weight: 600;
}

.gen-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gen-step.done .gen-step-icon {
    background: rgba(16, 185, 129, 0.15);
}

.gen-step.active .gen-step-icon {
    background: var(--primary-bg);
}

.gen-step.pending .gen-step-icon {
    background: rgba(148, 163, 184, 0.1);
}

.gen-step-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-bg);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.gen-time-estimate {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ═════════════════════════════════════════════════════════════
   Hide old hitl-bar if remnants exist
   ═════════════════════════════════════════════════════════════ */

.hitl-bar {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   BRIEFING STEP — Client-centric context input
   ═══════════════════════════════════════════════════════════════ */

.briefing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.briefing-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.briefing-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

/* ── Briefing Form Fields (merged from onboarding) ── */
.briefing-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.briefing-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.briefing-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.field-required {
    color: #EF4444;
    margin-left: 2px;
}

.briefing-input,
.briefing-select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: var(--transition-fast);
}

.briefing-input:hover,
.briefing-select:hover {
    border-color: var(--border-hover, #94A3B8);
}

.briefing-input:focus,
.briefing-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.briefing-input::placeholder {
    color: var(--text-muted);
}

/* ── Industry Combobox ── */
.industry-combobox {
    position: relative;
    display: flex;
    align-items: center;
}

.industry-combobox .industry-input {
    flex: 1;
    padding-right: 32px;
}

.industry-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.industry-arrow:hover {
    color: var(--text-primary);
}

.industry-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.industry-dropdown.open {
    display: block;
}

.industry-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s ease;
}

.industry-option:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.industry-option-add {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10B981;
    font-weight: 500;
    border-top: 1px solid var(--border);
}

.industry-option-add:hover {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.industry-option-empty {
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.briefing-textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: var(--transition-fast);
}

.briefing-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.briefing-textarea::placeholder {
    color: var(--text-muted);
    line-height: 1.7;
}

.briefing-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    margin-top: 12px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.briefing-upload-zone:hover,
.briefing-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.briefing-upload-zone svg {
    opacity: .5;
}

.briefing-upload-formats {
    font-size: 11px;
    color: var(--text-muted);
}

.briefing-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.briefing-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.briefing-file-tag button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
    opacity: .6;
}

.briefing-file-tag button:hover {
    opacity: 1;
}

.briefing-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
}

.briefing-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.briefing-continue-btn svg {
    transition: transform .2s;
}

.briefing-continue-btn:hover svg {
    transform: translateX(4px);
}