.w-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
}

.w-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.w-brand { text-decoration: none; color: var(--text); font-size: 13px; letter-spacing: 0.06em; }
.w-brand span { color: var(--accent); }
.w-count { color: var(--muted); font-size: 12px; }

.w-progress { height: 3px; background: var(--line); }
.w-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }

.w-main {
  flex: 1; width: min(720px, 100%); margin: 0 auto;
  padding: 32px 20px 40px;
}

.w-head { margin-bottom: 22px; }
.w-head h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; }
.w-head p { margin: 0; color: var(--muted); }

.w-errors {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--red); border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red); padding: 10px 14px; margin-bottom: 18px; font-size: 13px;
}

.w-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.w-field { display: grid; gap: 6px; align-content: start; }
.w-field.wide, .w-form > .w-cards, .w-form > .w-checks { grid-column: 1 / -1; }
.w-field:has(.w-cards), .w-field:has(.w-checks) { grid-column: 1 / -1; }

.w-label { font-size: 13px; font-weight: 600; }
.w-label i { color: var(--red); font-style: normal; }
.w-help { font-size: 12px; color: var(--muted); }
.w-note { grid-column: 1 / -1; color: var(--muted); margin: 0; }

.w-field input,
.w-field select,
.w-field textarea {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); width: 100%;
}
.w-field input:focus-visible,
.w-field select:focus-visible,
.w-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.w-field textarea { resize: vertical; font-family: inherit; }

/* choice cards */
.w-cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
.w-cards.two { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.w-card {
  position: relative; display: grid; gap: 3px;
  padding: 14px 16px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); min-height: 62px;
}
.w-card input { position: absolute; opacity: 0; pointer-events: none; }
.w-card:hover { border-color: var(--muted); }
/* Selection is styled from the live checked state, so choosing an option never
   requires a re-render. */
.w-card.on,
.w-card:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.w-card-name { font-weight: 600; }
.w-card-blurb { font-size: 12px; color: var(--muted); }

/* checkbox groups */
.w-checks { display: grid; gap: 8px; }
.w-check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.w-check.on,
.w-check:has(input:checked) { border-color: var(--accent); }
.w-check.locked { opacity: 0.72; cursor: default; }
.w-check input { margin-top: 2px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.w-check-body { display: grid; gap: 2px; }
.w-check-body span { font-size: 12px; color: var(--muted); }

.w-toggle {
  grid-column: 1 / -1;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.w-toggle input { margin-top: 2px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.w-toggle-body { display: grid; gap: 2px; }
.w-toggle-body span { font-size: 12px; color: var(--muted); }

.w-image { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.w-image-preview {
  width: 92px; height: 92px; border-radius: var(--radius);
  border: 1px dashed var(--line); background: var(--panel);
  display: grid; place-items: center; overflow: hidden;
  color: var(--muted); font-size: 11px; flex: none;
}
.w-image-preview img { width: 100%; height: 100%; object-fit: cover; }

/* summaries and permission read-outs */
.w-summary {
  margin-top: 24px; padding: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.w-summary h3 { margin: 0 0 8px; font-size: 14px; }
.w-summary h3 + p { margin-top: 0; }
.w-summary-lead { margin: 0 0 12px; color: var(--soft); }

.w-perms { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 5px; }
.w-perms li { display: flex; gap: 9px; font-size: 13px; }
.w-perms li span { width: 14px; flex: none; text-align: center; }
.w-perms li.yes { color: var(--text); }
.w-perms li.yes span { color: var(--green); }
.w-perms li.no { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

.w-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.w-chips span {
  background: var(--raised); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; font-size: 12px;
}
.w-fineprint { margin: 0; font-size: 12px; color: var(--muted); }

.w-foot {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.w-foot .btn { min-height: 44px; }
.w-foot .btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* completion */
.w-done { text-align: center; display: grid; justify-items: center; gap: 10px; padding-top: 64px; }
.w-done h1 { margin: 0; }
.w-done p { margin: 0; color: var(--muted); max-width: 44ch; }
.w-tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green); display: grid; place-items: center; font-size: 26px;
}
.w-caveat {
  border: 1px solid var(--amber); border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  color: var(--amber) !important; padding: 10px 14px; font-size: 13px;
}
.w-done .btn { margin-top: 12px; text-decoration: none; min-height: 44px; padding-inline: 22px; }

@media (max-width: 560px) {
  .w-main { padding: 22px 14px 32px; }
  .w-head h1 { font-size: 20px; }
  .w-form { grid-template-columns: 1fr; }
  .w-cards.two { grid-template-columns: 1fr; }
  .w-foot { padding-inline: 14px; }
}
