#intake {
  --surface: #fff;
  --soft: var(--mint);
  --accent: var(--green);
  --accent-hover: #1d376f;
  --edge: #a3b5d7;
  --warn: #a53934;
  min-height: 100vh;
  background: var(--white);
}

#intake :is(button, input, select, textarea) {
  font: inherit;
}

#intake :is(button, summary) {
  cursor: pointer;
}

#intake .layout {
  display: grid;
  grid-template-columns: 215px minmax(0,760px);
  gap: 42px;
  max-width: 1120px;
  margin: auto;
  padding: 52px 32px 120px;
}

#intake .sidebar {
  align-self: start;
  position: sticky;
  top: 28px;
}

#intake .sidebar h2 {
  margin: 0 0 13px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--muted);
}

#intake .rail {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

#intake .rail button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  min-height: 44px;
}

#intake .rail button[aria-current=step] {
  background: var(--soft);
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

#intake .rail button:hover {
  background: var(--soft);
}

#intake .rail .done {
  color: var(--ink);
}

#intake main {
  min-width: 0;
}

#intake .step {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(22px,5vw,49px);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

#intake .step.on {
  display: block;
}

#intake .step h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.3;
}

#intake .step h3 {
  margin: 2rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.16rem;
}

#intake .lead {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
}

#intake .sidebar small {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
}

#intake .q {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

#intake .q:last-child {
  border-bottom: 0;
}

#intake fieldset.q {
  min-inline-size: 0;
}

#intake .ql {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
}

#intake .no {
  color: var(--accent);
  margin-right: 8px;
  font-size: .88rem;
}

#intake .tag, #intake .note, #intake .units, #intake .scale-ends, #intake .week label {
  font-size: .9rem;
  color: var(--muted);
}

#intake .tag {
  margin-left: 7px;
}

#intake .note {
  margin: 0 0 10px;
}

#intake .units {
  margin: 5px 0 12px;
  padding-left: 20px;
}

#intake input[type=text], #intake input[type=tel], #intake select, #intake textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 10px 12px;
  min-height: 46px;
  color: var(--ink);
  background: var(--surface);
}

#intake textarea {
  min-height: 105px;
  resize: vertical;
}

#intake input[type=checkbox], #intake input[type=radio] {
  accent-color: var(--accent);
}

#intake .opts {
  display: grid;
  gap: 3px;
}

#intake .opt {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 9px 11px;
  cursor: pointer;
  min-height: 43px;
}

#intake .opt input {
  margin: 4px 0 0;
  width: 18px;
  height: 18px;
  flex: none;
}

#intake .opt:hover, #intake .opt:has(input:checked) {
  background: var(--soft);
  border-color: var(--line);
}

#intake .etc {
  margin-top: 10px;
}

#intake .scale {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 5px;
  max-width: 420px;
}

#intake .pill, #intake .chip {
  position: relative;
}

#intake .pill input, #intake .chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#intake .pill span, #intake .chip span {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: 5px;
}

#intake .pill span {
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

#intake .pill input:checked+span, #intake .chip input:checked+span {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 600;
}

#intake .pill input:focus-visible+span, #intake .chip input:focus-visible+span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#intake .scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 420px;
  margin-top: 5px;
}

#intake .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#intake .chip span {
  padding: 6px 12px;
  gap: 6px;
}

#intake .chip small {
  color: var(--muted);
}

#intake .week {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 9px;
}

#intake .week input {
  margin-top: 3px;
}

#intake .box {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 16px 18px;
  margin: 0 0 18px;
  font-size: .95rem;
}

#intake .box h3 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}

#intake .box p {
  margin: 0 0 10px;
}

#intake .box label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-weight: 600;
}

#intake .box input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 4px 0 0;
}

#intake .nav {
  position: fixed;
  inset: auto 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 11px max(16px,4vw) max(11px,env(safe-area-inset-bottom));
}

#intake .nav-in {
  max-width: 1056px;
  margin: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

#intake .count {
  color: var(--muted);
  font-size: 14px;
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

#intake .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
}

#intake .btn:hover {
  background: var(--soft);
}

#intake .btn.pri {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#intake .warn, #intake .req {
  color: var(--warn);
}

#intake .req {
  margin-left: 3px;
}

#intake .status {
  color: var(--accent);
  margin: 10px 0;
  font-weight: 600;
}

#intake .status:empty {
  display: none;
}

#intake .link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

#intake .basics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

#intake .basics fieldset {
  grid-column: 1/-1;
}

#intake .basics .q {
  border: 0;
}

#intake .back-link {
  margin: 0 0 14px;
}

#intake .consent-details {
  font-size: .92rem;
  color: var(--muted);
  margin: 8px 0;
}

#intake .consent-details p {
  margin: 8px 0;
}

#intake .consent-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 13px 0 15px;
}

#intake .consent-label input {
  width: 18px;
  height: 18px;
  flex: none;
}

#intake .draft-note, #intake .application-actions span {
  font-size: .9rem;
  color: var(--muted);
}

#intake .application-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#intake[data-step="1"] .layout,
#intake[data-step="5"] .layout {
  display: block;
  max-width: 760px;
  padding-bottom: 56px;
}

#intake:is([data-step="1"], [data-step="5"]) :is(.sidebar, .nav) {
  display: none;
}

#intake .consent-details a, #review-evidence:hover {
  text-decoration: underline;
}

#intake .nav {
  z-index: 2;
}

#intake .btn.pri:hover {
  background: var(--accent-hover);
}

#intake select {
  appearance: none;
  padding-right: 2.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

[data-config-link][aria-disabled="true"] {
  display: none !important;
}

.configured-review {
  color: var(--green);
  text-decoration: underline;
}

#boards-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: 90dvh;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 50px #101c3c38;
}

#boards-dialog::backdrop {
  background: #101c3cb8;
}

.gallery-heading, .board-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.gallery-heading {
  margin-bottom: 1rem;
}

.gallery-heading h2 {
  font-size: 1.35rem;
}

#boards-dialog button {
  padding: 0.4rem 0.9rem;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--mint);
  cursor: pointer;
}

#boards-dialog button:disabled {
  opacity: 0.45;
  cursor: default;
}

.board-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.board-track figure {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.board-track img {
  display: block;
  width: 100%;
  height: min(50dvh, 27rem);
  object-fit: contain;
  background: var(--mint);
  border-radius: 8px;
}

.board-track figcaption, .board-count {
  color: var(--muted);
  font-size: 0.95rem;
}

.board-track figcaption {
  padding: 0.65rem 0;
}

@media (max-width: 760px) {
  #intake .layout {
    display: block;
    padding: 0 0 100px;
  }

  #intake .sidebar {
    position: static;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  #intake .sidebar h2, #intake .sidebar small {
    display: none;
  }

  #intake .rail {
    display: flex;
    overflow: auto;
    border: 0;
  }

  #intake .rail li {
    flex: none;
  }

  #intake .rail button {
    padding: 10px 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  #intake .rail button[aria-current="step"] {
    border-bottom-color: var(--accent);
    background: transparent;
  }

  #intake main {
    padding: 16px;
  }

  #intake .step {
    padding: 23px 18px;
  }

  #intake .basics {
    display: block;
  }

  #intake .week {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
