/* ============================================
   MOBYDICK AI - UNIFIED DESIGN SYSTEM
   Master stylesheet for consistent look & feel
   ============================================
   
   CSS ARCHITECTURE:
   =================
   This is the single source of truth for shared styles.
   Page-specific styles go in separate files (e.g., dashboard.css).
   
   FILE STRUCTURE:
   - shared.css (this file) - Design system & shared components
   - dashboard.css - Dashboard page (BMC grid, step cards)
   - pipeline_dashboard.css - Pipeline page specifics
   
   SECTIONS IN THIS FILE:
   0. COLOR SYSTEM (CSS Variables)
   1. BASE & RESET
   2. LAYOUT & CONTAINERS
   3. CARDS & PANELS
   4. NAVIGATION (top-nav, sidebar)
   5. BUTTONS
   6. FORMS & INPUTS
   7. FILE LISTS
   8. EDITABLE FIELDS
   9. INFO ICONS & TOOLTIPS
   10. MODAL DIALOGS
   11. BRAND SELECTOR
   12. FONT STYLE SELECTOR
   13. COLOR PICKER
   14. FEEDBACK MESSAGES
   15. STATUS BADGES
   16. PROGRESS BAR
   17. PAGE-SPECIFIC COMPONENTS
   18. RESPONSIVE DESIGN - MOBILE FIRST
   
   RESPONSIVE BREAKPOINTS:
   - Mobile: max-width: 768px
   - Tablet: 768px - 1024px
   - Desktop: min-width: 769px
   
   NAMING CONVENTIONS:
   - BEM-like: .component, .component-element, .component--modifier
   - State: .is-active, .is-loading, .open, .closed
   
   WHEN ADDING NEW STYLES:
   1. Check if a similar component exists first
   2. Use CSS variables for colors (--color-primary, etc.)
   3. Add responsive styles in Section 18
   4. Page-specific? Create a new CSS file instead
   ============================================ */

/* ============================================
   0. COLOR SYSTEM (CSS Variables)
   ============================================ */
:root {
    /* MobyDick AI Brand Colors */
    --emergus-teal: #14788c;
    --emergus-teal-dark: #0d5d6e;
    --emergus-orange: #ffa500;
    --emergus-orange-dark: #ff8c00;
    
    /* Primary Colors (Teal) */
    --color-primary: var(--emergus-teal);
    --color-primary-dark: var(--emergus-teal-dark);
    --color-primary-gradient: linear-gradient(135deg, var(--emergus-teal) 0%, var(--emergus-teal-dark) 100%);
    
    /* Secondary Colors (Orange/Gold) */
    --color-secondary: var(--emergus-orange);
    --color-secondary-dark: var(--emergus-orange-dark);
    --color-secondary-gradient: linear-gradient(135deg, var(--emergus-orange) 0%, var(--emergus-orange-dark) 100%);
    --color-secondary-bg-light: #fff8e7;        /* Very light gold for backgrounds */
    --color-secondary-bg: #fff1cc;              /* Light gold for backgrounds */
    --color-secondary-bg-warm: #ffe8b3;         /* Warm gold for backgrounds */
    --color-secondary-bg-gradient: linear-gradient(135deg, #fff8e7 0%, #fff1cc 50%, #ffe8b3 100%);
    --color-secondary-border: rgba(255, 165, 0, 0.3);
    --color-secondary-border-hover: rgba(255, 165, 0, 0.5);
    
    /* Text Colors - Optimized for readability (WCAG AA compliant) */
    --color-text: #1a202c;          /* Primary text - 16:1 contrast on white */
    --color-text-secondary: #2d3748; /* Secondary text - 12:1 contrast */
    --color-text-light: #4a5568;     /* Light text - 7:1 contrast */
    --color-text-muted: #64748b;     /* Muted text - 5.5:1 contrast (improved from #718096) */
    --color-text-placeholder: #94a3b8; /* Placeholders only - 3:1 contrast */
    
    /* Text on dark/gradient backgrounds (use on teal, dark panels, etc.) */
    --color-text-inverse: #ffffff;           /* White text on dark backgrounds */
    --color-text-inverse-muted: rgba(255, 255, 255, 0.85); /* Softer white for secondary text */
    --color-text-inverse-subtle: rgba(255, 255, 255, 0.7); /* Subtle white for tertiary text */
    
    /* Semantic: Text on specific backgrounds (explicit pairing for clarity) */
    --color-text-on-primary: #ffffff;        /* White text on teal/primary */
    --color-text-on-primary-muted: rgba(255, 255, 255, 0.85);
    --color-text-on-secondary: #ffffff;      /* White text on orange/secondary */
    --color-text-on-gradient: #ffffff;       /* White text on gradient backgrounds */
    --color-text-on-dark: #ffffff;           /* White text on any dark bg */
    
    /* Link colors on dark backgrounds */
    --color-link-on-dark: #90cdf4;           /* Light blue link on dark bg */
    --color-link-on-dark-hover: #bee3f8;     /* Lighter blue on hover */
    
    /* Background Colors */
    --color-bg: white;
    --color-bg-light: #f7fafc;
    --color-bg-subtle: #f1f5f9;
    --color-bg-dark: #1a1a2e;         /* Dark mode panels, viewers */
    --color-bg-darker: #222;          /* Canvas, code blocks */
    
    /* Border Colors */
    --color-border: #e2e8f0;
    --color-border-strong: #e5e7eb;
    --color-border-dashed: #cbd5e0;
    
    /* Layout Variables */
    --nav-height: 70px;          /* Approximate nav height */
    --nav-height-mobile: 60px;   /* Nav height on mobile */
    --sticky-offset: 80px;       /* Nav height + breathing room */
    --container-margin: 20px;    /* Default container margin */
    
    /* Safe Area Insets - for notched devices (iPhone X+) */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    
    /* Semantic Colors - Status/Feedback */
    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-success-text: #065f46;
    
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-danger-text: #991b1b;
    
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --color-warning-text: #92400e;
    
    --color-info: #0891b2;
    --color-info-bg: #cffafe;
    --color-info-text: #155e75;
    
    /* Highlight Colors (for special nav items) */
    --color-highlight-teal: #2c7a7b;
    --color-highlight-teal-bg: #e6fffa;
    --color-highlight-teal-border: #b2f5ea;
    
    --color-highlight-indigo: #4f46e5;
    --color-highlight-indigo-bg: #eef2ff;
    --color-highlight-indigo-border: #c7d2fe;
    
    --color-highlight-pink: #db2777;
    --color-highlight-pink-bg: #fdf2f8;
    --color-highlight-pink-border: #fbcfe8;
    
    /* Common greys (use semantic names instead when possible) */
    --color-grey-600: #4b5563;        /* Same as --color-text-light */
    --color-grey-500: #6b7280;        /* Same as --color-text-muted */
    --color-grey-700: #374151;        /* Slightly darker grey */
    
    /* Shadow colors (for consistent hover effects) */
    --shadow-primary: rgba(20, 120, 140, 0.3);      /* Teal shadow for primary buttons */
    --shadow-primary-light: rgba(20, 120, 140, 0.15);
    --shadow-secondary: rgba(255, 165, 0, 0.3);     /* Orange shadow for secondary/success */
    --shadow-secondary-light: rgba(255, 165, 0, 0.1);
    --shadow-neutral: rgba(0, 0, 0, 0.1);           /* Neutral shadow */
}

/* ============================================
   1. BASE & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--sticky-offset);
    /* Prevent horizontal scroll on mobile when sidebar animates */
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    /* Fixed gradient background - iOS Safari doesn't support background-attachment: fixed,
       so we use a pseudo-element workaround instead */
    background: var(--color-primary-gradient);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height - fixes iOS Safari address bar issue */
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Fixed background workaround for iOS Safari (doesn't support background-attachment: fixed) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary-gradient);
    z-index: -1;
}

/* ============================================
   2. LAYOUT & CONTAINERS
   ============================================ */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start; /* Align grid items to top */
}

/* File sidebar in editor - sticky positioning for desktop */
.editor-container .sidebar {
    position: sticky;
    top: var(--sticky-offset);
    max-height: calc(100vh - var(--sticky-offset) - 20px);
    max-height: calc(100dvh - var(--sticky-offset) - 20px);
    overflow-y: auto;
    margin-top: 0; /* Ensure no margin pushes it down */
}

/* On desktop, when file sidebar is hidden, remove grid column to eliminate gap */
.editor-container.file-sidebar-hidden {
    grid-template-columns: 1fr;
    gap: 0;
}

/* Ensure form-panel doesn't have extra space on the right */
.editor-container .form-panel {
    min-width: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow */
}

.dashboard-layout {
    display: flex;
    gap: 15px; /* Reduced from 20px for tighter spacing */
    margin-top: 0;
    padding-top: 0;
    align-items: flex-start; /* Align items to top */
}

/* NOTE: Desktop sidebar styles consolidated in Section 18 - RESPONSIVE DESIGN */

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

/* ============================================
   3. CARDS & PANELS
   ============================================ */
.card,
.panel,
.form-panel,
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-panel {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar {
    flex-shrink: 0;
    height: fit-content;
    position: sticky;
    top: var(--sticky-offset);
    align-self: flex-start; /* Ensure sidebar starts at top of flex container */
    margin-top: 0; /* Ensure no margin pushes sidebar down */
}

.dashboard-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    margin-top: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Page Header Component (reusable across pages) */
.page-header {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-header-title {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin: 10px 0 20px 0;
}

.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.page-header-files {
    margin-top: 15px;
}

.page-header-files .btn {
    width: 100%;
    max-width: 200px;
}

/* File sidebar toggle - BASE STYLE (shown by default, hidden on large desktop) */
.file-sidebar-toggle {
    display: block;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.file-sidebar-toggle:hover {
    background: var(--color-primary-dark);
}

.dashboard-header h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: var(--color-text-secondary);
}

.dashboard-header p {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* ============================================
   4. NAVIGATION
   ============================================ */
.top-nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

/* NOTE: Mobile top-nav styles consolidated in Section 18 - RESPONSIVE DESIGN */

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    /* Safe area insets for notched devices */
    padding-left: calc(30px + var(--safe-area-inset-left));
    padding-right: calc(30px + var(--safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Sidebar toggle button - hidden on desktop by default, shown when needed */
.sidebar-toggle {
    display: none;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    margin: 4px auto;
    transition: all 0.3s;
    border-radius: 2px;
}

.sidebar-toggle.active {
    background: var(--color-primary-dark);
}

.sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* NOTE: Desktop sidebar-toggle styles consolidated in Section 18 - RESPONSIVE DESIGN */

.nav-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    font-size: 14px;
    color: var(--color-text-light);
    padding-right: 15px;
    border-right: 1px solid var(--color-border);
}

/* Sidebar Navigation */
.sidebar {
    width: 240px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 15px;
    background: white;
    transition: transform 0.3s ease, width 0.3s ease;
}

/* NOTE: Desktop and Mobile sidebar overrides consolidated in Section 18 - RESPONSIVE DESIGN */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--color-bg-light);
    border-radius: 3px;
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 0.75rem; /* Reduced from 0.9rem */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 8px; /* Reduced from 12px */
    font-weight: 600;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px; /* Reduced from 12px 16px */
    margin-bottom: 4px; /* Reduced from 6px */
    border-radius: 6px; /* Reduced from 8px */
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    font-size: 0.85rem; /* Reduced from 0.95rem */
}

.sidebar-nav-item:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
}

.sidebar-nav-item.active {
    background: var(--color-primary-gradient);
    color: white;
    font-weight: 600;
}

.sidebar-nav-item .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Highlighted nav items - special actions */
.sidebar-nav-item.highlight-teal {
    background: var(--color-highlight-teal-bg);
    color: var(--color-highlight-teal);
    border: 1px solid var(--color-highlight-teal-border);
    font-weight: 500;
}

.sidebar-nav-item.highlight-teal:hover {
    background: var(--color-highlight-teal-border);
}

.sidebar-nav-item.highlight-indigo {
    background: var(--color-highlight-indigo-bg);
    color: var(--color-highlight-indigo);
    border: 1px solid var(--color-highlight-indigo-border);
    font-weight: 500;
}

.sidebar-nav-item.highlight-indigo:hover {
    background: var(--color-highlight-indigo-border);
}

.sidebar-nav-item.highlight-pink {
    background: var(--color-highlight-pink-bg);
    color: var(--color-highlight-pink);
    border: 1px solid var(--color-highlight-pink-border);
    font-weight: 500;
}

.sidebar-nav-item.highlight-pink:hover {
    background: var(--color-highlight-pink-border);
}

/* ============================================
   5. BUTTONS
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

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

.btn-primary:hover {
    box-shadow: 0 8px 20px var(--shadow-primary);
}

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

.btn-success:hover {
    box-shadow: 0 8px 20px rgba(255, 165, 0, 0.4);
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text-secondary);
}

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

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(245, 101, 101, 0.4);
}

/* Outline buttons - for secondary actions */
.btn-outline-primary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

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

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

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

/* Sign Out button - Less prominent than danger */
.btn-signout {
    background: var(--color-bg-light);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-signout:hover {
    background: #edf2f7;
    color: var(--color-text-light);
    border-color: var(--color-border-strong);
}

/* Highlight button variants for content generation CTAs */
.btn-highlight-indigo {
    background: var(--color-highlight-indigo-bg);
    color: var(--color-highlight-indigo);
    border: 1px solid var(--color-highlight-indigo-border);
}

.btn-highlight-indigo:hover {
    background: #dde4ff;
    box-shadow: 0 4px 12px rgba(76, 81, 191, 0.2);
}

.btn-highlight-pink {
    background: var(--color-highlight-pink-bg);
    color: var(--color-highlight-pink);
    border: 1px solid var(--color-highlight-pink-border);
}

.btn-highlight-pink:hover {
    background: #fce7f3;
    box-shadow: 0 4px 12px rgba(184, 50, 128, 0.2);
}

.btn-highlight-teal {
    background: var(--color-highlight-teal-bg);
    color: var(--color-highlight-teal);
    border: 1px solid var(--color-highlight-teal-border);
}

.btn-highlight-teal:hover {
    background: #ccfbf1;
    box-shadow: 0 4px 12px rgba(44, 122, 123, 0.2);
}

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

.btn:disabled:hover {
    box-shadow: none;
}

/* Button sizes */
.btn-sm {
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 14px 28px;
}

/* Nav button styles */
.btn-nav {
    padding: 8px 16px;
    font-size: 13px;
    margin-right: 0;
}

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

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

.btn-nav.nav-active {
    background: var(--color-primary);
    color: white;
    font-weight: 600;
}

/* Action buttons */
.add-item-btn {
    padding: 10px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.add-item-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.btn-remove-section {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-remove-section:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

/* ============================================
   6. FORM STRUCTURE
   ============================================ */

/* Main form sections (top-level) */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: #fafafa;
}

/* Section titles (h3) */
.form-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-left: 0;
    color: var(--color-text);
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

/* Nested form sections (e.g., content sections) */
.form-section.nested {
    margin-bottom: 16px;
    padding: 20px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
}

/* Form groups (field containers) */
.form-group {
    margin-bottom: 18px;
}

.form-group.compact {
    margin-bottom: 8px;
}

.form-group.tight {
    margin-bottom: 4px;
}

/* Field labels */
.form-group label {
    display: block;
    margin-bottom: 0;
    padding-left: 0;
    font-weight: 800;
    color: var(--color-text);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    position: relative;
}

/* Title field labels (for section titles within nested sections) */
.form-group.title-field label {
    margin-bottom: 4px;
}

/* ============================================
   7. EDITABLE FIELDS
   ============================================ */
.editable-field {
    position: relative;
    min-height: 24px;
    padding: 8px 12px;
    margin-top: 4px;
    border-radius: 6px;
    cursor: text;
    transition: all 0.2s;
    background: transparent;
    border: 2px solid transparent;
    line-height: 1.5;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Title field variant (for section titles) */
.editable-field.title-field {
    font-weight: 800;
    color: var(--color-text);
    font-size: 1.2rem;
    padding: 6px 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.editable-field:hover {
    background: var(--color-bg-light);
    border-color: var(--color-border);
}

.editable-field.editing {
    background: white;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    cursor: text;
}

.editable-field.empty {
    color: #a0aec0;
    font-style: italic;
}

.editable-field.empty::before {
    content: 'Click to edit...';
}

.editable-field input,
.editable-field textarea,
.editable-field select {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    resize: none;
    line-height: inherit;
}

/* Title field input styling */
.editable-field.title-field input {
    font-weight: 800;
    color: var(--color-text);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

.editable-field.large textarea {
    min-height: 120px;
}

/* Hide inputs by default, show when editing */
.editable-field:not(.editing) input,
.editable-field:not(.editing) textarea,
.editable-field:not(.editing) select {
    display: none;
}

.editable-field.editing .field-value {
    display: none;
}

.editable-field:not(.editing) .field-value {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================
   8. ARRAYS & LISTS
   ============================================ */
.array-field {
    margin-top: 8px;
    padding: 0;
}

.array-item {
    display: flex;
    gap: 8px;
    margin-bottom: 1px;
    align-items: flex-start;
    padding: 3px 10px;
    border-radius: 6px;
    background: white;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    padding-left: 24px;
}

.array-item::before {
    content: '•';
    position: absolute;
    left: 10px;
    top: 4px;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1.4;
}

.array-item:hover {
    border-color: var(--color-border);
    background: var(--color-bg-light);
}

.array-item.editing {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.array-item .editable-field {
    flex: 1;
    margin: 0;
    padding: 1px 8px;
    min-height: 18px;
}

.array-item button {
    padding: 6px 12px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    opacity: 0;
}

.array-item:hover button {
    opacity: 1;
}

.array-item button:hover {
    background: #c53030;
}

/* ============================================
   9. INFO ICONS & TOOLTIPS
   ============================================ */
.info-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    cursor: help;
    position: relative;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    white-space: normal;
    max-width: 300px;
    width: max-content;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: normal;
    line-height: 1.4;
    text-align: left;
}

.info-icon::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1001;
}

.info-icon:hover::after,
.info-icon:hover::before {
    visibility: visible;
    opacity: 1;
}

/* ============================================
   10. MODAL DIALOGS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    min-width: 44px;
    min-height: 44px;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   CRITIQUE PANEL
   ============================================ */
.critique-panel {
    display: none;
    position: fixed;
    top: 10%;
    left: 10%;
    right: 10%;
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--color-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.critique-panel.active {
    display: block;
}

.critique-panel-header {
    background: var(--color-primary-gradient);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.critique-panel-header h3 {
    margin: 0;
    font-weight: 600;
}

.critique-panel-header small {
    opacity: 0.8;
    font-size: 0.85rem;
}

.critique-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    min-width: 44px;
    min-height: 44px;
}

.critique-panel-body {
    padding: 20px;
}

.critique-actions {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.critique-loading .spinner {
    border: 4px solid var(--color-bg-light);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.critique-loading p {
    margin-top: 15px;
    color: var(--color-text-light);
}

.critique-score-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    background: var(--color-text-muted);
}

.critique-score-circle.score-excellent { background: var(--color-success); }
.critique-score-circle.score-good { background: #20c997; }
.critique-score-circle.score-fair { background: var(--color-warning); color: var(--color-text); }
.critique-score-circle.score-poor { background: #fd7e14; }
.critique-score-circle.score-bad { background: var(--color-danger); }

/* NOTE: Mobile critique panel styles consolidated in Section 18 - RESPONSIVE DESIGN */

/* ============================================
   11. BRAND SELECTOR
   ============================================ */
.brand-selector {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-selector label {
    margin-right: 10px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
    white-space: nowrap;
}

.brand-selector select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--color-border);
    font-size: 0.95rem;
    background: white;
    min-width: 150px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.brand-selector select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(20, 120, 140, 0.1);
}

/* ============================================
   11. STATUS MESSAGES
   ============================================ */
.status {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.status.success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success);
}

.status.error {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger);
}

.status.warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning);
}

.status.info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info);
}

/* ============================================
   12. FILE LISTS
   ============================================ */
.file-list {
    list-style: none;
    padding: 0;
}

.file-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.2s;
}

.file-list li:hover {
    background: var(--color-bg-light);
    transform: translateX(2px);
}

.file-list li.active {
    background: linear-gradient(90deg, #e6f2ff 0%, #f0f7ff 100%);
    border-left: 3px solid var(--color-primary);
    padding-left: 9px;
}

/* File list item icon */
.file-item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.file-list li:hover .file-item-icon {
    opacity: 1;
}

.file-list li.active .file-item-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* File list item content */
.file-item-content {
    flex: 1;
    min-width: 0;
}

/* File list item header and metadata */
.file-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.file-type {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-brand {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--color-primary);
    background: linear-gradient(135deg, #edf2f7 0%, var(--color-border) 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-meta {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    gap: 4px;
}

.file-date {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* ============================================
   13. MODE TOGGLE
   ============================================ */
.mode-toggle {
    margin-bottom: 20px;
}

.mode-toggle a {
    padding: 8px 16px;
    margin-right: 10px;
    text-decoration: none;
    border-radius: 4px;
}

.mode-toggle a.active {
    background: #007bff;
    color: white;
}

.mode-toggle a:not(.active) {
    background: #f8f9fa;
    color: var(--color-text);
    border: 1px solid #ddd;
}

/* ============================================
   14. UTILITIES
   ============================================ */
.onboarded-message {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Select dropdown styling */
.editable-field select {
    cursor: pointer;
}

/* ============================================
   15. TYPOGRAPHY & HEADINGS
   ============================================ */

/* Page headers and hero sections */
.page-header,
.onboarding-header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

.page-header h1,
.onboarding-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: white;
}

/* On gradient backgrounds, use inverse text */
.onboarding-header p {
    color: var(--color-text-inverse-muted);
    font-size: 1.2rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* On white/light backgrounds, use dark text */
.page-header p,
.section-header p {
    color: var(--color-text-light);
    font-weight: 500;
}

/* Logo box in onboarding header */
.onboarding-logo-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.onboarding-logo-box img {
    height: 120px;
    display: block;
}

/* Extraction status message */
.extraction-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
}

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

.extraction-status.success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.extraction-status.error {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.extraction-status.loading {
    background: var(--color-bg-subtle);
    color: var(--color-text-light);
    margin: 0 auto;
}

/* Section headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--color-text);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   16. PROGRESS INDICATORS
   ============================================ */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emergus-teal) 0%, var(--emergus-teal-dark) 100%);
    transition: width 0.3s ease;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.step-dot.completed {
    background: #48bb78;
}

/* ============================================
   17. FORM INPUTS (Standard - not inline editing)
   ============================================ */

/* Standard form inputs (for onboarding, landing, etc. - not form_editor) */
.form-group input:not(.editable-field input),
.form-group textarea:not(.editable-field textarea),
.form-group select:not(.editable-field select) {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:not(.editable-field input):focus,
.form-group textarea:not(.editable-field textarea):focus,
.form-group select:not(.editable-field select):focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea:not(.editable-field textarea) {
    min-height: 120px;
    resize: vertical;
}

.form-group.large textarea:not(.editable-field textarea) {
    min-height: 150px;
}

.form-group small {
    display: block;
    color: var(--color-text-muted);
    margin-top: 5px;
    font-size: 0.85rem;
}

/* ============================================
   18. ANIMATIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ============================================
   19. FORM ACTIONS
   ============================================ */

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--color-border);
}

.form-actions .btn {
    margin-right: 10px;
}

/* ============================================
   20. FOOTER
   ============================================ */
.app-footer {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    padding: 30px 0;
    /* Safe area inset for notched devices (iPhone X+) */
    padding-bottom: calc(30px + var(--safe-area-inset-bottom));
    margin-top: 60px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Dark theme footer (for landing page) */
.app-footer.dark-theme {
    background: #1a202c;
    color: var(--color-border);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.app-footer.dark-theme .footer-brand-name {
    color: var(--color-border);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--color-border);
    background-clip: unset;
}

.app-footer.dark-theme .footer-divider {
    background: rgba(255, 255, 255, 0.2);
}

.app-footer.dark-theme .footer-attribution {
    color: var(--color-border-strong);
}

.app-footer.dark-theme .footer-text {
    color: var(--color-border-strong);
}

.app-footer.dark-theme .footer-link {
    color: var(--color-border);
}

.app-footer.dark-theme .footer-link:hover {
    color: var(--color-border);
    background: rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 48px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s;
    object-fit: contain;
    padding: 0;
    margin: 0;
    display: block;
}

.footer-brand:hover .footer-logo {
    opacity: 1;
}

.footer-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-divider {
    width: 1px;
    height: 30px;
    background: var(--color-border);
    opacity: 0.5;
}

.footer-attribution {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.footer-text {
    font-weight: 400;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text-light);
    font-weight: 600;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.footer-link:hover {
    color: var(--color-primary);
    background: var(--color-bg-light);
    transform: translateY(-1px);
}

.footer-humanglement-logo {
    height: 28px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
    object-fit: contain;
    background: transparent;
    padding: 0;
    margin: 0;
    display: block;
}

.footer-link:hover .footer-humanglement-logo {
    opacity: 1;
}

/* NOTE: Responsive footer styles consolidated in Section 18 - RESPONSIVE DESIGN */

/* ============================================
   16. BRAND VISUAL COMPONENTS
   ============================================ */

/* Color Picker Group */
.color-picker-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.color-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-input label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.color-input input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s;
}

.color-input input[type="color"]:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-input input[type="text"],
.color-input .color-hex-input {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background: white;
    color: var(--color-text-secondary);
    cursor: text;
    transition: all 0.3s;
}

.color-input .color-hex-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-input .color-hex-input:invalid {
    border-color: #fc8181;
}

/* Font Style Selector */
.font-style-selector {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.font-style-selector:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Font Preview */
.font-preview {
    margin-top: 10px;
}

.font-preview-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.font-preview-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Title styles */
.font-preview-title.font-preview-modern,
.font-preview-title.font-preview- {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
}

.font-preview-title.font-preview-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    font-style: normal;
}

.font-preview-title.font-preview-bold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.font-preview-title.font-preview-classic {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
}

.font-preview-title.font-preview-minimal {
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Subtitle styles */
.font-preview-subtitle.font-preview-modern,
.font-preview-subtitle.font-preview- {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
}

.font-preview-subtitle.font-preview-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 400;
    font-style: italic;
}

.font-preview-subtitle.font-preview-bold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.font-preview-subtitle.font-preview-classic {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 400;
}

.font-preview-subtitle.font-preview-minimal {
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 300;
    letter-spacing: 0.03em;
}

/* Body text styles */
.font-preview-body.font-preview-modern,
.font-preview-body.font-preview- {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
}

.font-preview-body.font-preview-elegant {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 400;
    font-style: normal;
}

.font-preview-body.font-preview-bold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.font-preview-body.font-preview-classic {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 400;
}

.font-preview-body.font-preview-minimal {
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* Visual Style Input (input on desktop, textarea on mobile) */
.visual-style-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

/* When rendered as textarea on mobile */
textarea.visual-style-input {
    resize: vertical;
    min-height: 60px;
}

.visual-style-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Optional Badge */
.optional-badge {
    display: inline-block;
    background: #edf2f7;
    color: var(--color-text-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

/* NOTE: Mobile color-picker-group styles consolidated in Section 18 - RESPONSIVE DESIGN */

/* ============================================
   17. ONBOARDING & IDEA GENERATOR SHARED STYLES
   ============================================ */

/* Shared container styles for onboarding and idea generator */
.onboarding-container,
.idea-generator-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%; /* Ensure full width available */
    min-width: 0; /* Allow shrinking */
}

.onboarding-form,
.idea-generator-form {
    background: var(--color-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Shared info/highlight boxes (used in onboarding and idea generator) */
.info-box,
.highlight-box {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
}

.info-box strong,
.highlight-box strong {
    color: var(--color-text);
    font-weight: 600;
}

.info-box p,
.highlight-box p {
    margin: 5px 0 0 0;
    font-style: italic;
    color: var(--color-text-light);
}

/* URL extraction box (onboarding) */
.url-extraction-box {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--color-bg-light);
    border-radius: 12px;
    border: 2px dashed var(--color-border-dashed);
}

.url-extraction-box h3 {
    margin-top: 0;
    color: var(--color-text);
}

.url-extraction-box p {
    margin-bottom: 15px;
    color: var(--color-text);
}

.idea-generator-header {
    text-align: center;
    margin-bottom: 40px;
}

.idea-generator-header h1 {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 10px;
}

.idea-generator-header p {
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Form step navigation (shared between onboarding and idea generator) */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Theme grid and options (shared between pipeline and idea generator) */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.theme-option {
    padding: 20px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    color: var(--color-text);
}

.theme-option:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-option.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

/* Idea cards (idea generator) */
.ideas-list {
    margin: 20px 0;
}

.idea-card {
    padding: 20px;
    margin: 15px 0;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-bg);
}

.idea-card:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.idea-card.selected {
    border-color: var(--color-primary);
    background: #eef2ff;
    border-width: 3px;
}

/* ============================================
   PAGINATION & LIST CONTROLS
   ============================================ */
.pagination-controls {
    background: var(--color-bg-light);
    padding: 12px;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-controls .pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.pagination-controls .page-size-group {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info panels (descriptions, details) */
.info-panel {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

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

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Progress indicator row */
.progress-indicator {
    background: var(--color-bg-light);
    padding: 8px 12px;
    margin-top: 12px;
    border-radius: 6px;
}

.progress-indicator .progress-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-dots {
    display: flex;
    gap: 6px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.2s;
}

.progress-dot.active {
    background: var(--color-primary);
    opacity: 0.5;
}

.progress-dot.current {
    background: var(--color-primary);
    transform: scale(1.3);
}

.progress-text {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

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

/* Spacing utilities */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

/* Form input - consistent styling */
.form-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-input:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* Auth page helpers */
.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.auth-divider a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* Horizontal divider with "or" text */
.divider {
    text-align: center;
    margin: 24px 0;
    color: var(--color-text-muted);
    font-size: 14px;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--color-border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Error text for dynamic JS error messages */
.error-text {
    color: var(--color-danger);
    padding: 20px;
    text-align: center;
}

/* Info box for test credentials */
.info-box-subtle {
    margin-top: 20px;
    padding: 16px;
    background: var(--color-bg-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-light);
}

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

/* Warning/error messages */
.warning-message {
    margin-bottom: 10px;
    padding: 10px;
    color: var(--color-danger-text);
    background: var(--color-danger-bg);
    border-radius: 6px;
}

.page-info {
    font-weight: 500;
    color: var(--color-text);
}

.status-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.content-block {
    white-space: pre-wrap;
    margin-top: 8px;
}

.meta-text {
    margin-top: 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Small form select */
.form-select-sm {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    font-size: 14px;
}

/* Flex utilities */
.flex-end {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

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

.flex-wrap {
    flex-wrap: wrap;
    gap: 15px;
}

/* Step group header for content sections */
.step-group-header {
    margin: 10px 0 20px 0;
}

.step-group-spacing {
    margin-top: 30px;
}

/* Step/form description text */
.step-description {
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Loading container (centered) */
.loading-container {
    text-align: center;
    padding: 40px;
}

.loading-container p {
    margin-top: 15px;
    color: var(--color-text);
    font-weight: 500;
}

/* Step header with inline title */
.step-title {
    margin: 0 0 15px 0;
}

/* Character counter */
.char-count {
    text-align: right;
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Form group for labeled inputs */
.form-group {
    margin-bottom: 20px;
}

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

/* Large textarea */
.textarea-lg {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
}

.textarea-lg:focus {
    border-color: var(--color-primary);
    outline: none;
}

.idea-card p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
}

/* Form actions (shared) */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

/* Loading spinner (shared) */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   18. RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Mobile breakpoint: < 768px */
@media (max-width: 768px) {
    /* Container adjustments - clear fixed top-nav */
    .container {
        padding: 0 15px;
        margin: var(--nav-height-mobile) auto 10px auto;
    }
    
    /* Dashboard container - no extra margin, header is flush */
    .container:has(.dashboard-layout) {
        margin-top: var(--nav-height-mobile);
        padding-top: 0;
    }
    
    /* Editor Container - Single column on mobile, no gap (file sidebar is fixed overlay) */
    .editor-container {
        display: block; /* Block layout - no grid/flex gap issues */
    }
    
    .editor-container > * {
        width: 100%;
    }
    
    /* Form panel takes full width */
    .editor-container .form-panel {
        width: 100%;
    }
    
    /* File sidebar hidden on mobile - remove from layout flow */
    .editor-container .sidebar#fileSidebar {
        display: none; /* Completely hidden on mobile */
        position: fixed; /* When shown via toggle, use fixed positioning */
        left: 0;
        top: var(--nav-height-mobile);
        width: 280px;
        height: calc(100vh - var(--nav-height-mobile));
        height: calc(100dvh - var(--nav-height-mobile));
        z-index: 999;
        transform: translateX(-100%); /* Hidden by default */
    }
    
    .editor-container .sidebar#fileSidebar.open {
        display: block;
        transform: translateX(0); /* Show when open */
    }
    
    /* Show File/Close buttons on mobile only */
    .file-list-header.file-sidebar-close-btn {
        display: flex !important; /* Show on mobile */
    }
    
    /* Form panel takes full width on mobile - no extra space */
    .form-panel {
        width: 100%;
        margin-bottom: 15px;
        margin-right: 0; /* Remove any right margin */
        padding-right: 0; /* Remove any right padding */
    }
    
    /* File List - Touch-friendly on mobile */
    .file-list li {
        padding: 16px;
        min-height: 44px; /* WCAG touch target minimum */
        border-bottom: 1px solid var(--color-border);
    }
    
    .file-list li:active {
        background: #e6f2ff;
    }
    
    /* Button Groups - Stack vertically on mobile */
    .editor-controls,
    .button-group,
    .form-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .editor-controls .btn,
    .button-group .btn,
    .form-actions .btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
        white-space: normal; /* Allow text wrapping */
        max-width: 100%; /* Prevent overflow */
        box-sizing: border-box;
    }
    
    /* Prevent horizontal scroll from any overflowing elements */
    .container,
    .main-content,
    .form-panel,
    .card {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Dashboard Layout - Sidebar becomes hamburger menu */
    .dashboard-layout {
        flex-direction: column;
        gap: 0; /* Remove gap on mobile since sidebar is fixed */
        position: relative;
    }
    
    /* Unified sidebar behavior - all sidebars use the same rules below */
    
    .dashboard-layout .main-content {
        width: 100%;
        margin-left: 0;
        margin-top: 0;
        padding: 0 15px;
        flex: 1 1 100%;
    }
    
    /* Progress Bar - Slightly larger on mobile */
    .progress-bar {
        height: 8px;
        margin-bottom: 20px;
    }
    
    /* Step Indicator - Horizontal scroll on mobile if many steps */
    .step-indicator {
        gap: 8px;
        overflow-x: auto;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .step-dot {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    /* Theme Grid - Single column on mobile */
    .theme-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .theme-option {
        padding: 16px;
        min-height: 44px; /* Touch target */
        font-size: 1rem;
    }
    
    /* Idea Cards - Full width on mobile */
    .idea-card {
        width: 100%;
        margin: 12px 0;
        padding: 16px;
        min-height: 44px; /* Touch target */
    }
    
    /* Brand Selector - Full width on mobile */
    .brand-selector {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .brand-selector label {
        font-size: 0.9rem;
    }
    
    .brand-selector select {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* ==========================================
       MOBILE: Form inputs - larger, touch-friendly
       ========================================== */
    .form-group input[type="text"],
    .form-group input[type="url"],
    .form-group input[type="email"] {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 52px;
        border-radius: 8px;
        border: 2px solid var(--color-border);
    }
    
    .form-group textarea {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px;
        min-height: 120px;
        resize: vertical;
        border-radius: 8px;
        border: 2px solid var(--color-border);
    }
    
    .form-group select {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 8px;
    }
    
    /* Larger textareas for content-heavy fields */
    .form-group textarea.large-input,
    .form-group textarea[name*="description"],
    .form-group textarea[name*="content"],
    .form-group textarea[name*="mission"],
    .form-group textarea[name*="objective"] {
        min-height: 180px;
    }
    
    /* ==========================================
       MOBILE: Editable fields (Form Editor) - multi-line editing
       ========================================== */
    .editable-field {
        min-height: 60px; /* Larger tap target */
        padding: 12px;
        border: 2px solid var(--color-border);
        border-radius: 8px;
        background: white;
    }
    
    .editable-field .field-value {
        font-size: 16px;
        line-height: 1.5;
        min-height: 40px;
    }
    
    /* When editing - inputs become larger */
    .editable-field.editing {
        min-height: 100px;
    }
    
    .editable-field input,
    .editable-field textarea {
        font-size: 16px !important;
        padding: 8px !important;
        min-height: 80px !important;
        width: 100% !important;
    }
    
    /* Force text inputs to behave more like textareas visually */
    .editable-field input[type="text"] {
        /* Can't make input multi-line, but make it taller and show full content */
        height: auto;
        min-height: 80px;
        padding: 12px;
        word-break: break-word;
    }
    
    .editable-field textarea {
        min-height: 120px !important;
    }
    
    .editable-field.large textarea {
        min-height: 180px !important;
    }
    
    /* Array items - editable fields inside */
    .array-item .editable-field {
        min-height: 52px;
    }
    
    .array-item .editable-field input {
        min-height: 48px !important;
    }
    
    /* Color Picker Group - Single column on mobile */
    .color-picker-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .color-input input[type="color"] {
        height: 60px; /* Larger touch target */
    }
    
    /* ==========================================
       MOBILE: Compact forms with white background
       ==========================================
       Keep white background for readability, minimize padding.
    */
    
    .onboarding-container,
    .idea-generator-container {
        margin: 8px auto;
        padding: 0; /* Zero side padding */
    }
    
    .onboarding-form,
    .idea-generator-form {
        background: white;
        padding: 12px 8px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
    
    /* Form panels - white background, minimal padding */
    .form-panel {
        background: white;
        padding: 10px 6px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        margin: 0;
    }
    
    /* Container - zero side padding on mobile */
    .container {
        padding: 0 4px;
    }
    
    /* Cards */
    .card {
        background: white;
        padding: 12px 10px;
        border-radius: 8px;
        margin-bottom: 12px;
    }
    
    /* Form groups - tighter spacing */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
        display: block;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Page Header - Stack elements on mobile */
    .page-header,
    [style*="background: white"][style*="border-radius: 12px"][style*="padding: 30px 20px"] {
        padding: 20px 15px;
    }
    
    .page-header h1,
    [style*="font-size: 2.5em"] {
        font-size: 1.8rem;
    }
    
    .page-header > div,
    [style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Two Column Layout - Single column on mobile */
    .two-column-layout {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .two-column-layout .main-content,
    .two-column-layout .sidebar {
        width: 100%;
    }
    
    /* Grid Layout - Responsive columns */
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    /* Business Model Canvas - Single column on mobile */
    /* Use higher specificity to override inline styles in dashboard.html */
    .bmc-container .bmc-grid,
    .bmc-container #bmcGrid,
    .bmc-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(9, auto);
        gap: 10px;
    }
    
    .bmc-container .bmc-cell,
    .bmc-cell {
        min-height: 100px;
        padding: 15px;
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        max-width: 100%;
    }
    
    /* Force all BMC cells to single column with explicit row order - higher specificity */
    .bmc-container .bmc-cell.key-partners,
    .bmc-cell.key-partners { grid-column: 1; grid-row: 1; }
    .bmc-container .bmc-cell.key-activities,
    .bmc-cell.key-activities { grid-column: 1; grid-row: 2; }
    .bmc-container .bmc-cell.key-resources,
    .bmc-cell.key-resources { grid-column: 1; grid-row: 3; }
    .bmc-container .bmc-cell.value-propositions,
    .bmc-cell.value-propositions { grid-column: 1; grid-row: 4; }
    .bmc-container .bmc-cell.customer-relationships,
    .bmc-cell.customer-relationships { grid-column: 1; grid-row: 5; }
    .bmc-container .bmc-cell.channels,
    .bmc-cell.channels { grid-column: 1; grid-row: 6; }
    .bmc-container .bmc-cell.customer-segments,
    .bmc-cell.customer-segments { grid-column: 1; grid-row: 7; }
    .bmc-container .bmc-cell.cost-structure,
    .bmc-cell.cost-structure { grid-column: 1; grid-row: 8; }
    .bmc-container .bmc-cell.revenue-streams,
    .bmc-cell.revenue-streams { grid-column: 1; grid-row: 9; }
    
    .bmc-cell h4 {
        font-size: 0.75rem;
    }
    
    .bmc-cell-content {
        font-size: 0.85rem;
    }
    
    .bmc-cell .open-link {
        opacity: 1; /* Always show on mobile */
        font-size: 0.7rem;
    }
    
    /* Pipeline Step Containers - Enhanced mobile styles */
    .step-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .step-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .step-actions .btn {
        width: 100%;
        min-height: 44px; /* Touch target */
    }
    
    /* Modal/Dialog - Full screen on mobile */
    .modal {
        align-items: flex-start;
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Modal close button - Larger touch target */
    .modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.5rem;
    }
    
    /* Ensure all buttons are touch-friendly */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    /* Input fields - Prevent zoom on iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Dashboard layout - Remove all gaps and margins on mobile */
    .dashboard-layout {
        margin-top: 0;
        padding-top: 0;
        gap: 0;
        align-items: flex-start;
    }
    
    /* Dashboard main content - No extra spacing */
    .dashboard-layout .main-content {
        margin-top: 0;
        padding-top: 0;
        margin-left: 0;
        align-self: flex-start;
    }
    
    /* Dashboard header - Rounded corners on all sides */
    .dashboard-header {
        margin-top: 0;
        padding-top: 20px; /* Just internal padding */
        border-radius: 12px; /* Rounded corners on all sides */
    }
    
    .dashboard-header > *:first-child {
        margin-top: 0;
    }
    
    /* Unified sidebar behavior on mobile - ALL sidebars hidden by default */
    /* All sidebars (Dashboard, Pipeline, Onboarding) use same height and styling */
    .sidebar {
        position: fixed;
        top: var(--nav-height-mobile);
        left: 0;
        width: 280px; /* Full width sidebar, not reduced */
        max-width: 85vw;
        height: calc(100vh - var(--nav-height-mobile));
        height: calc(100dvh - var(--nav-height-mobile));
        padding: 20px 15px; /* Proper padding, not reduced */
        transform: translateX(-100%); /* Hidden by default */
        z-index: 999;
        overflow-y: auto;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        background: white;
        transition: transform 0.3s ease;
        /* Remove from flex layout flow when hidden */
        flex: 0 0 0;
        min-width: 0;
        margin: 0;
        order: -1;
    }
    
    /* Sidebar visible when opened */
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Ensure ALL sidebars (including dashboard) have full height and proper styling */
    .dashboard-layout .sidebar,
    .sidebar {
        height: calc(100vh - var(--nav-height-mobile));
        height: calc(100dvh - var(--nav-height-mobile));
        width: 280px;
        padding: 20px 15px;
        min-height: calc(100vh - var(--nav-height-mobile));
        min-height: calc(100dvh - var(--nav-height-mobile));
    }
    
    /* File sidebar overlay */
    .file-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .file-sidebar-overlay.active {
        display: block;
    }
    
    /* Navigation - Mobile adjustments */
    .top-nav {
        padding: 0;
    }
    
    .nav-content {
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    /* Center logo between burger button and credits */
    .nav-left {
        flex: 1;
        display: flex;
        justify-content: center; /* Center the logo */
        align-items: center;
    }
    
    .nav-logo {
        margin: 0 auto; /* Center horizontally */
    }
    
    /* Sidebar toggle button - visible on mobile (for main navigation sidebar) */
    .sidebar-toggle {
        display: block;
        background: var(--color-primary);
        border: none;
        border-radius: 6px;
        cursor: pointer;
        padding: 8px;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .sidebar-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: white;
        margin: 4px auto;
        transition: all 0.3s;
        border-radius: 2px;
    }
    
    .sidebar-toggle.active {
        background: var(--color-primary-dark);
    }
    
    .sidebar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .sidebar-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .sidebar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* File sidebar toggle - base styles defined outside media query, no override needed */
    
    /* Nav left - Logo centered between burger and credits */
    .nav-left {
        display: flex;
        align-items: center;
        justify-content: center; /* Center the logo */
        gap: 15px;
        flex: 1;
        margin: 0 auto; /* Center horizontally */
    }
    
    .nav-logo {
        margin: 0 auto; /* Center the logo */
    }
    
    /* Hide logo text on mobile, keep logo image */
    .nav-logo span {
        display: none;
    }
    
    .nav-logo img {
        height: 32px;
    }
    
    /* Hide navigation menu items on mobile by default */
    .nav-left > .btn-nav {
        display: none;
    }
    
    /* Nav right - Always show credits and user info */
    .nav-right {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    #userCostBadge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Sign Out button - Less prominent */
    .btn-signout {
        background: var(--color-bg-light);
        color: var(--color-text-muted);
        border: 1px solid var(--color-border);
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .btn-signout:hover {
        background: #edf2f7;
        color: var(--color-text-light);
        border-color: var(--color-border-strong);
    }
    
    /* Nav overlay - for background dimming on mobile */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998; /* Below top-nav (1000) and sidebar (999) */
    }
    
    .nav-overlay.active {
        display: block;
    }
    
    /* URL Extraction Input Group - Wrap on mobile */
    .url-extraction-input-group {
        display: flex;
        gap: 8px;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    
    .url-extraction-input-group input {
        flex: 1 1 100%;
        min-width: 200px;
    }
    
    .url-extraction-input-group button {
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    /* Hide Sign Out from nav-right on mobile (it's in mobile menu) */
    .nav-right .btn-signout {
        display: none;
    }
    
    /* Dashboard sidebar - Always visible with proper padding */
    .dashboard-layout .sidebar {
        padding: 20px 15px;
    }
    
    .dashboard-layout .sidebar .sidebar-section {
        padding: 0;
    }
    
    .dashboard-layout .sidebar .sidebar-section h3 {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Cards and Panels - Full width on mobile */
    .card,
    .panel,
    .form-panel {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Top Nav - relative positioning for mobile menu */
    .top-nav {
        position: relative;
    }
    
    /* Critique Panel - Full screen on mobile */
    .critique-panel {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        z-index: 3000;
    }
    
    .critique-panel-body {
        padding: 15px;
    }
    
    .critique-actions {
        flex-direction: column;
    }
    
    .critique-actions .btn {
        width: 100%;
    }
    
    .critique-score-circle {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    /* Footer - Stack vertically on mobile */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-divider {
        width: 60px;
        height: 1px;
    }
    
    .footer-attribution {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   DESKTOP BREAKPOINT: min-width 769px
   ============================================ */
@media (min-width: 769px) {
    /* Dashboard layout - main content transition */
    .dashboard-layout .main-content {
        transition: margin-left 0.3s ease;
    }
    
    /* Sidebar - Sticky positioning for desktop */
    .sidebar {
        position: sticky;
        top: var(--sticky-offset);
        transform: translateX(0);
        width: 240px;
        max-width: none;
        height: auto;
        max-height: calc(100vh - var(--sticky-offset) - 20px);
        max-height: calc(100dvh - var(--sticky-offset) - 20px);
        box-shadow: none;
        z-index: auto;
        align-self: flex-start;
        margin-top: 0;
    }
    
    /* Hide mobile toggle buttons on desktop */
    .sidebar-toggle {
        display: none;
    }
    
    /* Sidebar explicitly closed on desktop */
    .sidebar.closed {
        transform: translateX(-100%);
        width: 0;
        padding: 0;
        overflow: hidden;
        margin: 0;
    }
    
    /* Compact sidebar mode */
    .sidebar.compact {
        width: 200px;
    }
    
    .sidebar.compact .sidebar-section h3 {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .sidebar.compact .sidebar-nav-item {
        padding: 10px 12px;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .sidebar.compact .sidebar-nav-item .icon {
        font-size: 1rem;
        width: 20px;
    }
    
    /* URL Extraction Input Group - Inline layout */
    .url-extraction-input-group {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        max-width: 100%; /* Prevent overflow */
        overflow: hidden; /* Prevent button from going outside */
    }
    
    .url-extraction-input-group input {
        flex: 1 1 0; /* Take available space but allow button to be at end */
        min-width: 200px; /* Reduced from 300px */
        max-width: calc(100% - 150px); /* Leave space for button */
    }
    
    .url-extraction-input-group button {
        flex: 0 0 auto; /* Don't grow, don't shrink - stays at right */
        white-space: nowrap;
        margin-left: auto; /* Push to right */
        max-width: 140px; /* Prevent overflow */
    }
}

/* ============================================
   TABLET BREAKPOINTS
   ============================================ */

/* Tablet: 769px to 914px - URL extraction wrapping */
@media (min-width: 769px) and (max-width: 914px) {
    .url-extraction-input-group {
        flex-wrap: wrap;
    }
    
    .url-extraction-input-group input {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .url-extraction-input-group button {
        flex: 1 1 auto;
        margin-left: 0;
    }
}

/* Tablet breakpoint: 768px - 1024px */
/* On tablet, file sidebar becomes collapsible (like mobile) to give form panel more space */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Theme Grid - 2 columns on tablet */
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Editor Container - Single column, file sidebar hidden by default */
    .editor-container {
        grid-template-columns: 1fr; /* Remove file sidebar column */
        gap: 0;
    }
    
    /* File sidebar - use mobile-style fixed drawer on tablet too */
    .editor-container .sidebar#fileSidebar {
        display: none;
        position: fixed;
        left: 0;
        top: var(--sticky-offset);
        width: 300px;
        height: calc(100vh - var(--sticky-offset));
        height: calc(100dvh - var(--sticky-offset));
        z-index: 999;
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    
    .editor-container .sidebar#fileSidebar.open {
        display: block;
        transform: translateX(0);
    }
    
    /* File sidebar toggle - explicitly show on tablet */
    .file-sidebar-toggle,
    .page-header-files .file-sidebar-toggle,
    button.file-sidebar-toggle {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Nav sidebar narrower on tablet */
    .sidebar {
        width: 220px;
    }
    
    /* Grid Layout - 2 columns on tablet */
    .grid-container[data-columns-tablet] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   LARGE DESKTOP BREAKPOINT: min-width 1025px
   ============================================ */
@media (min-width: 1025px) {
    /* Hide file sidebar toggle on large desktop - sidebar is always visible */
    .file-sidebar-toggle {
        display: none;
    }
    
    /* Editor container shows file sidebar by default */
    .editor-container {
        grid-template-columns: 1fr 300px;
        gap: 20px;
    }
}

