:root {
    --bmi-navy: #0b2f55;
    --bmi-blue: #0e5aa7;
    --bmi-blue-2: #1677c8;
    --bmi-cyan: #eaf6ff;
    --bmi-green: #16845b;
    --bmi-green-soft: #eaf8f2;
    --bmi-yellow: #b97900;
    --bmi-orange: #d86b16;
    --bmi-red: #b83c3c;
    --bmi-red-dark: #812b2b;
    --bmi-ink: #153047;
    --bmi-muted: #5e7182;
    --bmi-line: #d9e4ec;
    --bmi-bg: #f5f9fc;
    --bmi-white: #ffffff;
    --bmi-shadow: 0 18px 50px rgba(14, 63, 105, .10);
    --bmi-radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--bmi-ink);
    background: var(--bmi-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    transform: translateY(-160%);
    background: #fff;
    color: var(--bmi-navy);
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: var(--bmi-shadow);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--bmi-line);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
}
.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--bmi-navy), var(--bmi-blue-2));
    box-shadow: 0 8px 20px rgba(14,90,167,.22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; line-height: 1.1; }
.brand small { margin-top: 4px; color: var(--bmi-muted); font-size: .76rem; }
.back-link {
    text-decoration: none;
    color: var(--bmi-blue);
    font-weight: 700;
    padding: 9px 12px;
    border-radius: 10px;
}
.back-link:hover, .back-link:focus-visible { background: var(--bmi-cyan); }

.hero {
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(35, 164, 164, .22), transparent 34%),
        linear-gradient(135deg, #082b4f 0%, #0e5aa7 58%, #0b6f7b 100%);
    padding: 58px 0 82px;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, .7fr);
    gap: 34px;
    align-items: center;
}
.eyebrow, .section-kicker {
    margin: 0 0 8px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.eyebrow { color: #bfe8ff; }
.section-kicker { color: var(--bmi-blue); }
.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: .98;
    letter-spacing: -.055em;
}
.hero-copy {
    max-width: 760px;
    margin: 20px 0 0;
    color: #e6f3fb;
    font-size: clamp(1rem, 2vw, 1.18rem);
}
.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}
.trust-row span {
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 650;
}
.hero-note {
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.10);
    padding: 22px;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.hero-note strong { display: block; font-size: 1.05rem; }
.hero-note p { margin: 8px 0 0; color: #e5f2f8; font-size: .94rem; }

.calculator-section {
    margin-top: -48px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
    gap: 24px;
    align-items: start;
}
.calculator-card, .result-card, .content-card, .faq-section, .medical-disclaimer {
    background: var(--bmi-white);
    border: 1px solid var(--bmi-line);
    border-radius: var(--bmi-radius);
    box-shadow: var(--bmi-shadow);
}
.calculator-card { padding: 28px; }
.calculator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}
.calculator-head h2, .content-card h2, .faq-section h2 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -.025em;
}
.unit-toggle {
    display: inline-flex;
    background: #eef4f8;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #d8e4ec;
}
.unit-btn {
    border: 0;
    background: transparent;
    color: var(--bmi-muted);
    padding: 9px 13px;
    border-radius: 9px;
    font-weight: 800;
}
.unit-btn.is-active {
    color: #fff;
    background: var(--bmi-blue);
    box-shadow: 0 5px 14px rgba(14,90,167,.22);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}
.field-card {
    min-width: 0;
    padding: 17px;
    background: #fbfdff;
    border: 1px solid #dce7ee;
    border-radius: 16px;
}
.field-heading {
    min-height: 24px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.field-heading label, .label-like { font-weight: 800; }
.field-heading span { color: var(--bmi-muted); font-size: .78rem; }
.field-heading .label-like { color: var(--bmi-ink); font-size: 1rem; }
input[type="number"], select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #bdccd7;
    border-radius: 12px;
    background: #fff;
    color: var(--bmi-ink);
    padding: 10px 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
input[type="number"]:focus, select:focus {
    border-color: var(--bmi-blue-2);
    box-shadow: 0 0 0 4px rgba(22,119,200,.12);
}
.input-suffix-wrap { position: relative; }
.input-suffix-wrap input { padding-right: 58px; }
.suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bmi-muted);
    font-weight: 800;
    pointer-events: none;
}
.mini-select {
    width: auto;
    min-height: 34px;
    padding: 4px 28px 4px 8px;
    font-size: .8rem;
}
.split-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-card small { display: block; margin-top: 8px; color: var(--bmi-muted); font-size: .78rem; }
.error { min-height: 18px; margin: 6px 0 0; color: var(--bmi-red); font-size: .78rem; font-weight: 650; }
.range {
    width: 100%;
    margin: 12px 0 0;
    accent-color: var(--bmi-blue);
}
.calculator-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--bmi-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.privacy-inline { color: var(--bmi-muted); font-size: .8rem; }

.result-card {
    padding: 28px;
    position: sticky;
    top: 92px;
}
.result-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}
.result-label { display: block; color: var(--bmi-muted); font-size: .84rem; font-weight: 700; }
.bmi-score {
    display: block;
    margin-top: 2px;
    font-size: clamp(3.2rem, 8vw, 4.8rem);
    line-height: .95;
    letter-spacing: -.055em;
    color: var(--bmi-navy);
}
.category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: .79rem;
    font-weight: 850;
    text-align: center;
}
.category-under { background: #eaf3ff; color: #1a5a99; }
.category-normal { background: var(--bmi-green-soft); color: #0b714b; }
.category-over { background: #fff4d8; color: #8d5c00; }
.category-ob1 { background: #fff0df; color: #a34d0e; }
.category-ob2 { background: #ffe9e9; color: #a52f2f; }
.category-ob3 { background: #f9dddd; color: #772323; }

.gauge { margin-top: 24px; }
.gauge-bar {
    position: relative;
    height: 14px;
    display: grid;
    grid-template-columns: 8.5fr 6.5fr 5fr 5fr 5fr 5fr;
    overflow: visible;
    border-radius: 999px;
    background: #e8eef2;
}
.gauge-segment:first-child { border-radius: 999px 0 0 999px; }
.gauge-segment:nth-last-child(2) { border-radius: 0 999px 999px 0; }
.seg-under { background: #66a6df; }
.seg-normal { background: #43aa7c; }
.seg-over { background: #e1b74a; }
.seg-ob1 { background: #e58b43; }
.seg-ob2 { background: #d85b52; }
.seg-ob3 { background: #9a3e3e; }
.gauge-marker {
    --marker-left: 43%;
    position: absolute;
    left: var(--marker-left);
    top: 50%;
    width: 4px;
    height: 26px;
    border-radius: 999px;
    background: #0a2237;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(255,255,255,.9);
    transition: left .22s ease;
}
.gauge-labels { display: flex; justify-content: space-between; margin-top: 7px; color: var(--bmi-muted); font-size: .72rem; }

.result-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.result-stat {
    padding: 14px;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px solid #e1e9ef;
}
.result-stat span { display: block; color: var(--bmi-muted); font-size: .73rem; font-weight: 700; }
.result-stat strong { display: block; margin-top: 5px; font-size: .92rem; }
.result-message { margin: 18px 0 0; }
.asian-note {
    margin-top: 18px;
    padding: 14px;
    border-left: 4px solid var(--bmi-blue-2);
    border-radius: 12px;
    background: var(--bmi-cyan);
}
.asian-note strong { font-size: .88rem; }
.asian-note p { margin: 6px 0 0; color: #36566e; font-size: .8rem; }
.result-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.primary-btn, .secondary-btn {
    min-height: 44px;
    border-radius: 12px;
    padding: 9px 14px;
    font-weight: 800;
}
.primary-btn { border: 1px solid var(--bmi-blue); color: #fff; background: var(--bmi-blue); }
.primary-btn:hover, .primary-btn:focus-visible { background: #094a8c; }
.secondary-btn { border: 1px solid #b9c9d5; color: var(--bmi-ink); background: #fff; }
.secondary-btn:hover, .secondary-btn:focus-visible { background: #f1f6f9; }
.copy-status { min-height: 18px; margin: 7px 0 0; color: var(--bmi-green); font-size: .78rem; }

.content-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 34px;
}
.content-card { padding: 28px; }
.table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--bmi-line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 420px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #e5edf2; }
th { background: #f2f7fb; color: var(--bmi-navy); font-size: .82rem; }
td { font-size: .88rem; }
tbody tr:last-child td { border-bottom: 0; }
.source-note { color: var(--bmi-muted); font-size: .82rem; margin: 16px 0 0; }
.formula-box {
    margin: 18px 0;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef7ff, #eefbf6);
    border: 1px solid #cfe3f0;
    font-weight: 900;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    color: var(--bmi-navy);
}
.content-card h3 { margin: 22px 0 6px; }
.content-card p { color: #52697b; }

.faq-section { margin-top: 24px; padding: 28px; }
.faq-section details { border-top: 1px solid var(--bmi-line); }
.faq-section details:first-of-type { margin-top: 18px; }
.faq-section summary {
    cursor: pointer;
    padding: 16px 2px;
    font-weight: 800;
    color: var(--bmi-ink);
}
.faq-section details p { margin: -4px 0 16px; color: var(--bmi-muted); }
.medical-disclaimer {
    margin-top: 24px;
    padding: 20px 24px;
    color: #4d6374;
    font-size: .85rem;
    box-shadow: none;
}
.medical-disclaimer strong { color: var(--bmi-ink); }

.site-footer { margin-top: 34px; border-top: 1px solid var(--bmi-line); background: #fff; }
.footer-inner { min-height: 78px; display: flex; align-items: center; gap: 18px; color: var(--bmi-muted); font-size: .83rem; }
.footer-inner a { margin-left: auto; text-decoration: none; color: var(--bmi-blue); font-weight: 700; }
.footer-inner a + a { margin-left: 0; }

:focus-visible { outline: 3px solid rgba(22,119,200,.35); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
    .hero { padding-top: 44px; }
    .hero-grid, .calculator-section, .content-section { grid-template-columns: 1fr; }
    .hero-note { max-width: 650px; }
    .calculator-section { margin-top: -42px; }
    .result-card { position: static; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 22px, 1180px); }
    .header-inner { min-height: 64px; }
    .brand small { display: none; }
    .hero { padding: 36px 0 70px; }
    .hero h1 { font-size: 2.6rem; }
    .hero-grid { gap: 22px; }
    .trust-row { gap: 7px; }
    .trust-row span { font-size: .74rem; }
    .calculator-card, .result-card, .content-card, .faq-section { padding: 20px; border-radius: 18px; }
    .calculator-head { flex-direction: column; }
    .unit-toggle { width: 100%; }
    .unit-btn { flex: 1; }
    .input-grid { grid-template-columns: 1fr; }
    .result-topline { align-items: center; }
    .bmi-score { font-size: 3.6rem; }
    .result-stat-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-wrap: wrap; padding: 18px 0; }
    .footer-inner a { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
    .site-header, .hero, .calculator-card, .content-section, .faq-section, .site-footer,
    .medical-disclaimer, .result-buttons, .asian-note { display: none !important; }
    body { background: #fff; }
    .calculator-section { display: block; margin: 0; width: 100%; }
    .result-card { box-shadow: none; border: 1px solid #aaa; max-width: 620px; margin: 20px auto; }
}


.primary-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
