/* ═══════════════════════════════════════════════════════════════════
   RetinaSignal — Clinical Decision-Support Interface
   Design: Clinical, minimal, evidence-based. Color only for clinical meaning.
   Reference aesthetic: pathology report, not fitness dashboard.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Clinical colors — used ONLY for threshold status */
    --green: #2E7D32;
    --green-bg: #E8F5E9;
    --amber: #F57F17;
    --amber-bg: #FFF8E1;
    --deep-orange: #E65100;
    --deep-orange-bg: #FFF3E0;
    --red: #C62828;
    --red-bg: #FFEBEE;

    /* Neutral palette */
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --border: #E0E0E0;
    --border-dark: #BDBDBD;
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9E9E9E;
    --text-inverse: #FFFFFF;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --radius: 4px;
    --radius-lg: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--surface);
    border-bottom: 2px solid var(--text-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-mark {
    width: 44px;
    height: 44px;
    background: var(--text-primary);
    color: var(--text-inverse);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.tagline {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.version-badge {
    font-size: 11px;
    padding: 4px 12px;
    border: 1px solid var(--amber);
    color: var(--amber);
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.header-link:hover {
    background: #F5F5F5;
}

/* ── Navigation ────────────────────────────────────────────────── */
.screen-nav {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    overflow-x: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

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

.nav-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

.nav-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.nav-btn.active .nav-num {
    background: var(--text-primary);
    color: var(--text-inverse);
}

/* ── Screens ───────────────────────────────────────────────────── */
.screen {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.screen.active { display: block; }

.screen-header {
    margin-bottom: 32px;
}

.screen-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.screen-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.placeholder-msg {
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ── Upload Screen ─────────────────────────────────────────────── */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.upload-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.upload-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.drop-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--text-primary);
    background: #F5F5F5;
}

.drop-zone.uploaded {
    border-color: var(--green);
    border-style: solid;
    background: var(--green-bg);
}

.drop-icon {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drop-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-text small {
    color: var(--text-muted);
}

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

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.scan-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
}

.scan-status.pass {
    background: var(--green-bg);
    border-left: 3px solid var(--green);
    color: var(--green);
}

.scan-status.marginal {
    background: var(--amber-bg);
    border-left: 3px solid var(--amber);
    color: var(--amber);
}

.scan-status.fail {
    background: var(--red-bg);
    border-left: 3px solid var(--red);
    color: var(--red);
}

/* ── Demo Section ──────────────────────────────────────────────── */
.demo-section {
    text-align: center;
    padding: 24px;
    margin-bottom: 32px;
}

.demo-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    font-family: var(--font-mono);
}

/* ── Quality Assessment ────────────────────────────────────────── */
.quality-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.quality-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.quality-card h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.quality-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #F5F5F5;
    font-size: 13px;
}

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

.quality-label {
    color: var(--text-secondary);
}

.quality-value {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 12px;
}

.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.quality-badge.pass {
    background: var(--green-bg);
    color: var(--green);
}

.quality-badge.marginal {
    background: var(--amber-bg);
    color: var(--amber);
}

.quality-badge.fail {
    background: var(--red-bg);
    color: var(--red);
}

.action-bar {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--surface);
}

.btn:hover { background: #F5F5F5; }

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

.btn-primary:hover { background: #424242; }

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

.btn-lg {
    padding: 14px 36px;
    font-size: 15px;
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--border);
    color: var(--text-muted);
    border-color: var(--border);
}

/* ── Analysis Dashboard ────────────────────────────────────────── */
.analysis-content { }

.biomarker-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.biomarker-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--text-primary);
    font-weight: 700;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #F0F0F0;
    font-family: var(--font-mono);
    font-size: 13px;
}

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

.data-table .sector-name {
    font-family: var(--font);
    font-weight: 600;
    color: var(--text-primary);
}

/* Threshold color cells */
.cell-green { color: var(--green); font-weight: 600; }
.cell-amber { color: var(--amber); font-weight: 600; }
.cell-red { color: var(--red); font-weight: 600; }
.cell-flag { font-weight: 700; }

.threshold-col {
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-muted);
}

/* IED Summary */
.ied-summary {
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 16px;
}

.ied-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.ied-label { font-weight: 600; }

.ied-value {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Confidence Gauge */
.confidence-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.confidence-bar-container {
    margin: 16px 0;
}

.confidence-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.confidence-label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.confidence-factors {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.confidence-factors li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 0;
}

/* ── Risk Report ───────────────────────────────────────────────── */
.risk-badge {
    text-align: center;
    padding: 32px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    border: 2px solid;
}

.risk-badge h3 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.risk-badge .risk-subtitle {
    font-size: 14px;
    margin-top: 4px;
}

.risk-badge .risk-confidence {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.85;
}

.risk-badge.tier-low {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

.risk-badge.tier-moderate {
    background: var(--amber-bg);
    border-color: var(--amber);
    color: var(--amber);
}

.risk-badge.tier-elevated {
    background: var(--deep-orange-bg);
    border-color: var(--deep-orange);
    color: var(--deep-orange);
}

.risk-badge.tier-high {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.risk-badge.tier-abstain {
    background: #F5F5F5;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

/* Risk Panels */
.risk-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.risk-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.risk-panel h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.risk-panel .panel-level {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.risk-panel .panel-evidence {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.risk-panel .criteria-list {
    list-style: none;
    padding: 0;
}

.risk-panel .criteria-list li {
    font-size: 13px;
    padding: 4px 0;
    line-height: 1.5;
}

.risk-panel .interpretation {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.risk-panel .source {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Recommended Action */
.recommended-action {
    background: var(--surface);
    border: 2px solid var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.recommended-action h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.recommended-action .action-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.recommended-action .action-evidence {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.recommended-action .action-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Clinician Override */
.override-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.override-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.override-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
    margin-bottom: 12px;
}

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

.override-confirm {
    display: none;
    padding: 12px 16px;
    background: var(--green-bg);
    border-radius: var(--radius);
    color: var(--green);
    font-size: 13px;
    margin-top: 12px;
}

/* Normative Section */
.normative-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.normative-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.normative-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #F5F5F5;
    font-size: 13px;
}

.normative-name { font-weight: 600; }

.normative-detail {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ── Similar Cases ─────────────────────────────────────────────── */
.disclaimer-banner {
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 13px;
    color: #7B5800;
    margin-bottom: 24px;
    line-height: 1.5;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.case-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s ease;
}

.case-card:hover { box-shadow: var(--shadow-md); }

.case-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #333;
}

.case-image-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    background: linear-gradient(180deg, #EEEEEE 0%, #DADADA 100%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
}

.case-image-placeholder small {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 500;
}

.case-card-body {
    padding: 14px 16px;
}

.case-card-body .case-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.case-card-body .case-metrics {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    line-height: 1.6;
}

.case-card-body .case-similarity {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.why-expandable {
    margin-top: 16px;
    font-size: 13px;
}

.why-expandable summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
}

.why-expandable p {
    margin-top: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Longitudinal ──────────────────────────────────────────────── */
.longitudinal-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.rate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.rate-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rate-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.rate-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

.rate-alert {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
}

.rate-alert.pathological {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
}

.rate-alert.normal {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green);
}

.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.chart-container h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container img {
    max-width: 100%;
    height: auto;
}

.longitudinal-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.longitudinal-table h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.confidence-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Export ─────────────────────────────────────────────────────── */

/* Region Selector */
.region-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.region-selector h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.region-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.region-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.region-option {
    display: block;
    cursor: pointer;
}

.region-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.region-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.region-option:hover .region-card {
    border-color: var(--border-dark);
    background: var(--bg);
}

.region-option.selected .region-card {
    border-color: var(--text-primary);
    background: #F5F5F5;
}

.region-flag {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.region-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.region-info strong {
    font-size: 14px;
    font-weight: 600;
}

.region-info small {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.export-region-label {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

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

.export-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.export-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border: 2px solid var(--text-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.export-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.export-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.export-btn { width: 100%; }

.ehr-placeholder {
    text-align: center;
    padding: 20px;
}

.ehr-tooltip {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* ── Footer ────────────────────────────────────────────────────── */
.app-footer {
    background: #F5F5F5;
    border-top: 1px solid var(--border);
    padding: 20px 32px;
    margin-top: 48px;
}

/* ── About Page ────────────────────────────────────────────────── */
.about-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.about-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}

.about-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.about-hero h2 {
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: -0.6px;
    margin-bottom: 14px;
    max-width: 900px;
}

.about-lead {
    max-width: 860px;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.about-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.about-section {
    margin-bottom: 28px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h3 {
    font-size: 21px;
    margin-bottom: 4px;
}

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

.about-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.about-card,
.about-panel,
.status-card,
.vision-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}

.about-card-mark {
    display: inline-block;
    margin-bottom: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    background: #EEEEEE;
    color: var(--text-secondary);
}

.about-two-column,
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.about-panel h4,
.vision-panel h4 {
    font-size: 15px;
    margin-bottom: 10px;
}

.status-card.caution {
    border-color: var(--amber);
}

.status-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.about-list {
    padding-left: 18px;
    color: var(--text-secondary);
}

.about-list li {
    margin-bottom: 8px;
}

.dataset-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.dataset-pill,
.dataset-count {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
}

.dataset-pill.ready {
    border-color: var(--green);
    color: var(--green);
}

.dataset-pill.missing {
    border-color: var(--amber);
    color: var(--amber);
}

.dataset-name {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-right: 8px;
}

.dataset-value {
    font-family: var(--font-mono);
    font-weight: 700;
}

.roadmap-list {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.roadmap-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.roadmap-horizon {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.roadmap-goal {
    color: var(--text-primary);
}

.review-prompt {
    border-color: var(--text-primary);
}

.disclaimer-text {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
}

.disclaimer-text strong {
    color: var(--red);
}

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

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Alert inline */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-info {
    background: #E3F2FD;
    border-color: #1976D2;
    color: #1565C0;
}

.alert-warning {
    background: var(--amber-bg);
    border-color: var(--amber);
    color: #7B5800;
}

.alert-error {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.alert-success {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .upload-grid,
    .risk-panels,
    .export-grid,
    .longitudinal-rates {
        grid-template-columns: 1fr;
    }

    .region-options { grid-template-columns: 1fr; }
    .quality-grid { grid-template-columns: 1fr; }

    .about-two-column,
    .status-grid,
    .roadmap-item {
        grid-template-columns: 1fr;
    }

    .screen { padding: 20px; }
    .about-page { padding: 20px; }

    .app-header { padding: 12px 16px; }
    .screen-nav { padding: 0 8px; }
    .nav-btn { padding: 10px 12px; }
}

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
    .screen-nav,
    .app-header .version-badge,
    .btn,
    .override-section,
    .demo-section { display: none; }

    .screen { display: block !important; max-width: none; }

    body { font-size: 12px; background: white; }
}
