:root {
    /* Primary Colors - CVD Safe */
    --color-primary: #0077BB;
    --color-primary-dark: #005588;
    --color-secondary: #FF6B35;
    --color-accent: #7B2D9E;
    
    /* Status Colors - Standard */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    
    /* Status Colors - CVD Safe (Protanopia/Deuteranopia) */
    --color-success-cvd: #06A77D;
    --color-warning-cvd: #FFB000;
    --color-error-cvd: #FF6B35;
    --color-info-cvd: #0077BB;
    
    /* Status Colors - Tritanopia Safe */
    --color-success-trit: #009E73;
    --color-warning-trit: #EE7733;
    --color-error-trit: #CC3311;
    --color-info-trit: #999999;
    
    /* Neutral Colors */
    --color-bg: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-card: #1a1a24;
    --color-bg-elevated: #22222e;
    --color-text: #ffffff;
    --color-text-secondary: #a0a0b0;
    --color-text-muted: #6c6c7c;
    --color-border: #2a2a3a;
    --color-border-light: #3a3a4a;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height: 1.6;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 119, 187, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-modal: 200;
    --z-overlay: 300;
}

.high-contrast {
    --color-bg: #000000;
    --color-bg-secondary: #0a0a0a;
    --color-bg-card: #111111;
    --color-text: #ffffff;
    --color-border: #ffffff;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

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

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

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: var(--z-dropdown);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.logo i {
    color: var(--color-primary);
    font-size: var(--font-size-2xl);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    max-width: 400px;
    margin: 0 var(--space-xl);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--color-bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.settings-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--color-bg-secondary);
    border-left: 1px solid var(--color-border);
    z-index: var(--z-modal);
    transition: right var(--transition-normal);
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

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

.settings-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--color-bg-card);
    color: var(--color-text);
}

.settings-content {
    padding: var(--space-lg);
}

.settings-content h4 {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.context-info, .manual-settings, .cvd-override {
    margin-bottom: var(--space-xl);
}

.context-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    color: var(--color-text-secondary);
}

.context-item i {
    width: 20px;
    color: var(--color-primary);
}

.setting-group {
    margin-bottom: var(--space-md);
}

.setting-group label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--color-bg-card);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-card);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--color-text);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.main-content {
    padding-top: 64px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

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

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

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-2xl) var(--space-xl);
}

.page-centered {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

.page-header p {
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-fast);
}

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

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

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 119, 187, 0.4);
}

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

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

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

.btn-warning {
    background: var(--color-warning);
    color: #000;
}

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

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
}

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

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

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 187, 0.2);
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-option:hover, .checkbox-option:hover {
    border-color: var(--color-primary);
}

.radio-option input, .checkbox-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
}

.likert-scale {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.likert-row {
    display: flex;
    gap: var(--space-sm);
    justify-content: space-between;
}

.likert-anchors {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding: 0 2px;
}

.likert-option {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xs);
    min-height: 48px;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.likert-option:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-elevated);
}

.likert-option.selected {
    border-color: var(--color-primary);
    background: rgba(0, 119, 187, 0.1);
}

.likert-option input {
    display: none;
}

.likert-value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.likert-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.timer-display.warning {
    color: var(--color-warning);
}

.timer-display.critical {
    color: var(--color-error);
    animation: pulse 0.5s infinite;
}

.confidence-rating {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.confidence-star {
    font-size: var(--font-size-3xl);
    color: var(--color-border);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.confidence-star.active,
.confidence-star:hover {
    color: var(--color-warning);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── CVD Color Remapping ────────────────────────── */
/* IMPORTANT: every remap is scoped to `.adaptive` so the CVD-safe palette
   only applies in the ADAPTIVE interface. In the STANDARD interface a CVD
   participant must see the same color-only palette as everyone else, which
   is what makes the standard condition genuinely color-inaccessible. */

/* Protanopia (red-blind) & Deuteranopia (green-blind): remap red/green.
   Okabe-Ito palette (Wong, Nature Methods 2011): every pair stays distinct
   under deuteranopia (worst-pair CIEDE2000 rises from ~8.5 to ~20.8). */
body.adaptive.protanopia,
body.adaptive.deuteranopia,
body.adaptive.protanomaly,
body.adaptive.deuteranomaly {
    --color-success: #009E73;
    --color-error: #D55E00;
    --color-warning: #F0E442;
    --color-info: #56B4E9;
}

/* Okabe-Ito info (#56B4E9) is a light blue, so the full-background info
   alert needs dark text to stay legible. Scoped to the red-green adaptive
   palettes only, so the standard baseline and tritanopia are untouched.
   (Warning #F0E442 is already covered by .alert-warning { color:#000 }.) */
body.adaptive.protanopia .alert-info,
body.adaptive.deuteranopia .alert-info,
body.adaptive.protanomaly .alert-info,
body.adaptive.deuteranomaly .alert-info {
    color: #000;
}

/* Tritanopia (blue-yellow blind) */
body.adaptive.tritanopia {
    --color-success: #009E73;
    --color-error: #CC3311;
    --color-warning: #EE7733;
    --color-info: #999999;
}

/* ── CVD Selector Cards ─────────────────────────── */

.cvd-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.cvd-type-card {
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.cvd-type-card:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-elevated);
    transform: translateY(-2px);
}

.cvd-type-card.selected {
    border-color: #4dabf7;
    background: rgba(77, 171, 247, 0.08);
    box-shadow: 0 0 20px rgba(77, 171, 247, 0.25);
    transform: translateY(-2px);
}

.cvd-card-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.cvd-card-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.cvd-card-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.3;
}

.cvd-unsure-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255, 193, 7, 0.06);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: var(--radius-lg);
}

/* ── Viewport Fit for Interactive Pages ──────────── */

.page-fit-viewport {
    max-height: calc(100vh - 64px);
    overflow: hidden;
}

/* ══════════════════════════════════════════════════
   PRIORITY 2 — VISUAL POLISH & UX ENHANCEMENTS
   ══════════════════════════════════════════════════ */

/* ── Display font for headings ───────────────────── */
h1, h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

/* ── Animated background mesh gradient ──────────── */
@keyframes meshMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-bg {
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(ellipse at 20% 40%, rgba(0,119,187,0.18) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(123,45,158,0.12) 0%, transparent 55%),
                radial-gradient(ellipse at 60% 80%, rgba(255,107,53,0.10) 0%, transparent 50%);
    animation: meshMove 12s ease infinite;
    background-size: 200% 200%;
    pointer-events: none;
    z-index: 0;
}
.hero-bg > * { position: relative; z-index: 1; }

/* ── Glass card variant ──────────────────────────── */
.card-glass {
    background: rgba(26, 26, 36, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Landing hero ────────────────────────────────── */
.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-xl) var(--space-xl);
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 16px;
    background: rgba(0,119,187,0.15);
    border: 1px solid rgba(0,119,187,0.35);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: #4dabf7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-lg);
}

.landing-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 0%, #a0c4f1 60%, #7B2D9E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
}

.landing-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 540px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.landing-meta-row {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}

.landing-meta-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.landing-meta-pill i { color: var(--color-primary); }

/* ── Phase-based progress bar ────────────────────── */
.phase-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 480px;
    margin: 0 var(--space-lg);
    overflow: hidden;
}

.phase-step {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-bg-card);
    transition: background var(--transition-slow);
    position: relative;
}

.phase-step.done {
    background: linear-gradient(90deg, var(--color-primary), #06A77D);
}

.phase-step.active {
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 0 8px rgba(0,119,187,0.6);
    animation: phasePulse 2s ease-in-out infinite;
}

@keyframes phasePulse {
    0%, 100% { box-shadow: 0 0 6px rgba(0,119,187,0.4); }
    50%       { box-shadow: 0 0 14px rgba(0,119,187,0.8); }
}

.phase-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    margin-left: var(--space-sm);
}

/* ── Upgraded break screen ───────────────────────── */
.break-context-msg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0,119,187,0.1);
    border: 1px solid rgba(0,119,187,0.25);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    color: #4dabf7;
    margin-bottom: var(--space-lg);
}

.break-timer-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: var(--space-xl) auto;
}

.break-timer-ring svg {
    transform: rotate(-90deg);
}

.break-timer-ring .ring-bg {
    fill: none;
    stroke: var(--color-bg-card);
    stroke-width: 8;
}

.break-timer-ring .ring-fill {
    fill: none;
    stroke: url(#ringGrad);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 376;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.break-timer-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--color-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.03em;
}

/* ── CVD-safe task result screen ─────────────────── */
.task-result-icon {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto var(--space-lg);
    font-size: 2.4rem;
}

.task-result-icon.correct {
    /* Teal/blue — safe for protanopia & deuteranopia */
    background: linear-gradient(135deg, #06A77D, #0077BB);
    box-shadow: 0 0 40px rgba(6,167,125,0.45);
}

.task-result-icon.incorrect {
    /* Orange — CVD-safe alternative to red */
    background: linear-gradient(135deg, #FF6B35, #CC3311);
    box-shadow: 0 0 40px rgba(255,107,53,0.45);
}

.task-result-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
    opacity: 0.9;
}

/* ── Micro-animations for card selection ─────────── */
@keyframes cardPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.05); }
    70%  { transform: scale(0.98); }
    100% { transform: scale(1.02); }
}

.status-card.selected,
.alert.selected,
.cvd-type-card.selected {
    animation: cardPop 0.3s ease forwards;
}

/* ── Progress bar glow pulse ─────────────────────── */
.progress-fill {
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-secondary);
    box-shadow: 0 0 8px var(--color-secondary);
    transform: translateX(50%);
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: translateX(50%) scale(1); }
    50%       { opacity: 0.6; transform: translateX(50%) scale(0.8); }
}

/* ── Mobile touch drag placeholder ──────────────── */
.sortable-item.touch-dragging {
    opacity: 0.4;
    border-color: var(--color-primary);
    background: rgba(0,119,187,0.08);
}

.sortable-item.touch-over {
    border-color: var(--color-secondary);
    background: rgba(255,107,53,0.08);
}

/* ── Intro icon upgrade ───────────────────────────  */
.intro-icon {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    margin: 0 auto var(--space-lg);
    box-shadow: var(--shadow-glow);
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ── Task instruction highlight ──────────────────── */
.task-instruction {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: #4dabf7;
    background: rgba(77,171,247,0.08);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid #4dabf7;
    text-align: center;
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

/* ── Step divider badges in overview cards ───────── */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ── CVD-safe task result icons ──────────────────── */
.task-result-icon {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    gap: 6px;
    font-size: 2.4rem;
    animation: resultPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.task-result-icon.correct {
    background: linear-gradient(135deg, #047a5c, #06A77D);
    box-shadow: 0 0 40px rgba(6,167,125,0.35);
}
.task-result-icon.incorrect {
    background: linear-gradient(135deg, #c74b0a, #FF6B35);
    box-shadow: 0 0 40px rgba(255,107,53,0.35);
}
.task-result-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
@keyframes resultPop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.break-context-msg {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(6,167,125,0.1);
    border: 1px solid rgba(6,167,125,0.25);
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    width: min(340px, 88vw);
    margin: 0 auto 4px;
    box-sizing: border-box;
    color: #06A77D;
}

/* The check icon should stay top-aligned with the first line, not float in the
   vertical middle of a wrapped multi-line message. */
.break-context-msg .fa-check-circle {
    align-self: flex-start;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Touch drag visual states ────────────────────── */
.touch-dragging {
    opacity: 0.3;
    border: 2px dashed var(--color-primary) !important;
}
.touch-over {
    border-color: var(--color-primary) !important;
    background: rgba(0,119,187,0.15) !important;
    transform: scale(1.02);
}

/* ── Researcher dashboard link in nav (optional) ─── */
.researcher-link {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.researcher-link:hover { opacity: 1; }

/* ── Task Container Layout Consistency ────────────── */
.task-container {
    width: 100%;
    max-width: 700px;
    min-height: 550px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.task-content {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.task-actions {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}