:root {
  font: 100%/1.4 system-ui, sans-serif;
  color: #263c37;
  background: #f4f7f5;
  --forest: #204f44;
  --line: #d0ddd6;
  --gutter: clamp(.75rem, 3vw, 1.5rem);
}
* { box-sizing: border-box; }
body { margin: 0; }
header { background: white; border-bottom: 1px solid var(--line); padding: .55rem max(var(--gutter), calc((100% - 63rem) / 2)); }
header img { display: block; width: 9.4rem; height: auto; max-height: 3rem; }
main { max-width: 66rem; padding: 1rem var(--gutter) 3rem; margin: auto; }
h1 { font: 500 clamp(1.8rem, 3.7vw, 2.45rem)/1.12 Georgia, serif; color: var(--forest); margin: 0 0 .6rem; }
h2, h3, h4, p { margin: 0 0 .65rem; }
.panel, .form-group { border: 1px solid var(--line); background: white; border-radius: .65rem; }
.panel { max-width: 42rem; padding: 1.25rem; }
.intake-start { max-width: 42rem; margin-inline: auto; }
.intake-start h1 { text-align: center; }
.panel .field { margin-bottom: .85rem; }
button { font: inherit; font-weight: 550; border: 1px solid #a6b9af; border-radius: .4rem; color: var(--forest); background: white; cursor: pointer; padding: .4rem .8rem; }
button.primary { background: var(--forest); color: white; border-color: var(--forest); }
button:hover:enabled { border-color: var(--forest); }
button:disabled { opacity: .55; }
:focus-visible { outline: 3px solid #2773a7; outline-offset: 2px; }
.meta, .text-size, .actions { display: flex; align-items: center; gap: .55rem; }
.meta { margin-bottom: .8rem; flex-wrap: wrap; font-size: .875rem; color: #486359; }
.email { flex: 1; min-width: 8rem; overflow-wrap: anywhere; }
.text-size { gap: 0; }
.text-size button { min-width: 2.35rem; }
.text-size button:first-child { border-radius: .4rem 0 0 .4rem; }
.text-size button:last-child { border-radius: 0 .4rem .4rem 0; margin-left: -1px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; border: 1px solid #b7c9bf; border-radius: .55rem; background: white; }
.steps button { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; border: 0; border-radius: 0; padding: .4rem; background: transparent; line-height: 1.2; }
.steps button + button { border-left: 1px solid #b7c9bf; }
.steps button:first-child { border-radius: .48rem 0 0 .48rem; }
.steps button:last-child { border-radius: 0 .48rem .48rem 0; }
.steps button[aria-current] { background: var(--forest); color: white; }
.step-number { display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; width: 1.35rem; height: 1.35rem; flex: none; font-size: .78rem; }
.page-fields, .field { min-width: 0; padding: 0; margin: 0; border: 0; }
.form-group + .form-group { margin-top: .8rem; }
.form-group > h2, .form-group > summary {
  font: 620 1.04rem/1.25 system-ui, sans-serif; color: var(--forest);
  padding: .52rem .9rem; background: #e7f0eb; border-radius: .6rem .6rem 0 0;
  border-bottom: 1px solid var(--line); margin: 0;
}
summary { cursor: pointer; }
details.form-group:not([open]) > summary { border-radius: .6rem; border-bottom: 0; }
.field-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: .68rem .95rem; padding: .8rem .95rem .95rem; align-items: end; }
.slot { min-width: 0; }
.slot-third { grid-column: span 2; }
.slot-half { grid-column: span 3; }
.slot-full { grid-column: 1 / -1; }
.field > label, legend { padding: 0; display: block; font-size: .92rem; font-weight: 585; margin-bottom: .2rem; }
input:not([type=checkbox]), select, textarea {
  width: 100%; max-width: 100%; min-width: 0; min-height: 2.3rem; padding: .33rem .56rem;
  font: inherit; color: inherit; border: 1px solid #94a99e; border-radius: .32rem; background: #fff;
}
.birth-field { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .45rem; }
.birth-age { color: var(--forest); font-size: .875rem; }
.measurement { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .45rem; }
.measurement-parts { display: flex; gap: .45rem; min-width: 0; }
.measurement-part { flex: 1; min-width: 0; }
.measurement-input { position: relative; }
.measurement-input:has(span) input { padding-right: 1.85rem; }
.measurement-input span { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font-size: .875rem; pointer-events: none; }
.measurement-error { color: #942e1f; font-size: .875rem; }
textarea { min-height: 4rem; display: block; resize: vertical; }
input[type=file] { font-size: .9rem; }
input::file-selector-button { font: inherit; }
input[type=checkbox] { flex: none; margin: .18rem 0 0; accent-color: var(--forest); width: 1rem; height: 1rem; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .15rem .9rem; }
.checks label { display: flex; align-items: start; gap: .48rem; padding: .23rem 0; font-size: .94rem; cursor: pointer; }
.field p { margin: .32rem 0 0; overflow-wrap: anywhere; }
.field input + button { margin-top: .4rem; }
.repeatable-rows { container-type: inline-size; margin-bottom: .35rem; }
.repeatable-rows table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.repeatable-rows th, .repeatable-rows td { padding: 0 .55rem 0 0; }
.repeatable-rows th { text-align: start; vertical-align: bottom; font-size: .9rem; font-weight: 550; }
.repeatable-rows td { padding-top: .3rem; }
.repeatable-rows :is(th, td):last-child { padding-right: 0; }
.repeatable-rows th:last-child { width: 5.5rem; }
.repeatable-rows label { display: block; }
.repeatable-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.repeatable-rows td button { width: 100%; min-height: 2.3rem; padding: .33rem .56rem; }
@container (width < 35rem) {
  .repeatable-rows thead { display: none; }
  .repeatable-rows :is(table, tbody, tr, td) { display: block; }
  .repeatable-rows td { padding: 0; }
  .repeatable-rows tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: .35rem .55rem; }
  .repeatable-rows tr + tr { border-top: 1px solid var(--line); margin-top: .55rem; padding-top: .55rem; }
  .repeatable-label { position: static; width: auto; height: auto; clip-path: none; font-size: .9rem; }
  .repeatable-rows tr:has(td:nth-child(4)) td:first-child,
  .repeatable-rows td:last-child { grid-column: 1 / -1; }
  .repeatable-rows td:last-child { justify-self: end; }
}
button.add-row { font-size: .8125rem; line-height: 1.2; min-height: 1.75rem; padding: .2rem .5rem; }
a { color: #155a4c; }
.policy { display: inline-block; margin: 0 0 .3rem; }
.answer-review { margin: .75rem .95rem 0; }
.answer-review summary { color: var(--forest); text-decoration: underline; }
.answer-review section { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.answer-review dt { font-weight: 600; }
.answer-review dd { margin: .1rem 0 .5rem; overflow-wrap: anywhere; }
.actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.actions button:first-child:not(.primary) { margin-right: auto; }
.actions [role=status] { font-size: .875rem; color: #476159; }
.error { color: #942e1f; padding: .65rem; margin-top: .7rem; background: #fff0ec; }
@media (min-width: 46em) {
  .doctor-prefix { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 46em) {
  .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .slot-third { grid-column: span 1; }
  .slot-half { grid-column: 1 / -1; }
  .checks { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 32em) {
  .steps button { flex-direction: column; font-size: .9rem; gap: .2rem; }
  .checks { grid-template-columns: 1fr; }
  .field-grid { gap: .6rem .65rem; padding: .75rem; }
  .meta button, .checks label { min-height: 2.25rem; }
  .meta button { padding-inline: .55rem; }
}
