:root {
  color-scheme: light;
  --ink: #24352b;
  --muted: #718078;
  --muted-dark: #53665b;
  --green: #416b52;
  --green-dark: #315640;
  --sage: #edf2ec;
  --line: #e3e9e3;
  --paper: #fff;
  --page: #f7f8f5;
  --gold: #d39a6b;
  --danger: #a74840;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); }
button, input { font: inherit; }
.page-shell { width: min(1120px, calc(100% - 56px)); margin: 0 auto; }
.topbar { height: 85px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(42, 67, 49, .09); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: #e5ede5; display: grid; place-items: center; color: var(--green); }
.brand-mark svg { width: 28px; height: 28px; }
.brand-name { font-family: inherit; font-size: 17px; letter-spacing: -.7px; font-weight: 800; }
.brand-name span { color: var(--green); }
.top-note { color: var(--muted); font-size: 12px; display: inline-flex; gap: 8px; align-items: center; }
.live-dot { width: 7px; height: 7px; background: #77a27f; border-radius: 50%; box-shadow: 0 0 0 4px #e8efe6; }

.intro { min-height: 277px; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.intro-copy { position: relative; z-index: 1; padding: 38px 0 44px; max-width: 540px; }
.eyebrow { margin: 0 0 15px; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; color: #718477; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-family: inherit; font-size: clamp(32px, 4vw, 43px); font-weight: 800; line-height: 1.14; letter-spacing: -1.8px; }
h1 span { color: var(--green); }
.intro-text { margin: 0; max-width: 430px; color: var(--muted); line-height: 1.65; font-size: 14px; }
.intro-art { width: 365px; height: 210px; position: relative; margin-right: 14px; }
.art-sun { position: absolute; right: 29px; top: 5px; width: 86px; height: 86px; border-radius: 50%; background: #e7ece2; }
.art-chart { position: absolute; inset: 3px 0 0 4px; width: 100%; height: 100%; }
.art-label { position: absolute; font-size: 10px; color: #7e9082; letter-spacing: .3px; }
.label-left { left: 1px; top: 42px; transform: rotate(-90deg); transform-origin: left; }
.label-right { right: 1px; bottom: 4px; }

.calculator { display: grid; grid-template-columns: 355px minmax(0, 1fr); border: 1px solid #e7ebe6; border-radius: 18px; box-shadow: 0 14px 40px rgba(48, 69, 52, .055); background: var(--paper); overflow: hidden; min-height: 575px; }
.form-panel { padding: 30px 30px 27px; border-right: 1px solid var(--line); background: #fff; }
.results-panel { padding: 30px 31px 27px; min-width: 0; background: #fff; }
.panel-heading { display: flex; gap: 12px; align-items: flex-start; }
.step-badge { flex: none; width: 27px; height: 27px; border-radius: 9px; color: #fff; background: var(--green); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.step-badge-muted { background: #eef2ec; color: #6e8474; }
.panel-heading h2 { font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.4px; margin: 1px 0 3px; }
.panel-heading p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
form { margin-top: 26px; }
fieldset { padding: 0; border: 0; margin: 0 0 19px; min-width: 0; }
.sex-field legend, .field-label { color: #42554a; font-size: 11px; font-weight: 700; margin-bottom: 8px; display: block; }
.sex-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sex-option { display: block; position: relative; cursor: pointer; }
.sex-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.sex-card { position: relative; min-height: 47px; padding: 0 12px; border: 1px solid #e4eae4; border-radius: 10px; display: flex; gap: 8px; align-items: center; color: #596a5f; font-size: 12px; font-weight: 600; transition: .18s ease; }
.sex-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-size: 16px; line-height: 1; background: #edf2ec; color: #668671; }
.girl-icon { color: #b6826c; background: #f5eee9; }
.radio-indicator { margin-left: auto; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #c9d4cb; }
.sex-option input:checked + .sex-card { background: #f5f8f4; border-color: #75927b; box-shadow: inset 0 0 0 1px #75927b; color: var(--green-dark); }
.sex-option input:checked + .sex-card .radio-indicator { border: 4px solid var(--green); background: #fff; }
.sex-option input:focus-visible + .sex-card { outline: 3px solid #bfd4c1; outline-offset: 2px; }
.field-block { margin-bottom: 16px; }
.field-label { margin-bottom: 7px; }
.required { color: #b47c57; }
.input-wrap { height: 44px; display: flex; align-items: center; border: 1px solid #dfe6df; border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: #789780; box-shadow: 0 0 0 3px rgba(109, 149, 117, .12); }
.input-wrap input { width: 100%; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; border-radius: 9px; color: var(--ink); background: transparent; font-size: 14px; font-weight: 600; }
.input-wrap input::placeholder { color: #b0bbb2; font-weight: 400; }
.input-wrap > span { flex: none; color: #8a988e; font-size: 11px; padding: 0 12px 0 5px; }
.age-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field-help { color: #8a978e; font-size: 10px; margin: 6px 0 0; }
.submit-button { width: 100%; height: 46px; margin-top: 3px; display: flex; justify-content: center; align-items: center; gap: 10px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .18s, transform .18s, box-shadow .18s; box-shadow: 0 5px 12px rgba(49, 86, 64, .16); }
.submit-button span { font-size: 18px; font-weight: 400; margin-top: -2px; }
.submit-button:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 7px 15px rgba(49, 86, 64, .22); }
.submit-button:focus-visible { outline: 3px solid #b7ceb9; outline-offset: 3px; }
.form-error { color: var(--danger); font-size: 11px; line-height: 1.45; margin: 10px 0 0; }

.results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 40px; }
.reference-chip { border: 1px solid #e2e9e2; border-radius: 20px; padding: 6px 9px; color: #6e8073; background: #f8faf7; font-size: 9px; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.empty-state { min-height: 465px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 34px 48px; }
.empty-illustration { width: 168px; height: 132px; display: grid; place-items: center; margin-bottom: 15px; }
.empty-illustration svg { width: 100%; height: 100%; }
.empty-state h3 { font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 7px; }
.empty-state p { color: #89968d; font-size: 11px; line-height: 1.65; max-width: 270px; margin: 0; }
.data-error { margin: 35px 0; border-radius: 12px; padding: 16px 18px; background: #faf2ee; color: #774f43; font-size: 12px; line-height: 1.65; }
.result-content { padding-top: 22px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 22px; }
.metric-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px 14px; min-width: 0; background: linear-gradient(145deg, #fff 0%, #fbfcfa 100%); }
.metric-top { display: flex; align-items: center; gap: 7px; color: #718076; font-size: 10px; font-weight: 600; }
.metric-dot { width: 7px; height: 7px; border-radius: 3px; background: var(--green); }
.metric-card.weight .metric-dot { background: var(--gold); }
.metric-value-row { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-top: 9px; }
.metric-percentile { color: var(--green-dark); font-family: inherit; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -1px; white-space: nowrap; }
.metric-card.weight .metric-percentile { color: #a9744c; }
.metric-measure { color: #87948a; font-size: 10px; white-space: nowrap; }
.metric-caption { color: #829087; font-size: 9px; margin-top: 7px; line-height: 1.45; }
.metric-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: #687d6d; font-size: 9px; font-weight: 600; }
.metric-status.outside { color: #9b6750; }
.chart-stack { display: grid; gap: 15px; }
.chart-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 10px; min-width: 0; }
.chart-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.chart-title { font-family: inherit; font-size: 11px; font-weight: 700; margin: 0; }
.chart-value { color: #7d8c81; font-size: 9px; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis { stroke: #dfe6df; stroke-width: 1; }
.chart-grid { stroke: #edf1ec; stroke-width: 1; }
.chart-tick { fill: #8a978e; font: 9px 'DM Sans', sans-serif; }
.curve-line { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .78; }
.curve-label { fill: #829087; font: 8px 'DM Sans', sans-serif; }
.measurement-line { stroke: #6b8d70; stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.measurement-dot { fill: #fff; stroke: #416b52; stroke-width: 2.5; }
.measurement-dot.weight-dot { stroke: #c88c60; }
.measurement-label { fill: #355e44; font: 700 9px 'DM Sans', sans-serif; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 9px 13px; margin: 3px 0 0 34px; color: #839087; font-size: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-line { width: 12px; height: 2px; border-radius: 2px; background: #799482; }
.chart-note { color: #89958c; font-size: 9px; line-height: 1.5; margin: 7px 1px 0; }
.chart-note strong { color: #64776a; font-weight: 600; }
.note-strip { display: flex; align-items: flex-start; gap: 11px; padding: 16px 2px 0; color: #7d8b81; }
.note-icon { flex: none; width: 16px; height: 16px; border: 1px solid #b8c7ba; color: #7f9783; border-radius: 50%; display: grid; place-items: center; font: 600 10px Georgia, serif; }
.note-strip p { font-size: 10px; line-height: 1.6; margin: 0; }
.footer { border-top: 1px solid rgba(42, 67, 49, .09); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 0 26px; margin-top: 19px; font-size: 9px; color: #8b978e; }
.footer-source { display: flex; flex-direction: column; gap: 6px; max-width: 760px; line-height: 1.6; }
.footer-source a { color: #547760; font-weight: 600; text-decoration: none; }
.footer-source a:hover { text-decoration: underline; }
.footer-right { text-align: right; }

@media (max-width: 860px) {
  .page-shell { width: min(720px, calc(100% - 36px)); }
  .intro { min-height: 245px; }
  .intro-art { width: 290px; margin-right: -12px; transform: scale(.9); transform-origin: center right; }
  .calculator { grid-template-columns: 310px minmax(0, 1fr); }
  .form-panel, .results-panel { padding-left: 23px; padding-right: 23px; }
  .metric-percentile { font-size: 21px; }
  .metric-measure { font-size: 9px; }
}
@media (max-width: 650px) {
  .page-shell { width: min(500px, calc(100% - 28px)); }
  .topbar { height: 68px; }
  .top-note { font-size: 0; gap: 0; }
  .live-dot { width: 8px; height: 8px; }
  .intro { min-height: auto; padding: 33px 0 25px; }
  .intro-copy { padding: 0; }
  .intro-art { display: none; }
  .eyebrow { margin-bottom: 11px; font-size: 9px; }
  h1 { font-size: 34px; letter-spacing: -1.3px; }
  .intro-text { font-size: 12px; max-width: 360px; }
  .calculator { display: flex; flex-direction: column; }
  .form-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 22px 22px; }
  .results-panel { padding: 24px 21px 23px; }
  form { margin-top: 22px; }
  .empty-state { min-height: 300px; padding: 22px 26px 28px; }
  .empty-illustration { width: 143px; height: 112px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 12px 10px; }
  .metric-percentile { font-size: 21px; }
  .metric-value-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .chart-card { padding-left: 10px; padding-right: 10px; }
  .chart-legend { margin-left: 30px; }
  .footer { flex-direction: column; gap: 7px; }
  .footer-right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
