/* The app kit: the layout and the parts brand.css has no copy of (field,
   switch, segmented control, progress bar, pending and optimistic states).
   No tokens of its own: every colour, size and edge is a --sw-* token from
   brand.css. Layout measures come from the prototype's intake (46rem
   column, 44px targets, 56px big buttons, reserved message line) and
   plans/05 → Mobile and look: designed at 375px, then widened. */

@layer layout {
  /* --- Shell: header, one main column ------------------------------- */
  .app { display: grid; grid-template-rows: auto 1fr; min-block-size: 100vh; min-block-size: 100dvh; }
  .app__head {
    background: var(--sw-surface);
    border-block-end: var(--sw-rule-heavy) solid var(--sw-rule);
  }
  .app__headin {
    display: flex; align-items: center; gap: var(--sw-s3);
    max-inline-size: var(--sw-page); margin-inline: auto;
    min-block-size: 64px; padding-inline: var(--sw-s3);
  }
  .app__spacer { flex: 1; }
  .app__main {
    inline-size: 100%; max-inline-size: calc(46rem + 2 * var(--sw-s3)); margin-inline: auto;
    padding: var(--sw-s4) var(--sw-s3) var(--sw-s6);
    display: grid; gap: var(--sw-s4); align-content: start;
  }
  .app__main--wide { max-inline-size: calc(var(--sw-page) + 2 * var(--sw-s3)); }
  @media (min-width: 48rem) {
    .app__headin { padding-inline: var(--sw-s4); }
    .app__main { padding: var(--sw-s5) var(--sw-s4) var(--sw-s7); max-inline-size: calc(46rem + 2 * var(--sw-s4)); }
    .app__main--wide { max-inline-size: calc(var(--sw-page) + 2 * var(--sw-s4)); }
  }

  /* The SQUAREWELL lockup from the landing page. The -dark file shows in
     dark mode, by system setting or by data-theme, without <picture> so a
     forced theme swaps it too. */
  .wordmark { display: inline-flex; align-items: center; min-block-size: 44px; }
  .wordmark img { display: block; inline-size: 132px; block-size: auto; }
  .wordmark .wordmark__dark { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .wordmark .wordmark__light { display: none; }
    :root:not([data-theme="light"]) .wordmark .wordmark__dark { display: block; }
  }
  :root[data-theme="dark"] .wordmark .wordmark__light { display: none; }
  :root[data-theme="dark"] .wordmark .wordmark__dark { display: block; }

  .stack { display: grid; gap: var(--sw-s3); align-content: start; min-inline-size: 0; }
  .stack-lg { display: grid; gap: var(--sw-s4); align-content: start; min-inline-size: 0; }
  /* A list kept as a list for screen readers but drawn without bullets. */
  ul[role="list"], ol[role="list"] { margin: 0; padding: 0; list-style: none; }
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sw-s2) var(--sw-s3); }

  /* The primary action at the foot of a ticket, under its dashed tear
     line (plans/05). Buttons stretch on phones. */
  .actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sw-s2) var(--sw-s3);
    border-block-start: 2px dashed var(--sw-line);
    padding-block-start: var(--sw-s3); margin-block-start: var(--sw-s1);
  }
  .actions > .btn { flex: 1 1 100%; }
  @media (min-width: 40.01rem) {
    .actions > .btn { flex: 0 0 auto; min-inline-size: 10rem; }
  }
}

@layer components {
  /* --- Buttons: what the intake added to brand.css's .btn ----------- */
  .btn--big { min-block-size: 56px; padding-inline: 32px; font-size: 1rem; }
  .btn--full { inline-size: 100%; }

  /* --- Card head ------------------------------------------------------ */
  .card__head { display: grid; gap: var(--sw-s1); margin-block-end: var(--sw-s3); }
  .card__body { display: grid; gap: var(--sw-s3); }

  /* --- Field: label, control, then a message line that is always there,
     so a problem coming or going moves nothing ------------------------- */
  .field { display: grid; gap: 6px; align-content: start; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
  .field__label { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; padding: 0; }
  .field__opt { margin-inline-start: 6px; font-size: var(--sw-t-small); font-weight: 500; color: var(--sw-muted); }
  .field__msg { margin: 0; min-block-size: 1.25rem; font-size: var(--sw-t-small); line-height: 1.43; color: var(--sw-muted); }
  .field__msg--err { color: var(--sw-err); font-weight: 600; }
  .field textarea { resize: vertical; min-block-size: 6rem; }

  /* --- Switch: the Theme tab's square toggle -------------------------- */
  .switch { display: flex; align-items: center; gap: 12px; min-block-size: 48px; cursor: pointer; inline-size: fit-content; max-inline-size: 100%; }
  .switch__text { display: grid; gap: 2px; font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }
  .switch__hint { font-weight: 400; font-size: var(--sw-t-small); color: var(--sw-muted); }
  .switch input {
    appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0;
    inline-size: 44px; block-size: 24px;
    border: var(--sw-border) solid var(--sw-rule); border-radius: var(--sw-radius);
    background: var(--sw-bg); cursor: pointer; transition: background-color 150ms;
  }
  .switch input::after {
    content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px;
    inline-size: 16px; block-size: 16px; background: var(--sw-text); transition: translate 150ms;
  }
  .switch input:checked { background: var(--sw-primary); border-color: var(--sw-primary-edge); }
  .switch input:checked::after { translate: 20px 0; background: var(--sw-white); }
  .switch input:disabled { opacity: 0.6; cursor: not-allowed; }

  /* --- Segmented control: an inked track, the chosen segment ink ------ */
  .seg { display: grid; gap: 6px; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
  .seg__track {
    display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px;
    inline-size: fit-content; max-inline-size: 100%;
    background: var(--sw-surface-2); border: var(--sw-border) solid var(--sw-text);
  }
  .seg__opt {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-block-size: 48px; padding: 0 14px; cursor: pointer; white-space: nowrap;
    color: var(--sw-muted); font-weight: 600; font-size: var(--sw-t-small);
  }
  @media (hover: hover) { .seg__opt:hover { color: var(--sw-text); background: var(--sw-surface); } }
  .seg__opt input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; }
  .seg__opt:has(input:checked) { background: var(--sw-text); color: var(--sw-bg); }
  .seg__opt:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; box-shadow: var(--sw-focus-ring); }

  /* --- Progress: one segment per step; done ink, now yellow ----------- */
  .progress { display: grid; gap: 8px; margin: 0; }
  .progress__line { display: flex; justify-content: space-between; align-items: baseline; gap: 0 var(--sw-s2); margin: 0; font-size: var(--sw-t-small); color: var(--sw-muted); }
  .progress__label { font-weight: 600; color: var(--sw-text); min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress__track { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }
  .progress__seg { flex: 1; block-size: 6px; background: var(--sw-line); }
  .progress__seg--done { background: var(--sw-text); }
  .progress__seg--now { background: var(--sw-yellow); box-shadow: inset 0 0 0 1px var(--sw-ink); }

  /* --- A send on its way (app.js): spinner, dimmed card --------------- */
  .sw-spin {
    display: inline-block; flex: none; inline-size: 14px; block-size: 14px; vertical-align: -2px;
    border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%;
    animation: sw-spin 0.8s linear infinite;
  }
  @keyframes sw-spin { to { rotate: 1turn; } }
  .is-pending { opacity: 0.72; transition: opacity var(--sw-fast) ease-out; }
  [aria-busy="true"] { cursor: progress; }

  /* --- Optimistic rows (app.js): shown at once, filled by the server -- */
  .is-optimistic { opacity: 0.72; }
  .is-failed { opacity: 1; }
  .optimistic__msg { margin: 0; font-size: var(--sw-t-small); font-weight: 600; color: var(--sw-err); }

  /* --- The owner flow's choices (plans/05, screens 2 to 7) ---------- */
  /* Tiles: big square choices, a radio or a checkbox inside. A picked
     tile is framed cobalt with a check (action); a toggle that is on
     turns yellow (on). */
  .tiles { display: grid; gap: var(--sw-s2); min-inline-size: 0; margin: 0; padding: 0; border: 0; }
  .tiles > legend { margin-block-end: var(--sw-s2); }
  .tiles:empty { display: none; }
  .tiles__more { margin-block-start: var(--sw-s2); }
  @media (min-width: 40.01rem) { .tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles--2 > legend { grid-column: 1 / -1; } }
  .tile {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-block-size: 56px; padding: 10px 14px;
    border: var(--sw-border) solid var(--sw-text); border-radius: var(--sw-radius);
    background: var(--sw-surface); cursor: pointer; font-weight: 600; line-height: 1.3;
    transition: background-color var(--sw-fast), box-shadow var(--sw-fast);
  }
  @media (hover: hover) { .tile:hover { box-shadow: var(--sw-lift); } }
  .tile--big { min-block-size: 72px; font-size: 1.125rem; }
  .tile input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .tile__body { display: grid; gap: 6px; flex: 1; min-inline-size: 0; }
  .tile__label { overflow-wrap: anywhere; }
  .tile__mark {
    flex: none; display: grid; place-items: center; inline-size: 24px; block-size: 24px;
    border: var(--sw-border) solid var(--sw-text); background: var(--sw-bg);
  }
  .tile:has(input:checked) { border-color: var(--sw-primary); box-shadow: inset 0 0 0 2px var(--sw-primary); background: var(--sw-primary-soft); }
  .tile:has(input:checked) .tile__mark { background: var(--sw-primary); border-color: var(--sw-primary-edge); }
  .tile:has(input:checked) .tile__mark::after {
    content: ""; inline-size: 12px; block-size: 7px; translate: 0 -2px; rotate: -45deg;
    border-inline-start: 3px solid var(--sw-white); border-block-end: 3px solid var(--sw-white);
  }
  .tile:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; box-shadow: var(--sw-focus-ring); }
  /* Pick one of a group (screen 2's type): a round radio mark with a dot,
     so it never reads as "tick several". */
  .tile--radio .tile__mark { border-radius: 50%; }
  .tile--radio:has(input:checked) .tile__mark::after {
    inline-size: 10px; block-size: 10px; translate: none; rotate: none;
    border: 0; border-radius: 50%; background: var(--sw-white);
  }
  .tile--toggle:has(input:checked) { border-color: var(--sw-ink); box-shadow: none; background: var(--sw-yellow); color: var(--sw-ink); }
  .tile--toggle:has(input:checked) .tile__mark { background: var(--sw-ink); border-color: var(--sw-ink); }
  .tile--toggle:has(input:checked) .chip { background: var(--sw-white); color: var(--sw-ink); }
  .tile--toggle:has(input:checked) .quote { color: var(--sw-ink); }
  .quote { font-size: var(--sw-t-small); font-weight: 400; font-style: italic; color: var(--sw-muted); overflow-wrap: anywhere; }

  /* Picks: tap-to-add chips, 44px tall, a plus that becomes a check */
  .picks { display: flex; flex-wrap: wrap; gap: var(--sw-s2); }
  .pick {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    min-block-size: 48px; padding: 0 14px; cursor: pointer;
    border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface);
    font-size: var(--sw-t-small); font-weight: 600;
  }
  .pick input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .pick::before { content: "+"; font-weight: 800; font-size: 1rem; line-height: 1; }
  .pick:has(input:checked) { background: var(--sw-yellow); color: var(--sw-ink); border-color: var(--sw-ink); }
  .pick:has(input:checked)::before { content: "\2713"; }
  .pick:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; box-shadow: var(--sw-focus-ring); }

  /* Rows: one service or town each, inked box. Turning Keep off dims
     the row and strikes its name until the save, so Undo is a tap. */
  .rowlist { display: grid; gap: var(--sw-s3); margin: 0; padding: 0; list-style: none; }
  .item { display: grid; gap: var(--sw-s2); padding: var(--sw-s3); border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); min-inline-size: 0; }
  .item--new { border-color: var(--sw-primary); }
  .item__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sw-s2) var(--sw-s3); }
  .item__name { display: grid; gap: 6px; flex: 1 1 8rem; min-inline-size: 0; }
  .item__name h3 { overflow-wrap: anywhere; }
  .item__src { display: flex; flex-wrap: wrap; gap: 6px; }
  .item__aka { font-size: var(--sw-t-small); color: var(--sw-muted); overflow-wrap: anywhere; }
  .item:has(.keep input:not(:checked)) { border-style: dashed; border-color: var(--sw-faint); background: transparent; }
  .item:has(.keep input:not(:checked)) .item__more { display: none; }
  .item:has(.keep input:not(:checked)) h3 { color: var(--sw-muted); text-decoration: line-through; }
  .keep { display: inline-flex; align-items: center; gap: 10px; min-block-size: 48px; cursor: pointer; font-weight: 600; font-size: var(--sw-t-small); }
  .keep input {
    appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0;
    inline-size: 44px; block-size: 24px; border: var(--sw-border) solid var(--sw-rule); background: var(--sw-bg); cursor: pointer;
  }
  .keep input::after { content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; inline-size: 16px; block-size: 16px; background: var(--sw-text); transition: translate 150ms; }
  .keep input:checked { background: var(--sw-primary); border-color: var(--sw-primary-edge); }
  .keep input:checked::after { translate: 20px 0; background: var(--sw-white); }
  .keep input:focus-visible { outline: var(--sw-focus-outline); outline-offset: 3px; box-shadow: var(--sw-focus-ring); }
  .keep__off { display: none; color: var(--sw-muted); }
  .keep:has(input:not(:checked)) .keep__on { display: none; }
  .keep:has(input:not(:checked)) .keep__off { display: inline; }

  /* The "Want more" star and "Own page": a square toggle, yellow when on */
  .star {
    position: relative; display: inline-flex; align-items: center; gap: 8px; inline-size: fit-content; max-inline-size: 100%;
    min-block-size: 48px; padding: 0 14px; cursor: pointer;
    border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); font-weight: 600; font-size: var(--sw-t-small);
  }
  .star input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .star span { font-size: 1.125rem; line-height: 1; color: var(--sw-faint); }
  .star:has(input:checked) { background: var(--sw-yellow); color: var(--sw-ink); border-color: var(--sw-ink); }
  .star:has(input:checked) span { color: var(--sw-ink); }
  .star:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; box-shadow: var(--sw-focus-ring); }

  /* One-line rows (screens 3 and 4, UX round 1): the name on the left,
     the star and Keep on the right; a service's pricing folds under
     "Change pricing", whose summary names the model picked. */
  .rowlist--tight { gap: var(--sw-s2); }
  .is-filtered { display: none !important; }
  .item--row { gap: 2px; padding: var(--sw-s2) var(--sw-s3); }
  .item__acts { display: flex; flex: none; align-items: center; gap: var(--sw-s2); }
  .star--icon { inline-size: 48px; padding: 0; justify-content: center; }
  /* UX round 2: at 375px the name had about 100px and broke mid-word
     ("Remodelin / g"). The name takes the first column and wraps only
     between words; its small lines, chips and "Removed · Undo" run the
     full width under it, and the star and Keep keep one width. */
  .item--row .item__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px var(--sw-s2); }
  .item--row .item__name { display: contents; }
  .item--row .item__name > * { grid-column: 1 / -1; }
  .item--row .item__name > h3, .item--row .item__name > .field { grid-column: 1; grid-row: 1; }
  .item--row .item__acts { grid-column: 2; grid-row: 1; }
  .item--row .item__name h3 { overflow-wrap: normal; word-break: normal; hyphens: manual; }
  .item--row .item__aka { overflow-wrap: break-word; }
  .item__gone { display: none; inline-size: fit-content; min-block-size: 44px; align-items: center; gap: 6px; cursor: pointer; font-size: var(--sw-t-small); color: var(--sw-muted); }
  .item:has(.keep input:not(:checked)) .item__gone { display: inline-flex; }
  .item:has(.keep input:checked) .item__off { display: none; }
  /* A county with no row left (all filtered) shows no heading */
  .towngroup:not(:has(.item:not(.is-filtered))) { display: none; }
  /* The home page's title, one plain line at the top of screen 3 */
  .headline { margin: 0; font-size: var(--sw-t-small); }
  .headline a { font-weight: 600; }
  /* Phones: the ticket's side padding shrinks and the rows lose their
     own box (rules between them), so a row is not a card in a card. */
  @media (max-width: 40rem) {
    .ticket:has(.rowlist--tight) { padding-inline: calc(var(--sw-s2) + var(--sw-s1)); }
    .rowlist--tight { gap: 0; }
    .rowlist--tight > .item--row { padding-inline: 0; border-inline-width: 0; border-block-start-width: 0; border-block-end: 1px solid var(--sw-line); background: transparent; }
    .rowlist--tight > .item--row:has(.keep input:not(:checked)) { border-block-end: 1px dashed var(--sw-faint); }
  }
  .tally { margin: 0; font-size: var(--sw-t-small); font-weight: 600; }
  .item__pricing > summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-block-size: 44px; list-style: none; cursor: pointer;
    font-size: var(--sw-t-small); color: var(--sw-muted);
  }
  .item__pricing > summary::-webkit-details-marker { display: none; }
  .item__pricing > summary:focus-visible { outline: var(--sw-focus-outline); outline-offset: 2px; }
  .item__change { color: var(--sw-link); font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; }
  .item__pricing[open] > summary { margin-block-end: var(--sw-s2); }
  .pm { display: none; }
  .item:has(.item__model input[value="call"]:checked) .pm--call,
  .item:has(.item__model input[value="estimate"]:checked) .pm--estimate,
  .item:has(.item__model input[value="price"]:checked) .pm--price { display: inline; }
  .item:has(.keep input:not(:checked)) .item__pricing { display: none; }
  form:has(#all_estimate:checked) .item__pricing { display: none; }

  /* The pricing model: segments that wrap their words on phones, and
     only the details of the model picked show (no JS needed) */
  .item__model .seg__track { inline-size: 100%; }
  .item__model .seg__opt { white-space: normal; text-align: center; line-height: 1.2; padding: 6px 8px; }
  .item__price > summary { list-style: none; inline-size: fit-content; }
  .item__price > summary::-webkit-details-marker { display: none; }
  .item__price[open] > summary { margin-block-end: var(--sw-s3); }
  /* The star and "Price details" share a line; open details take the
     full width under the star */
  .item__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sw-s2) var(--sw-s3); min-inline-size: 0; }
  .item__foot > .item__price { min-inline-size: 0; }
  .item__foot > .item__price[open] { flex-basis: 100%; }
  .item__price > summary { min-block-size: 48px; }
  .price { display: none; }
  .item:has(.item__model input[value="call"]:checked) .price--call,
  .item:has(.item__model input[value="estimate"]:checked) .price--estimate,
  .item:has(.item__model input[value="price"]:checked) .price--price { display: grid; }
  .pair { display: grid; gap: var(--sw-s2) var(--sw-s3); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .radio { display: inline-flex; align-items: center; gap: 8px; min-block-size: 48px; font-weight: 600; font-size: 0.9375rem; cursor: pointer; }
  /* Screen 4: towns by county, and the one line for states and the
     home base with "Change" (UX round 1) */
  .towngroup { display: grid; gap: var(--sw-s2); }
  .where > summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-block-size: 44px; list-style: none; cursor: pointer; font-weight: 600;
  }
  .where > summary::-webkit-details-marker { display: none; }
  .where > summary:focus-visible { outline: var(--sw-focus-outline); outline-offset: 2px; }
  .where[open] > summary { margin-block-end: var(--sw-s2); }
  .where__states { display: grid; gap: var(--sw-s2) var(--sw-s3); grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }

  /* The receipt (screen 5): one row per fact, a dashed tear between */
  .receipt { display: grid; margin: 0; padding: 0; list-style: none; }
  .receipt__row:first-child { padding-block-start: 0; }
  .receipt__row { display: grid; gap: var(--sw-s2); padding-block: var(--sw-s3); border-block-end: 2px dashed var(--sw-line); min-inline-size: 0; }
  .receipt__row:last-child { border-block-end: 0; }
  .receipt__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sw-s2); }
  .receipt__label { font-size: var(--sw-t-tag); font-weight: 600; letter-spacing: var(--sw-track-tag); text-transform: uppercase; color: var(--sw-muted); }
  .receipt__value { font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }
  .change > summary { list-style: none; inline-size: fit-content; }
  .change > summary::-webkit-details-marker { display: none; }
  .change[open] > summary { margin-block-end: var(--sw-s2); }

  /* Hours: the days show under Set my hours (prefilled with the found
     hours), so a picked preset stays one tap */
  .days { display: none; padding: var(--sw-s3) 0 0; }
  .hours:has(input[value="custom"]:checked) .days { display: grid; }
  .day { display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }
  .day input[type="time"] { font-size: var(--sw-t-small); font-variant-numeric: tabular-nums; }
  .day input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  .day__name { display: inline-flex; align-items: center; gap: 8px; min-block-size: 48px; font-weight: 600; cursor: pointer; }
  .day input[type="time"] { padding-inline: 6px; min-inline-size: 0; }
  .day:has(.day__name input:not(:checked)) input[type="time"] { opacity: 0.45; }
  .day__msg { grid-column: 1 / -1; }

  /* A screen's form-level problem line keeps no blank line when empty:
     it ends the form, so nothing below shifts when it fills */
  .form__msg:empty { min-block-size: 0; }

  /* The live status line under the bar: what runs right now, in plain
     words (not a kicker, so it never reads as the question's heading).
     Empty when nothing is happening. Past the first screen it keeps a
     fixed two-line height, empty or not, cut at two lines: it sits above
     the question, so a line that comes or goes never moves the choices
     under the owner's finger (UX round 2). */
  .status { display: flex; align-items: center; gap: var(--sw-s2); margin: 0; font-size: var(--sw-t-small); line-height: 1.4; color: var(--sw-muted); }
  .status:empty, .status:not(.status--fixed):has(.status__text:empty) { display: none; }
  .status__text { min-inline-size: 0; }
  .status--fixed { block-size: calc(2 * 1.4em); overflow: hidden; }
  .status--fixed .status__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .status .tape { flex: none; inline-size: 48px; block-size: 14px; }

  /* A line about the screen (a late guess, the Google category note) */
  .note { padding: var(--sw-s2) var(--sw-s3); border-inline-start: 4px solid var(--sw-yellow); background: var(--sw-surface-2); font-size: var(--sw-t-small); }
  .note.row { justify-content: space-between; }
  .contents { display: contents; }
  /* The "Is this you?" card: listings split by the tear line, the
     Maps link steps as a short numbered list. */
  #gbp-card:empty { display: none; }
  .gbp-pick { padding-block-end: var(--sw-s3); border-block-end: 2px dashed var(--sw-line); }
  .howto { display: grid; gap: 4px; margin: 0; padding-inline-start: 1.25rem; }
  /* The wizard's top row: Back, and Start over kept quiet and away from
     the primary button. */
  .wizard__top { justify-content: space-between; min-block-size: 44px; }
  .wizard__over { margin-inline-start: auto; padding-block: 12px; font-size: var(--sw-t-small); color: var(--sw-muted); }
  /* UX round 3: the top took 100 to 150px of a phone. The wizard starts
     closer to the header, Back and Start over share one short row whose
     text lines up with the content edge (44px targets kept), and that
     row sits tight on the step bar. Step 1 has no row at all. */
  .app__main:has(> #wizard) { padding-block-start: var(--sw-s2); }
  #wizard > .wizard__top { margin-block: -10px -14px; }
  .wizard__back, .wizard__top .wizard__over { display: inline-flex; align-items: center; min-block-size: 44px; padding-block: 0; font-size: var(--sw-t-small); }
  .wizard__back { font-weight: 600; color: var(--sw-text); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.18em; }
  .wizard__back:hover { text-decoration-color: currentColor; }
  /* A ticket with no tag needs no room for one */
  .ticket:not(:has(> .ticket__tag)) { padding-block-start: var(--sw-s4); }

  /* Screen 2 (UX round 3): the Google card's slot is held from the first
     paint at the height of a one-listing card, so a card that lands
     never pushes the question down under a tap. */
  .gbp-slot > #gbp-card > .card { min-block-size: 26rem; }
  .gbp-slot > #gbp-card > .card[aria-busy="true"] { align-content: center; justify-items: center; text-align: center; }
  /* The list folded to the confirmed listing's category: one line and
     Change. Open, the line goes and the tiles, search and notes show. */
  .typefold > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sw-s1) var(--sw-s3); min-block-size: 48px; padding: var(--sw-s3); border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface-2); }
  .typefold > summary::-webkit-details-marker { display: none; }
  .typefold__change { font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; }
  .typefold[open] > summary { display: none; }
  .ticket:has(.typefold:not([open])) .type-more { display: none; }
  /* The first look: a phone-sized sketch of the home page's top */
  .firstlook__phone { justify-self: center; inline-size: min(100%, 13.5rem); padding: 8px; border-radius: 26px; background: var(--sw-ink); box-shadow: var(--sw-lift); }
  .firstlook__hero { position: relative; display: grid; align-content: space-between; gap: var(--sw-s4); min-block-size: 20rem; padding: var(--sw-s3) 12px; border-radius: 18px; overflow: hidden; background: var(--sw-slab); color: var(--sw-white); }
  .firstlook__photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
  .firstlook__hero--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(20 20 20 / 0.55), rgb(20 20 20 / 0.2) 40%, rgb(20 20 20 / 0.85)); }
  .firstlook__bar, .firstlook__body { position: relative; z-index: 1; }
  .firstlook__bar { display: flex; align-items: center; gap: var(--sw-s2); min-inline-size: 0; }
  .firstlook__logo { flex: none; inline-size: auto; max-inline-size: 3rem; block-size: 2rem; object-fit: contain; background: var(--sw-white); border-radius: 4px; padding: 2px; }
  .firstlook__name { font-weight: 700; font-size: var(--sw-t-small); line-height: 1.2; overflow-wrap: anywhere; }
  .firstlook__body { display: grid; gap: var(--sw-s2); justify-items: start; }
  .firstlook__title { margin: 0; font-family: var(--sw-font-head); font-weight: 800; font-size: 1.6rem; line-height: 1; overflow-wrap: anywhere; }
  .firstlook__stars { margin: 0; font-size: var(--sw-t-small); }
  .firstlook__stars span { color: var(--sw-yellow); letter-spacing: 1px; }
  .firstlook__call { display: inline-block; padding: 8px 12px; background: var(--sw-yellow); color: var(--sw-ink); font-weight: 700; font-size: var(--sw-t-small); }
  .note .tape, .bio .tape { display: block; margin-block-end: var(--sw-s2); }
  /* A search field with its button on the input's line: the field's
     parts join the form's grid, so a hint that wraps at 375px pushes
     nothing out of line. */
  .search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--sw-s2); align-items: stretch; }
  .search .field { display: contents; }
  .search .field__label { grid-column: 1 / -1; }
  .search .field input { grid-column: 1; grid-row: 2; }
  .search .btn { grid-column: 2; grid-row: 2; margin: 0; }
  .search .field__msg { grid-column: 1 / -1; grid-row: 3; }

  /* The bio as the site will show it */
  .bio__preview { display: grid; gap: var(--sw-s3); padding: var(--sw-s3); border-inline-start: 4px solid var(--sw-text); background: var(--sw-surface-2); }
  .bio__text { white-space: pre-line; }

  /* The license fields show once Licensed is on */
  /* Screen 5: "Another name" or number opens only once picked */
  .nap__other { display: none; }
  .receipt__row:has(input[value="other"]:checked) .nap__other, .nap__other--open { display: grid; }

  .license { display: none; }
  form:has(#tag-licensed:checked) .license { display: grid; }
  /* The number takes the full row on phones so a 12-character license
     fits with its note on one or two lines; Issued by goes under it
     (UX round 2: "13VH1432810C" was cut off in a half column). */
  .pair--license { grid-template-columns: minmax(0, 1fr); }
  .pair--license .field:last-child { max-inline-size: 12rem; }
  @media (min-width: 40.01rem) { .pair--license { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .pair--license .field:last-child { max-inline-size: none; } }

  /* Quick proof (screen 6): a dashed tear above, one question per block,
     segments that wrap on phones, and only the fields a choice needs
     open under it (no JS needed) */
  .proof { padding-block-start: var(--sw-s4); border-block-start: 2px dashed var(--sw-line); }
  .proof__h { font: 700 1.375rem/1.1 var(--sw-font-head); text-transform: uppercase; margin: 0; }
  .proof__lede { margin: var(--sw-s1) 0 0; color: var(--sw-muted); }
  .proof__q .seg__track { display: grid; grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); inline-size: 100%; }
  .proof__q .seg__opt { white-space: normal; text-align: center; line-height: 1.2; padding: 6px 10px; }
  .proof__more, .proof__private { display: none; }
  .proof__q:has(input[value="year"]:checked) .proof__more--year,
  .proof__q:has(input[value="told"]:checked) .proof__more--told,
  .proof__q:has(input[value="call"]:checked) .proof__more--call,
  .proof__q:has(input[value="price"]:checked) .proof__more--price,
  .proof__q:has(input[value="private"]:checked) .proof__private { display: grid; }
  .proof__q--3 .seg__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @media (min-width: 40.01rem) {
    .proof__q .seg__track { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); }
  }
  .proof__more--year .field, .proof__more--call .field, .proof__more--price .field { max-inline-size: 12rem; }

  /* The primary button stays in view on long screens (the bottom bar) */
  .actions--sticky { position: sticky; inset-block-end: 0; z-index: 2; background: var(--sw-surface); padding-block-end: var(--sw-s3); margin-block-end: calc(-1 * var(--sw-s3)); }
  /* Phones: the bar is pinned to the screen's foot on every screen that
     has one (UX round 2: sticky inside the ticket, it let go once the
     ticket's end scrolled past and a tap meant for it hit the list).
     The page keeps the bar's height free at its end, and a focused field
     scrolls clear of it. */
  @media (max-width: 40rem) {
    :root:has(.actions--sticky) { --sw-bar: calc(56px + 2 * var(--sw-s2) + var(--sw-rule-heavy) + env(safe-area-inset-bottom, 0px)); scroll-padding-block-end: calc(var(--sw-bar) + var(--sw-s2)); }
    .actions--sticky {
      position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 5; margin: 0;
      padding: var(--sw-s2) var(--sw-s3) calc(var(--sw-s2) + env(safe-area-inset-bottom, 0px));
      border-block-start: var(--sw-rule-heavy) solid var(--sw-rule);
    }
    .app__main:has(.actions--sticky) { padding-block-end: calc(var(--sw-bar) + var(--sw-s4)); }
  }

  /* --- Screens 8 to 10: photos, logo and colors, theme --------------- */
  .hint { margin: 0; font-size: var(--sw-t-small); color: var(--sw-muted); }

  /* Photos: 2 across on phones, 3 wider; a tap frames the photo cobalt
     with the check, like a tile */
  .photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sw-s2); margin: 0; padding: 0; list-style: none; }
  @media (min-width: 40.01rem) { .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .photo { position: relative; display: grid; gap: 6px; align-content: start; min-inline-size: 0; }
  .photo__pick { position: relative; display: block; aspect-ratio: 4 / 3; cursor: pointer; border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface-2); overflow: hidden; }
  /* A photo still on its way from the owner's site shimmers instead of
     sitting as an empty frame (app.js marks it loaded) */
  :root[data-js] .photo__pick:has(img:not(.is-loaded)) {
    background: linear-gradient(100deg, var(--sw-surface-2) 35%, var(--sw-line) 50%, var(--sw-surface-2) 65%) 0 0 / 300% 100% var(--sw-surface-2);
    animation: sw-shimmer 1.4s linear infinite;
  }
  @keyframes sw-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
  .photo__pick img, .photo__ph { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
  .photo__pick input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .photo__pick .tile__mark { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; }
  /* A picked photo is unmistakable: a thick cobalt frame and a big
     check; its "Which service?" shows only then (UX round 1). */
  .fold > summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-block-size: 48px; list-style: none; cursor: pointer; font-weight: 600;
  }
  .fold > summary::-webkit-details-marker { display: none; }
  .fold > summary:focus-visible { outline: var(--sw-focus-outline); outline-offset: 2px; }
  .fold[open] > summary .item__change { display: none; }
  .fold[open] > summary { margin-block-end: var(--sw-s2); }
  .fold > .hint { margin-block-end: var(--sw-s2); }
  .photo__pick:has(input:checked) { border-color: var(--sw-primary); box-shadow: inset 0 0 0 5px var(--sw-primary); }
  .photo__pick:has(input:checked) img { opacity: 0.92; }
  .photo__pick:has(input:checked) .tile__mark { background: var(--sw-primary); border-color: var(--sw-primary-edge); }
  .photo__pick:has(input:checked) .tile__mark::after {
    content: ""; inline-size: 12px; block-size: 7px; translate: 0 -2px; rotate: -45deg;
    border-inline-start: 3px solid var(--sw-white); border-block-end: 3px solid var(--sw-white);
  }
  .photo__pick:has(input:checked) .tile__mark { inline-size: 36px; block-size: 36px; }
  .photo__pick:has(input:checked) .tile__mark::after { inline-size: 16px; block-size: 9px; border-width: 4px; }
  .photo__pick:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; }
  .photo__pick:has(input:disabled) { cursor: not-allowed; opacity: 0.6; }
  .photo__state, .photo__src { position: absolute; inset-block-end: 8px; inset-inline-start: 8px; }
  .photo__state { display: flex; align-items: center; gap: 6px; padding: 2px 8px; background: var(--sw-surface); font-size: var(--sw-t-tag); font-weight: 600; }
  .photo__state .tape { inline-size: 24px; block-size: 10px; }
  /* "Which service is this?" has its own row under every photo, kept
     free from the start, so picking moves nothing (UX round 2) and
     covers none of the photo (UX round 3: over the foot it hid 40% of
     it and cut "Bathroom Re…"). With JS the full name shows on up to two
     lines and the native select lies over it, so a tap opens the phone's
     own list; without JS the select itself shows. */
  .photos:has(.photo__svc) { row-gap: var(--sw-s3); }
  .photo__svc { position: relative; min-block-size: 48px; }
  .photo:not(:has(input[name="pick"]:checked)) .photo__svc { visibility: hidden; }
  .photo__svc select { inline-size: 100%; min-block-size: 48px; font-size: var(--sw-t-small); }
  .photo__svcname {
    display: flex; align-items: center; min-block-size: 48px; padding: 4px 28px 4px 8px;
    border: var(--sw-border) solid var(--sw-primary); background: var(--sw-surface);
    font-size: var(--sw-t-small); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat;
  }
  .photo__svcname > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  :root[data-js] .photo__svc select { position: absolute; inset: 0; block-size: 100%; opacity: 0; cursor: pointer; }
  .photo__svc:has(select:focus-visible) .photo__svcname { outline: var(--sw-focus-outline); outline-offset: 2px; }
  .photo--failed .photo__pick { border-style: dashed; }
  .upload { display: grid; gap: 6px; }
  .upload__input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
  .upload__input:focus-visible + .field__msg { outline: var(--sw-focus-outline); }
  .upload__btn { cursor: pointer; }
  .upload__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--sw-t-small); }
  .upload__list:empty { display: none; }

  /* Logos: tiles that hold the image on a white plate */
  .logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sw-s2); }
  .tile.logo { min-block-size: 96px; justify-content: center; background: var(--sw-white); }
  .tile.logo img { display: block; max-inline-size: 100%; max-block-size: 72px; object-fit: contain; }
  /* The round mark keeps its own strip on the left, off the logo art */
  .tile.logo { padding-inline-start: 44px; }
  .tile.logo .tile__mark { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; }
  .tile.logo:has(input:checked) { background: var(--sw-white); }
  .logo__ph { display: grid; gap: 4px; justify-items: center; font-size: var(--sw-t-small); color: var(--sw-ink); }
  .make > summary { inline-size: fit-content; min-block-size: 48px; }
  .make[open] > summary { margin-block-end: var(--sw-s3); }
  .tile.wm { min-block-size: 72px; background: var(--sw-white); }
  .wm__art { display: block; flex: 1; min-inline-size: 0; }
  .wm__art svg { display: block; block-size: 40px; inline-size: auto; max-inline-size: 100%; }
  .tile.wm { flex-wrap: wrap; }
  /* A picked wordmark stays on white: its art is drawn in the logo's own
     colors, which the dark checked tile would hide; the border and tick
     mark the pick. */
  .tile.wm:has(input:checked) { background: var(--sw-white); }
  .tile.wm:not(:has(input:checked)) .tile__mark { background: var(--sw-white); border-color: #4A4A4A; }
  .wm__label { flex-basis: 100%; padding-inline-start: 36px; font-size: var(--sw-t-small); font-weight: 600; color: #4A4A4A; } /* the tile is always white: light theme's muted, 8:1 */
  .icons { display: flex; flex-wrap: wrap; gap: var(--sw-s2); margin: 0; padding: 0; border: 0; }
  .icons > legend { margin-block-end: var(--sw-s2); }
  .icon {
    position: relative; display: grid; place-items: center; inline-size: 48px; block-size: 48px; cursor: pointer;
    border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); color: var(--sw-text);
  }
  .icon input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .icon svg { inline-size: 24px; block-size: 24px; }
  .icon__none { font-size: var(--sw-t-tag); font-weight: 600; }
  .icon:has(input:checked) { background: var(--sw-yellow); color: var(--sw-ink); border-color: var(--sw-ink); }
  .icon:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; }
  .gen { display: grid; gap: var(--sw-s2); padding-block-start: var(--sw-s3); border-block-start: 2px dashed var(--sw-line); }

  /* Colors: palette tiles with two swatches, the owner's own pair, and
     the engine's plain-word notes */
  .colors, .plain { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
  .palettes { display: grid; gap: var(--sw-s2); }
  @media (min-width: 40.01rem) { .palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .sw { flex: none; inline-size: 48px; block-size: 24px; border: 1px solid var(--sw-text); }
  .custom { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sw-s3); }
  .colors:has(input[name="palette"][value="custom"]:checked) .custom { display: grid; }
  .color { inline-size: 100%; min-block-size: 48px; padding: 2px; border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); cursor: pointer; }
  .kit { display: flex; align-items: flex-start; gap: var(--sw-s3); padding: var(--sw-s3); border-inline-start: 4px solid var(--sw-text); background: var(--sw-surface-2); font-size: var(--sw-t-small); }
  .kit p { margin: 0; }
  .kit__logo { flex: none; inline-size: 64px; block-size: 40px; object-fit: contain; padding: 2px; background: var(--sw-white); }
  /* "Set my own colors": a quiet link that opens the colour pickers */
  .pal-own { inline-size: fit-content; min-block-size: 44px; display: inline-flex; align-items: center; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
  .pal-own input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .pal-own:has(input:checked) { text-decoration: none; }
  .pal-own:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; }
  .notes { display: grid; gap: 4px; margin: 0; padding-inline-start: 1.1em; }

  /* Looks (UX round 3): the look that fits leads at the full width of
     the ticket, the others follow in a row to swipe on phones (each
     about 70% wide, so the next one peeks) and side by side wider. A
     frame is the owner's home page laid out about 390px wide and scaled
     by --k; the iframe's width is the frame's divided by --k, so a frame
     of any width is filled. Taps go to the radio. */
  .looks { display: grid; gap: var(--sw-s3); }
  .looks__more { margin: var(--sw-s2) 0 0; }
  .looks__row {
    display: grid; grid-auto-flow: column; grid-auto-columns: 70%; gap: var(--sw-s3);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0;
    padding-block-end: var(--sw-s2); margin-inline: calc(-1 * var(--sw-s1)); padding-inline: var(--sw-s1);
  }
  .looks__row > .look { scroll-snap-align: start; }
  @media (min-width: 48rem) { .looks__row { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; } }
  .look { display: grid; gap: 6px; align-content: start; min-inline-size: 0; }
  .look__pick { display: grid; gap: var(--sw-s2); cursor: pointer; padding: 6px; border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); }
  .look__pick input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; pointer-events: none; }
  .look__pick:has(input:checked) { border-color: var(--sw-primary); box-shadow: inset 0 0 0 2px var(--sw-primary); background: var(--sw-primary-soft); }
  /* One pick of four: the round radio mark of screens 2 and 5 */
  .look__pick:has(input:checked) .tile__mark { background: var(--sw-primary); border-color: var(--sw-primary-edge); }
  .look__pick:has(input:checked) .tile__mark::after { content: ""; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--sw-white); }
  .look__pick:has(input:focus-visible) { outline: var(--sw-focus-outline); outline-offset: 3px; }
  .look__frame { --k: 0.56; position: relative; display: block; inline-size: 100%; block-size: calc(600px * var(--k)); overflow: hidden; background: var(--sw-white); border: 1px solid var(--sw-line); }
  .look--lead .look__frame { --k: 0.74; block-size: calc(620px * var(--k)); }
  @media (min-width: 48rem) { .look--lead .look__frame { inline-size: calc(390px * var(--k)); margin-inline: auto; } }
  .look__frame iframe { position: absolute; inset: 0 auto auto 0; inline-size: calc(100% / var(--k)); block-size: calc(100% / var(--k)); border: 0; transform: scale(var(--k)); transform-origin: 0 0; pointer-events: none; }
  .look__body { display: grid; gap: 4px; justify-items: start; }
  .look__name { display: flex; align-items: center; gap: 8px; font-family: var(--sw-font-head); font-weight: 800; text-transform: uppercase; letter-spacing: var(--sw-track-head); font-size: 1.125rem; }
  .look__name .tile__mark { display: grid; place-items: center; inline-size: 22px; block-size: 22px; border: var(--sw-border) solid var(--sw-text); border-radius: 50%; background: var(--sw-bg); }
  .look__line { font-size: var(--sw-t-small); color: var(--sw-muted); }
  .look__why { font-size: var(--sw-t-small); }
  .look__full { display: inline-flex; align-items: center; min-block-size: 44px; font-size: var(--sw-t-small); }
  /* Screen 10's pinned bar has one quiet line of plain facts under the
     button; the page keeps room for it */
  .actions__note { flex-basis: 100%; margin: 0; font-size: var(--sw-t-small); line-height: 1.3; color: var(--sw-muted); text-align: center; text-wrap: balance; }
  @media (max-width: 40rem) {
    :root:has(.actions--note) { --sw-bar: calc(56px + 2 * var(--sw-s2) + var(--sw-s1) + 2.6em + var(--sw-rule-heavy) + env(safe-area-inset-bottom, 0px)); }
    .actions--note { row-gap: var(--sw-s1); }
  }

  /* Shown only once app.js runs (data-js on <html>), and only without */
  :root:not([data-js]) .js-only { display: none; }
  :root[data-js] .nojs-only { display: none; }

  /* --- The build and the preview (plans/05 → Build hand-off, Preview) */
  /* The build ticket: one line per stage. Done is an ink square with a
     check, now is yellow with the tape, to come is a hollow square. */
  .steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
  .steps__item { display: flex; align-items: center; gap: 12px; min-block-size: 44px; padding-block: 6px; color: var(--sw-faint); font-weight: 600; border-block-end: 1px solid var(--sw-line); }
  .steps__item:last-child { border-block-end: 0; }
  .steps__mark { flex: none; display: grid; place-items: center; inline-size: 22px; block-size: 22px; border: var(--sw-border) solid var(--sw-line); background: var(--sw-bg); }
  .steps__item--done { color: var(--sw-text); }
  .steps__item--done .steps__mark { background: var(--sw-text); border-color: var(--sw-text); }
  .steps__item--done .steps__mark::after {
    content: ""; inline-size: 11px; block-size: 6px; translate: 0 -2px; rotate: -45deg;
    border-inline-start: 3px solid var(--sw-bg); border-block-end: 3px solid var(--sw-bg);
  }
  .steps__item--now { color: var(--sw-text); }
  .steps__item--now .steps__mark { background: var(--sw-yellow); border-color: var(--sw-ink); }
  /* The go-live steps (P4.4): a line under the step at hand, a problem
     is the error tone with a bang. */
  .steps__body { display: grid; gap: 2px; }
  .steps__line { font-weight: 400; color: var(--sw-text); font-size: var(--sw-t-small); }
  .steps__item--problem { color: var(--sw-text); }
  .steps__item--problem .steps__mark { background: var(--sw-err-bg); border-color: var(--sw-err); }
  .steps__item--problem .steps__mark::after { content: "!"; color: var(--sw-err); font-weight: 800; line-height: 1; }
  .golive__refusals { margin: 0; padding-inline-start: 1.2em; display: grid; gap: var(--sw-s1, 4px); }
  .ticket .status { min-block-size: 1.5rem; }

  /* Quick questions: one small form each, the question as its label */
  .question { display: grid; gap: var(--sw-s2); padding-block-start: var(--sw-s3); border-block-start: 2px dashed var(--sw-line); }
  .question .field__label { font-size: 1rem; }
  .question .btn { min-block-size: 48px; justify-self: start; }
  .question__yesno { display: flex; gap: var(--sw-s2); }
  .question__yesno .btn { min-inline-size: 6rem; }
  .question__later { margin-block-start: calc(-1 * var(--sw-s2)); }
  .question__later .btn { min-block-size: 48px; }
  .question__pair { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; gap: var(--sw-s3); }
  .saved { margin: 0; padding: var(--sw-s2) var(--sw-s3); background: var(--sw-ok-bg); color: var(--sw-ok); font-weight: 600; font-size: var(--sw-t-small); }

  /* The Google listing check */
  .fixes > summary { padding-block: 12px; min-block-size: 48px; cursor: pointer; font-weight: 600; color: var(--sw-link); }
  .fixes__list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
  .fix { display: grid; gap: 4px; justify-items: start; padding-block: var(--sw-s3); border-block-start: 1px solid var(--sw-line); }
  .fix__what { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
  .fix__why { margin: 0; font-size: var(--sw-t-small); color: var(--sw-muted); }

  /* Plan cards: two tickets side by side once there is room */
  .plans { display: grid; gap: var(--sw-s3); }
  @media (min-width: 40.01rem) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .plan { display: grid; gap: var(--sw-s2); align-content: start; padding: var(--sw-s4) var(--sw-s3) var(--sw-s3); border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); }
  .plan--founder { box-shadow: inset 0 6px 0 var(--sw-yellow); }
  .plan__price { display: flex; align-items: baseline; gap: 6px; margin: 0; }
  .plan__amount { font-family: var(--sw-font-head); font-weight: 800; font-size: 2.5rem; line-height: 1; }
  .plan__per { color: var(--sw-muted); font-size: var(--sw-t-small); }
  .plan__founder { margin: 0; font-size: var(--sw-t-small); font-weight: 600; }
  .plan__founder s { color: var(--sw-muted); font-weight: 400; margin-inline-end: 4px; }
  .plan__lines { display: grid; gap: 4px; margin: 0 0 var(--sw-s2); padding-inline-start: 1.1em; font-size: var(--sw-t-small); }

  /* The preview's top bar: what is ready, then the numbers, then Publish */
  .pbar { display: grid; gap: var(--sw-s3); padding: var(--sw-s4) var(--sw-s3); border: var(--sw-border) solid var(--sw-text); background: var(--sw-surface); }
  .pbar__head { display: grid; gap: var(--sw-s2); }
  .pbar__lede { margin: 0; color: var(--sw-muted); }
  .pbar__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sw-s2); margin: 0; }
  .stat { display: grid; gap: 2px; align-content: start; padding: var(--sw-s2) var(--sw-s2) var(--sw-s2) 10px; border-inline-start: 4px solid var(--sw-text); background: var(--sw-surface-2); min-inline-size: 0; }
  .stat dt { font-size: var(--sw-t-tag); font-weight: 600; letter-spacing: var(--sw-track-tag); text-transform: uppercase; color: var(--sw-muted); }
  .stat dd { margin: 0; font-weight: 600; font-size: var(--sw-t-small); overflow-wrap: anywhere; }
  .stat__note { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--sw-muted); }
  .stat__note .tape { flex: none; inline-size: 32px; block-size: 12px; }
  .pbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sw-s2) var(--sw-s3); }
  .pbar__actions .btn--primary { flex: 1 1 100%; }
  .pbar__actions .btn--quiet { min-block-size: 48px; }
  @media (max-width: 30rem) { .pbar__stats { grid-template-columns: minmax(0, 1fr); } }
  @media (min-width: 48rem) {
    .pbar { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: var(--sw-s4); }
    .pbar__stats { grid-column: 1 / -1; grid-row: 2; }
    .pbar__actions { grid-column: 2; grid-row: 1; flex-direction: column; align-items: stretch; }
    .pbar__actions .btn--primary { flex: none; }
  }

  /* The site itself, framed: full width on phones, beside the side
     column on wide screens */
  .preview { display: grid; gap: var(--sw-s4); align-items: start; }
  .preview__frame { border: var(--sw-border) solid var(--sw-text); background: var(--sw-white); }
  .preview__frame iframe { display: block; inline-size: 100%; block-size: 75vh; block-size: 75dvh; border: 0; }
  @media (min-width: 64rem) {
    .preview { grid-template-columns: minmax(0, 1fr) 24rem; }
    .preview__frame { position: sticky; inset-block-start: var(--sw-s3); }
    .preview__frame iframe { block-size: calc(100vh - 2 * var(--sw-s4)); }
    .preview__side .plans { grid-template-columns: minmax(0, 1fr); }
  }

  /* View as owner (plans/15 → Admin console): the ink bar over every
     owner page an operator reads as the owner. Sticky, so it never
     scrolls out of sight. */
  .viewbar {
    position: sticky; inset-block-start: 0; z-index: 10;
    background: var(--sw-slab); color: var(--sw-white);
    border-block-end: var(--sw-rule-heavy) solid var(--sw-highlight);
  }
  .viewbar__in {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--sw-s2) var(--sw-s3);
    max-inline-size: var(--sw-page); margin-inline: auto;
    padding: var(--sw-s2) var(--sw-s3);
  }
  .viewbar__text { flex: 1 1 16rem; margin: 0; font-size: var(--sw-t-small); overflow-wrap: anywhere; }
  .viewbar .viewbar__end { background: var(--sw-highlight); color: var(--sw-highlight-ink); border-color: var(--sw-highlight); }
  @media (min-width: 48rem) { .viewbar__in { padding-inline: var(--sw-s4); } }

}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .sw-spin { animation-duration: 2.4s; }
    .switch input, .switch input::after, .keep input::after, .tile { transition: none; }
    :root[data-js] .photo__pick:has(img:not(.is-loaded)) { animation: none; background: var(--sw-surface-2); }
  }
}
