/* ============================================================================
   TuneKit - Professional Design System
   ============================================================================ */

:root {
    /* Colors - Clean professional palette with blue accent (Dark mode default) */
    --bg-base: #0a0a0b;
    --bg-surface: #111113;
    --bg-elevated: #19191d;
    --bg-hover: #1f1f24;
    --bg-active: #28282f;

    /* Better text contrast */
    --text-primary: #f4f4f5;
    --text-secondary: #b4b4bb;
    --text-tertiary: #8c8c96;
    --text-muted: #6b6b76;

    /* Professional blue accent */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-muted: rgba(59, 130, 246, 0.1);
    --accent-subtle: rgba(59, 130, 246, 0.06);

    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(59, 130, 246, 0.4);

    --error: #f43f5e;
    --error-muted: rgba(244, 63, 94, 0.1);
    --warning: #f59e0b;
    --success: #22c55e;
    --success-muted: rgba(34, 197, 94, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
}

/* Light mode */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --accent-muted: rgba(37, 99, 235, 0.1);
    --accent-subtle: rgba(37, 99, 235, 0.05);

    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --border-accent: rgba(37, 99, 235, 0.4);

    --error: #dc2626;
    --error-muted: rgba(220, 38, 38, 0.1);
    --warning: #d97706;
    --success: #16a34a;
    --success-muted: rgba(22, 163, 74, 0.1);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   BASE
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* ============================================================================
   TOP NAVIGATION
   ============================================================================ */

.top-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5px;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-icon img {
    display: block;
    object-fit: contain;
    object-position: center;
}

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

/* Step Progress - Pill design */
.nav-steps {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Hide the track and fill - using connectors instead */
.progress-track,
.progress-fill {
    display: none;
}

.progress-step-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.progress-dot-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease);
    flex-shrink: 0;
}

/* Hide all icons by default */
.progress-dot-nav .check-icon,
.progress-dot-nav .pulse-ring-nav {
    display: none;
}

.progress-dot-nav .check-icon {
    width: 14px;
    height: 14px;
    stroke-width: 3;
    color: white;
}

.pulse-ring-nav {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
}

/* Completed state - show checkmark */
.progress-step-nav.completed .progress-dot-nav {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.progress-step-nav.completed .progress-dot-nav .check-icon {
    display: block;
}

/* Active state - show pulse */
.progress-step-nav.active .progress-dot-nav {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.progress-step-nav.active .progress-dot-nav .pulse-ring-nav {
    display: block;
}

.step-label-nav {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    transition: color 0.3s var(--ease);
}

.progress-step-nav.completed .step-label-nav {
    color: var(--text-secondary);
}

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

/* Connector lines between steps */
.progress-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s var(--ease);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--duration) var(--ease);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Theme Toggle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    position: absolute;
}

.theme-toggle .sun-icon {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

.theme-toggle .moon-icon {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

[data-theme="light"] .theme-toggle .sun-icon {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

[data-theme="light"] .theme-toggle .moon-icon {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 56px 40px 80px;
}

/* ============================================================================
   STEP CONTENT
   ============================================================================ */

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s var(--ease);
}

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

/* ============================================================================
   CONTENT HEADER
   ============================================================================ */

.content-header {
    margin-bottom: 36px;
}

.content-header.centered {
    text-align: center;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.content-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============================================================================
   CONTENT GRID - Aligned layout
   ============================================================================ */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: stretch; /* Make both columns same height */
}

.content-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   UPLOAD CARD - Stretch to match sidebar
   ============================================================================ */

.upload-card {
    padding: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 280px;
    cursor: pointer;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    margin: 16px;
    background: var(--bg-elevated);
    transition: all var(--duration) var(--ease);
    text-align: center;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.upload-visual {
    margin-bottom: 20px;
}

.upload-icon-bg {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    background: var(--bg-active);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.upload-zone:hover .upload-icon-bg {
    background: var(--accent-muted);
    border-color: var(--accent);
    transform: scale(1.05);
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-tertiary);
    transition: color var(--duration) var(--ease);
}

.upload-zone:hover .upload-icon {
    color: var(--accent);
}

.upload-text {
    text-align: center;
}

.upload-main {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-sub {
    font-size: 14px;
    color: var(--text-tertiary);
}

.upload-browse {
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
}

.upload-browse:hover {
    text-decoration: underline;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: var(--success-muted);
    border-top: 1px solid rgba(34, 197, 94, 0.15);
}

.file-info.hidden {
    display: none;
}

.file-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 16px;
}

.file-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.file-stat.success {
    color: var(--success);
    font-weight: 500;
}

.btn-remove {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.btn-remove:hover {
    background: var(--error-muted);
    color: var(--error);
}

/* Validation Status */
.validation-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
}

.validation-status.hidden {
    display: none;
}

.validation-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--success-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

.validation-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.validation-meta {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Dataset Summary Card */
.dataset-summary-card {
    margin-top: 20px;
    padding: 0;
    margin-bottom: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dataset-summary-card.hidden {
    display: none;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.summary-header svg {
    color: var(--accent);
}

.summary-stats-grid {
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Primary stats - top row */
.stats-primary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--border);
}

.primary-stat {
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.primary-stat:last-child {
    border-right: none;
}

.primary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.primary-label {
    display: block;
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Detail rows */
.stats-details {
    padding: 0;
    flex: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-label {
    font-size: 13px;
    color: var(--text-tertiary);
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.quality-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quality-badge.success {
    background: var(--success-muted);
    color: var(--success);
}

.quality-badge.accent {
    background: var(--accent-muted);
    color: var(--accent);
}

.quality-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Training Estimate Section */
.stats-estimate {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.estimate-label {
    font-size: 13px;
    color: var(--text-tertiary);
}

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

/* Warnings */
.stats-warnings {
    background: rgba(245, 158, 11, 0.05);
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    padding: 12px 20px;
    margin: 0;
}

.warning-item {
    font-size: 13px;
    color: var(--warning);
    padding: 4px 0;
    margin: 0;
}

.warning-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.warning-item.with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.warning-item.with-action .btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 28px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.prompt-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

/* ============================================================================
   ALTERNATIVE MODEL MODAL
   ============================================================================ */

.alt-model-modal {
    max-width: 480px;
}

.alt-model-modal .modal-header {
    padding: 24px;
    gap: 16px;
}

.modal-model-info {
    flex: 1;
}

.modal-model-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.modal-model-size {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-active);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.modal-score-ring {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.modal-score-ring svg {
    transform: rotate(-90deg);
}

.modal-score-ring .score-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.modal-score-ring .score-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s var(--ease);
}

.modal-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.alt-model-modal .modal-body {
    padding: 20px 24px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.modal-reasons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-reason {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-reason .reason-icon {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.modal-spec {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-spec svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.modal-spec strong {
    color: var(--accent);
}

.alt-model-modal .modal-footer {
    padding: 16px 24px;
}

/* ============================================================================
   SYSTEM PROMPT CARD
   ============================================================================ */

.system-prompt-card {
    margin-top: 20px;
    background: var(--bg-elevated);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.system-prompt-card.hidden {
    display: none;
}

.prompt-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(245, 158, 11, 0.08);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--warning);
    font-size: 13px;
    flex: 1;
}

.warning-content svg {
    flex-shrink: 0;
}

.prompt-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.prompt-actions.hidden {
    display: none;
}

.prompt-editor {
    padding: 0;
}

.prompt-editor.hidden {
    display: none;
}

.prompt-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
}

.prompt-tab {
    padding: 14px 20px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--duration) var(--ease);
}

.prompt-tab:hover {
    color: var(--text-secondary);
}

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

.prompt-content {
    padding: 24px 28px;
}

.prompt-content.hidden {
    display: none;
}

.suggested-prompts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggested-prompt-option {
    padding: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font-sans);
    overflow: hidden;
}

.suggested-prompt-option:hover {
    border-color: var(--border-strong);
}

.suggested-prompt-option.selected {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.prompt-option-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.prompt-title-section {
    flex: 1;
    min-width: 0;
}

.prompt-tagline {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.prompt-best-for {
    padding: 0 16px 10px 44px;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.prompt-details {
    border-top: 1px solid var(--border);
}

.prompt-details summary {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: all var(--duration) var(--ease);
}

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

.prompt-details summary:hover {
    color: var(--accent);
}

.prompt-details summary::after {
    content: ' ▸';
    font-size: 9px;
    transition: transform var(--duration) var(--ease);
    display: inline-block;
}

.prompt-details[open] summary::after {
    transform: rotate(90deg);
}

.prompt-details .prompt-option-text {
    padding: 12px 16px 14px;
    font-size: 11px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
}

.prompt-radio {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.suggested-prompt-option.selected .prompt-radio {
    border-color: var(--accent);
    border-width: 5px;
}

.prompt-radio::after {
    display: none;
}

.prompt-option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.prompt-option-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-family: var(--font-mono);
}

.prompt-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.prompt-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    line-height: 1.6;
    box-sizing: border-box;
    transition: border-color var(--duration) var(--ease);
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.prompt-textarea::placeholder {
    color: var(--text-muted);
}

.prompt-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

.system-prompt-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    margin-top: 16px;
    background: var(--success-muted);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* ============================================================================
   INFO CARDS - Better readability
   ============================================================================ */

.info-card,
.example-card {
    padding: 24px;
    flex: 1;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.info-header svg {
    color: var(--text-tertiary);
}

.requirements-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.requirements-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary); /* Higher contrast */
    line-height: 1.5;
}

.req-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.req-note {
    color: var(--text-tertiary);
    font-size: 13px;
}

.requirements-list code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-active);
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--accent);
    border: 1px solid var(--border);
}

.code-block {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================================
   ERROR BANNER
   ============================================================================ */

.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--error-muted);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.error-banner.hidden {
    display: none;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    color: var(--error);
}

.error-text {
    font-size: 14px;
    color: var(--text-primary);
}

.error-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}

.error-close:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--error);
}

/* ============================================================================
   ACTION BAR
   ============================================================================ */

.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    min-width: 120px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 16px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

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

.hidden {
    display: none !important;
}

/* ============================================================================
   INTERACTIVE QUESTION FLOW
   ============================================================================ */

.interactive-flow {
    max-width: 900px;
    margin: 60px auto 60px;
    padding: 0 24px;
    position: relative;
    min-height: 480px;
}

.flow-question {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.flow-question.active {
    display: block;
    pointer-events: all;
    animation: questionFadeIn 0.4s var(--ease) forwards;
}

@keyframes questionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.flow-question-header {
    margin-bottom: 48px;
    text-align: center;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
    padding: 8px 16px;
    border-radius: 24px;
    margin-bottom: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.flow-question-text {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typewriter cursor */
.flow-question-text.typing::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: middle;
    animation: cursorBlink 0.8s ease infinite;
}

@keyframes cursorBlink {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

/* Options grid - handles both 5 and 6 items elegantly */
.flow-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
}

/* For 5-item grid: center the last item across the bottom */
.flow-options.five-items {
    grid-template-columns: repeat(6, 1fr);
}

.flow-options.five-items .flow-option:nth-child(1),
.flow-options.five-items .flow-option:nth-child(2),
.flow-options.five-items .flow-option:nth-child(3) {
    grid-column: span 2;
}

.flow-options.five-items .flow-option:nth-child(4) {
    grid-column: 2 / span 2;
}

.flow-options.five-items .flow-option:nth-child(5) {
    grid-column: 4 / span 2;
}

.flow-option {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 110px;
    padding: 24px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    font-family: var(--font-sans);
    opacity: 0;
    animation: optionReveal 0.5s var(--ease) forwards;
    animation-delay: calc(var(--delay) * 0.08s + 1.2s);
    position: relative;
    overflow: hidden;
}

.flow-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.04));
    opacity: 0;
    transition: opacity 0.2s ease;
}

@keyframes optionReveal {
    to {
        opacity: 1;
    }
}

.flow-option:hover:not(.selected) {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.flow-option:hover:not(.selected)::before {
    opacity: 1;
}

.flow-option.selected {
    border-color: var(--accent);
    background: var(--accent-muted);
    box-shadow: 0 0 0 2px var(--accent);
}

.flow-option.selected::before {
    opacity: 1;
}

.flow-option.unselected {
    opacity: 0.2;
    pointer-events: none;
}

.flow-option-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.flow-option-desc {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.flow-back-btn {
    position: fixed;
    bottom: 40px;
    left: 40px;
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: backBtnReveal 0.3s ease forwards;
    animation-delay: 0.5s;
}

@keyframes backBtnReveal {
    to {
        opacity: 0.7;
    }
}

.flow-back-btn:hover {
    opacity: 1;
}

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

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}

.option-grid.compact {
    grid-template-columns: repeat(3, 1fr);
}

.option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font-sans);
    text-align: left;
}

.option-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-card.selected {
    background: var(--accent-muted);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    transform: translateY(-2px);
}

.option-card.compact {
    padding: 18px 16px;
}

.option-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color var(--duration) var(--ease);
}

.option-icon.small {
    font-size: 26px;
}

.option-card:hover .option-icon,
.option-card.selected .option-icon {
    color: var(--accent);
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.option-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================================================
   RECOMMENDATION
   ============================================================================ */

.rec-content {
    animation: fadeIn 0.3s var(--ease);
}

.rec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.primary-rec {
    position: relative;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.rec-badge {
    position: absolute;
    top: -10px;
    left: 24px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.3s var(--ease);
}

.rec-badge.selected-alt {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.rec-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    margin-top: 8px;
}

.rec-model-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.rec-model-size {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-active);
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Score Ring */
.rec-score-ring {
    width: 68px;
    height: 68px;
    position: relative;
    flex-shrink: 0;
}

.rec-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--bg-active);
    stroke-width: 3;
}

.score-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s var(--ease);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
}

/* Reasons */
.rec-reasons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.rec-reason {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.reason-icon {
    color: var(--accent);
    font-size: 14px;
}

/* Metrics */
.rec-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.rec-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.rec-metric svg {
    color: var(--accent);
    flex-shrink: 0;
}

.rec-metric strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Alternatives */
.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alternatives-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.alt-card {
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
}

.alt-card:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alt-name-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alt-best-match-tag {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.alt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.alt-score-ring {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.alt-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.alt-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.alt-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.alt-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.alt-metric svg {
    color: var(--accent);
    flex-shrink: 0;
}

.alt-metric strong {
    color: var(--text-primary);
    font-weight: 600;
}

.alt-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alt-reason {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-active);
    padding: 4px 10px;
    border-radius: 5px;
}

/* Training Info Card */
.training-info-card {
    margin-top: 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(59, 130, 246, 0.03) 100%);
    border: 1px solid var(--border);
}

.training-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all var(--duration) var(--ease);
}

.training-info-header:hover {
    opacity: 0.8;
}

.training-info-header svg:first-child {
    color: var(--accent);
    flex-shrink: 0;
}

.training-info-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.training-info-header .toggle-icon {
    color: var(--text-secondary);
    transition: transform var(--duration) var(--ease);
    flex-shrink: 0;
    transform: rotate(0deg); /* Pointing down when expanded (default) */
}

.training-info-card.collapsed .toggle-icon {
    transform: rotate(-90deg); /* Pointing right when collapsed */
}

.training-info-card.collapsed .training-info-content {
    display: none;
}

.training-info-content {
    padding: 20px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.training-method {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.method-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method-icon {
    font-size: 18px;
}

.method-title {
    color: var(--text-primary);
}

.method-details {
    padding-left: 28px;
}

.method-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.method-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.method-features li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent);
    font-weight: 700;
    font-size: 18px;
}

.method-features li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.progress-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 66%, var(--border) 66%);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.progress-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-active);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease);
    position: relative;
    flex-shrink: 0;
}

.progress-dot svg {
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

.progress-step.completed .progress-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.progress-step.active .progress-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15), 0 4px 16px rgba(59, 130, 246, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15), 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.1), 0 4px 16px rgba(59, 130, 246, 0.4);
    }
}

.pulse-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.step-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    margin-top: 4px;
}

.step-status {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: -4px;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.progress-step.completed .step-status {
    color: var(--accent);
}

.progress-step.active .step-status {
    color: var(--accent);
    animation: fade 2s ease-in-out infinite;
}

@keyframes fade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--border);
    margin: 0 12px;
    position: relative;
    top: 22px;
    border-radius: 2px;
    transition: background 0.3s var(--ease);
}

.progress-line.completed {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Pipeline Flow */
.pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.pipeline-step {
    flex: 1;
    max-width: 200px;
    padding: 20px;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--duration) var(--ease);
}

.pipeline-step:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.pipeline-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.pipeline-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.pipeline-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pipeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.pipeline-arrow {
    color: var(--accent);
    flex-shrink: 0;
}

/* LoRA Callout */
/* LoRA Section */
.lora-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.section-icon {
    font-size: 20px;
}

.section-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

.lora-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lora-features li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.lora-explanation {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
}

.explanation-icon {
    font-size: 18px;
    flex-shrink: 0;
}

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

.explanation-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Export Section */
.export-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.export-formats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.export-format-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
}

.export-format-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.export-format-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-icon {
    font-size: 20px;
}

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

.export-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.export-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.export-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

.export-note {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Dataset Summary */
.dataset-summary {
    padding: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.summary-item {
    text-align: center;
    padding: 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.summary-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================================
   TRAINING
   ============================================================================ */

.training-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.training-option {
    text-align: center;
    padding: 36px 28px;
}

.training-icon {
    font-size: 52px;
    margin-bottom: 20px;
}

.training-option h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.training-option > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.training-features {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
}

.training-features li {
    padding: 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.training-features li:last-child {
    border-bottom: none;
}

.training-features li::before {
    content: '✓';
    color: var(--accent);
    margin-right: 10px;
    font-weight: 600;
}

/* Training Status */
.training-status-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.status-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.status-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.status-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-meta code {
    font-family: var(--font-mono);
    color: var(--accent);
}

.status-meta strong {
    color: var(--success);
}

.training-log {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.log-header {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.log-output {
    padding: 18px 20px;
    height: 220px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
}

.log-line {
    padding: 5px 0;
    color: var(--text-tertiary);
}

.log-line:last-child {
    color: var(--text-primary);
}

.log-line.log-success {
    color: var(--success);
}

.log-line.log-error {
    color: var(--error);
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 56px 36px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--success);
}

.success-card h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
}

.success-card > p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
}

.package-contents {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.package-contents code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-elevated);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ============================================================================
   COLAB CARD
   ============================================================================ */

.colab-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.colab-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.colab-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
}

.colab-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.colab-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.colab-features {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.feature-item svg {
    color: var(--success);
    flex-shrink: 0;
}

.colab-actions {
    margin-bottom: 28px;
}

.colab-actions .btn {
    width: 100%;
    justify-content: center;
}

.btn-large {
    padding: 16px 28px;
    font-size: 16px;
    gap: 10px;
}

.colab-steps {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.colab-steps h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.colab-steps ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.colab-steps ol li::marker {
    color: var(--accent);
    font-weight: 600;
}

.colab-steps a {
    color: var(--accent);
    text-decoration: none;
}

.colab-steps a:hover {
    text-decoration: underline;
}

/* Notebook Ready */
.colab-instructions {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.instruction-step:last-child {
    border-bottom: none;
}

.instruction-step .step-num {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.instruction-step code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.notebook-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.notebook-hint {
    color: var(--text-tertiary);
    font-size: 13px;
}

.start-over {
    margin-top: 28px;
}

/* ============================================================================
   MODAL CREDENTIALS
   ============================================================================ */

.credentials-modal {
    max-width: 480px;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-group svg {
    color: var(--accent);
}

.modal-title-group h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.credentials-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.credentials-steps {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.step-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-item a {
    color: var(--accent);
    text-decoration: none;
}

.step-item a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-mono);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s var(--ease);
    box-sizing: border-box;
}

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

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

.toggle-password {
    position: absolute;
    right: 12px;
    top: 38px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--success-muted);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--success);
    line-height: 1.5;
}

.security-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* Connection Status */
.option-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.disconnected {
    background: var(--text-muted);
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-dot.connecting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

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

.option-hint a {
    color: var(--accent);
    text-decoration: none;
}

.option-hint a:hover {
    text-decoration: underline;
}

.deploy-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.deploy-note strong {
    color: var(--accent);
}

.deploy-note code {
    padding: 2px 6px;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
}

.deploy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    font-size: 12px;
}

.deploy-hint {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

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

@media (max-width: 1100px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .content-sidebar {
        flex-direction: row;
    }
    
    .content-sidebar > .card {
        flex: 1;
    }
    
    .rec-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
        height: 64px;
    }
    
    .nav-steps {
        padding: 4px;
    }
    
    .nav-step {
        padding: 8px 12px;
    }
    
    .step-label {
        display: none;
    }
    
    .main-content {
        padding: 40px 20px 60px;
    }
    
    .content-sidebar {
        flex-direction: column;
    }
    
    .option-grid,
    .option-grid.compact {
        grid-template-columns: 1fr;
    }
    
    .training-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-primary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .primary-stat:nth-child(2) {
        border-right: none;
    }
    
    .primary-stat:nth-child(1),
    .primary-stat:nth-child(2) {
        border-bottom: 1px solid var(--border);
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .prompt-textarea {
        min-height: 120px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
