﻿/* ==========================================================
   FEVERCARE UI 2026 — Clean Medical Design
   Đã dọn dẹp: bỏ duplicate, gộp mobile thành 1 block
========================================================== */

body {
    font-family: 'Inter', sans-serif;
    background: #f5e6c8;
    color: #1f2937;
    line-height: 1.6;
}

/* ── Page wrapper ── */
.flow-content {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ── Main card ── */
.flow-card {
    border: 1px solid rgba(15, 23, 42, 0.10); /* thêm dòng này */
    position: relative;
    overflow: visible;
    border: none;
    border-radius: 28px;
    background: white;
    box-shadow: 0 20px 60px rgba(15,23,42,.08);
}

/* ── Card body ── */
.flow-body,
.card-body {
    padding: 48px !important;
}

.summary-card .card-body {
    padding: 12px 14px !important;
}

/* ── Header ── */
.flow-header {
    text-align: center;
    padding: 40px 32px 28px;
    background: #fafcff;
    border-bottom: 1px solid #eef2f7;
}

    .flow-header h1 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 8px;
        letter-spacing: -0.02em;
    }

    .flow-header p {
        color: #64748b;
        font-size: 1rem;
        margin: 0;
    }

/* ── Hero section (intro) ── */
.hero-section {
    text-align: center;
    padding: 18px 12px;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.hero-subtitle {
    margin-top: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #2563eb;
    line-height: 1.4;
}

.hero-desc {
    margin-top: 12px;
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Question ── */
h3 {
    font-size: 1.8rem;
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.question-title {
    white-space: pre-line;
}

.question-hint {
    background: #f8fafc;
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 24px;
    font-size: 1.15rem;
    line-height: 1.6;
    text-align: left;
    color: #475569;
}

/* ── Node ID (debug) ── */
.text-muted.small,
.mb-3.text-muted.small {
    display: none !important;
}

/* ── Alert ── */
.alert {
    border: none;
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.alert-secondary {
    background: #f8fafc;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    color: #0f172a;
}

/* ── Yes/No buttons ── */
.answer-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.answer-btn {
    width: 114px;
    height: 52px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .answer-btn:hover {
        transform: translateY(-2px);
    }

.answer-yes {
    background: #fff;
    color: #15803d;
    border: 2px solid #bbf7d0;
}

    .answer-yes:hover {
        background: #dcfce7;
        border-color: #86efac;
    }

.answer-no {
    background: #fff;
    color: #374151;
    border: 2px solid #fecaca;
}

    .answer-no:hover {
        background: #fef2f2;
        border-color: #fca5a5;
        color: #991b1b;
    }

/* ── Choice button ── */
.choice-btn {
    width: 100%;
    min-height: 72px;
    margin-bottom: 12px;
    border-radius: 18px;
    border: 2px solid #e5e7eb;
    background: white;
    text-align: left;
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    transition: .2s;
}

    .choice-btn:hover {
        border-color: #2563eb;
        background: #f8fbff;
    }

/* ── Inputs ── */
.input-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.big-input {
    width: 240px;
    height: 52px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: white;
    font-size: 1rem;
    padding: 0 16px;
    text-align: center;
    transition: all .2s ease;
    box-sizing: border-box;
}

    .big-input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37,99,235,.12);
        outline: none;
    }

.numeric-card {
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

.numeric-input {
    width: 240px;
    height: 52px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    box-sizing: border-box;
}

/* ── Continue button (fever numeric) ── */
.continue-btn-fever {
    display: block;
    width: 240px;
    height: 52px;
    margin: 20px auto 0;
    border: none;
    border-radius: 14px;
    background: #2E7D32;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    transition: .2s;
    box-sizing: border-box;
}

    .continue-btn-fever:hover {
        transform: translateY(-2px);
    }

/* ── Continue button (intro/growth) ── */
.continue-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #2E7D32;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 12px;
}

    .continue-btn:hover:not(:disabled) {
        background: #1a3a17;
    }

    .continue-btn:disabled {
        background: #d1d5db;
        cursor: not-allowed;
        opacity: 0.7;
    }

/* ── Reset button (top-right) ── */
.reset-btn-top {
    position: absolute;
    top: -18px;
    right: -18px;
    min-width: 52px;
    height: 52px;
    padding: 0 14px;
    border: 2px solid #3b82f6;
    border-radius: 26px;
    background: #fff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59,130,246,0.12);
    transition: all .2s ease;
    z-index: 10;
}

    .reset-btn-top:hover {
        background: #2563eb;
        color: white;
        transform: translateY(-1px);
    }

    .reset-btn-top:focus {
        outline: none;
    }

.icon {
    font-size: 22px;
    line-height: 1;
    color: inherit;
}

/* ── Restart button (bottom) ── */
.restart-btn {
    border: 2px solid #3b82f6 !important;
    background: #fff !important;
    color: #3b82f6 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 56px !important;
    min-width: 180px !important;
    border-radius: 16px !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
}

    .restart-btn:hover {
        background: #2563eb !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
    }

    .restart-btn .icon {
        font-size: 1.2em;
    }

/* ── Result banner ── */
.result-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

    .result-success h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: #166534;
        margin-bottom: 8px;
    }

    .result-success p {
        font-size: 0.88rem;
        color: #15803d;
        line-height: 1.6;
        margin: 0;
    }

/* ── Summary card ── */
.summary-card {
    border: 0.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: none !important;
    margin-bottom: 16px;
}

/* ── Card header ── */
.card-header {
    padding: 16px 18px;
}

    .card-header h4 {
        font-size: 1.1rem;
        font-weight: 600;
    }

    .card-header.bg-primary {
        background: #2E7D32 !important;
        border-bottom: none;
        padding: 14px 16px;
    }

    .card-header.bg-light {
        background: #f8fafc !important;
        border-bottom: 0.5px solid #e2e8f0;
        padding: 12px 16px;
    }

    .card-header.bg-primary h4 {
        color: #fff;
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
    }

    .card-header.bg-light h4 {
        color: #111827;
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
    }

.header-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.8);
}

.edit-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    cursor: pointer;
}

    .edit-btn:hover {
        background: rgba(255,255,255,0.3);
    }

/* ── Info grid ── */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 0.5px solid #e2e8f0;
}

.info-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

/* ── Summary items ── */
.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 500;
    border: 1px solid transparent;
}

    .summary-item.success {
        background: #f0fdf4;
        border-color: #bbf7d0;
        color: #166534;
    }

    .summary-item.warning {
        background: #fffbeb;
        border-color: #fde68a;
        color: #92400e;
    }

    .summary-item.danger {
        background: #fef2f2;
        border-color: #fecaca;
        color: #991b1b;
    }

.summary-icon {
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 1px;
}

/* ── Dose box ── */
.dose-box {
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 16px;
}

    .dose-box.paracetamol {
        background: linear-gradient(135deg, #ecfdf5, #dcfce7);
    }

    .dose-box.ibuprofen {
        background: linear-gradient(135deg, #fffbeb, #fef3c7);
    }

    .dose-box h4 {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 8px;
        color: #374151;
    }

    .dose-box h2 {
        font-size: 2.5rem;
        font-weight: 800;
        color: #1e293b;
        margin: 8px 0;
    }

    .dose-box p {
        font-size: 0.9rem;
        color: #64748b;
        margin-bottom: 8px;
    }

    .dose-box small {
        font-size: 0.78rem;
        color: #9ca3af;
        line-height: 1.6;
        display: block;
    }

/* ── Usage guide ── */
.usage-guide {
    margin-bottom: 10px;
}

.guide-toggle {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #e7f5ff;
    color: #1971c2;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all .2s ease;
}

    .guide-toggle:hover {
        background: #d0ebff;
    }

.guide-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #2B6CB0;
}

.guide-content {
    text-align: left;
    line-height: 1.7;
}

.guide-item {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 8px;
}

    .guide-item:last-child {
        border-bottom: none;
    }

.drug-group {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.drug-bullet {
    margin-top: 4px;
    padding-left: 12px;
    border-left: 3px solid #e2e8f0;
    color: #475569;
    font-size: 0.95rem;
}

.warning {
    background: #fff8e1;
    padding: 14px;
    border-radius: 10px;
    border-left: 4px solid #ffb300;
}

.contact {
    background: #eef7ff;
    padding: 14px;
    border-radius: 10px;
    margin-top: 12px;
}

/* ── Agree box ── */
.agree-box {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #2d3748;
    transition: all 0.2s ease;
}

    .agree-box:hover {
        border-color: #cbd5e1;
        background: #f1f5f9;
    }

    .agree-box input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: #3b82f6;
        cursor: pointer;
    }

    .agree-box.checked {
        border-color: #22c55e;
        background: #f0fdf4;
    }

.check-anim {
    margin-left: auto;
    color: #22c55e;
    font-weight: bold;
}

.hint-text {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

    .hint-text .ok {
        color: #16a34a;
        font-weight: 500;
    }

/* ══════════════════════════════════════════════════════════════════
   GROWTH MODULE
══════════════════════════════════════════════════════════════════ */

.growth-page {
    max-width: 920px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.growth-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border: 0.5px solid #dbeafe;
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.growth-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #fff;
    border: 0.5px solid #dbeafe;
    box-shadow: 0 2px 6px rgba(29,78,216,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #1d4ed8;
    flex-shrink: 0;
}

.growth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 4px;
    color: #111827;
}

.growth-header .subtitle {
    font-size: 0.82rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.about-card {
    background: #f0f9ff;
    border: 0.5px solid #bae6fd;
    border-radius: 12px;
    overflow: hidden;
}

    .about-card summary {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 11px 16px;
        font-size: 0.85rem;
        font-weight: 600;
        color: #0369a1;
        cursor: pointer;
        list-style: none;
        user-select: none;
    }

        .about-card summary::-webkit-details-marker {
            display: none;
        }

    .about-card .about-content {
        padding: 0 16px 14px;
        font-size: 0.83rem;
        color: #374151;
        line-height: 1.65;
        border-top: 0.5px solid #bae6fd;
    }

        .about-card .about-content p {
            margin: 10px 0 6px;
        }

        .about-card .about-content ul {
            margin: 0 0 8px;
            padding-left: 1.2rem;
        }

        .about-card .about-content li {
            margin-bottom: 3px;
        }

.about-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff7ed;
    border: 0.5px solid #fed7aa;
    color: #92400e;
    font-size: 0.78rem;
    margin-top: 10px;
}

.growth-form-card {
    background: #fff;
    border: 0.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 24px 24px;
}

    .growth-form-card .card-title {
        font-size: 1rem;
        font-weight: 700;
        color: #111827;
        margin: 0 0 3px;
    }

    .growth-form-card .card-subtitle {
        font-size: 0.8rem;
        color: #9ca3af;
        margin: 0 0 18px;
    }

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.growth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .growth-field label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #4b5563;
        margin: 0;
    }

    .growth-field .field-hint {
        font-size: 0.72rem;
        color: #9ca3af;
        margin-top: 2px;
    }

.g-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #f8f8f6;
    border: 1px solid #e0ddd6;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}

    .g-input:focus {
        border-color: #93c5fd;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
    }

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.g-input-num {
    display: block;
    box-sizing: border-box;
    width: 120px;
    flex: 0 0 120px;
    background: #f8f8f6;
    border: 1px solid #e0ddd6;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .g-input-num:focus {
        border-color: #93c5fd;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
    }

.unit {
    font-size: 0.88rem;
    color: #9ca3af;
    white-space: nowrap;
}

.age-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border: 0.5px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.88rem;
    color: #1e40af;
    margin-bottom: 16px;
}

    .age-badge strong {
        font-weight: 700;
    }

.age-tag-2007 {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.btn-assess {
    width: 100%;
    padding: 13px 16px;
    border-radius: 10px;
    border: none;
    background: #2E7D32;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s;
    margin-top: 6px;
}

    .btn-assess:hover:not(:disabled) {
        background: #1a3a17;
    }

    .btn-assess:disabled {
        background: #93c5fd;
        cursor: not-allowed;
    }

.growth-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
    background: #fef2f2;
    border: 0.5px solid #fecaca;
    color: #991b1b;
    font-size: 0.85rem;
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    border: 0.5px solid transparent;
}

    .summary-banner > i {
        font-size: 20px;
        flex-shrink: 0;
        margin-top: 2px;
    }

.summary-text {
    font-weight: 700;
    margin: 0 0 2px;
    font-size: 0.9rem;
}

.summary-meta {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
}

.banner-ok {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #064e3b;
}

.banner-warn {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #78350f;
}

.btn-reset {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: #60a5fa;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s;
}

    .btn-reset:hover {
        background: #0e7490;
    }

.indicator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.zscore-card {
    background: #fff;
    border: 0.5px solid #e5e7eb;
    border-left: 5px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

    .zscore-card.zc-ok {
        border-left-color: #10b981;
    }

    .zscore-card.zc-warning {
        border-left-color: #f59e0b;
    }

    .zscore-card.zc-danger {
        border-left-color: #ef4444;
    }

    .zscore-card.zc-accent {
        border-left-color: #3b82f6;
    }

    .zscore-card.zc-gray {
        border-left-color: #d1d5db;
    }

.zcard-header {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.zcard-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f5f5f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #6b7280;
    flex-shrink: 0;
}

.zcard-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1px;
    line-height: 1.3;
}

.zcard-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
    margin: 0;
}

.zcard-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.gauge-wrap {
    position: relative;
    padding-top: 2px;
    margin-bottom: 2px;
}

.gauge-track {
    position: relative;
    height: 9px;
    border-radius: 5px;
    background: #f1f1ef;
    overflow: hidden;
}

.gauge-zone {
    position: absolute;
    top: 0;
    bottom: 0;
}

.gauge-marker {
    position: absolute;
    top: 2px;
    transform: translate(-50%,-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1f2937;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px #1f2937, 0 1px 3px rgba(0,0,0,0.25);
    z-index: 5;
}

.gauge-labels {
    position: relative;
    height: 14px;
    margin-top: 5px;
}

    .gauge-labels span {
        position: absolute;
        transform: translateX(-50%);
        font-size: 0.64rem;
        font-weight: 600;
        color: #9ca3af;
        white-space: nowrap;
    }

.gauge-label-zero {
    font-weight: 800 !important;
    color: #374151 !important;
}

.zscore-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zscore-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.zscore-value-block {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

/* ── Sex toggle ── */
.sex-toggle {
    display: flex;
    gap: 8px;
}

.sex-btn {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid #e0ddd6;
    background: #f8f8f6;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    overflow: visible;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.sex-icon {
    font-size: 17px;
    line-height: 1;
    opacity: 0.6;
}

.sex-btn:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
    color: #6b7280;
}

.sex-btn-male.sex-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(147,197,253,0.3);
}

    .sex-btn-male.sex-active:hover {
        background: #bfdbfe;
        border-color: #60a5fa;
    }

.sex-btn-female.sex-active {
    background: #fce7f3;
    border-color: #f9a8d4;
    color: #be185d;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(249,168,212,0.3);
}

    .sex-btn-female.sex-active:hover {
        background: #fbcfe8;
        border-color: #f472b6;
    }

.sex-check {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #16a34a;
    background: #fff;
    border-radius: 50%;
    z-index: 2;
}

/* ── Hero growth ── */
.hero-section-growth-page {
    text-align: center;
    padding: 18px 12px;
    margin-bottom: 18px;
}

.hero-icon-growth-page {
    font-size: 40px;
    margin-bottom: 8px;
}

.hero-title-growth-page {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.hero-subtitle-growth-page {
    margin-top: 10px;
    font-size: 1.0rem;
    font-weight: 600;
    color: #2563eb;
    line-height: 1.4;
    max-width: 900px;
}

.hero-desc-growth-page {
    margin-top: 12px;
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Intro card ── */
.intro-card {
    background: #fff;
    border: 0.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 22px;
}

.usage-guide {
    border: 0.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.guide-toggle {
    width: 100%;
    padding: 13px 16px;
    background: #f9fafb;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
}

    .guide-toggle:hover {
        background: #f3f4f6;
    }

.guide-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
}

.guide-arrow {
    font-size: 0.7rem;
    color: #9ca3af;
}

.guide-content {
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 0.5px solid #e5e7eb;
}

.guide-item {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.7;
}

    .guide-item strong {
        display: block;
        font-size: 0.88rem;
        color: #111827;
        margin-bottom: 6px;
    }

    .guide-item ul {
        margin: 6px 0 0;
        padding-left: 1.2rem;
    }

    .guide-item li {
        margin-bottom: 4px;
    }

    .guide-item.warning {
        background: #fffbeb;
        border: 0.5px solid #fde68a;
        border-radius: 10px;
        padding: 12px 14px;
    }

        .guide-item.warning strong {
            color: #92400e;
        }

    .guide-item.contact {
        background: #eff6ff;
        border: 0.5px solid #bfdbfe;
        border-radius: 10px;
        padding: 12px 14px;
    }

        .guide-item.contact strong {
            color: #1e40af;
        }

.drug-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.drug-item {
    background: #f9fafb;
    border: 0.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}

    .drug-item b {
        font-size: 0.82rem;
        color: #111827;
        display: block;
        margin-bottom: 3px;
    }

.drug-bullet {
    font-size: 0.76rem;
    color: #6b7280;
    line-height: 1.5;
}

.agree-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    transition: background 0.15s, border-color 0.15s;
}

    .agree-box.checked {
        background: #f0fdf4;
        border-color: #86efac;
    }

    .agree-box input[type="checkbox"] {
        width: 19px;
        height: 19px;
        accent-color: #16a34a;
        cursor: pointer;
        flex-shrink: 0;
    }

    .agree-box label {
        font-size: 0.88rem;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        flex: 1;
        margin: 0;
    }

.check-anim {
    display: none;
    color: #16a34a;
    font-weight: 800;
}

.agree-box.checked .check-anim {
    display: inline;
}

.hint-text {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

    .hint-text .ok {
        color: #16a34a;
        font-weight: 600;
    }

/* ══════════════════════════════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════════════════════════════ */

.home-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.home-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563eb;
    margin: 0;
}

.home-section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.home-section-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.home-hero {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    margin-top: 32px;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('/img/background.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.95);
}

.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.35) 100%);
    pointer-events: none;
}

.home-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.home-hero-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.home-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1a3a1a;
    line-height: 1.15;
    margin: 0 0 14px;
}

.home-hero-subtitle {
    font-size: 1rem;
    line-height: 1.7;
    color: #2d5a2d;
    max-width: 500px;
    margin: 0 0 10px;
}

.home-hero-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #2d5a2d;
    max-width: 500px;
    margin: 0 auto 10px;
}

.home-hero-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #166534;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 4px 14px;
    display: inline-block;
    margin-bottom: 24px;
}

.home-hero-action-hint {
    font-size: 0.78rem;
    color: rgba(45,90,39,0.7);
    margin: 0 0 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.home-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.home-btn-primary,
.home-btn-secondary {
    width: 180px; /* Tất cả nút cùng chiều rộng */
    height: 32px; /* Chiều cao cố định */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 999px; /* Bo tròn hoàn toàn */

    border: 1px solid rgba(0,0,0,.08);
    background: linear-gradient( to bottom, #4CAF50 0%, #2E7D32 100% );
    color: white;
    font-weight: 600;
    /* Hiệu ứng nổi */
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), /* ánh sáng phía trên */
    0 7px 0 #2d5a27, /* cạnh dưới của nút */
    0 10px 18px rgba(0,0,0,.18); /* bóng */

    transform: translateY(0);
    transition: transform .12s, box-shadow .12s, background .2s;
    text-decoration: none !important;
}

    .home-btn-primary:hover,
    .home-btn-secondary:hover {
        background: linear-gradient( to bottom, #5BC95F, #4CAF50 );
        transform: translateY(-2px);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 9px 0 #2d5a27, 0 14px 24px rgba(0,0,0,.2);
        text-decoration: none;
    }

    .home-btn-primary:active,
    .home-btn-secondary:active {
        /* Nút lún xuống */
        transform: translateY(5px);
        box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 2px 0 #2d5a27, 0 4px 8px rgba(0,0,0,.15);
    }

.home-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.home-feature-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    border-radius: 20px;
    border: 0.5px solid #e5e7eb;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(15,23,42,0.05);
}

    .home-feature-card:hover {
        box-shadow: 0 8px 28px rgba(15,23,42,0.1);
        transform: translateY(-2px);
        text-decoration: none;
        color: inherit;
    }

.home-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.home-feature-fever .home-feature-icon {
    background: #fef2f2;
    color: #dc2626;
}

.home-feature-growth .home-feature-icon {
    background: #eff6ff;
    color: #1d4ed8;
}

.home-feature-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.home-feature-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.home-feature-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
}

.home-coming {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
}

.home-coming-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: 16px;
    border: 0.5px dashed #d1d5db;
    background: #f9fafb;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9ca3af;
    text-align: center;
}

    .home-coming-item i {
        font-size: 22px;
        color: #d1d5db;
    }

.home-coming {
    grid-template-columns: 1fr 1fr !important;
}

.home-coming-item {
    min-height: 90px !important;
    justify-content: center !important;
}

    .home-coming-item span {
        white-space: pre-line;
        text-align: center;
    }

.home-values {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 16px;
}

.home-value-item {
    padding: 22px;
    border-radius: 16px;
    background: #fff;
    border: 0.5px solid #e5e7eb;
}

.home-value-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #1d4ed8;
    margin-bottom: 12px;
}

.home-value-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.home-value-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
}

.home-disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 20px 24px;
}

.home-disclaimer-inner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.home-disclaimer-icon {
    font-size: 20px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.home-disclaimer-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 6px;
}

.home-disclaimer-text {
    font-size: 0.82rem;
    color: #78350f;
    line-height: 1.7;
    margin: 0 0 6px;
}

/* ══════════════════════════════════════════════════════════════════
   UNIT CONVERTER
══════════════════════════════════════════════════════════════════ */

.uc-wrap {
    margin-top: 10px;
    border: 0.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.uc-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    text-align: left;
    transition: background 0.15s;
}

    .uc-toggle:hover {
        background: #f3f4f6;
        color: #374151;
    }

    .uc-toggle i:first-child {
        font-size: 14px;
        color: #9ca3af;
    }

    .uc-toggle span {
        flex: 1;
    }

.uc-arrow {
    font-size: 13px;
}

.uc-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uc-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uc-section-sep {
    padding-top: 10px;
    border-top: 0.5px solid #f3f4f6;
}

.uc-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.uc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uc-field {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 10px;
}

    .uc-field:focus-within {
        border-color: #93c5fd;
        background: #eff6ff;
    }

.uc-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 3px;
}

.uc-field:focus-within .uc-label {
    color: #3b82f6;
}

.uc-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    outline: none;
    padding: 0;
}

.uc-ft-in {
    display: flex;
    gap: 4px;
    align-items: center;
}

    .uc-ft-in .uc-input {
        width: 38px;
    }

.uc-unit-hint {
    font-size: 11px;
    color: #9ca3af;
    flex-shrink: 0;
}

.uc-arrow-mid {
    font-size: 14px;
    color: #d1d5db;
    flex-shrink: 0;
}

.uc-result {
    flex: 1;
    border-radius: 8px;
    padding: 7px 10px;
}

.uc-value {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.uc-result-blue {
    background: #eff6ff;
    border: 0.5px solid #bfdbfe;
}

    .uc-result-blue .uc-label {
        color: #93c5fd;
    }

    .uc-result-blue .uc-value {
        color: #1d4ed8;
    }

.uc-result-amber {
    background: #fffbeb;
    border: 0.5px solid #fde68a;
}

    .uc-result-amber .uc-label {
        color: #fbbf24;
    }

    .uc-result-amber .uc-value {
        color: #d97706;
    }

.uc-hint {
    font-size: 11px;
    color: #d1d5db;
    margin: 0;
    text-align: center;
}

.uc-toggle-warn {
    font-size: 14px;
    color: #d97706;
    flex-shrink: 0;
}

.uc-toggle-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.uc-toggle-req {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d97706;
}

.uc-toggle-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE — 1 block duy nhất, không trùng lặp
══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Fever flow ── */
    .flow-content {
        max-width: 100%;
        margin: 0;
        padding: 8px 0 0;
    }

    .flow-card {
        border-radius: 16px;
        margin: 0 6px 8px;
        overflow: hidden;
    }

    .flow-body,
    .card-body {
        padding: 16px 20px !important;
    }

    .summary-card .card-body {
        padding: 10px 12px !important;
    }

    /* ── Typography ── */
    .hero-title {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-desc {
        font-size: 0.82rem;
    }

    .question-title {
        font-size: 1.05rem;
        line-height: 1.5;
    }

    .question-hint {
        font-size: 0.85rem;
        padding: 14px 16px;
    }

    h3 {
        font-size: 1.3rem;
    }

    /* ── Answer buttons ── */
    .answer-group {
        flex-direction: column;
        gap: 10px;
    }

    .answer-btn {
        width: 100%;
        height: 52px;
        font-size: 1rem;
        border-radius: 14px;
    }

    /* ── Numeric input ── */
    .big-input,
    .numeric-input,
    .continue-btn-fever {
        width: 100%;
    }

    .numeric-card {
        justify-content: stretch;
    }

    /* ── Reset top ── */
    .reset-btn-top {
        position: absolute !important;
        top: -18px !important;
        right: 12px !important;
        height: 36px !important;
        min-width: auto !important;
        padding: 0 12px !important;
        font-size: 0.82rem !important;
        border-radius: 20px !important;
        box-shadow: 0 2px 8px rgba(59,130,246,0.15) !important;
    }

    .restart-btn {
        display: flex !important;
        margin: 0 auto !important;
    }

    /* flow-card cần overflow visible để nút nhô ra ngoài */
    .flow-card {
        overflow: visible !important;
    }
    /* ── Result ── */
    .result-success {
        padding: 14px;
    }

        .result-success h3 {
            font-size: 1rem;
        }

    .dose-box {
        padding: 16px;
    }

        .dose-box h2 {
            font-size: 1.8rem;
        }

    /* ── Summary ── */
    .summary-card {
        margin-bottom: 10px;
    }

    .info-grid {
        gap: 6px;
    }

    /* ── Growth ── */
    .growth-page {
        padding: 0 8px 40px;
        margin: 8px auto;
    }

    .growth-form-card {
        padding: 16px 12px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sex-toggle {
        gap: 6px;
    }

    .sex-btn {
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    .sex-check {
        width: 16px;
        height: 16px;
        font-size: 16px;
        top: -6px;
        right: -6px;
    }

    .indicator-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .zscore-card {
        padding: 14px;
    }

    .hero-title-growth-page {
        font-size: 1.4rem;
    }

    .hero-subtitle-growth-page {
        font-size: 0.88rem;
    }

    .hero-desc-growth-page {
        font-size: 0.82rem;
    }

    /* ── Intro card (Growth) ── */
    .intro-card {
        padding: 16px 12px;
    }

    .usage-guide {
        margin: 8px 0;
    }

    .guide-content {
        font-size: 0.82rem;
    }

    .drug-group {
        grid-template-columns: 1fr;
    }

    /* ── Unit converter ── */
    .uc-arrow-mid {
        display: none;
    }

    .uc-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        align-items: start;
    }

    .uc-field, .uc-result {
        width: 100%;
    }

    /* ── Home ── */
    .home-page {
        padding: 0 16px 40px;
        gap: 28px;
    }

    .home-hero {
        margin-top: 8px;
        margin-left: 6px !important;
        margin-right: 6px !important;
        min-height: auto;
    }

    .home-hero-content {
        padding: 24px 14px 20px;
    }

    .home-hero-title {
        font-size: 1.6rem;
    }

    .home-hero-subtitle {
        font-size: 0.9rem;
    }

    .home-hero-desc {
        font-size: 0.82rem;
    }

    .home-features, .home-values {
        grid-template-columns: 1fr;
    }

    .home-coming {
        grid-template-columns: 1fr 1fr;
    }

    .home-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-btn-primary, .home-btn-secondary {
        justify-content: center;
        padding: 12px 16px;
    }

    .home-values {
        grid-template-columns: 1fr;
    }

    .home-features,
    .home-values,
    .home-coming,
    .home-disclaimer,
    .home-section {
        margin-left: 6px !important;
        margin-right: 6px !important;
    }
}

@media (max-width: 400px) {
    .home-coming {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════
   GROWTH INTERPRETATION — phần bị thiếu
══════════════════════════════════════════════════════════════════ */

.zscore-number {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.zscore-sd {
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0.75;
    line-height: 1;
}

.zc-ok .zscore-number, .zc-ok .zscore-sd {
    color: #059669;
}

.zc-warning .zscore-number, .zc-warning .zscore-sd {
    color: #d97706;
}

.zc-danger .zscore-number, .zc-danger .zscore-sd {
    color: #dc2626;
}

.zc-accent .zscore-number, .zc-accent .zscore-sd {
    color: #2563eb;
}

.zc-gray .zscore-number, .zc-gray .zscore-sd {
    color: #9ca3af;
}

.status-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.chip-ok {
    background: #d1fae5;
    color: #065f46;
}

.chip-warning {
    background: #fef3c7;
    color: #92400e;
}

.chip-danger {
    background: #fee2e2;
    color: #991b1b;
}

.chip-accent {
    background: #dbeafe;
    color: #1e40af;
}

.chip-gray {
    background: #f3f4f6;
    color: #6b7280;
}

.percentile-text {
    font-size: 0.7rem;
    font-weight: 500;
    color: #9ca3af;
    margin: 0;
}

.zcard-na {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0 2px;
}

.who-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f9fafb;
    border: 0.5px solid #e5e7eb;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.6;
}

    .who-note i {
        flex-shrink: 0;
        margin-top: 1px;
        font-size: 13px;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.interpret-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-interpret {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #c4b5fd;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s;
}

    .btn-interpret:hover {
        background: #ede9fe;
        border-color: #a78bfa;
    }

.interpret-toggle-icon {
    font-size: 14px;
    margin-left: 2px;
}

.interpret-panel {
    background: #fff;
    border: 0.5px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}

.interpret-header {
    padding: 16px 20px;
    border-bottom: 0.5px solid #f0f0ee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.interpret-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f5f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #7c3aed;
    flex-shrink: 0;
}

.interpret-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.interpret-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 1px 0 0;
}

.acc-item {
    border-bottom: 0.5px solid #f0f0ee;
}

.acc-item-last {
    border-bottom: none;
}

.acc-head {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

    .acc-head:hover {
        background: #fafafa;
    }

.acc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-ok {
    background: #22c55e;
}

.dot-warn {
    background: #f59e0b;
}

.dot-danger {
    background: #ef4444;
}

.dot-accent {
    background: #3b82f6;
}

.dot-gray {
    background: #d1d5db;
}

.acc-head-text {
    flex: 1;
    min-width: 0;
}

.acc-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.acc-chip {
    font-size: 0.74rem;
    color: #9ca3af;
    margin: 1px 0 0;
}

.acc-chevron {
    color: #c4c4c4;
    font-size: 15px;
    flex-shrink: 0;
}

.acc-body {
    padding: 0 20px 18px 50px;
    font-size: 0.83rem;
    color: #4b5563;
    line-height: 1.7;
}

    .acc-body p {
        margin: 0 0 10px;
    }

.acc-action {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 0.78rem;
    line-height: 1.5;
}

.acc-action-icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 14px;
}

.acc-action-ok {
    background: #f0fdf4;
    border: 0.5px solid #bbf7d0;
    color: #166534;
}

.acc-action-warn {
    background: #fffbeb;
    border: 0.5px solid #fde68a;
    color: #92400e;
}

.overall-conclusion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    margin: 4px 14px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.conclusion-icon {
    font-size: 19px;
    flex-shrink: 0;
    margin-top: 1px;
}

.conclusion-label {
    font-size: 0.78rem;
    font-weight: 700;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.conclusion-text {
    font-size: 0.84rem;
    line-height: 1.65;
    margin: 0;
}

.conclusion-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

    .conclusion-ok .conclusion-icon {
        color: #16a34a;
    }

    .conclusion-ok .conclusion-label {
        color: #166534;
    }

    .conclusion-ok .conclusion-text {
        color: #166534;
    }

.conclusion-review {
    background: #faf5ff;
    border-color: #d8b4fe;
}

    .conclusion-review .conclusion-icon {
        color: #7c3aed;
    }

    .conclusion-review .conclusion-label {
        color: #6b21a8;
    }

    .conclusion-review .conclusion-text {
        color: #581c87;
    }

.btn-interpret-close {
    margin-top: 6px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1.5px solid #c4b5fd;
    background: #fff;
    color: #6d28d9;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s;
}

    .btn-interpret-close:hover {
        background: #f5f3ff;
        border-color: #a78bfa;
    }

@media (max-width: 768px) {
    .uc-row {
        display: flex !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .uc-field,
    .uc-result {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: 50% !important;
        box-sizing: border-box !important;
    }
}

/* ── Home — justify các đoạn văn nhiều chữ ── */
.home-hero-desc,
.home-section-desc,
.home-feature-desc,
.home-value-desc,
.home-disclaimer-text,
.home-feature-tag,
.home-section-title /* coming soon title dài */ {
    text-align: justify;
}

/* Giữ nguyên center cho hero */
.home-hero-subtitle {
    text-align: center;
}

/* coming-item và feature-tag ngắn — giữ center/left */
.home-coming-item span {
    text-align: center;
}

.mobile-only-br {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only-br {
        display: inline;
    }
}

.guide-body,
.drug-item,
.drug-bullet,
.dose-box small {
    white-space: pre-line;
    text-align: justify;
}

.guide-content,
.guide-item,
.drug-item,
.drug-bullet,
.guide-item small,
.guide-item.contact,
.guide-item.warning {
    text-align: justify;
    text-justify: inter-word;
}

.question-hint,
.result-success p,
.result-success h3 + p {
    text-align: justify;
}

/* ── Letter page — prefix letter-* ── */
.letter-page {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.letter-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    border: 0.5px solid #e5e7eb;
    overflow: hidden;
}

.letter-header {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 0.5px solid #bbf7d0;
    padding: 32px 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.letter-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.letter-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #166534;
    margin: 0;
    line-height: 1.3;
}

.letter-body {
    padding: 36px 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.letter-salutation {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.letter-body p {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.8;
    margin: 0;
    text-align: justify;
}

.letter-closing {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 0.5px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.letter-signature {
    margin-top: 12px;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 0.5px solid #e5e7eb;
}

.letter-sig-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 2px !important;
    text-align: left !important;
}

.letter-sig-title {
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    margin: 0 0 8px !important;
    text-align: left !important;
}

.letter-sig-contact {
    font-size: 0.82rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    text-align: left !important;
}

    .letter-sig-contact a {
        color: #2563eb;
        text-decoration: none;
    }

        .letter-sig-contact a:hover {
            text-decoration: underline;
        }

@media (max-width: 768px) {
    .letter-page {
        padding: 0 12px 40px;
        margin: 8px auto;
    }

    .letter-header {
        padding: 24px 20px 20px;
    }

    .letter-title {
        font-size: 1.15rem;
    }

    .letter-body {
        padding: 24px 20px;
        gap: 14px;
    }

        .letter-body p {
            font-size: 0.88rem;
        }
}

/* ── Letter page — prefix letter-* ── */
.letter-page {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.letter-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    border: 0.5px solid #e5e7eb;
    overflow: hidden;
}

.letter-header {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 0.5px solid #bbf7d0;
    padding: 32px 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.letter-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.letter-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #166534;
    margin: 0;
    line-height: 1.3;
}

.letter-body {
    padding: 36px 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.letter-salutation {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.letter-body p {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.8;
    margin: 0;
    text-align: justify;
}

.letter-closing {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 0.5px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.letter-signature {
    margin-top: 12px;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 0.5px solid #e5e7eb;
}

.letter-sig-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 2px !important;
    text-align: left !important;
}

.letter-sig-title {
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    margin: 0 0 8px !important;
    text-align: left !important;
}

.letter-sig-contact {
    font-size: 0.82rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    text-align: left !important;
}

    .letter-sig-contact a {
        color: #2563eb;
        text-decoration: none;
    }

        .letter-sig-contact a:hover {
            text-decoration: underline;
        }

@media (max-width: 768px) {
    .letter-page {
        padding: 0 12px 40px;
        margin: 8px auto;
    }

    .letter-header {
        padding: 24px 20px 20px;
    }

    .letter-title {
        font-size: 1.15rem;
    }

    .letter-body {
        padding: 24px 20px;
        gap: 14px;
    }

        .letter-body p {
            font-size: 0.88rem;
        }
}

/* ── Letter contact box ── */
.letter-contact-box {
    background: #f0fdf4;
    border: 0.5px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px 0;
}

.letter-contact-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #166534 !important;
    margin: 0 0 8px !important;
    text-align: left !important;
}

.letter-postscript {
    font-style: italic;
    color: #6b7280 !important;
    font-size: 0.88rem !important;
    border-top: 0.5px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   COMPANION PAGE — layout khác Letter, thoáng hơn, header tối
══════════════════════════════════════════════════════════════════ */

.companion-page {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

/* Header tối, icon lớn */
.companion-header {
    text-align: center;
    padding: 40px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.companion-header-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(15,23,42,0.2);
}

.companion-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

/* Body — không có card, chỉ là text trên nền */
.companion-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .companion-body p {
        font-size: 0.92rem;
        color: #374151;
        line-height: 1.8;
        margin: 0;
        text-align: justify;
    }

/* Contact box — nổi bật hơn Letter */
.companion-contact {
    background: #1e293b;
    border-radius: 16px;
    padding: 20px 24px;
    margin: 8px 0;
    color: #fff;
}

.companion-contact-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: left !important;
}

.companion-contact p {
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.75) !important;
    margin: 0 0 14px !important;
    text-align: left !important;
}

.companion-contact-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.companion-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #93c5fd;
    text-decoration: none;
}

    .companion-contact-link:hover {
        color: #bfdbfe;
        text-decoration: underline;
    }

/* Signature */
.companion-signature {
    padding: 16px 0 0;
    border-top: 0.5px solid #e5e7eb;
}

.companion-sig-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 2px !important;
    text-align: left !important;
}

.companion-sig-title {
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    text-align: left !important;
}

/* Postscript — italic, xám nhạt */
.companion-ps {
    border-top: 0.5px dashed #e5e7eb;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .companion-ps p {
        font-size: 0.85rem !important;
        color: #9ca3af !important;
        font-style: italic;
        text-align: left !important;
    }

@media (max-width: 768px) {
    .companion-page {
        padding: 0 16px 40px;
        margin: 8px auto;
    }

    .companion-header {
        padding: 24px 20px 20px;
    }

    .companion-title {
        font-size: 1.2rem;
    }

    .companion-body p {
        font-size: 0.88rem;
    }

    .companion-contact {
        padding: 16px 18px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   COMPANION PAGE v2 — giữ logo, header navy, khác Letter
══════════════════════════════════════════════════════════════════ */

.companion-page {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.companion-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    border: 0.5px solid #e5e7eb;
    overflow: hidden;
}

/* Header navy — khác Letter xanh lá */
.companion-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 32px 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.companion-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.companion-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.3;
}

/* Body */
.companion-body {
    padding: 36px 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .companion-body > p {
        font-size: 0.92rem;
        color: #374151;
        line-height: 1.8;
        margin: 0;
        text-align: justify;
    }

/* Contact box — navy accent */
.companion-contact {
    background: #f8fafc;
    border: 0.5px solid #e2e8f0;
    border-left: 4px solid #1e293b;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 6px 0;
}

.companion-contact-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: left !important;
}

.companion-contact > p {
    font-size: 0.85rem !important;
    color: #64748b !important;
    margin: 0 0 12px !important;
    text-align: left !important;
}

.companion-contact-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.companion-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
}

    .companion-contact-link:hover {
        text-decoration: underline;
    }

/* Signature */
.companion-signature {
    padding: 16px 0 0;
    border-top: 0.5px solid #e5e7eb;
}

.companion-sig-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 2px !important;
    text-align: left !important;
}

.companion-sig-title {
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    text-align: left !important;
}

/* Postscript */
.companion-ps {
    border-top: 0.5px dashed #e5e7eb;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .companion-ps > p {
        font-size: 0.85rem !important;
        color: #9ca3af !important;
        font-style: italic;
        text-align: left !important;
        line-height: 1.7 !important;
    }

    .companion-contact p,
    .companion-signature p,
    .companion-ps p {
        text-align: justify !important;
    }

@media (max-width: 768px) {
    .companion-page {
        padding: 0 12px 40px;
        margin: 8px auto;
    }

    .companion-header {
        padding: 24px 20px 20px;
    }

    .companion-title {
        font-size: 1.15rem;
    }

    .companion-body {
        padding: 24px 20px;
        gap: 12px;
    }

        .companion-body > p {
            font-size: 0.88rem;
        }

    .companion-contact {
        padding: 14px 16px;
    }
}

.view-counter {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin-top: 0.5rem;
}
/* ══════════════════════════════════════════════════════════════════
   FEVER — Emergency override (nút "vẫn cần tính liều" + banner cảnh báo)
══════════════════════════════════════════════════════════════════ */

.action-btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.override-btn {
    border: 2px solid #d97706 !important;
    background: #fff !important;
    color: #d97706 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 56px !important;
    min-width: 180px !important;
    padding: 0 20px !important;
    border-radius: 16px !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
    white-space: normal;
    line-height: 1.3;
}

    .override-btn:hover,
    .override-btn:focus {
        background: #d97706 !important;
        color: #fff !important;
        transform: translateY(-1px);
        outline: none;
    }

.emergency-followup-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    color: #991b1b;
    text-align: center;
    margin-top: 24px;
    margin-bottom: 28px;
}

.emergency-followup-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .action-btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .override-btn {
        width: 100%;
        min-width: auto !important;
        height: 52px !important;
        font-size: 0.9rem !important;
    }

    .emergency-followup-banner {
        padding: 14px 16px;
        font-size: 0.88rem;
        border-radius: 8px;
        text-align: left;
    }
}

/* ══════════════════════════════════════════════════════════════════
   DOB PICKER — chỉ Android mới dùng phần trigger + wheel bottom-sheet.
   PC và iOS dùng thẳng <input type="date"> mặc định của trình duyệt.
══════════════════════════════════════════════════════════════════ */

/* Mặc định: chiếm full chiều rộng ô chứa nó — dùng cho Growth.razor
   (ô nằm trong lưới 2 cột cùng "Giới tính", cần lấp đầy như g-input cũ) */
.dob-picker {
    width: 100%;
    min-width: 0; /* fix lỗi flex-item tràn khỏi .input-wrapper trên iOS Safari */
}

    .dob-picker input[type="date"] {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        /* Tắt khung/nền mặc định của iOS Safari cho input date — đây là nguyên nhân
       thật sự gây hiện tượng "lòi 2 lớp": iOS vẽ 1 lớp khung riêng bên dưới
       CSS tuỳ chỉnh của mình thay vì thay thế nó. -webkit-appearance: none
       tắt hẳn lớp khung mặc định đó, chỉ còn CSS mình tự viết. */
        -webkit-appearance: none;
        appearance: none;
    }

/* Riêng trong Fever.razor: câu hỏi đứng 1 mình giữa trang (.input-wrapper
   đã có sẵn display:flex; justify-content:center), nên thu nhỏ về đúng
   240px để khớp với .continue-btn-fever bên dưới — CHỈ áp dụng từ 769px
   trở lên. Dùng min-width (thay vì đặt trong khối max-width:768px có sẵn)
   để tránh phụ thuộc thứ tự rule khác trong file — dù đặt ở đâu, media
   query luôn được đánh giá đúng theo kích thước màn hình. */
@media (min-width: 769px) {
    .input-wrapper .dob-picker {
        width: 240px;
        max-width: 100%;
    }
}

/* ── Nút trigger (trạng thái đóng, chỉ hiện trên Android) ── */
.dob-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #f8f8f6;
    border: 1px solid #e0ddd6;
    border-radius: 10px;
    padding: 11px 14px;
    min-height: 46px;
    font-size: 0.95rem;
    color: #111827;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .dob-trigger:hover {
        border-color: #cbd5c9;
    }

    .dob-trigger:focus-visible {
        outline: none;
        border-color: #93c5fd;
        box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
    }

.dob-trigger-text.is-placeholder {
    color: #9ca3af;
}

.dob-trigger-icon {
    color: #9ca3af;
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* ── Backdrop + sheet ── */
.dob-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1000;
    animation: dobFadeIn 0.15s ease-out;
}

.dob-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    z-index: 1001;
    padding: 4px 4px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    animation: dobSlideUp 0.2s ease-out;
}

@keyframes dobFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dobSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.dob-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 0.5px solid #f0efe9;
}

.dob-sheet-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #111827;
}

.dob-sheet-cancel,
.dob-sheet-done {
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 4px;
    cursor: pointer;
}

.dob-sheet-cancel {
    color: #6b7280;
}

.dob-sheet-done {
    color: #2E7D32;
}

/* ── Tiêu đề 3 cột (Ngày / Tháng / Năm), tránh nhầm cột vì đều là số ── */
.dob-wheel-labels {
    display: flex;
    padding: 8px 10px 0;
}

    .dob-wheel-labels span {
        flex: 1;
        text-align: center;
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #9ca3af;
    }

/* ── 3 cột wheel ── */
.dob-wheel-row {
    position: relative;
    display: flex;
    height: 220px;
    padding: 0 10px;
}

.dob-wheel {
    flex: 1;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .dob-wheel::-webkit-scrollbar {
        display: none;
    }

.dob-wheel-pad {
    height: 88px;
}

.dob-wheel-item {
    height: 44px;
    line-height: 44px;
    text-align: center;
    scroll-snap-align: center;
    font-size: 1.05rem;
    color: #9ca3af;
    transition: color 0.1s, font-weight 0.1s;
}

    .dob-wheel-item.is-active {
        color: #111827;
        font-weight: 700;
        font-size: 1.15rem;
    }

.dob-wheel-highlight {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 44px;
    transform: translateY(-50%);
    border-top: 1px solid #e0ddd6;
    border-bottom: 1px solid #e0ddd6;
    background: rgba(147, 197, 253, 0.06);
    pointer-events: none;
    border-radius: 8px;
}

/* ── Lỗi (dùng chung cho cả input type=date và wheel) ── */
.dob-error {
    display: block;
    color: #b91c1c;
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ── Dose Guide Section ── */
/* ── Dose Guide Section ── */
.dose-guide-main-toggle {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #166534;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 2px 6px rgba(22,101,52,0.25);
}

    .dose-guide-main-toggle:hover {
        background: #14532d;
    }

    .dose-guide-main-toggle .guide-arrow {
        color: #fff;
    }

.dose-guide-main-title {
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .dose-guide-main-title .ti {
        font-size: 18px;
    }

.dose-guide-section {
    margin-bottom: 20px;
}

.dose-guide-content {
    text-align: left;
    margin-top: 10px;
}

.dose-filter-group {
    margin-bottom: 12px;
}

.dose-filter-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
}

    .dose-filter-label-row .dose-filter-label {
        margin: 0;
    }

.dose-clear-filter-btn {
    border: none;
    background: none;
    color: #1971c2;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}

    .dose-clear-filter-btn:hover {
        text-decoration: underline;
    }

.dose-filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 6px;
}

.dose-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dose-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
    border: 1.5px solid #e5e7eb;
}

    .dose-filter-chip:hover {
        background: #e5e7eb;
        border-color: #d1d5db;
    }

    .dose-filter-chip input {
        display: none;
    }

.dose-filter-chip-active {
    background: #1971c2;
    color: #fff;
    border-color: #1971c2;
    box-shadow: 0 2px 6px rgba(25,113,194,0.28);
}

    .dose-filter-chip-active:hover {
        background: #1864ab;
        border-color: #1864ab;
    }

.dose-table-wrapper {
    border: 0.5px solid #f0f0ee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.dose-safe-range {
    font-size: 0.72rem;
    color: #9ca3af;
    margin: 2px 0 0;
}

.dose-warning-chip {
    font-size: 0.74rem;
    color: #b45309;
    margin: 1px 0 0;
}

.dose-empty-note {
    padding: 16px 20px;
    font-size: 0.83rem;
    color: #9ca3af;
    text-align: center;
    margin: 0;
}

/* ── Dose row: nổi bật dòng khuyến nghị chính ── */
.dose-row {
    border-radius: 10px;
    transition: background .15s ease;
}

.dose-row-head {
    display: block;
    cursor: pointer;
}

.dose-row .acc-body {
    padding-left: 20px;
}

    .dose-row .acc-body p {
        text-align: justify;
    }

/* Hàng 1: tên thuốc + nút "Xem hướng dẫn" cùng hàng */
.dose-row-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .dose-row-title-line .acc-title {
        flex: 1;
        min-width: 0;
    }

/* Hàng 2: nội dung khuyến nghị, xuống dòng riêng, full width thoải mái */
.dose-row-body-line {
    margin-top: 6px;
}

.dose-instruction-main {
    font-size: 0.98rem;
    font-weight: 800;
    color: #166534;
    margin: 0;
    line-height: 1.4;
}

.dose-equivalent-caption {
    font-size: 0.74rem;
    color: #9ca3af;
    margin: 2px 0 0;
    font-weight: 400;
}

/* Khi mở "Chi tiết": highlight cả khung (tên thuốc + dòng khuyến nghị) rõ hơn */
.dose-row-expanded {
    background: #f0fdf4;
    box-shadow: 0 0 0 1.5px #86efac inset;
}

    .dose-row-expanded .dose-instruction-main {
        color: #14532d;
    }

    .dose-row-expanded .acc-title {
        color: #14532d;
    }

.dose-soft-warning {
    font-size: 0.76rem;
    color: #0369a1;
    background: #f0f9ff;
    border-radius: 6px;
    padding: 4px 8px;
    margin: 6px 0 0;
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.5;
}

.dose-warning-chip {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b45309;
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Nút "Xem hướng dẫn chi tiết" — rõ affordance, không chỉ mũi tên */
.dose-detail-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #1971c2;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    align-self: center;
}

    .dose-detail-toggle .ti {
        font-size: 14px;
    }

.dose-detail-label {
    font-weight: 700;
    color: #374151;
    margin: 0 0 6px;
}

/* ── "Có sẵn ở nhà?" toggle ── */
.dose-choice-btn {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all .15s ease;
}

    .dose-choice-btn:hover {
        border-color: #1971c2;
        color: #1971c2;
    }

/* ── Gợi ý khi chưa có thuốc sẵn ── */
.dose-recommend-group {
    padding: 12px 20px 4px;
}

    .dose-recommend-group:first-child {
        padding-top: 16px;
    }

.dose-route-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dose-recommended-badge {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
}

.dose-add-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 6px;
}

.dose-add-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 999px;
    border: 1.5px solid #1971c2;
    background: #fff;
    color: #1971c2;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .15s ease;
}

    .dose-add-more-btn:hover {
        background: #e7f5ff;
    }

    .dose-add-more-btn .ti {
        font-size: 14px;
    }

/* ── Dose box ── */
.dose-box {
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 16px;
}

    .dose-box.paracetamol {
        background: linear-gradient(135deg, #ecfdf5, #dcfce7);
    }

    .dose-box.ibuprofen {
        background: linear-gradient(135deg, #fffbeb, #fef3c7);
    }

    .dose-box h4 {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 8px;
        color: #374151;
    }

    .dose-box h2 {
        font-size: 2.5rem;
        font-weight: 800;
        color: #1e293b;
        margin: 8px 0;
    }

    .dose-box p {
        font-size: 0.9rem;
        color: #64748b;
        margin-bottom: 8px;
    }

    .dose-box small {
        font-size: 0.78rem;
        color: #9ca3af;
        line-height: 1.6;
        display: block;
    }

.dose-recommend {
    font-size: 0.95rem;
    font-weight: 800;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 10px 0;
    display: inline-block;
}

/* ── Usage guide ── */


/* ══════════════════════════════════════════════════════════════════
   DARK MODE — additive override, không sửa bất kỳ rule nào ở trên.
   Kích hoạt bằng cách gắn thuộc tính data-theme="dark" lên thẻ <html>.
   Toggle bằng JS (xem darkmode.js) + lưu lựa chọn qua localStorage.
══════════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
    --dm-bg: #12161c;
    --dm-bg-soft: #191f27;
    --dm-surface: #1c232b;
    --dm-surface-2: #232b34;
    --dm-surface-3: #2a323c;
    --dm-border: #2e3742;
    --dm-border-soft: #262d36;
    --dm-text: #e8eaed;
    --dm-text-soft: #c3c9d1;
    --dm-text-muted: #98a2b3;
    --dm-text-faint: #6f7a89;
    --dm-green: #4ade80;
    --dm-green-soft: #86efac;
    --dm-red: #f87171;
    --dm-red-soft: #fca5a5;
    --dm-amber: #fbbf24;
    --dm-amber-soft: #fcd34d;
    --dm-blue: #60a5fa;
    --dm-blue-soft: #93c5fd;
    --dm-purple: #c4b5fd;

    color-scheme: dark;
}

/* ── Base ── */
html[data-theme="dark"] body {
    background: var(--dm-bg);
    color: var(--dm-text);
}

/* ── Card / surface trắng → tối ── */
html[data-theme="dark"] .card,
html[data-theme="dark"] .flow-card,
html[data-theme="dark"] .letter-card,
html[data-theme="dark"] .companion-card,
html[data-theme="dark"] .interpret-panel,
html[data-theme="dark"] .zscore-card,
html[data-theme="dark"] .growth-form-card,
html[data-theme="dark"] .intro-card,
html[data-theme="dark"] .home-feature-card,
html[data-theme="dark"] .home-value-item,
html[data-theme="dark"] .dose-table-wrapper,
html[data-theme="dark"] .dose-row-expanded,
html[data-theme="dark"] .uc-wrap,
html[data-theme="dark"] .letter-signature,
html[data-theme="dark"] .big-input,
html[data-theme="dark"] .numeric-input,
html[data-theme="dark"] .choice-btn,
html[data-theme="dark"] .answer-yes,
html[data-theme="dark"] .answer-no,
html[data-theme="dark"] .restart-btn,
html[data-theme="dark"] .override-btn,
html[data-theme="dark"] .reset-btn-top,
html[data-theme="dark"] .dose-choice-btn,
html[data-theme="dark"] .btn-interpret-close,
html[data-theme="dark"] .g-input,
html[data-theme="dark"] .g-input-num,
html[data-theme="dark"] .dob-trigger,
html[data-theme="dark"] .dob-sheet {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .flow-card {
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

/* ── Header / nền phụ nhạt (#f8fafc, #f9fafb, #f5f5f3, #f8f8f6, #f3f4f6...) ── */
html[data-theme="dark"] .flow-header,
html[data-theme="dark"] .question-hint,
html[data-theme="dark"] .alert-secondary,
html[data-theme="dark"] .info-tile,
html[data-theme="dark"] .drug-group,
html[data-theme="dark"] .agree-box,
html[data-theme="dark"] .card-header.bg-light,
html[data-theme="dark"] .drug-item,
html[data-theme="dark"] .who-note,
html[data-theme="dark"] .uc-toggle,
html[data-theme="dark"] .uc-field,
html[data-theme="dark"] .g-input,
html[data-theme="dark"] .g-input-num,
html[data-theme="dark"] .zcard-icon,
html[data-theme="dark"] .guide-toggle,
html[data-theme="dark"] .home-coming-item,
html[data-theme="dark"] .letter-signature,
html[data-theme="dark"] .dose-filter-chip,
html[data-theme="dark"] .dose-detail-toggle,
html[data-theme="dark"] .dob-trigger,
html[data-theme="dark"] .sex-btn {
    background: var(--dm-surface-2);
    border-color: var(--dm-border-soft);
    color: var(--dm-text-soft);
}

html[data-theme="dark"] .flow-header p,
html[data-theme="dark"] .hero-desc,
html[data-theme="dark"] .hero-desc-growth-page,
html[data-theme="dark"] .growth-header .subtitle,
html[data-theme="dark"] .growth-form-card .card-subtitle,
html[data-theme="dark"] .home-section-desc,
html[data-theme="dark"] .home-feature-desc,
html[data-theme="dark"] .home-value-desc,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .unit,
html[data-theme="dark"] .uc-label,
html[data-theme="dark"] .uc-hint,
html[data-theme="dark"] .uc-toggle-sub,
html[data-theme="dark"] .zcard-subtitle,
html[data-theme="dark"] .percentile-text,
html[data-theme="dark"] .acc-chip,
html[data-theme="dark"] .interpret-subtitle,
html[data-theme="dark"] .dose-safe-range,
html[data-theme="dark"] .dose-empty-note,
html[data-theme="dark"] .dose-equivalent-caption,
html[data-theme="dark"] .letter-sig-title,
html[data-theme="dark"] .letter-sig-contact,
html[data-theme="dark"] .letter-postscript,
html[data-theme="dark"] .companion-sig-title,
html[data-theme="dark"] .companion-ps p,
html[data-theme="dark"] .view-counter,
html[data-theme="dark"] .zcard-na,
html[data-theme="dark"] .drug-bullet,
html[data-theme="dark"] .dose-route-label {
    color: var(--dm-text-muted);
}

/* ── Chữ đậm chính (#111827, #1e293b, #1f2937, #0f172a) ── */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .hero-title,
html[data-theme="dark"] .hero-title-growth-page,
html[data-theme="dark"] .growth-header h1,
html[data-theme="dark"] .info-value,
html[data-theme="dark"] .home-section-title,
html[data-theme="dark"] .home-feature-title,
html[data-theme="dark"] .home-value-title,
html[data-theme="dark"] .card-header.bg-light h4,
html[data-theme="dark"] .guide-title,
html[data-theme="dark"] .guide-item strong,
html[data-theme="dark"] .drug-item b,
html[data-theme="dark"] .zcard-title,
html[data-theme="dark"] .interpret-title,
html[data-theme="dark"] .acc-title,
html[data-theme="dark"] .letter-salutation,
html[data-theme="dark"] .letter-sig-name,
html[data-theme="dark"] .companion-title,
html[data-theme="dark"] .companion-sig-name,
html[data-theme="dark"] .dob-sheet-title,
html[data-theme="dark"] .dose-box h2,
html[data-theme="dark"] .gauge-label-zero {
    color: var(--dm-text);
}

/* ── Chữ nội dung phụ (#374151, #4b5563, #475569, #6b7280, #64748b, #9ca3af) ── */
html[data-theme="dark"] p,
html[data-theme="dark"] .question-hint,
html[data-theme="dark"] .guide-item,
html[data-theme="dark"] .drug-bullet,
html[data-theme="dark"] .growth-field label,
html[data-theme="dark"] .acc-body,
html[data-theme="dark"] .letter-body p,
html[data-theme="dark"] .companion-body p,
html[data-theme="dark"] .companion-body > p,
html[data-theme="dark"] .about-card .about-content,
html[data-theme="dark"] .dose-detail-label,
html[data-theme="dark"] .dose-filter-label,
html[data-theme="dark"] .agree-box label {
    color: var(--dm-text-soft);
}

/* ── Viền nhạt dùng chung ── */
html[data-theme="dark"] .flow-header,
html[data-theme="dark"] .card-header.bg-light,
html[data-theme="dark"] .growth-header,
html[data-theme="dark"] .growth-form-card,
html[data-theme="dark"] .intro-card,
html[data-theme="dark"] .info-tile,
html[data-theme="dark"] .home-feature-card,
html[data-theme="dark"] .home-value-item,
html[data-theme="dark"] .usage-guide,
html[data-theme="dark"] .guide-item,
html[data-theme="dark"] .drug-item,
html[data-theme="dark"] .agree-box,
html[data-theme="dark"] .who-note,
html[data-theme="dark"] .uc-wrap,
html[data-theme="dark"] .uc-section-sep,
html[data-theme="dark"] .interpret-panel,
html[data-theme="dark"] .interpret-header,
html[data-theme="dark"] .acc-item,
html[data-theme="dark"] .zscore-card,
html[data-theme="dark"] .letter-card,
html[data-theme="dark"] .letter-closing,
html[data-theme="dark"] .letter-signature,
html[data-theme="dark"] .companion-card,
html[data-theme="dark"] .companion-signature,
html[data-theme="dark"] .companion-ps,
html[data-theme="dark"] .dose-table-wrapper,
html[data-theme="dark"] .dob-sheet-header,
html[data-theme="dark"] .g-input,
html[data-theme="dark"] .g-input-num,
html[data-theme="dark"] .big-input,
html[data-theme="dark"] .numeric-input,
html[data-theme="dark"] .choice-btn,
html[data-theme="dark"] .home-coming-item {
    border-color: var(--dm-border-soft);
}

/* ── Input focus ── */
html[data-theme="dark"] .big-input:focus,
html[data-theme="dark"] .g-input:focus,
html[data-theme="dark"] .g-input-num:focus,
html[data-theme="dark"] .dob-trigger:focus-visible {
    background: var(--dm-surface-3);
    border-color: var(--dm-blue);
    box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
}

html[data-theme="dark"] .uc-field:focus-within {
    background: rgba(96,165,250,0.08);
    border-color: var(--dm-blue);
}

html[data-theme="dark"] .uc-input {
    color: var(--dm-text);
}

/* ── Choice / answer buttons hover ── */
html[data-theme="dark"] .choice-btn:hover {
    background: var(--dm-surface-3);
    border-color: var(--dm-blue);
}

html[data-theme="dark"] .answer-yes {
    color: var(--dm-green-soft);
}

html[data-theme="dark"] .answer-yes:hover {
    background: rgba(34,197,94,0.12);
}

html[data-theme="dark"] .answer-no {
    color: var(--dm-text-soft);
}

html[data-theme="dark"] .answer-no:hover {
    background: rgba(239,68,68,0.12);
    color: var(--dm-red-soft);
}

/* ── Alert / trạng thái màu (success / danger / warning / info / purple) ── */
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .summary-item.danger,
html[data-theme="dark"] .growth-alert,
html[data-theme="dark"] .banner-warn,
html[data-theme="dark"] .chip-danger,
html[data-theme="dark"] .emergency-followup-banner {
    background: rgba(239,68,68,0.12);
    border-color: rgba(248,113,113,0.35);
    color: var(--dm-red-soft);
}

html[data-theme="dark"] .alert-info {
    background: rgba(59,130,246,0.12);
    border-color: rgba(96,165,250,0.35);
    color: var(--dm-text);
}

html[data-theme="dark"] .result-success,
html[data-theme="dark"] .summary-item.success,
html[data-theme="dark"] .banner-ok,
html[data-theme="dark"] .chip-ok,
html[data-theme="dark"] .acc-action-ok,
html[data-theme="dark"] .conclusion-ok,
html[data-theme="dark"] .agree-box.checked,
html[data-theme="dark"] .letter-contact-box,
html[data-theme="dark"] .dose-row-expanded {
    background: rgba(34,197,94,0.10);
    border-color: rgba(134,239,172,0.3);
}

html[data-theme="dark"] .result-success h3,
html[data-theme="dark"] .summary-item.success,
html[data-theme="dark"] .banner-ok,
html[data-theme="dark"] .chip-ok,
html[data-theme="dark"] .acc-action-ok,
html[data-theme="dark"] .conclusion-ok .conclusion-icon,
html[data-theme="dark"] .conclusion-ok .conclusion-label,
html[data-theme="dark"] .conclusion-ok .conclusion-text,
html[data-theme="dark"] .letter-contact-title,
html[data-theme="dark"] .dose-instruction-main,
html[data-theme="dark"] .dose-row-expanded .dose-instruction-main,
html[data-theme="dark"] .dose-row-expanded .acc-title {
    color: var(--dm-green-soft);
}

html[data-theme="dark"] .result-success p {
    color: var(--dm-green);
}

html[data-theme="dark"] .summary-item.warning,
html[data-theme="dark"] .about-note,
html[data-theme="dark"] .guide-item.warning,
html[data-theme="dark"] .home-disclaimer,
html[data-theme="dark"] .chip-warning,
html[data-theme="dark"] .acc-action-warn,
html[data-theme="dark"] .warning {
    background: rgba(245,158,11,0.12);
    border-color: rgba(251,191,36,0.35);
    color: var(--dm-amber-soft);
}

html[data-theme="dark"] .home-disclaimer-title,
html[data-theme="dark"] .guide-item.warning strong,
html[data-theme="dark"] .dose-warning-chip {
    color: var(--dm-amber);
}

html[data-theme="dark"] .home-disclaimer-text {
    color: var(--dm-amber-soft);
}

html[data-theme="dark"] .about-card,
html[data-theme="dark"] .growth-header,
html[data-theme="dark"] .age-badge,
html[data-theme="dark"] .uc-result-blue,
html[data-theme="dark"] .chip-accent,
html[data-theme="dark"] .guide-item.contact,
html[data-theme="dark"] .contact {
    background: rgba(59,130,246,0.10);
    border-color: rgba(147,197,253,0.3);
}

html[data-theme="dark"] .about-card summary,
html[data-theme="dark"] .age-badge,
html[data-theme="dark"] .uc-result-blue .uc-value,
html[data-theme="dark"] .chip-accent,
html[data-theme="dark"] .guide-item.contact strong,
html[data-theme="dark"] .zc-accent .zscore-number,
html[data-theme="dark"] .zc-accent .zscore-sd,
html[data-theme="dark"] .home-value-icon,
html[data-theme="dark"] .home-feature-growth .home-feature-icon {
    color: var(--dm-blue-soft);
}

html[data-theme="dark"] .about-card .about-content {
    color: var(--dm-text-soft);
    border-top-color: rgba(147,197,253,0.3);
}

/* ── chip-gray / zc-gray bị bỏ sót ở bản đầu ── */
html[data-theme="dark"] .chip-gray,
html[data-theme="dark"] .zc-gray .zscore-number,
html[data-theme="dark"] .zc-gray .zscore-sd {
    background: var(--dm-surface-3);
    color: var(--dm-text-muted);
}

/* ── Bootstrap .text-muted / .text-dark dùng trực tiếp trong Fever.razor
   (card-header bg-light text-dark, mb-3 text-muted small...) — Bootstrap
   utility có thể có specificity cao nên thêm !important cho chắc. ── */
html[data-theme="dark"] .text-muted {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .btn-interpret,
html[data-theme="dark"] .btn-interpret-close,
html[data-theme="dark"] .conclusion-review,
html[data-theme="dark"] .interpret-header-icon {
    background: rgba(168,85,247,0.12);
    border-color: rgba(196,181,253,0.35);
    color: var(--dm-purple);
}

html[data-theme="dark"] .conclusion-review .conclusion-icon,
html[data-theme="dark"] .conclusion-review .conclusion-label,
html[data-theme="dark"] .conclusion-review .conclusion-text {
    color: var(--dm-purple);
}

/* ── Dose box (paracetamol / ibuprofen) ── */
html[data-theme="dark"] .dose-box.paracetamol {
    background: linear-gradient(135deg, rgba(34,197,94,0.14), rgba(34,197,94,0.06));
}

html[data-theme="dark"] .dose-box.ibuprofen {
    background: linear-gradient(135deg, rgba(245,158,11,0.14), rgba(245,158,11,0.06));
}

html[data-theme="dark"] .dose-box h4 {
    color: var(--dm-text-soft);
}

html[data-theme="dark"] .dose-box p {
    color: var(--dm-text-muted);
}

html[data-theme="dark"] .dose-box small {
    color: var(--dm-text-faint);
}

html[data-theme="dark"] .dose-recommend {
    background: rgba(239,68,68,0.14);
    border-color: rgba(248,113,113,0.35);
    color: var(--dm-red-soft);
}

/* ── Dose filter chip active giữ nguyên xanh dương (đã đủ tương phản) ── */
html[data-theme="dark"] .dose-filter-chip-active {
    background: #1971c2;
    border-color: #1971c2;
    color: #fff;
}

/* ── Sex toggle ── */
html[data-theme="dark"] .sex-btn:hover {
    background: var(--dm-surface-3);
    color: var(--dm-text-soft);
}

html[data-theme="dark"] .sex-btn-male.sex-active {
    background: rgba(59,130,246,0.18);
    border-color: var(--dm-blue);
    color: var(--dm-blue-soft);
}

html[data-theme="dark"] .sex-btn-female.sex-active {
    background: rgba(236,72,153,0.18);
    border-color: #f472b6;
    color: #f9a8d4;
}

html[data-theme="dark"] .sex-check {
    background: var(--dm-surface);
}

/* ── Gauge / z-score ── */
html[data-theme="dark"] .gauge-track {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .gauge-marker {
    background: var(--dm-text);
    border-color: var(--dm-surface);
    box-shadow: 0 0 0 1.5px var(--dm-text), 0 1px 3px rgba(0,0,0,0.5);
}

html[data-theme="dark"] .zscore-label {
    color: var(--dm-text-muted);
}

/* ── Unit converter kết quả ── */
html[data-theme="dark"] .uc-result-amber {
    background: rgba(245,158,11,0.12);
    border-color: rgba(251,191,36,0.3);
}

html[data-theme="dark"] .uc-result-amber .uc-value {
    color: var(--dm-amber);
}

/* ── Home hero (ảnh nền) ── */
html[data-theme="dark"] .home-hero::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
}

html[data-theme="dark"] .home-hero-bg {
    filter: brightness(0.6);
}

html[data-theme="dark"] .home-hero-title {
    color: #eafbe8;
}

html[data-theme="dark"] .home-hero-subtitle,
html[data-theme="dark"] .home-hero-desc {
    color: #cfe8cf;
}

html[data-theme="dark"] .home-hero-badge {
    background: rgba(0,0,0,0.35);
    color: #bbf7d0;
}

html[data-theme="dark"] .home-hero-action-hint {
    color: rgba(207,232,207,0.75);
}

/* ── Letter / Companion header gradient ── */
html[data-theme="dark"] .letter-header {
    background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(34,197,94,0.08));
    border-bottom-color: rgba(134,239,172,0.3);
}

html[data-theme="dark"] .letter-title {
    color: var(--dm-green-soft);
}

html[data-theme="dark"] .companion-header {
    background: linear-gradient(135deg, #0b1220 0%, #05080e 100%);
}

/* ── Reset / restart / override buttons: giữ viền màu nổi bật ── */
html[data-theme="dark"] .reset-btn-top:hover {
    background: #2563eb;
    color: #fff;
}

html[data-theme="dark"] .restart-btn:hover {
    background: #2563eb !important;
    color: #fff !important;
}

html[data-theme="dark"] .override-btn:hover,
html[data-theme="dark"] .override-btn:focus {
    background: #d97706 !important;
    color: #fff !important;
}

/* ── continue-btn / btn-assess: đã là nút xanh đậm, giữ nguyên ── */

/* ── Dòng phân cách / node debug ── */
html[data-theme="dark"] .guide-item,
html[data-theme="dark"] .acc-item,
html[data-theme="dark"] .interpret-header,
html[data-theme="dark"] .dob-sheet-header {
    border-color: var(--dm-border-soft);
}

html[data-theme="dark"] .acc-head:hover {
    background: rgba(255,255,255,0.03);
}

/* Lưu ý: .nav-sidebar giữ nguyên nền xanh thương hiệu (#2E7D32) ở cả 2 theme —
   không override vì đây là màu brand cố định, không phải bề mặt sáng/tối cần đổi. */

/* ── Scrollbar wheel chọn ngày sinh ── */
html[data-theme="dark"] .dob-wheel-item {
    color: var(--dm-text-faint);
}

html[data-theme="dark"] .dob-wheel-item.is-active {
    color: var(--dm-text);
}

html[data-theme="dark"] .dob-wheel-highlight {
    border-color: var(--dm-border);
    background: rgba(96,165,250,0.08);
}

html[data-theme="dark"] .dob-sheet-backdrop {
    background: rgba(0,0,0,0.6);
}

/* ── .mobile-topbar giờ chứa 2 nút (DarkModeToggle + LanguageToggle) thay
   vì 1 — rule gốc trong app.css chưa có gap. Thêm ở đây (flow.css load sau
   app.css nên thắng, không cần sửa app.css) để 2 nút không dính sát nhau. ── */
.mobile-topbar {
    gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   ÉP !important — các rule gốc trong flow.css dùng !important nên
   override phía trên (không !important) bị thua độ ưu tiên, không có
   tác dụng. Danh sách dưới đây khớp CHÍNH XÁC các rule gốc có !important
   liên quan đến background/color.
══════════════════════════════════════════════════════════════════ */

/* .card-header.bg-light { background: #f8fafc !important; } — dòng 417 flow.css
   → đây là nguyên nhân thanh "Tóm tắt đánh giá" vẫn trắng trong ảnh anh gửi */
html[data-theme="dark"] .card-header.bg-light {
    background: var(--dm-surface-2) !important;
    border-bottom-color: var(--dm-border-soft) !important;
}

html[data-theme="dark"] .card-header.bg-light h4 {
    color: var(--dm-text) !important;
}

/* .restart-btn { background:#fff!important; color:#3b82f6!important; ... } */
html[data-theme="dark"] .restart-btn {
    background: var(--dm-surface) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* .override-btn { background:#fff!important; color:#d97706!important; ... } */
html[data-theme="dark"] .override-btn {
    background: var(--dm-surface) !important;
    border-color: #d97706 !important;
    color: var(--dm-amber) !important;
}

/* .gauge-label-zero { color:#374151 !important; } */
html[data-theme="dark"] .gauge-label-zero {
    color: var(--dm-text) !important;
}

/* letter-sig-* / letter-contact-title / letter-postscript — tất cả dùng
   !important trong flow.css (dòng ~2880-3095) */
html[data-theme="dark"] .letter-sig-name {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .letter-sig-title,
html[data-theme="dark"] .letter-sig-contact,
html[data-theme="dark"] .letter-postscript {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] .letter-contact-title {
    color: var(--dm-green-soft) !important;
}

html[data-theme="dark"] .letter-contact-box {
    background: rgba(34,197,94,0.10) !important;
    border-color: rgba(134,239,172,0.3) !important;
}

/* companion-sig-* / companion-ps / companion-contact-title / companion-contact>p
   — cả bản v1 (companion-page đầu) lẫn v2 (companion-page navy, dòng ~3260+)
   đều dùng !important, nên override cũng phải !important để thắng cả 2 bản. */
html[data-theme="dark"] .companion-sig-name {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .companion-sig-title,
html[data-theme="dark"] .companion-ps p {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] .companion-contact-title {
    color: var(--dm-blue-soft) !important;
}

html[data-theme="dark"] .companion-contact > p {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] .companion-contact {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border-soft) !important;
}

/* ── .dose-soft-warning — hộp xanh nhạt "Có thể cân nhắc..." bị bỏ sót
   hoàn toàn ở bản trước (không có !important ở bản gốc, chỉ là quên thêm) ── */
html[data-theme="dark"] .dose-soft-warning {
    background: rgba(59,130,246,0.12);
    color: var(--dm-blue-soft);
}

/* ── Dark mode toggle — công tắc trượt (switch), tự đổi màu nền theo theme
   để nổi bật, rõ ràng hơn kiểu nút tròn icon nhỏ trước đây. Tự đứng độc
   lập (không phụ thuộc nền xanh sidebar) nên đặt được ở bất kỳ đâu — cả
   trong .nav-bottom-row (drawer) lẫn .mobile-topbar (thanh trên mobile). ── */
.nav-bottom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

    /* Ghi đè width:100% của rule gốc .nav-lang-wrap .lang-toggle-pill (app.css)
       để 2 nút chia sẻ hàng — nằm sau trong thứ tự file nên thắng khi cùng độ
       đặc hiệu, không cần sửa rule gốc. */
    .nav-bottom-row .lang-toggle-pill {
        width: auto;
        flex: 1;
        min-width: 0;
    }

.dark-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 28px;
    padding: 3px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.25s ease;
}

    .dark-toggle-switch:hover {
        filter: brightness(1.05);
    }

.dark-toggle-knob {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    transform: translateX(0);
    transition: transform 0.25s ease;
}

    .dark-toggle-knob .ti {
        font-size: 13px;
        line-height: 1;
        color: #f59e0b;
    }

    .dark-toggle-knob .dark-icon-sun {
        display: inline;
    }

    .dark-toggle-knob .dark-icon-moon {
        display: none;
    }

html[data-theme="dark"] .dark-toggle-switch {
    background: linear-gradient(135deg, #1e293b, #0b1220);
}

html[data-theme="dark"] .dark-toggle-knob {
    transform: translateX(24px);
}

    html[data-theme="dark"] .dark-toggle-knob .ti {
        color: #60a5fa;
    }

    html[data-theme="dark"] .dark-toggle-knob .dark-icon-sun {
        display: none;
    }

    html[data-theme="dark"] .dark-toggle-knob .dark-icon-moon {
        display: inline;
    }