@layer components {
  /* ── One-question wizard (evolution §1) ─────────────────────────────
     One paper sheet over the landscape, a thin ink progress line, the
     question in display type, fat option cards, Back as underlined
     text left / ink Next pill right. No color beyond ink — procedure,
     not commitment (Law 2). */

  .wizard-card { max-width: 640px; }

  .wizard-progress {
    height: 3px;
    background: var(--hover-edge);
    margin-bottom: var(--space-6);
  }
  .wizard-progress span {
    display: block;
    height: 100%;
    background: var(--ink);
    transition: width 0.3s ease;
  }

  .wizard-card h1.wizard-question {
    font-family: var(--display);
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: var(--space-2);
  }
  .wizard-because {
    color: var(--ink-soft);
    margin-bottom: var(--space-5);
  }

  .wizard-field { margin: var(--space-5) 0; }
  .wizard-input { width: 100%; font-size: 17px; padding: 14px 16px; }

  /* Fat option cards — radio hidden, the label is the whole target. */
  .wizard-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: var(--space-5) 0;
  }
  .wizard-option { position: relative; }
  .wizard-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .wizard-option label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--hover-edge);
    border-radius: var(--radius-xs);
    padding: 20px 22px;
    font-size: 16px;
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .wizard-option label:hover { border-color: var(--ink-faint); }
  .wizard-option input:checked + label {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
  }
  .wizard-option input:focus-visible + label {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .wizard-option-code {
    font-size: 12px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    color: var(--ink-faint);
  }

  /* Two-up grid for short options (pronouns). */
  .wizard-options--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  /* Photo step — current photo as a square, the picker as an outline pill. */
  .wizard-photo { display: flex; align-items: center; gap: var(--space-4); }
  .wizard-photo-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius-xs);
  }
  /* Native file input, dressed: the browser button is the target and its
     filename readout is the no-JS proof a file was picked. */
  .wizard-photo input[type="file"] { font-size: 14px; color: var(--ink-soft); }
  .wizard-photo input[type="file"]::file-selector-button {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: var(--weight-semibold);
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: var(--radius-xs);
    padding: 12px 20px;
    margin-right: var(--space-3);
    cursor: pointer;
  }
  .wizard-photo input[type="file"]::file-selector-button:hover {
    background: var(--ink);
    color: var(--paper);
  }

  .wizard-alert {
    color: var(--required, #b3261e);
    font-size: 14px;
    margin-bottom: var(--space-4);
  }

  /* Review screen — the D1 row grammar wearing the wizard sheet. */
  .wizard-review { margin: var(--space-5) 0 0; }
  .wizard-review .g-row { align-items: center; }

  /* ── Travel review as a card / itinerary (Jul 23) ─────────────── */
  .trip-days {
    display: flex; align-items: baseline; gap: 10px;
    margin: var(--space-5) 0 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--hover-edge);
    text-decoration: none; color: inherit;
  }
  .trip-days-label {
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-faint); font-weight: var(--weight-semibold);
  }
  .trip-days-value { color: var(--ink); font-size: 15px; }
  .trip-days-change { margin-left: auto; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

  .trip-card {
    border: 1px solid var(--hover-edge); border-radius: 8px;
    margin-bottom: 14px; overflow: hidden;
  }
  .trip-card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--hover-edge);
  }
  .trip-card-glyph { flex: none; display: grid; place-items: center; opacity: .75; }
  .trip-card-glyph svg { width: 20px; height: 20px; }
  .trip-card-heading { min-width: 0; }
  .trip-card-eyebrow {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink-faint); font-weight: var(--weight-semibold);
  }
  .trip-card-mode { color: var(--ink); font-family: var(--display); font-size: 17px; line-height: 1.25; margin-top: 2px; }
  .trip-card-change { margin-left: auto; flex: none; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

  .trip-lines { margin: 0; }
  .trip-line {
    display: flex; align-items: baseline; gap: 12px;
    padding: 11px 16px; text-decoration: none; color: inherit;
    border-top: 1px solid var(--hover-edge);
  }
  .trip-lines .trip-line:first-child { border-top: none; }
  .trip-line:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .trip-line-label {
    flex: none; width: 92px; margin: 0;
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-faint); font-weight: var(--weight-semibold);
  }
  .trip-line-value { margin: 0; flex: 1 1 auto; color: var(--ink); font-size: 15px; min-width: 0; }
  .trip-line-change { flex: none; font-size: 12px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
  .wizard-review-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    flex: none;
  }
  .wizard-note {
    color: var(--ink-faint);
    font-size: 14px;
    line-height: 1.5;
    margin-top: var(--space-4);
  }

  .wizard-aside { font-size: 14px; margin-top: var(--space-3); }
  .wizard-aside a { color: var(--ink-soft); }
  .wizard-aside a:hover { color: var(--ink); }

  .wizard-actions {
    margin-top: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
  }

  /* THE EXCEPTION, FOLDED AWAY (Elisa, Aug 31). Most guests sleep here for
     exactly as long as they are here, so the second date question sits behind
     a disclosure rather than on the step. Quieter than the question above it
     in every way — smaller, softer, no border — because opening it should
     feel like a footnote, not a second form. */
  .wizard-aside {
    margin: var(--space-4) 0 0;
    border-top: 1px solid var(--paper-edge);
    padding-top: var(--space-3);
  }
  .wizard-aside-summary {
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    list-style: none;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .wizard-aside-summary::-webkit-details-marker { display: none; }
  .wizard-aside-summary:hover { color: var(--ink); }
  .wizard-aside-note {
    margin: var(--space-3) 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-faint);
  }
  .wizard-aside-note .btn-quiet { font-size: 13px; opacity: .75; }
  .wizard-aside-note .btn-quiet:hover { opacity: 1; }

  /* THE WAY BACK OUT (Neal, Aug 26). Under the actions, not among them:
     it undoes the whole step rather than moving through it, and it should
     never sit at the same weight as Next. */
  .wizard-undo {
    margin: var(--space-4) 0 0;
    text-align: center;
  }
  .wizard-undo .btn-quiet {
    font-size: 13px;
    opacity: .75;
  }
  .wizard-undo .btn-quiet:hover { opacity: 1; }

  /* Save & exit — quiet outline pill in the chrome, always present. */
  .wizard-exit {
    font-size: 13px;
    font-weight: var(--weight-semibold);
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--hover-edge);
    border-radius: 999px;
    padding: 8px 16px;
    background: var(--paper);
    transition: border-color 0.15s ease;
  }
  .wizard-exit:hover { border-color: var(--ink); text-decoration: none; }

  @media (max-width: 640px) {
    .wizard-card h1.wizard-question { font-size: 27px; }
    .wizard-option label { padding: 16px 18px; }
  }
}

/* The paste door — quiet under the actions until it's wanted. */
@layer components {
  .wizard-paste { margin-top: 26px; }
  .wizard-paste summary {
    cursor: pointer;
    color: var(--ink-faint);
    font-size: 13.5px;
  }
  .wizard-paste summary:hover { color: var(--ink-soft); }
  .wizard-paste form { margin-top: 12px; }
  .wizard-paste textarea { width: 100%; font-size: 13.5px; }
}
