:root {
  color-scheme: light;
  --blue: #356df3;
  --blue-dark: #2454c6;
  --blue-soft: #eef4ff;
  --navy: #17243d;
  --ink: #293246;
  --muted: #69758d;
  --line: #dce3ee;
  --line-strong: #c9d3e1;
  --surface: #ffffff;
  --surface-alt: #f5f8fc;
  --green: #397456;
  --green-soft: #eaf6ef;
  --amber: #815318; /* 12px 굵은 텍스트 기준 --amber-soft 배경에서 WCAG AA(4.5:1 이상) 충족 */
  --amber-soft: #fff4df;
  --red: #bd3f49;
  --red-soft: #fff0f1;
  --shadow: 0 18px 45px rgba(36, 58, 94, 0.1);
  --shadow-soft: 0 8px 24px rgba(36, 58, 94, 0.07);
  --radius: 22px;
  --radius-sm: 13px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfcfe;
  font-family: Pretendard, "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

a:focus-visible,
.chart-wrap:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid rgba(53, 109, 243, 0.36);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.visually-hidden {
  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: 100;
  padding: 10px 14px;
  border-radius: 9px;
  color: white;
  background: var(--navy);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(220, 227, 238, 0.88);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 650;
  text-decoration: none;
}

.brand strong {
  color: var(--blue);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #5687ff, #2f67ec);
  box-shadow: 0 8px 20px rgba(53, 109, 243, 0.25);
}

.brand-mark svg,
.source-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.source-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.source-link:hover {
  color: var(--blue);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  color: #68758a;
  font-size: 13px;
  font-weight: 650;
}

.breadcrumb a {
  /* 시각적 배치는 유지하면서 터치 영역만 넓힙니다. */
  margin: -10px -4px;
  padding: 10px 4px;
  color: #65738a;
  text-underline-offset: 3px;
}

.breadcrumb [aria-current="page"] {
  overflow: hidden;
  color: var(--blue);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb + main .hero {
  padding-top: 44px;
}

.hero {
  padding: 76px 0 38px;
  text-align: center;
}

.standard-badge,
.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.standard-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #d7e3ff;
  border-radius: 999px;
  background: #f5f8ff;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(53, 109, 243, 0.12);
}

.hero h1 {
  margin: 19px 0 13px;
  color: var(--navy);
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 690px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

.calculator-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 46px;
  row-gap: 26px;
}

.field-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: #31394a;
  font-size: 17px;
  font-weight: 720;
}

legend.field-label {
  float: left;
  width: 145px;
  padding: 0;
}

.field-label > svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-label small {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: #657187;
  background: #eff2f6;
  font-size: 12px;
  font-weight: 700;
}

/* 호버 툴팁 대신 항상 보이는 도움말: 터치 환경과 WCAG 1.4.13을 모두 충족합니다. */
.field-help {
  grid-column: 1 / -1;
  margin-top: -6px;
  color: #5b6880;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  display: grid;
  min-height: 50px;
  place-items: center;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.segmented label:first-of-type {
  border-radius: 10px 0 0 10px;
}

.segmented label:last-of-type {
  margin-left: -1.5px;
  border-radius: 0 10px 10px 0;
}

.segmented input:checked + label {
  z-index: 1;
  color: white;
  background: var(--blue);
}

.segmented input:focus-visible + label {
  outline: 3px solid rgba(53, 109, 243, 0.36);
  outline-offset: 2px;
}

.input-with-unit {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px 0 0 10px;
  color: var(--navy);
  background: white;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-unit input:focus {
  z-index: 1;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.18);
}

.input-with-unit input[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

.input-with-unit > span {
  display: grid;
  min-width: 62px;
  height: 52px;
  place-items: center;
  margin-left: -1.5px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0 10px 10px 0;
  color: #374052;
  background: #eef1f5;
  font-size: 16px;
  font-weight: 700;
}

.age-control {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
}

.age-type label {
  min-height: 52px;
  border-radius: 0;
}

.age-type label:first-of-type {
  border-radius: 10px 0 0 10px;
}

.age-type label:last-of-type {
  border-radius: 0;
}

.age-input input {
  border-radius: 0 10px 10px 0;
}

.age-input > span {
  border-radius: 0 10px 10px 0;
}

.age-input[data-age-panel="month"] input {
  border-radius: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 19px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(53, 109, 243, 0.38);
  outline-offset: 2px;
}

.button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(57, 116, 86, 0.2);
}

.button-primary:hover {
  background: #2f6749;
}

.form-actions .button-primary {
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(53, 109, 243, 0.22);
}

.form-actions .button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  color: white;
  background: #66707e; /* 흰 텍스트 기준 WCAG AA(4.5:1 이상) 충족 */
}

.button-secondary:hover {
  background: #606976;
}

.button-ghost {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  color: #4b5870;
  background: white;
  font-size: 14px;
}

.form-message {
  margin-top: 22px;
  padding: 11px 14px;
  border: 1px solid #f2c5c8;
  border-radius: 9px;
  color: #a5333d;
  background: var(--red-soft);
  font-size: 14px;
  font-weight: 650;
}

.results {
  padding-top: 82px;
}

.results:focus {
  outline: none;
}

.result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button-pdf {
  min-height: 48px;
  color: white;
  background: var(--blue);
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(53, 109, 243, 0.2);
}

.button-pdf:hover {
  background: var(--blue-dark);
}

.button-pdf:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}

.button-pdf[aria-busy="true"] svg {
  animation: pdf-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes pdf-pulse {
  to {
    opacity: 0.35;
    transform: translateY(-1px);
  }
}

.print-report-header,
.print-report-footer {
  display: none;
}

.result-heading h2,
.guide-intro h2,
.source-section h2 {
  margin: 6px 0 0;
  color: var(--navy);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.summary-card dt {
  padding: 10px 7px;
  color: #59677e;
  background: #f3f6fa;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.summary-card dd {
  display: grid;
  min-height: 58px;
  place-items: center;
  margin: 0;
  padding: 10px 6px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.summary-card[data-static="true"] dd {
  font-size: 14px;
}

.summary-card.is-unavailable dd {
  color: #657187;
}

.percentile-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 0 26px;
  padding: 14px 17px;
  border: 1px solid #cddfff;
  border-radius: 12px;
  color: #38547f;
  background: var(--blue-soft);
  font-size: 14px;
}

.percentile-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
}

.percentile-note p,
.screening-notice p,
.source-copy p {
  margin: 0;
}

.result-navigation {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.result-navigation a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #56637a;
  background: white;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.result-navigation a:hover {
  border-color: #a9c2fb;
  color: var(--blue);
  background: #f5f8ff;
}

.result-panels {
  display: grid;
  gap: 22px;
}

.metric-card {
  scroll-margin-top: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
}

.metric-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 850;
}

.metric-header h3 {
  margin: 0;
  color: var(--navy);
  font-size: 23px;
  letter-spacing: -0.025em;
}

.metric-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.assessment {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.assessment-success {
  color: var(--green);
  background: var(--green-soft);
}

.assessment-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.assessment-danger {
  color: var(--red);
  background: var(--red-soft);
}

.metric-tabs {
  display: flex;
  gap: 4px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.metric-tabs button {
  position: relative;
  min-height: 44px;
  padding: 10px 15px 12px;
  border: 0;
  color: #647187;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.metric-tabs button[aria-selected="true"] {
  color: var(--blue);
}

.metric-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  content: "";
}

.metric-tab-panel {
  padding: 24px 26px 28px;
}

.metric-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 26px;
  align-items: stretch;
}

.metric-visual-grid > * {
  min-width: 0;
}

.chart-wrap {
  position: relative;
  min-width: 0;
  height: 340px;
  padding: 6px 4px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7f9fd 100%);
}

.growth-chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-scroll-hint {
  display: none;
}

.chart-grid-line {
  stroke: #e2e8f1;
  stroke-width: 1;
}

.chart-axis-text,
.chart-axis-label {
  fill: #657187;
  font-family: inherit;
  font-size: 11px;
}

.chart-axis-label {
  font-size: 12px;
  font-weight: 650;
}

.chart-line-p97,
.chart-line-p3 {
  fill: none;
  stroke: #7ca2fb;
  stroke-width: 2;
}

.chart-line-p50 {
  fill: none;
  stroke: #356df3;
  stroke-width: 2.5;
}

.chart-range {
  fill: rgba(83, 132, 246, 0.09);
}

.chart-input-line {
  stroke: rgba(231, 113, 68, 0.45);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-input-point {
  fill: #e56f43;
  stroke: white;
  stroke-width: 3;
  filter: drop-shadow(0 2px 3px rgba(154, 65, 35, 0.25));
}

.chart-input-label {
  fill: #a94a28;
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 17px;
  margin-top: 8px;
  color: #5f6c82;
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line,
.legend-dot {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: #7ca2fb;
}

.legend-line.mid {
  background: var(--blue);
}

.legend-dot {
  width: 8px;
  height: 8px;
  background: #e56f43;
}

.metric-details {
  display: grid;
  align-content: center;
  gap: 10px;
}

.detail-box {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.detail-box span {
  display: block;
  margin-bottom: 2px;
  color: #617087;
  font-size: 12px;
  font-weight: 700;
}

.detail-box strong {
  color: var(--navy);
  font-size: 19px;
}

.detail-box .assessment-text-danger {
  color: var(--red);
}

.detail-box .assessment-text-warning {
  color: var(--amber);
}

.detail-box .assessment-text-success {
  color: var(--green);
}

.table-scroll {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.growth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}

.growth-table th,
.growth-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e8edf4;
}

.growth-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #40516e;
  background: #eef4ff;
  font-weight: 800;
}

.growth-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.growth-table tbody tr.is-current {
  color: #234fae;
  background: #eaf1ff;
  font-weight: 800;
}

.metric-unavailable {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 26px 26px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #68758a;
  background: #f5f7fa;
  font-size: 14px;
}

.metric-unavailable svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.screening-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 14px;
  color: #4b5c72;
  background: #f0f4f7;
  font-size: 14px;
}

.screening-notice svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screening-notice strong {
  display: block;
  margin-bottom: 3px;
  color: #334257;
}

.guide-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 70px;
  align-items: start;
  padding-top: 105px;
  padding-bottom: 96px;
}

.guide-intro p {
  margin: 13px 0 0;
  color: var(--muted);
}

.guide-links {
  display: grid;
  gap: 10px;
}

.guide-links a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  box-shadow: 0 4px 14px rgba(36, 58, 94, 0.04);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.guide-links a:hover {
  border-color: #aac3fb;
  transform: translateX(3px);
}

.guide-links span {
  color: #68758a;
  font-size: 12px;
  font-weight: 800;
}

.guide-links strong {
  color: #2f64dd;
  font-size: 16px;
}

.guide-links svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #98a5b8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.source-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 65px;
  margin-bottom: 90px;
  padding: 35px 38px;
  border: 1px solid #d9e4f3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f6f9ff, #f8fbfa);
}

.source-section h2 {
  font-size: 25px;
}

.source-copy {
  color: #617087;
  font-size: 14px;
}

.source-copy a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: #68758a;
  background: white;
  font-size: 13px;
}

.site-footer .shell {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: #445169;
}

@media (max-width: 1050px) {
  .form-grid {
    column-gap: 26px;
  }

  .field-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  legend.field-label {
    width: 120px;
  }

  .age-control {
    grid-template-columns: 125px minmax(0, 1fr);
  }

  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .shell {
    width: min(100% - 28px, 680px);
  }

  .header-inner {
    min-height: 64px;
  }

  .source-link {
    display: none;
  }

  .hero {
    padding: 52px 0 28px;
    text-align: left;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero p {
    font-size: 15px;
  }

  .calculator-card {
    padding: 24px 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .field-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .form-actions {
    margin-top: 2px;
  }

  .results {
    padding-top: 64px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-visual-grid {
    grid-template-columns: 1fr;
  }

  .metric-details {
    grid-template-columns: repeat(3, 1fr);
  }

  .guide-section,
  .source-section {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .guide-section {
    padding-top: 82px;
    padding-bottom: 70px;
  }

  .source-section {
    padding: 28px;
  }
}

@media (max-width: 560px) {
  body {
    word-break: normal;
  }

  .shell {
    width: calc(100% - 22px);
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 40px;
  }

  .standard-badge {
    font-size: 12px;
  }

  .hero h1 {
    margin-top: 15px;
    font-size: 33px;
  }

  .field-row {
    display: block;
  }

  .field-label,
  legend.field-label {
    float: none;
    width: 100%;
    margin-bottom: 8px;
    font-size: 15px;
  }

  .segmented label {
    min-height: 46px;
    font-size: 15px;
  }

  .input-with-unit input,
  .input-with-unit > span {
    height: 48px;
  }

  .age-control {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
  }

  .button {
    min-height: 48px;
    padding-inline: 13px;
  }

  .result-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .result-heading h2 {
    font-size: 25px;
  }

  .result-actions {
    width: 100%;
    align-items: stretch;
  }

  .result-actions .button-pdf {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-card dd {
    min-height: 51px;
    font-size: 16px;
  }

  .metric-header {
    align-items: flex-start;
    padding: 20px 18px 15px;
  }

  .metric-header h3 {
    font-size: 19px;
  }

  .metric-index {
    width: 30px;
    height: 30px;
  }

  .metric-tabs {
    padding: 0 16px;
  }

  .metric-tab-panel {
    padding: 18px 14px 22px;
  }

  .chart-wrap {
    width: 100%;
    max-width: 100%;
    height: 280px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: #b9c7dc transparent;
    scrollbar-width: thin;
  }

  .growth-chart {
    width: 680px;
    max-width: none;
    overflow: hidden;
  }

  .chart-scroll-hint {
    display: block;
    margin: 7px 2px 0;
    color: #59677e;
    font-size: 11px;
    font-weight: 650;
  }

  .metric-details {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .detail-box {
    min-width: 0;
    padding: 10px 8px;
    text-align: center;
  }

  .detail-box strong {
    font-size: 15px;
  }

  .detail-box span {
    font-size: 11px;
  }

  .metric-unavailable {
    margin: 0 18px 20px;
  }

  .screening-notice {
    padding: 17px;
  }

  .guide-section {
    padding-top: 70px;
  }

  .guide-links a {
    padding: 14px;
  }

  .source-section {
    margin-bottom: 58px;
    padding: 23px 20px;
  }

  .site-footer .shell {
    display: block;
    padding: 22px 0;
  }

  .site-footer p + p {
    margin-top: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@page {
  size: A4 portrait;
  margin: 11mm;
}

@media print {
  :root {
    --shadow: none;
    --shadow-soft: none;
  }

  html,
  body {
    width: 100%;
    margin: 0;
    color: #1f2b40;
    background: white;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .site-header,
  .skip-link,
  .breadcrumb,
  .hero,
  .calculator-card,
  .guide-section,
  .source-section,
  .site-footer,
  .result-heading,
  .result-navigation,
  .metric-tabs {
    display: none !important;
  }

  main,
  #results {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #results[hidden] {
    display: none !important;
  }

  .print-report-header {
    display: block;
    margin-bottom: 6mm;
    padding-bottom: 5mm;
    border-bottom: 1.5px solid #356df3;
  }

  .print-report-brand {
    display: flex;
    align-items: center;
    gap: 2.5mm;
    color: #356df3;
    font-size: 10pt;
  }

  .print-report-brand svg {
    width: 7mm;
    height: 7mm;
    padding: 1.2mm;
    border-radius: 2mm;
    color: white;
    background: #356df3;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .print-report-header h1 {
    margin: 3mm 0 0;
    color: #17243d;
    font-size: 21pt;
    line-height: 1.2;
    letter-spacing: -0.04em;
  }

  .print-report-header p {
    margin: 1.5mm 0 0;
    color: #66758b;
    font-size: 8.5pt;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2mm;
  }

  .summary-card {
    border-radius: 2.5mm;
    box-shadow: none;
  }

  .summary-card dt {
    padding: 1.8mm 1mm;
    font-size: 7.5pt;
  }

  .summary-card dd {
    min-height: 10mm;
    padding: 1.8mm 1mm;
    font-size: 11pt;
  }

  .summary-card[data-static="true"] dd {
    font-size: 9pt;
  }

  .percentile-note {
    gap: 2mm;
    margin: 4mm 0 5mm;
    padding: 2.5mm 3mm;
    border-radius: 2.5mm;
    font-size: 8pt;
  }

  .percentile-note svg {
    width: 4mm;
    height: 4mm;
  }

  .result-panels {
    display: block;
  }

  .metric-card {
    margin: 0 0 5mm;
    border-radius: 3mm;
    box-shadow: none;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .metric-header {
    padding: 3.5mm 4mm 2.5mm;
  }

  .metric-index {
    width: 7mm;
    height: 7mm;
    border-radius: 2mm;
    font-size: 7pt;
  }

  .metric-header h3 {
    font-size: 13pt;
  }

  .metric-header p,
  .assessment {
    font-size: 7pt;
  }

  [data-tab-panel="chart"] {
    display: block !important;
  }

  [data-tab-panel="table"] {
    display: none !important;
  }

  .metric-tab-panel {
    padding: 2.5mm 4mm 4mm;
  }

  .metric-visual-grid {
    grid-template-columns: minmax(0, 1fr) 36mm;
    gap: 4mm;
  }

  .chart-wrap {
    height: 69mm;
    padding: 0;
    border-radius: 2mm;
  }

  .chart-legend {
    gap: 2mm 4mm;
    margin-top: 1mm;
    font-size: 7pt;
  }

  .detail-box {
    padding: 2.5mm 3mm;
    border-radius: 2mm;
  }

  .detail-box span {
    font-size: 7pt;
  }

  .detail-box strong {
    font-size: 11pt;
  }

  .metric-unavailable {
    margin: 0 4mm 4mm;
    padding: 3mm;
    border-radius: 2mm;
    font-size: 8pt;
  }

  .screening-notice {
    gap: 3mm;
    margin-top: 5mm;
    padding: 4mm;
    border-radius: 3mm;
    font-size: 8pt;
    break-inside: avoid;
  }

  .print-report-footer {
    display: block;
    margin-top: 5mm;
    padding-top: 3mm;
    border-top: 1px solid #dce3ee;
    color: #6c788d;
    font-size: 7.5pt;
    break-inside: avoid;
  }

  .print-report-footer p {
    margin: 0 0 1mm;
  }
}
