/* Follows the Phase 2 boards of the design canvas (Profiles, Wizard, AddonsCinemeta, Account). */
:root {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --text: #1b1b1f;
  --muted: #5d5d68;
  --border: #dcdce3;
  --accent: #6d4aff;
  --accent-text: #ffffff;
  --link: #5b3fd6;
  --danger: #c62a2f;
  --ok-bg: #e3f4e8;
  --ok-text: #1d5b2c;
  --error-bg: #fdecec;
  --error-text: #8a1c20;
  --warn-bg: #fff4dc;
  --warn-border: #d9a23a;
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216;
    --surface: #1c1c22;
    --surface-2: #24242c;
    --text: #ececf1;
    --muted: #9b9ba6;
    --border: #2c2c35;
    --accent: #8b6dff;
    --link: #b9a6ff;
    --danger: #ff9da0;
    --ok-bg: #173320;
    --ok-text: #a6e3b5;
    --error-bg: #3a1618;
    --error-text: #ffb3b5;
    --warn-bg: #33290f;
    --warn-border: #b88a2c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.is-busy { cursor: progress; }

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

.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px 0; display: grid; gap: 4px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.top-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; }

/* Section tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
.tabs a {
  padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--muted);
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 800; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center;
  background: #8b6dff; color: #ffffff;
}
.top-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  gap: 28px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; margin: 0; }
.h2 { font-size: 21px; }
.h3 { font-size: 16px; }
h1.h2, h2.h3 { margin: 0; }
p { margin: 0 0 8px; }

.hint { color: var(--muted); font-size: 14px; }
.lede { max-width: 680px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
}
.card > * { margin: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.narrow { max-width: 520px; width: 100%; margin: 0 auto; }
.banner { border-color: var(--warn-border); background: var(--warn-bg); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head > * { margin: 0; }
.stack-lg { display: grid; gap: 14px; }

/* Profiles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.profile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile.is-active { border: 2px solid var(--accent); }
/* While editing, a card takes the whole row so the picture picker has room. */
.profile:has(.edit[open]) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(200px, 300px) 1fr; }
.profile:has(.edit[open]) .profile-banner { aspect-ratio: auto; min-height: 100%; align-content: start; padding-top: 24px; }
.profile:has(.edit[open]) .profile-banner img { width: 80%; max-width: 240px; height: auto; }
@media (max-width: 640px) {
  .profile:has(.edit[open]) { grid-template-columns: 1fr; }
  .profile:has(.edit[open]) .profile-banner { aspect-ratio: 5 / 2; }
}

.profile-banner {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}
.profile-banner img { height: 100%; width: auto; display: block; }
@media (max-width: 520px) {
  .profile-banner { aspect-ratio: 5 / 2; }
}

/* Picture picker */
.picker { display: grid; gap: 12px; }
.picker-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); }
.picker-tabs[hidden] { display: none; }
.picker-tabs button { flex: 1; min-height: 40px; padding: 0 8px; border: none; background: transparent; color: var(--muted); }
.picker-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.pic-grid[hidden] { display: none; }
.pic { position: relative; display: block; cursor: pointer; }
.pic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pic img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 3px solid transparent; }
.pic input:checked + img { border-color: var(--text); }
.pic input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.shuffle[hidden] { display: none; }
.pill {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: #ffffff; color: #14141a;
  font-size: 12px; font-weight: 700;
}

.profile-body { padding: 14px; display: grid; gap: 12px; }
.profile-body p { margin: 2px 0 0; }
/* The pencil sits at the right of the button row; its panel opens full width underneath. */
.profile-actions { display: flex; flex-wrap: wrap; position: relative; }
.profile-actions > form { flex: 1; display: flex; margin-right: 52px; }
.edit { flex-basis: 100%; }
.edit > summary { list-style: none; position: absolute; top: 0; right: 0; }
.edit > summary::-webkit-details-marker { display: none; }
.edit[open] > summary { color: var(--accent); border-color: var(--accent); }
.edit-panel { display: grid; gap: 16px; padding-top: 14px; }

.new-tile {
  min-height: 200px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.new-tile:hover { border-color: var(--accent); }

/* Controls */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.align-end { align-items: flex-end; }
.stack { display: grid; gap: 12px; margin: 0; }
form.inline { display: inline-flex; }
.grow { flex: 1 1 auto; }
.row .grow { flex: 1 1 280px; }

label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
label.radio { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 15px; min-height: 32px; }
input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }

input:not([type="radio"]):not([type="checkbox"]) {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-height: 44px;
  width: 100%;
}
.row > input { width: auto; flex: 1 1 180px; }

button, .button, .icon-button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
button.grow { width: 100%; }
.icon-button { width: 44px; padding: 0; color: var(--muted); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { border: none; background: none; padding: 0; min-height: 0; color: var(--link); text-decoration: underline; font-weight: 500; }
button.link.danger { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px 12px; margin: 0; min-width: 0; }
legend { padding: 0 4px; font-size: 14px; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; display: inline-block; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span:first-of-type {
  display: block; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c); border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border);
}
.swatch input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.fold { border-top: 1px solid var(--border); padding-top: 12px; }
.fold > summary { cursor: pointer; color: var(--link); min-height: 32px; }
.fold[open] > summary { margin-bottom: 10px; }
.fold > * + * { margin-top: 10px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.status-ok { color: var(--ok-text); }

/* Messages */
.flash { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 16px; }
.flash svg { flex: none; margin-top: 3px; }
.flash p { margin: 0; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }

/* Tables and lists */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; }
td { padding: 10px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.actions { white-space: nowrap; display: flex; gap: 12px; align-items: center; }

.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.activity li { display: flex; flex-wrap: wrap; gap: 4px 12px; }

.compare { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.compare dt { font-weight: 600; }
.compare dd { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Sign-in page (Phase 2 design, "Sign in with Stremio" board) */
.signin { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; padding: 32px 0; }
.signin-pitch { flex: 0 1 440px; display: grid; gap: 18px; }
.signin-pitch h1 { font-size: 38px; line-height: 1.1; margin: 0; }
.signin-card { flex: 0 1 420px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--muted); }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps strong { color: var(--text); }
.step-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--link); font-weight: 800;
}
.inline-icon { vertical-align: -2px; margin-right: 4px; }
.fold-top { border-top: 1px solid var(--border); padding-top: 12px; }

/* Account card */
.sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sessions li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px;
}
.danger-zone > summary { color: var(--danger); }

.bin { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 8px; }
.bin h3 { margin: 0; font-size: 16px; }

/* Undo for the last edit */
.undo {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok-text); font-size: 15px;
}
.undo-button { min-height: 36px; padding: 0 14px; background: transparent; border-color: currentColor; color: inherit; font-weight: 700; }

/* Profiles: cards link to the editor */
.profile-actions { flex-wrap: nowrap; gap: 8px; }
.profile-actions > form { margin-right: 0; }
.profile-actions .button { padding: 0 14px; }
.profile.is-editing { outline: 2px solid var(--accent); outline-offset: -2px; }
.button.is-current { border-color: var(--accent); color: var(--link); }

/* First-run checklist */
.get-started { border-color: var(--accent); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.checklist li.is-done { opacity: 0.75; }
.checklist li.is-done .step-n { background: var(--ok-bg); color: var(--ok-text); }
.checklist h3 { font-size: 16px; }
.checklist p { margin: 2px 0 0; }
@media (max-width: 560px) {
  .checklist li { grid-template-columns: auto 1fr; }
  .checklist li > :last-child { grid-column: 1 / -1; }
}

/* The profile editor: side navigation plus clearly marked sections */
.editor {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  scroll-margin-top: 16px;
}
.editor-nav {
  background: var(--surface-2); border-right: 1px solid var(--border);
  padding: 16px 10px; display: flex; flex-direction: column; gap: 2px;
}
.editor-who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 14px; font-size: 17px; }
.editor-who img { border-radius: 9px; }
.editor-nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.editor-nav a:hover { background: var(--bg); color: var(--text); }
.editor-body { padding: 22px 26px; display: grid; min-width: 0; }
.editor-section { display: grid; gap: 12px; padding: 22px 0; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.editor-section:first-child { border-top: none; padding-top: 0; }
.editor-section:last-child { padding-bottom: 0; }
.editor-section h2 { font-size: 19px; margin: 0; }
.editor-section > p { margin: 0; }
.editor-section.danger h2 { color: var(--danger); }
.danger-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--danger);
}
.self-start { justify-self: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.stats div { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; }
@media (max-width: 760px) {
  .editor { grid-template-columns: 1fr; }
  .editor-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .editor-who { padding: 0 8px 0 4px; flex: none; }
  .editor-nav a { white-space: nowrap; }
  .editor-body { padding: 18px 16px; }
}

/* Lists (backups, bin, sessions) */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list > li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px;
}
.list-main { display: grid; gap: 2px; min-width: 0; }
.list-main .hint { font-size: 13px; }
.backup-groups { gap: 20px; }
.backup-group { display: grid; gap: 8px; }
.card h2 .hint { font-weight: 500; font-size: 14px; }
.covered-head { display: flex; gap: 14px; align-items: center; }
.covered-head p { margin: 2px 0 0; }
.covered-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; background: var(--ok-bg); color: var(--ok-text);
}
.danger-card { border-color: var(--danger); }
.danger-card h2 { color: var(--danger); }

/* Add-on lists */
.addon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.addon-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.addon-row.is-dragging { opacity: 0.5; }
.addon-row.is-new { border-color: var(--accent); }
.addon-row.is-removed { border-style: dashed; border-color: var(--danger); opacity: 0.7; }
.addon-row.is-removed .addon-name { text-decoration: line-through; }
.addon-row:has(input[name="addon"]:not(:checked)) { opacity: 0.6; }
.grip { color: var(--muted); cursor: grab; display: inline-flex; flex: none; }
.addon-tile {
  width: 38px; height: 38px; flex: none; border-radius: 9px;
  display: grid; place-items: center; color: #ffffff; font-weight: 800;
}
.addon-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.addon-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.addon-name { font-weight: 700; overflow-wrap: anywhere; }
.addon-text > .hint { font-size: 13px; overflow-wrap: anywhere; }
.badge { padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--link); font-size: 12px; font-weight: 700; }
.badge[hidden], .health[hidden] { display: none; }
.badge-new { background: var(--accent); color: var(--accent-text); }
.health { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ok-bg); color: var(--ok-text); }
.health[data-state="unreachable"] { background: var(--error-bg); color: var(--error-text); }
.health[data-state="device"] { background: var(--bg); color: var(--muted); }
.row-buttons { display: flex; gap: 6px; flex: none; }
.addon-row .icon-button { width: 36px; min-height: 36px; }
.remove-toggle {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--danger); cursor: pointer; font-size: 15px;
}
.remove-toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.remove-toggle:has(input:checked) { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.remove-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.addon-row input[name="addon"][data-locked] { opacity: 0.6; cursor: not-allowed; }
.catalogs > summary { cursor: pointer; color: var(--link); font-size: 13px; }
.catalogs .stack { padding: 10px 0 4px; }
@media (max-width: 560px) {
  .addon-row { flex-wrap: wrap; }
  .grip { display: none; }
  .addon-text { flex-basis: calc(100% - 110px); }
  .row-buttons { margin-left: auto; }
}

/* The add-on manager and Cinemeta, side by side */
main.wide { max-width: 1240px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; justify-self: start; }
.manager { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .manager { grid-template-columns: 1fr; } }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; border-top: 1px solid var(--border); padding-top: 16px; }
.add-by-link { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.add-by-link[hidden], .add-by-link [hidden] { display: none; }
.add-by-link > .hint { flex-basis: 100%; margin: 0; }
.add-by-link > .hint:empty { display: none; }
.savebar {
  position: sticky; bottom: 12px; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.has-changes .savebar { border-color: var(--accent); }
.savebar [hidden] { display: none; }
.spread { justify-content: space-between; }
.cinemeta-panel { position: sticky; top: 16px; }
@media (max-width: 980px) { .cinemeta-panel { position: static; } }

select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 44px; padding: 0 12px; width: 100%;
}

/* Switches (checkboxes drawn as toggles) */
.switches { display: grid; gap: 10px; }
.switches[hidden] { display: none; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 15px; cursor: pointer;
}
.switch-row > span { display: grid; gap: 2px; }
.switch-row .hint { font-size: 13px; }
input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 52px; height: 30px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer;
  transition: background 0.15s;
}
input[role="switch"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #ffffff; transition: transform 0.15s;
}
input[role="switch"]:checked { background: var(--accent); }
input[role="switch"]:checked::after { transform: translateX(22px); }
.warn {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); font-size: 14px; line-height: 1.5;
}
.warn[hidden] { display: none; }
.warn svg { flex: none; margin-top: 2px; }

/* The wizard */
.wizard { max-width: 880px; width: 100%; margin: 0 auto; gap: 18px; }
.wizard-head { display: grid; gap: 16px; }
.wizard-head h1 { margin: 0; font-size: 24px; }
.wizard-head .icon-button { font-size: 22px; text-decoration: none; }
.wizard-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wizard-steps[hidden] { display: none; }
.wizard-steps button {
  width: 100%; min-height: 0; padding: 0; border: none; background: transparent; color: var(--muted);
  display: grid; gap: 8px; justify-content: stretch; text-align: left; font-size: 13px; font-weight: 700;
}
.wizard-steps .bar { height: 4px; border-radius: 2px; background: var(--border); }
.wizard-steps .is-done .bar, .wizard-steps .is-current .bar { background: var(--accent); }
.wizard-steps .is-current button { color: var(--text); }
@media (max-width: 640px) {
  .wizard-steps button > span:last-child { display: none; }
}
.wizard-step { display: grid; gap: 14px; }
.wizard-step[hidden] { display: none; }
.wizard-step > p { margin: 0; }
.step-title { font-size: 19px; margin: 0; }
.step-title:focus { outline: none; }
/* With the step bar showing, the step's own title is only for screen readers. */
.wizard.is-js .step-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.wizard:not(.is-js) .wizard-step + .wizard-step { border-top: 1px solid var(--border); padding-top: 18px; }
.name-field { max-width: 360px; }
.name-field input { font-size: 17px; }
.wizard-picture { display: flex; gap: 24px; align-items: flex-start; }
.big-preview { width: 180px; height: 180px; flex: none; border-radius: 16px; }
@media (max-width: 640px) {
  .wizard-picture { flex-direction: column; }
  .big-preview { width: 120px; height: 120px; }
}
.choices { border: none; padding: 0; display: grid; gap: 12px; }
.choice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 15px;
}
.choice:has(input:checked) { border: 2px solid var(--accent); padding: 15px; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.choice-text strong { font-size: 16px; }
.choice-text select { margin-top: 6px; max-width: 320px; }
.review { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.review .big-preview { width: 150px; height: 150px; }
.review .compare { flex: 1; min-width: 240px; gap: 12px 20px; margin: 0; }
.wizard-foot {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border); padding-top: 16px;
}
.wizard-foot [hidden] { display: none; }
.wizard-foot [data-step-count] { flex: 1; text-align: center; }
