/* The Alder — leasing site
   Palette is fixed by the brand: cream page, espresso ink, burgundy actions,
   slate blue for badges and chips only (it is too light to carry text on cream). */

:root {
  --cream: #fae9cd;
  --cream-raised: #fff4df;
  --espresso: #3f2212;
  --burgundy: #612022;
  --slate: #849cbe;

  --rule: rgba(63, 34, 18, 0.18);
  --ink-soft: rgba(63, 34, 18, 0.72);

  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 46ch;

  /* One size for every control. 3rem clears the 44px tap-target floor, and
     1rem keeps iOS from zooming the page when a field takes focus. */
  --control-h: 3rem;
  --control-px: 0.875rem;
  --control-font: 1rem;
  --control-border: 1.5px;
  --radius: 2px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* The UA rule for [hidden] is display:none, but any author `display` beats it —
   .btn and .upload__preview set one, so hidden elements rendered anyway.
   This keeps the hidden attribute meaning hidden, everywhere. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
}

a { color: var(--burgundy); }

:is(a, button, input, summary):focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  background: var(--cream-raised);
  padding: 0.5rem 0.75rem;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.125rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  color: var(--espresso);
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: 5.5rem;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav__list {
  display: flex;
  gap: clamp(1rem, 2.2vw, 1.875rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.9375rem;
}

.nav__list a {
  color: var(--espresso);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav__list a:hover { border-bottom-color: var(--espresso); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.link-quiet {
  font-family: var(--display);
  font-size: 0.9375rem;
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px solid var(--burgundy);
  padding-bottom: 2px;
  white-space: nowrap;
}
.link-quiet:hover { border-bottom-width: 2px; }

.navtoggle { display: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  font-family: var(--display);
  font-size: var(--control-font);
  font-weight: 500;
  line-height: 1;
  padding: 0 1.125rem;
  border: var(--control-border) solid var(--burgundy);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--burgundy);
  color: var(--cream);
}
.btn--primary:hover { background: #4e1a1c; }

.btn--ghost {
  background: transparent;
  color: var(--burgundy);
}
.btn--ghost:hover { background: rgba(97, 32, 34, 0.08); }

.btn--lg {
  min-height: 3.5rem;
  font-size: 1.0625rem;
  padding: 0 1.5rem;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(3rem, 8vw, 6rem);
  max-width: 88rem;
  margin-inline: auto;
}

.badge {
  display: inline-block;
  margin: 0 0 1.5rem;
  background: var(--slate);
  color: var(--espresso);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3125rem 0.625rem;
  border-radius: 2px;
}

.hero__title {
  font-family: var(--display);
  font-size: clamp(2.75rem, 7.2vw, 5.25rem);
  font-weight: 800;
  font-variation-settings: "wdth" 92, "opsz" 72;
  line-height: 0.97;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.hero__lede {
  max-width: var(--measure);
  margin: 0 0 2rem;
  font-size: 1.1875rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}

/* ---------- Availability finder ---------- */

.finder {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.finder__beds {
  margin: 0;
  padding: 0;
  border: 0;
}

.finder legend,
.finder__date label {
  display: block;
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
  padding: 0;
}

.chips { display: flex; gap: 0.5rem; }

.chip { cursor: pointer; }

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  font-family: var(--display);
  font-size: var(--control-font);
  padding: 0 var(--control-px);
  border: var(--control-border) solid var(--rule);
  border-radius: var(--radius);
  background: var(--cream-raised);
}

.chip input:checked + span {
  background: var(--slate);
  border-color: var(--slate);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}

.finder__date input {
  min-height: var(--control-h);
  font-family: var(--display);
  font-size: var(--control-font);
  color: var(--espresso);
  padding: 0 var(--control-px);
  border: var(--control-border) solid var(--rule);
  border-radius: var(--radius);
  background: var(--cream-raised);
}

/* ---------- Floor plan ---------- */

.plan {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 27rem;
}

.plan__svg {
  display: block;
  width: 100%;
  height: auto;
}

.plan-fill { fill: var(--slate); }

.plan-lines { stroke: var(--espresso); }

.plan-labels {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  fill: var(--espresso);
}

.plan-labels__small { font-size: 12px; }

.plan__caption {
  margin-top: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* One orchestrated moment: the plan draws itself once, then the rooms are named. */
@media (prefers-reduced-motion: no-preference) {
  .plan-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }
  .plan-line:nth-child(1) { animation-duration: 2s; }
  .plan-line:nth-child(n + 2) { animation-delay: 0.9s; animation-duration: 0.8s; }

  .plan-fill,
  .plan-labels { animation: settle 0.9s ease 1.5s backwards; }

  @keyframes draw {
    to { stroke-dashoffset: 0; }
  }
  @keyframes settle {
    from { opacity: 0; }
  }
}

/* ---------- Sections ---------- */

.section {
  max-width: 88rem;
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border-top: 1px solid var(--rule);
}

.section__head {
  max-width: 34rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__title {
  font-family: var(--display);
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
  font-weight: 700;
  font-variation-settings: "wdth" 92;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.section__lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

/* ---------- Floor plans ---------- */

.plans__top { margin-bottom: clamp(1.75rem, 4vw, 2.5rem); }

.plans__top .section__head { margin-bottom: 0; }

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.25rem;
}

.arrows {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.arrow {
  display: grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  background: transparent;
  color: var(--burgundy);
  border: var(--control-border) solid var(--burgundy);
  border-radius: var(--radius);
  cursor: pointer;
}

.arrow svg {
  width: 1.375rem;
  height: 1.375rem;
}

.arrow:hover:not(:disabled) {
  background: var(--burgundy);
  color: var(--cream);
}

.arrow:disabled {
  color: var(--ink-soft);
  border-color: var(--rule);
  cursor: default;
}

/* A real scroll container: swipe and keyboard work with no JS at all.
   The arrows and picker below only drive scrollTo. */
.track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-block: 1px solid var(--rule);
}

.track::-webkit-scrollbar { display: none; }

.track:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .track { scroll-behavior: smooth; }
}

.unit {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(2rem, 4vw, 3rem);
  scroll-snap-align: start;
}

/* ---------- Photos and plan, one frame ---------- */

.frame {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--cream-raised);
  border: 1px solid var(--rule);
}

.viewer { position: relative; }

/* Arrows sit on the photo itself so they cost no layout height.
   Espresso overlay, per the palette's role for it. */
.vbtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(63, 34, 18, 0.62);
  color: var(--cream);
  cursor: pointer;
}

.vbtn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.vbtn--prev { left: 0.75rem; }
.vbtn--next { right: 0.75rem; }

.vbtn:hover { background: var(--espresso); }

.vbtn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: -4px;
}

/* The link list is the no-JS fallback; the viewer hides it once it takes over. */
.shotlist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0.625rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.875rem;
}

.unit__media[data-ready] .shotlist { display: none; }

.unit__name {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 700;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.badge--open { margin-bottom: 1.25rem; }

.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.specs dt {
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  padding-top: 0.25rem;
}

.specs dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.specs__rent {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.unit__note {
  max-width: var(--measure);
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
}

.unit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Plan picker ---------- */

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.25rem;
}

.picker__item {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  font-family: var(--display);
  font-size: var(--control-font);
  color: var(--espresso);
  background: var(--cream-raised);
  border: var(--control-border) solid var(--rule);
  border-radius: var(--radius);
  padding: 0 var(--control-px);
  cursor: pointer;
}

.picker__item:hover { border-color: var(--espresso); }

.picker__item[aria-current="true"] {
  background: var(--slate);
  border-color: var(--slate);
}

/* ---------- How applying works ---------- */
/* Numbered because this genuinely is a sequence. */

.howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.howto__step {
  padding-top: 1.25rem;
  border-top: 2px solid var(--espresso);
}

.howto__num {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--burgundy);
}

.howto__title {
  margin: 0 0 0.625rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.015em;
}

.howto__body {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

/* ---------- Questions and answers ---------- */

.faq {
  max-width: 48rem;
  border-top: 1px solid var(--rule);
}

.faq__item { border-bottom: 1px solid var(--rule); }

.faq__q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.125rem 0;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker { display: none; }

/* Plus turning to minus, drawn rather than typed so it stays aligned. */
.faq__q::after {
  content: "";
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  background:
    linear-gradient(var(--burgundy), var(--burgundy)) center / 100% 1.5px no-repeat,
    linear-gradient(var(--burgundy), var(--burgundy)) center / 1.5px 100% no-repeat;
}

.faq__item[open] .faq__q::after {
  background:
    linear-gradient(var(--burgundy), var(--burgundy)) center / 100% 1.5px no-repeat;
}

.faq__q:hover { color: var(--burgundy); }

.faq__q:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: -2px;
}

.faq__a {
  padding-bottom: 1.25rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.faq__a p { margin: 0; }

/* ---------- Tour band ---------- */

.band {
  background: var(--cream-raised);
  border-block: 1px solid var(--rule);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
}

.band__inner {
  max-width: 44rem;
  margin-inline: auto;
}

.band__title {
  font-family: var(--display);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 800;
  font-variation-settings: "wdth" 90;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.band__lede {
  max-width: var(--measure);
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

.band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

/* ---------- Application form ---------- */

.apply {
  max-width: 44rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}

/* Visually hidden, still read aloud. Used where the question IS the label. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Progress ---------- */

.progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.625rem;
  font-family: var(--display);
  font-size: 0.875rem;
}

.progress__section {
  margin: 0;
  font-weight: 700;
}

.progress__count {
  margin: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.progress__track {
  height: 3px;
  background: var(--rule);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  background: var(--burgundy);
}

@media (prefers-reduced-motion: no-preference) {
  .progress__fill { transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
}

/* ---------- One question ---------- */

.q {
  margin: 0;
  padding: clamp(2.5rem, 7vw, 4rem) 0 0;
  border: 0;
  min-height: 15rem;
}

.q__title {
  padding: 0;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  max-width: 22ch;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  font-weight: 700;
  font-variation-settings: "wdth" 92;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.row--three { grid-template-columns: 2fr 1fr 1fr; }

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  margin-bottom: 0.4375rem;
  font-family: var(--display);
  font-size: 0.875rem;
}

.field--narrow { max-width: 18rem; }

.money { position: relative; }

.money__sign {
  position: absolute;
  left: var(--control-px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--text);
  font-size: 1.125rem;
  color: var(--ink-soft);
  pointer-events: none;
}

/* Specificity matters here: `.field input` below sets the `padding`
   shorthand, which would otherwise reset this padding-left and leave the
   first digit sitting underneath the $ sign. */
.field .money input {
  padding-left: calc(var(--control-px) + 1rem);
  font-variant-numeric: tabular-nums;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--control-h);
  font-family: var(--text);
  font-size: var(--control-font);
  color: var(--espresso);
  background: var(--cream-raised);
  border: var(--control-border) solid var(--rule);
  border-radius: var(--radius);
  padding: 0.6875rem var(--control-px);
}

.field textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.field :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 1px;
  border-color: var(--burgundy);
}

.field .is-invalid { border-color: var(--burgundy); }

.field__hint {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ---------- ID upload ---------- */

.uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.uploads .field { margin-bottom: 0; }

.upload__label {
  display: block;
  margin-bottom: 0.4375rem;
  font-family: var(--display);
  font-size: 0.875rem;
}

/* Hidden but focusable — the styled label is the visible control. */
.upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.25rem 1rem;
  border: var(--control-border) dashed var(--rule);
  border-radius: var(--radius);
  background: var(--cream-raised);
  font-family: var(--display);
  font-size: 0.9375rem;
  color: var(--burgundy);
  cursor: pointer;
}

.upload__cta svg {
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.upload__cta:hover { border-color: var(--burgundy); }

.upload__input:focus-visible + .upload__cta {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}

.upload.has-file .upload__cta {
  border-style: solid;
  border-color: var(--slate);
}

.upload__preview {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--rule);
  background: var(--cream-raised);
}

.upload__thumb {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.upload__badge {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  background: var(--slate);
  color: var(--espresso);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 700;
}

.upload__meta {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.upload__remove {
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--burgundy);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--burgundy);
  padding: 0;
  cursor: pointer;
}

.field--check { margin-top: 1.75rem; }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  font-family: var(--text);
  font-size: 1rem;
}

.check input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.25rem;
  accent-color: var(--burgundy);
}

.summary {
  padding: 1.5rem;
  background: var(--cream-raised);
  border: 1px solid var(--rule);
}

.summary__edit {
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--burgundy);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--burgundy);
  padding: 0;
  cursor: pointer;
}

.summary__list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.summary__list dt {
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.summary__list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.formnote {
  margin: 1.75rem 0 0;
  padding: 1rem 1.125rem;
  border-left: 3px solid var(--burgundy);
  background: var(--cream-raised);
}

.apply__nav {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.apply__kbd {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.apply__kbd kbd {
  font-family: var(--display);
  font-size: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.125rem 0.375rem;
}

/* ---------- Tour dialog ---------- */

.modal {
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(44rem, calc(100vh - 2rem));
  max-height: min(44rem, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid var(--espresso);
  border-radius: 2px;
  background: var(--cream);
  color: var(--espresso);
  overflow: hidden;
}

/* Only when open — a bare display:flex would force a closed dialog visible.
   Column layout lets the body scroll between a pinned head and foot. */
.modal[open] {
  display: flex;
  flex-direction: column;
}

/* iOS Safari still scrolls the page behind a modal dialog. */
body.is-locked { overflow: hidden; }

.modal::backdrop { background: rgba(63, 34, 18, 0.55); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.modal__title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.02em;
}

.modal__sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.modal__close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--espresso);
  cursor: pointer;
}

.modal__close svg { width: 1.125rem; height: 1.125rem; }
.modal__close:hover { border-color: var(--espresso); }

/* Scrolls by layout rather than a fixed height, so it fits any screen. */
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal__foot {
  flex-shrink: 0;
  max-height: 55%;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--cream-raised);
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chosen {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.875rem;
  background: var(--cream-raised);
  border-left: 3px solid var(--burgundy);
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 700;
}

/* ---------- Calendar ---------- */

.cal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.cal__month {
  margin: 0;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
}

.cal__nav {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--burgundy);
  cursor: pointer;
}

.cal__nav svg { width: 1.125rem; height: 1.125rem; }
.cal__nav:hover:not(:disabled) { border-color: var(--burgundy); }
.cal__nav:disabled { color: var(--ink-soft); opacity: 0.4; cursor: default; }

.cal__dow,
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.cal__dow {
  margin-bottom: 0.25rem;
  font-family: var(--display);
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
}

.cal__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--espresso);
  background: var(--cream-raised);
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}

.cal__day:hover:not(:disabled) { border-color: var(--burgundy); }

.cal__day.is-closed {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  opacity: 0.35;
  cursor: default;
}

.cal__day.is-today { border-color: var(--slate); border-width: 2px; }

.cal__day.is-selected {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--cream);
  font-weight: 700;
}

.cal__note {
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* ---------- Dialog steps ---------- */

.modal__progress {
  flex-shrink: 0;
  padding: 0.875rem 1.5rem 0;
}

.msteps {
  display: flex;
  gap: 1.25rem;
  margin: 0 0 0.625rem;
  padding: 0;
  list-style: none;
  font-family: var(--display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.mstep {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
}

.mstep__dot {
  width: 0.5rem;
  height: 0.5rem;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
}

.mstep.is-done .mstep__dot {
  background: var(--slate);
  border-color: var(--slate);
}

.mstep[aria-current="step"] {
  color: var(--espresso);
  font-weight: 700;
}

.mstep[aria-current="step"] .mstep__dot {
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.modal__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.tstep { min-height: 0; }

.tstep__title {
  margin: 0 0 0.875rem;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
}

/* ---------- Time slots ---------- */

.slots__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}

.slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0 0.5rem;
  font-family: var(--display);
  font-size: var(--control-font);
  color: var(--espresso);
  background: var(--cream-raised);
  border: var(--control-border) solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}

.slot:hover { border-color: var(--burgundy); }

.slot.is-selected {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--cream);
}

/* ---------- Footer ---------- */

.footer {
  background: var(--espresso);
  color: var(--cream);
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  max-width: 88rem;
  margin-inline: auto;
}

.footer__addr {
  margin: 0;
  line-height: 1.7;
}

.footer__managed {
  display: inline-block;
  margin-top: 0.625rem;
  font-family: var(--display);
  font-size: 0.8125rem;
  color: rgba(250, 233, 205, 0.7);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--display);
}

.footer__links a {
  color: var(--cream);
  text-decoration-color: rgba(250, 233, 205, 0.45);
  text-underline-offset: 4px;
}
.footer__links a:hover { text-decoration-color: var(--cream); }

.footer :focus-visible { outline-color: var(--cream); }

/* ---------- Narrow screens ---------- */

@media (max-width: 62rem) {
  /* Headline first on a narrow screen — the drawing is support, not the lead. */
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .plan { max-width: 20rem; justify-self: start; }

  /* Photo above its details once the slide collapses. */
  .unit {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .controls { flex-wrap: wrap; }

  .howto { grid-template-columns: 1fr; gap: 2rem; }
}


@media (max-width: 52rem) {
  .navtoggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 0;
    padding: 0.375rem 0;
    cursor: pointer;
    color: var(--espresso);
    font-family: var(--display);
    font-size: 0.9375rem;
  }

  .navtoggle__bars,
  .navtoggle__bars::before,
  .navtoggle__bars::after {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--espresso);
  }
  .navtoggle__bars {
    position: relative;
  }
  .navtoggle__bars::before,
  .navtoggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .navtoggle__bars::before { top: -6px; }
  .navtoggle__bars::after { top: 6px; }

  .topbar {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  /* 72px of logo is most of a phone's header. */
  .brand__logo { height: 3rem; }

  /* Comfortable thumb targets. */
  .navtoggle { padding: 0.625rem 0; }
  .vbtn { width: 2.75rem; height: 2.75rem; }
  .nav__list a { display: inline-block; padding-block: 0.25rem; }

  /* Collapsed only once app.js has claimed the nav, so it stays reachable
     if the script never loads. */
  .nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 0 0.5rem;
  }
  .nav[data-open="false"] { display: none; }

  .nav__list {
    flex-direction: column;
    gap: 0.875rem;
    font-size: 1.0625rem;
  }

  .nav__actions {
    flex-wrap: wrap;
    gap: 1rem;
  }
}

/* Multi-column form rows get cramped well before phone width. */
@media (max-width: 40rem) {
  .row,
  .row--three { grid-template-columns: 1fr; gap: 0; }
  .uploads { grid-template-columns: 1fr; }
  .uploads .field { margin-bottom: 1.25rem; }

  .summary { padding: 1.125rem; }

  /* There is no Enter key worth mentioning on a soft keyboard. */
  .apply__kbd { display: none; }

  .apply__nav {
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }
  .apply__nav .btn { flex: 1 1 100%; text-align: center; }
  .apply__nav [data-back] { order: 2; }

  /* Let the bar breathe, and keep the question clear of it. */
  .progress__meta { margin-bottom: 0.875rem; }
  .progress__track { height: 4px; }

  .q {
    min-height: 0;
    padding-top: 2.75rem;
  }
  .q__title {
    margin-bottom: 1.5rem;
    line-height: 1.12;
  }
  .field { margin-bottom: 1rem; }

  /* Clear of the floating browser toolbar on iOS. */
  .footer { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }

  /* A floating box on a phone wastes the screen and crams the calendar.
     Full-height sheet instead, using dvh so browser chrome cannot clip it. */
  .modal {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .modal__head,
  .modal__body,
  .modal__foot,
  .modal__progress { padding-inline: 1.125rem; }

  .msteps { gap: 1rem; }

  .modal__foot { max-height: 60%; }

  .modal__actions { gap: 0.625rem; }
  .modal__actions .btn { flex: 1 1 100%; text-align: center; }

  /* Wider cells now that the sheet is full width. */
  .cal__day { font-size: 1rem; }
  .cal__dow,
  .cal__grid { gap: 0.3125rem; }

  .slots__list { grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); }

  .summary__edit { padding: 0.375rem 0; }
}

@media (max-width: 30rem) {
  .brand__logo { height: 2.625rem; }

  .hero__actions .btn,
  .band__actions .btn,
  .unit__actions .btn { flex: 1 1 100%; text-align: center; }

  .specs { grid-template-columns: 1fr; gap: 0.125rem; }
  .specs dt { padding-top: 0.75rem; }

  .finder { gap: 1.25rem; }
  .finder > * { flex-basis: 100%; }

  .summary__list { grid-template-columns: 1fr; gap: 0.125rem; }
  .summary__list dt { padding-top: 0.75rem; }
}
