/* ==========================================================================
   ExtEval — ICU Extubation Decision Support
   Design tokens & global styles
   ========================================================================== */

:root {
    --primary: #0d6e8a;
    --primary-light: #1a9cc2;
    --primary-dark: #094d62;
    --accent: #17a689;
    --accent-light: #1cc9a6;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --danger: #dc3545;
    --success: #17a689;
    --warning: #d97706;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.05);
    --shadow-md: 0 2px 10px rgba(0,0,0,.07);
    --shadow-lg: 0 4px 20px rgba(0,0,0,.10);
    --transition: .2s ease;
}

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

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Global focus indicator — keyboard accessibility */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip-to-content — screen reader + keyboard nav */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: .5rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: .5rem; }


/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: .85rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.navbar-custom .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: .3px;
}
.navbar-custom .nav-link { color: rgba(255,255,255,.85); font-size: 1rem; }
.navbar-custom .nav-link:hover { color: #fff; }


/* ==========================================================================
   Progress stepper
   ========================================================================== */

.step-bar {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 1.5rem 0 .75rem;
}
.step-bar .step {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .92rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.step-bar .step .circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .88rem;
    background: #fff;
    flex-shrink: 0;
    transition: all var(--transition);
}
.step-bar .step.active .circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13,110,138,.15);
}
.step-bar .step.done .circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.step-bar .step .line {
    width: 52px; height: 3px;
    background: var(--border);
    margin: 0 .3rem;
    border-radius: 2px;
    transition: background var(--transition);
}
.step-bar .step.done .line,
.step-bar .step.active .line {
    background: var(--primary-light);
}


/* ==========================================================================
   Page container
   ========================================================================== */

.page-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    flex: 1;
    width: 100%;
}


/* ==========================================================================
   Cards
   ========================================================================== */

.card-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2.25rem;
}


/* ==========================================================================
   Welcome hero
   ========================================================================== */

.hero-section {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: .6rem;
    letter-spacing: -.3px;
}
.hero-section .lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-icon {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.2rem; color: #fff;
    box-shadow: 0 4px 20px rgba(13,110,138,.25);
}


/* ==========================================================================
   Feature cards (welcome page)
   ========================================================================== */

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.feature-card .icon { font-size: 1.75rem; margin-bottom: .6rem; }
.feature-card h6 { font-weight: 700; font-size: 1.05rem; margin-bottom: .35rem; }
.feature-card p { font-size: .95rem; color: var(--text-secondary); margin: 0; line-height: 1.55; }


/* ==========================================================================
   Page headings used across templates
   ========================================================================== */

.page-heading {
    font-weight: 700;
    font-size: 1.45rem;
    margin-bottom: .3rem;
    color: var(--text-primary);
}
.page-subtext {
    color: var(--text-secondary);
    font-size: 1.02rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.page-meta {
    font-size: .95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   Slider groups (input page)
   ========================================================================== */

.input-group-section {
    margin-bottom: 1.5rem;
}
.input-group-title {
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border);
    padding-bottom: .4rem;
    margin-bottom: .85rem;
}

.slider-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.4rem;
    margin-bottom: .85rem;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.slider-group:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}
.slider-group.computed-field {
    background: #f8fafb;
    border-style: dashed;
}
.slider-group label {
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: .15rem;
}
.slider-group label .unit {
    font-weight: 500;
    font-size: .9rem;
    color: var(--text-muted);
}
.slider-group .desc {
    font-size: .9rem;
    color: var(--text-secondary);
    margin-bottom: .6rem;
}
.slider-row {
    display: flex;
    align-items: center;
    gap: .85rem;
}
.slider-row .range-label {
    font-size: .85rem;
    color: var(--text-muted);
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.slider-row .range-label-max { text-align: left; }

.slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e2e8f0, #cbd5e1);
    outline: none;
    cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.22);
    transition: transform var(--transition), box-shadow var(--transition);
}
.slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 10px rgba(13,110,138,.35);
}
.slider-row input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}
.slider-row .value-input {
    min-width: 88px;
    max-width: 96px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    background: #eef6f9;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .4rem .5rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-variant-numeric: tabular-nums;
}
.slider-row .value-input-left {
    flex: 0 0 auto;
}
.slider-row .value-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,138,.15);
}
.slider-row .computed-input {
    background: #f0f0f0;
    color: var(--text-secondary);
    cursor: not-allowed;
    max-width: 100px;
}
.slider-row .computed-hint {
    font-size: .85rem;
    color: var(--text-muted);
    font-style: italic;
}


/* ==========================================================================
   Model selection cards
   ========================================================================== */

.model-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.model-option:hover { border-color: var(--primary-light); }
.model-option.selected {
    border-color: var(--primary);
    background: rgba(13,110,138,.04);
    box-shadow: 0 0 0 3px rgba(13,110,138,.12);
}
.model-option.disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}
.model-option h5 { font-size: 1.15rem; }
.model-option .badge-available {
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    padding: .25rem .7rem;
    border-radius: 20px;
    font-weight: 600;
}
.model-option .badge-coming {
    background: var(--text-muted);
    color: #fff;
    font-size: .8rem;
    padding: .25rem .7rem;
    border-radius: 20px;
    font-weight: 600;
}
.model-option .model-detail {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: .75rem;
}
.threshold-box {
    border-radius: var(--radius-sm);
    padding: .6rem;
    text-align: center;
}
.threshold-box .threshold-label {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: .15rem;
}
.threshold-box .threshold-value {
    font-size: 1.2rem;
    font-weight: 700;
}
.threshold-box .threshold-unit {
    font-size: .78rem;
}


/* ==========================================================================
   Results page
   ========================================================================== */

/* -- Recommendation banner -- */
.recommendation-box {
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    text-align: center;
    margin-bottom: 1.75rem;
}
.recommendation-box.continue-treatment {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}
.recommendation-box.extubate-now {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid var(--accent);
}
.recommendation-box h3 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: .4rem;
}
.recommendation-box p {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
}

/* -- Confidence indicator -- */
.confidence-bar-wrapper {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(0,0,0,.08);
}
.confidence-bar-label {
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: .4rem;
    display: flex;
    justify-content: space-between;
}
.confidence-bar-track {
    height: 10px;
    border-radius: 5px;
    background: rgba(0,0,0,.08);
    overflow: hidden;
    position: relative;
}
.confidence-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width .6s ease;
}
.confidence-bar-fill.high { background: var(--accent); }
.confidence-bar-fill.medium { background: var(--warning); }
.confidence-bar-fill.low { background: var(--danger); }

/* -- Action result sections -- */
.result-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow var(--transition);
}
.result-section:hover { box-shadow: var(--shadow-md); }
.result-header {
    padding: 1.1rem 1.4rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex; align-items: center; gap: .6rem;
}
.result-header .rec-badge {
    margin-left: auto;
    font-weight: 500;
    font-size: .88rem;
}
.result-header.action-0 { background: #fff3cd; color: #7c5e04; }
.result-header.action-1 { background: #d1ecf1; color: #0c5460; }

.result-body {
    padding: 1.4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}
.metric-card {
    text-align: center;
    padding: 1.15rem 1rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--border);
    transition: transform var(--transition);
}
.metric-card:hover { transform: translateY(-2px); }
.metric-card .metric-label {
    font-size: .9rem;
    color: var(--text-secondary);
    margin-bottom: .35rem;
    font-weight: 500;
}
.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.metric-card .metric-unit {
    font-size: .85rem;
    color: var(--text-muted);
}
.metric-better { color: var(--accent) !important; }
.metric-worse  { color: var(--danger) !important; }
.metric-direction {
    font-size: .82rem;
    font-weight: 500;
    margin-top: .25rem;
}


/* ==========================================================================
   Collapsible explanation sections (progressive disclosure)
   ========================================================================== */

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 1rem 1.35rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background var(--transition), border-color var(--transition);
    user-select: none;
}
.collapsible-header:hover {
    background: #edf2f7;
    border-color: #cbd5e1;
}
.collapsible-header h5 {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
    color: var(--primary-dark);
}
.collapsible-header .toggle-icon {
    font-size: 1.1rem;
    transition: transform .25s ease;
    color: var(--text-muted);
}
.collapsible-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}
.collapsible-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s ease, padding .35s ease;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0 1.35rem;
}
.collapsible-body.open {
    max-height: 2000px;
    padding: 1.1rem 1.35rem 1.35rem;
}
.collapsible-body ul { padding-left: 1.3rem; }
.collapsible-body li {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
    line-height: 1.65;
}

/* Legacy non-collapsible explanation-box (SHAP, model config) */
.explanation-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
}
.explanation-box h5 {
    font-weight: 700;
    font-size: 1.08rem;
    margin-bottom: .8rem;
    color: var(--primary-dark);
}
.explanation-box ul { padding-left: 1.3rem; }
.explanation-box li {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
    line-height: 1.65;
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    padding: .75rem 2.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.05rem;
    transition: transform .12s, box-shadow var(--transition);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}
.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(13,110,138,.3);
    color: #fff;
}
.btn-primary-custom:active { transform: translateY(0); }

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: .7rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}
.btn-outline-custom:hover {
    background: var(--primary);
    color: #fff;
}


/* ==========================================================================
   Disclaimer banner
   ========================================================================== */

.disclaimer {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: .95rem;
    color: #92400e;
    margin-top: 1.75rem;
    line-height: 1.6;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    text-align: center;
    padding: 1.1rem;
    font-size: .88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
    line-height: 1.6;
}


/* ==========================================================================
   Feedback section (results page)
   ========================================================================== */

.feedback-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}
.feedback-section h5 {
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--primary-dark);
    margin-bottom: .35rem;
}
.feedback-section .feedback-prompt {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
    line-height: 1.6;
}
.feedback-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn-feedback {
    flex: 1;
    min-width: 220px;
    padding: .85rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.02rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid var(--border);
    background: #fff;
    color: var(--text-primary);
}
.btn-feedback:hover { border-color: var(--primary-light); background: #f7fafc; }
.btn-feedback.btn-agree.selected {
    background: #d1fae5;
    border-color: var(--accent);
    color: #065f46;
}
.btn-feedback.btn-disagree.selected {
    background: #fee2e2;
    border-color: #dc3545;
    color: #991b1b;
}
.feedback-textarea {
    width: 100%;
    padding: .85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.6;
}
.feedback-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,138,.12);
}
.feedback-success {
    background: #d1fae5;
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: #065f46;
    font-weight: 600;
}


/* ==========================================================================
   Follow-up page
   ========================================================================== */

.followup-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: .85rem;
}
.followup-options {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.followup-option {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .9rem 1.15rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
    margin: 0;
}
.followup-option:hover { border-color: var(--primary-light); background: #f9fafb; }
.followup-option input[type="radio"] {
    margin-top: .3rem;
    accent-color: var(--primary);
    flex-shrink: 0;
    width: 18px; height: 18px;
    cursor: pointer;
}
.followup-option:has(input:checked) {
    background: rgba(13,110,138,.04);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,138,.1);
}
.followup-option-body { flex: 1; }
.followup-option-title {
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text-primary);
}
.followup-option-desc {
    font-size: .92rem;
    color: var(--text-secondary);
    margin-top: .2rem;
    line-height: 1.5;
}

/* Smooth reveal for conditional follow-up sections */
.followup-section[style*="display:none"],
.followup-section.hidden { display: none; }
.followup-section {
    animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   SHAP chart sections
   ========================================================================== */

.shap-chart-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.shap-chart-section h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: .6rem;
}

/* SHAP loading overlay */
.shap-loading {
    text-align: center;
    padding: 3rem 1rem;
}
.shap-loading .spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.shap-loading p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
}


/* ==========================================================================
   Utility: inline font classes used in templates
   ========================================================================== */

.text-sm   { font-size: .92rem; }
.text-base { font-size: 1rem;   }
.text-lg   { font-size: 1.1rem; }
.text-muted-color { color: var(--text-muted); }


/* ==========================================================================
   Population statistics bar charts
   ========================================================================== */

.pop-stat-group {
    margin-bottom: 1.25rem;
}
.pop-stat-group:last-child {
    margin-bottom: 0;
}
.pop-stat-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: .45rem;
}
.pop-stat-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .35rem;
}
.pop-stat-split {
    flex: 0 0 90px;
    font-size: .88rem;
    color: var(--text-secondary);
    text-align: right;
}
.pop-stat-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
}
.pop-stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
    min-width: 2px;
}
.pop-stat-value {
    flex: 0 0 72px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    html { font-size: 15px; }
    .hero-section h1 { font-size: 1.6rem; }
    .hero-section .lead { font-size: 1rem; }
    .card-main { padding: 1.15rem; }
    .result-body { grid-template-columns: 1fr; }
    .step-bar .step .line { width: 20px; }
    .step-bar .step { font-size: .75rem; }
    .step-bar { padding: 1rem 0 .5rem; gap: 0; flex-wrap: nowrap; }
    .step-bar .circle { width: 26px; height: 26px; font-size: .75rem; }
    .feedback-buttons { flex-direction: column; }
    .page-container { padding: .75rem .6rem 1.5rem; }
    .recommendation-box { padding: 1rem 1.1rem; margin-bottom: 0; }
    .recommendation-box h4 { font-size: 1.1rem; }
    .recommendation-box h5 { font-size: .92rem; }
    .recommendation-box p { font-size: .88rem; }
    .result-header { padding: .85rem 1rem; font-size: .95rem; flex-wrap: wrap; gap: .3rem; }
    .result-header .rec-badge { font-size: .78rem; }
    .result-body { padding: 1rem; gap: .85rem; }
    .metric-card { padding: .9rem .75rem; }
    .metric-card .metric-value { font-size: 1.4rem; }
    .metric-card .metric-label { font-size: .82rem; }
    .metric-card .metric-unit { font-size: .78rem; }
    .collapsible-header h5 { font-size: .95rem; }
    .navbar-custom .navbar-brand { font-size: 1rem; }
    .model-option { padding: 1.1rem; }
    .model-option h5 { font-size: 1rem; }
    .threshold-box .threshold-value { font-size: 1.1rem; }
    .pop-stat-split { flex: 0 0 70px; font-size: .8rem; }
    .pop-stat-value { flex: 0 0 62px; font-size: .82rem; }
    .pop-stat-bar-track { height: 16px; }
    .feature-card { padding: 1.25rem .75rem; }
    .feature-card .icon { font-size: 1.8rem; }
    .feature-card h6 { font-size: .95rem; }
    .feature-card p { font-size: .85rem; }
    .disclaimer { font-size: .88rem; padding: .85rem 1rem; }
    .btn-primary-custom, .btn-outline-custom { font-size: .92rem; padding: .65rem 1.25rem; }
    .slider-group { padding: .9rem 1rem; }
    .slider-row .value-input { min-width: 72px; max-width: 84px; font-size: .92rem; }
    .input-group-title { font-size: .98rem; }
    .slider-group label { font-size: .95rem; }
    .slider-group .desc { font-size: .82rem; }
    .d-flex.justify-content-between { gap: .5rem; }
}

@media (max-width: 420px) {
    html { font-size: 14px; }
    .step-bar .step .line { width: 14px; }
    .step-bar .circle { width: 22px; height: 22px; font-size: .7rem; }
    .recommendation-box { padding: .85rem; }
    .recommendation-box h4 { font-size: 1rem; }
    .result-header { font-size: .88rem; }
    .metric-card .metric-value { font-size: 1.25rem; }
    .pop-stat-split { flex: 0 0 58px; font-size: .75rem; }
    .pop-stat-value { flex: 0 0 56px; font-size: .78rem; }
}

@media (min-width: 1200px) {
    html { font-size: 18px; }
    .page-container { max-width: 1080px; }
}
