:root {
  --ink: #17213f;
  --muted: #58627e;
  --blue: #4c6fff;
  --purple: #7c5cff;
  --line: rgba(54, 70, 121, .12);
  --glass: rgba(255, 255, 255, .78);
  --shadow: 0 26px 80px rgba(39, 52, 108, .13);
  --result: #3f7ae0;
  --result-soft: rgba(63, 122, 224, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(123, 92, 255, .13), transparent 27%),
    radial-gradient(circle at 90% 30%, rgba(64, 174, 255, .14), transparent 30%),
    linear-gradient(145deg, #f7f8ff 0%, #eef4ff 48%, #f9f7ff 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; border-radius: 50%; filter: blur(8px); pointer-events: none; z-index: -1; }
.ambient-one { width: 300px; height: 300px; left: -150px; top: 40%; background: rgba(127, 94, 255, .13); }
.ambient-two { width: 250px; height: 250px; right: -100px; top: 12%; background: rgba(68, 168, 255, .13); }
.page-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 70px 0 30px; }
.hero { text-align: center; max-width: 720px; margin: 0 auto 35px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #596482; font-size: .76rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 0 0 5px rgba(88, 99, 255, .09); }
.hero h1 { font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: clamp(2.45rem, 6vw, 4.3rem); line-height: 1; letter-spacing: -.055em; margin: 18px 0 16px; }
.hero h1 span { background: linear-gradient(110deg, var(--blue), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.04rem; line-height: 1.7; margin: auto; max-width: 610px; }

.workspace { display: grid; grid-template-columns: 1.06fr .94fr; min-height: 720px; background: var(--glass); border: 1px solid rgba(255,255,255,.72); backdrop-filter: blur(20px); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.form-panel { padding: 42px; background: rgba(255,255,255,.75); border-right: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.step-label, .result-label { color: #6c7692; font-size: .67rem; font-weight: 800; letter-spacing: .16em; }
.section-heading h2, .reference-card h2 { font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: 1.5rem; letter-spacing: -.025em; margin: 8px 0 0; }
.heading-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--purple); background: rgba(124,92,255,.1); border-radius: 14px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.heading-icon svg { width: 21px; }
.adult-notice { margin: -12px 0 24px; padding: 11px 13px; color: #4d5773; background: rgba(76, 111, 255, .07); border: 1px solid rgba(76, 111, 255, .14); border-radius: 11px; font-size: .76rem; line-height: 1.5; }
.field { margin-bottom: 21px; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 9px; color: #3b4563; }
.optional { color: #929ab0; font-size: .68rem; font-weight: 600; margin-left: 5px; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.hint { color: #929ab0; font-size: .72rem; }
.input-wrap { position: relative; display: flex; align-items: center; height: 54px; border: 1.5px solid rgba(74,89,135,.15); background: rgba(247,248,253,.76); border-radius: 13px; transition: border-color .2s, box-shadow .2s, background .2s; }
.input-wrap:focus-within { background: #fff; border-color: rgba(76,111,255,.75); box-shadow: 0 0 0 4px rgba(76,111,255,.1); }
.input-wrap svg { width: 20px; min-width: 20px; margin-left: 16px; color: #8a94b0; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 14px; color: var(--ink); background: transparent; }
.input-wrap select { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 14px; color: var(--ink); background: transparent; cursor: pointer; }
.select-wrap { overflow: hidden; }
.input-wrap input::placeholder { color: #a8aec0; }
.input-wrap.has-unit input { padding-right: 5px; }
.input-wrap > span { padding-right: 15px; color: #9098ad; font-size: .78rem; }
.field.invalid .input-wrap { border-color: #ef5d70; box-shadow: 0 0 0 3px rgba(239,93,112,.09); }
.field-help { display: block; color: #68728d; font-size: .69rem; padding: 4px 4px 0; }
.error { display: block; min-height: 16px; color: #b4233d; font-size: .71rem; font-weight: 600; padding: 4px 4px 0; }
.form-alert { display: none; margin: -4px 0 16px; padding: 10px 12px; border-radius: 10px; background: #fff0f2; color: #b93248; font-size: .78rem; }
.form-alert.show { display: block; animation: shake .35s ease; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 3px; }
.actions button { height: 54px; border-radius: 13px; border: 0; font-weight: 700; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.actions button:active { transform: translateY(1px) scale(.99); }
.actions button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #1f4ed8; outline-offset: 3px; }
.primary-btn { display: flex; align-items: center; justify-content: center; gap: 14px; color: white; background: linear-gradient(110deg, #496ffc, #7957f3); box-shadow: 0 12px 26px rgba(87,90,232,.25); }
.primary-btn svg { width: 19px; transition: transform .2s; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(87,90,232,.33); }
.primary-btn:hover svg { transform: translateX(3px); }
.secondary-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; color: #68718b; background: #eef0f7; }
.secondary-btn svg { width: 17px; }
.secondary-btn:hover { color: #444f70; background: #e7e9f2; transform: translateY(-2px); }

.insight-panel { position: relative; display: grid; place-items: center; min-width: 0; padding: 42px; background: linear-gradient(150deg, rgba(245,247,255,.65), rgba(239,242,255,.82)); }
.idle-state { text-align: center; max-width: 330px; }
.orbital-graphic { position: relative; width: 170px; height: 170px; margin: 0 auto 26px; }
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(99,101,232,.15); }
.orbit-one { animation: spin 16s linear infinite; }
.orbit-one::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; top: 18px; right: 25px; background: #7b5cf5; box-shadow: 0 0 0 6px rgba(123,92,245,.09); }
.orbit-two { inset: 22px; border-style: dashed; animation: spin 12s linear infinite reverse; }
.heart-icon { position: absolute; inset: 43px; display: grid; place-items: center; border-radius: 50%; color: #5b70ed; background: rgba(255,255,255,.85); box-shadow: 0 14px 40px rgba(70,77,164,.16); }
.heart-icon svg { width: 35px; }
.idle-state h2 { font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: 1.45rem; margin: 9px 0 10px; }
.idle-state > p { color: var(--muted); line-height: 1.6; margin: 0; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; padding: 9px 13px; color: #727b94; background: rgba(255,255,255,.7); border: 1px solid rgba(75,87,134,.09); border-radius: 99px; font-size: .71rem; }
.privacy-note svg { width: 14px; }

.result-card { width: 100%; color: var(--ink); animation: resultIn .55s cubic-bezier(.2,.8,.2,1); }
.result-card[hidden] { display: none; }
.result-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--result); background: var(--result-soft); padding: 7px 10px; border-radius: 99px; font-size: .68rem; font-weight: 800; }
.status-chip > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--result); }
.result-greeting { color: var(--muted); margin: 0 0 4px; }
.bmi-value { display: flex; align-items: baseline; gap: 9px; }
.bmi-value strong { color: var(--result); font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: clamp(3.7rem, 7vw, 5.4rem); line-height: 1.08; letter-spacing: -.065em; }
.bmi-value span { color: #8a93ab; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.result-card h2 { font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; margin: 5px 0 10px; font-size: 1.45rem; }
.result-message { min-height: 48px; color: var(--muted); line-height: 1.55; margin: 0; }
.result-details { display: grid; gap: 10px; margin: 24px 0 0; }
.result-details div { padding: 12px 14px; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 12px; }
.result-details dt { color: #7c859d; font-size: .67rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.result-details dd { margin: 5px 0 0; color: var(--ink); font-size: .84rem; font-weight: 700; line-height: 1.4; }
.result-notice { margin-top: 15px; padding: 12px 14px; color: #8a3a22; background: #fff2eb; border: 1px solid rgba(166,75,22,.18); border-radius: 12px; font-size: .76rem; font-weight: 650; line-height: 1.5; }
.gauge-block { margin: 29px 0 25px; }
.gauge-labels, .gauge-numbers { display: grid; grid-template-columns: 22% 28% 25% 25%; color: #838ca3; font-size: .61rem; }
.gauge-labels span { text-align: center; }
.gauge { position: relative; display: grid; grid-template-columns: 22% 28% 25% 25%; gap: 3px; height: 9px; margin: 10px 0 8px; }
.gauge-segment:first-child { border-radius: 99px 0 0 99px; }
.gauge-segment:last-of-type { border-radius: 0 99px 99px 0; }
.gauge .low, .table-dot.low { background: #5c99e6; }
.gauge .normal, .table-dot.normal { background: #35b981; }
.gauge .overweight, .table-dot.overweight { background: #f1bf3c; }
.gauge .obese { background: linear-gradient(90deg, #f28b3d, #e54e5e); }
.gauge-marker { position: absolute; top: 50%; left: 0; width: 18px; height: 18px; border: 4px solid white; border-radius: 50%; background: var(--result); box-shadow: 0 2px 9px rgba(28,39,82,.35); transform: translate(-50%,-50%); transition: left .7s cubic-bezier(.2,.8,.2,1), background .3s; }
.gauge-numbers { grid-template-columns: 1fr 1fr 1fr 1fr 0; }
.gauge-numbers span { transform: translateX(-25%); }
.gauge-numbers span:last-child { text-align: right; transform: none; }
.result-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 20px; }
.result-meta span { display: flex; align-items: center; justify-content: center; gap: 6px; color: #737d97; font-size: .72rem; border-right: 1px solid var(--line); }
.result-meta span:last-child { border: 0; }
.result-meta svg { width: 15px; color: var(--result); }
.result-meta b { color: var(--ink); }

.reference-card { display: grid; grid-template-columns: .72fr 1.28fr; gap: 45px; align-items: center; margin-top: 26px; padding: 34px 40px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: 0 18px 55px rgba(45,57,107,.08); }
.age-reference-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.age-reference-list article { display: grid; gap: 5px; padding: 14px; background: rgba(247,248,253,.8); border: 1px solid var(--line); border-radius: 12px; }
.age-reference-list strong { font-size: .78rem; }
.age-reference-list span { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.check-grid { display: grid; gap: 10px; margin: 0 0 22px; }
.check-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 11px 13px; background: rgba(247,248,253,.76); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-card input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--purple); }
.check-card span { color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.45; }
.check-card strong { display: block; color: #3b4563; font-size: .76rem; }
.sources-card { margin-top: 18px; padding: 28px 34px; background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.8); border-radius: 20px; }
.sources-card h2 { margin: 0 0 12px; font-family: ui-rounded, "Segoe UI", system-ui, sans-serif; font-size: 1.15rem; }
.sources-card ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.sources-card a { color: #465bc6; font-size: .78rem; line-height: 1.45; }
.eyebrow.compact { font-size: .65rem; }
.reference-copy p { color: var(--muted); line-height: 1.6; font-size: .88rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th { padding: 0 13px 11px; color: #8a92a7; text-align: left; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
th:last-child, td:last-child { text-align: center; }
td { padding: 10px 13px; border-top: 1px solid var(--line); }
td:nth-child(2) { font-weight: 600; }
.table-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.table-dot.obesity-one { background: #f3983f; }
.table-dot.obesity-two { background: #ee6b48; }
.table-dot.obesity-three { background: #df4e5f; }
.medical-note { display: flex; gap: 13px; align-items: center; margin: 18px auto 0; padding: 13px 18px; max-width: 820px; color: #737c94; }
.medical-note svg { width: 20px; min-width: 20px; color: #6575d9; }
.medical-note p { margin: 0; font-size: .75rem; line-height: 1.5; }
.medical-note strong { color: #525e7b; margin-right: 4px; }
footer { display: flex; justify-content: space-between; width: min(1120px, calc(100% - 36px)); margin: 15px auto 0; padding: 25px 0 35px; color: #8991a7; border-top: 1px solid rgba(72,86,135,.1); font-size: .74rem; }
footer p { margin: 0; } footer span { color: #785eea; }
.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; }

.reveal { opacity: 0; transform: translateY(20px); animation: reveal .7s forwards; }
.workspace.reveal { animation-delay: .12s; }
.reference-card.reveal { animation-delay: .22s; }
.medical-note.reveal { animation-delay: .3s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes resultIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

@media (max-width: 850px) {
  .page-shell { padding-top: 45px; }
  .workspace { grid-template-columns: 1fr; }
  .form-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-panel { min-height: 500px; }
  .reference-card { grid-template-columns: 1fr; gap: 22px; }
  .age-reference-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 22px, 1120px); padding-top: 35px; }
  .hero { margin-bottom: 25px; }
  .hero h1 { font-size: 2.55rem; }
  .hero p { font-size: .92rem; }
  .workspace { border-radius: 22px; }
  .form-panel, .insight-panel { padding: 28px 20px; }
  .section-heading h2 { font-size: 1.25rem; }
  .heading-icon { display: none; }
  .fields-grid { grid-template-columns: 1fr; gap: 0; }
  .actions { grid-template-columns: 1fr; }
  .secondary-btn { order: 2; }
  .insight-panel { min-height: 460px; }
  .result-meta span { flex-direction: column; gap: 2px; }
  .reference-card { padding: 27px 20px; }
  .sources-card { padding: 24px 20px; }
  table { min-width: 490px; }
  footer { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
