:root {
  --color-fulfilled: #4caf7d;
  --color-partial: #e8b339;
  --color-unfulfilled: #c97b63;
  --color-unanswered: #d9d6d1;
  --color-wanted: #c76b93;
  --color-unwanted: #6f8fa8;
  --color-match: #4caf7d;
  --color-mismatch: #d98c3d;
  --color-align-good: #4caf7d;
  --color-align-partial: #e8b339;
  --color-align-bad: #d98c3d;
  --color-align-unrated: #d9d6d1;
  --color-bg: #faf8f4;
  --color-ink: #2b2b2b;
  --color-muted: #6b6b6b;
  --color-panel-bg: #ffffff;
  --color-border: rgba(0, 0, 0, 0.08);
  --ring-thickness: 5px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-ink);
}

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

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 1rem;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.app-title {
  font-size: 1.1rem;
  margin: 0;
  white-space: nowrap;
}

.person-controls,
.data-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

select#person-select {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.9rem;
}

.btn {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-ink);
}

.btn:hover { background: #f2f0eb; }

.btn-icon {
  padding: 0.35rem 0.55rem;
  line-height: 1;
}

.btn-done-active {
  background: var(--color-fulfilled);
  color: #fff;
  border-color: var(--color-fulfilled);
}
.btn-done-active:hover { background: var(--color-fulfilled); }

.tabs {
  display: flex;
  gap: 0.3rem;
}

.tab {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-muted);
}

.tab.active {
  background: var(--color-ink);
  color: #fff;
  border-color: var(--color-ink);
}

.lang-toggle {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.lang-btn {
  border: none;
  background: #fff;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-muted);
}

.lang-btn + .lang-btn { border-left: 1px solid var(--color-border); }

.lang-btn.active {
  background: var(--color-ink);
  color: #fff;
}

.legend {
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.swatch--fulfilled { background: var(--color-fulfilled); }
.swatch--partial { background: var(--color-partial); }
.swatch--unfulfilled { background: var(--color-unfulfilled); }
.swatch--unanswered { background: var(--color-unanswered); }

.swatch--align-good { background: var(--color-align-good); }
.swatch--align-partial { background: var(--color-align-partial); }
.swatch--align-bad { background: var(--color-align-bad); }
.swatch--align-unrated { background: var(--color-align-unrated); }

.legend--align {
  padding-top: 0.1rem;
}

.legend-label {
  font-weight: 600;
  color: var(--color-ink);
}

/* ---------- Main / hint ---------- */

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.hint {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  max-width: 640px;
  margin: 0.5rem auto 1.5rem;
}

/* ---------- Circular board ---------- */

.board-wrap {
  position: relative;
  width: min(96vw, 820px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

/* Concentric shaded bands behind the bubbles, echoing the original paper
   board's dark-outer/light-inner rings so the circle reads as zoned areas
   instead of empty space with dots scattered on it. `closest-side` makes
   the gradient's 100% stop land exactly at the box edge (radius 50 in the
   same units `layoutRing()` uses), so these percentages line up with the
   actual ring radii used in app.js. */
.board-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle closest-side at 50% 50%,
    var(--color-bg) 0%,
    var(--color-bg) 18%,
    #efe8da 18%,
    #efe8da 33%,
    #e3d9c3 33%,
    #e3d9c3 50%,
    transparent 50%
  );
  z-index: 0;
}


/* Category bubbles are adaptive rounded-rect "pills": they size to fit
   their own label instead of being squeezed into a fixed circle, which is
   what caused long titles to spill outside the shape. */
.bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bubble:hover,
.bubble:focus-visible {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  outline: none;
}

.bubble--outer {
  min-width: clamp(58px, 7.8vw, 75px);
  max-width: clamp(80px, 9.8vw, 100px);
  padding: 7px 8px;
}

.bubble--inner {
  min-width: clamp(48px, 6.2vw, 60px);
  max-width: clamp(64px, 7.8vw, 78px);
  padding: 5px 6px;
}

.bubble-label {
  font-size: clamp(0.56rem, 1vw, 0.64rem);
  line-height: 1.15;
  font-weight: 600;
  overflow-wrap: break-word;
  hyphens: auto;
}

.bubble--inner .bubble-label { font-size: clamp(0.5rem, 0.9vw, 0.56rem); }

.bubble-badge-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.bubble-badge {
  font-size: 0.58rem;
  color: var(--color-muted);
}

.mismatch-flag {
  font-size: 0.56rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-mismatch);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
}

.bubble-progress {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  background: var(--color-unanswered);
}

.bubble-progress > span { height: 100%; display: block; }

/* Two nested rings: .hub (outer) shows the alignment score (the "second
   color scale"), .hub-status-ring (middle) shows the plain status
   distribution as before, .hub-inner (center) holds the text. */
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(120px, 19vw, 175px);
  height: clamp(120px, 19vw, 175px);
  border-radius: 50%;
  padding: 7px;
  z-index: 1;
}

.hub-status-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 6px;
}

.hub-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.hub-name {
  font-weight: 700;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  margin-bottom: 0.1rem;
}

.hub-percent {
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.hub-sub {
  font-size: clamp(0.56rem, 1vw, 0.62rem);
  color: var(--color-muted);
  line-height: 1.25;
}

.hub-sub-secondary {
  font-size: clamp(0.54rem, 0.9vw, 0.58rem);
  color: var(--color-muted);
  opacity: 0.8;
  margin-top: 0.1rem;
}

/* On narrow screens there simply isn't enough circumference for 28
   variable-sized cards around two rings without them colliding. Below this
   breakpoint we drop the circular layout in favor of a plain wrapping grid,
   which can never overlap regardless of label length or viewport width. */
@media (max-width: 640px) {
  .hint { margin: 0.4rem auto 1rem; }

  .board-wrap {
    position: static;
    width: 100%;
    aspect-ratio: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
  }

  /* The zoned radial background is keyed to the circular layout's radii —
     with the board collapsed to a static wrapping list below, drop it and
     let the bubbles' own ring tints (below) carry the "zoned" grouping
     cue instead. */
  .board-wrap::before { display: none; }

  .hub {
    position: static;
    transform: none;
    width: clamp(150px, 56vw, 190px);
    height: clamp(150px, 56vw, 190px);
    order: -1;
    margin-bottom: 0.1rem;
  }

  #board-rings {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 480px;
  }

  .bubble {
    position: static;
    transform: none !important;
  }

  .bubble--outer,
  .bubble--inner {
    min-width: 104px;
    max-width: 44vw;
  }

  /* Faint ring-specific tint (matching the desktop zone-band colors)
     instead of plain white, so the two groups still read as distinct
     "zones" even without the circular background. */
  .bubble--outer { background: #e3d9c3; }
  .bubble--inner { background: #efe8da; }

  .bubble--outer .bubble-label,
  .bubble--inner .bubble-label {
    font-size: 0.72rem;
  }

  .bubble:hover,
  .bubble:focus-visible {
    transform: scale(1.03) !important;
  }
}

/* ---------- Overview tab ---------- */

.overview-total {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.mismatch-summary {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-mismatch);
  font-weight: 600;
}

.overview-total .big-percent {
  font-size: 2.2rem;
  font-weight: 700;
}

.overview-total-label {
  font-size: 0.9rem;
}

.overview-total-sub {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.overview-list {
  max-width: 640px;
  margin: 0 auto;
}

.overview-row {
  margin-bottom: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
}

.overview-row:hover { background: #f2f0eb; }

.overview-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.overview-row-head .cat-title { font-weight: 600; }
.overview-row-head .cat-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-muted);
  white-space: nowrap;
}

.progress-bar {
  height: 9px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  background: var(--color-unanswered);
}

.progress-bar > span { height: 100%; display: block; }
.progress-fulfilled { background: var(--color-fulfilled); }
.progress-partial { background: var(--color-partial); }
.progress-unfulfilled { background: var(--color-unfulfilled); }

/* ---------- Match tab ---------- */

.match-controls {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.match-select-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-muted);
  font-weight: 600;
}

.match-select-label select {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.9rem;
  color: var(--color-ink);
  min-width: 160px;
}

.match-vs {
  font-size: 1.2rem;
  color: var(--color-muted);
  padding-bottom: 0.5rem;
}

.match-locked {
  max-width: 420px;
  margin: 1rem auto 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.match-locked-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.match-summary {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.match-summary .big-percent {
  font-size: 2.2rem;
  font-weight: 700;
}

.match-summary-label {
  font-size: 0.9rem;
}

.match-all-good {
  text-align: center;
  color: var(--color-match);
  font-weight: 600;
  font-size: 0.95rem;
}

.discuss-list {
  max-width: 640px;
  margin: 0 auto;
}

.discuss-group { margin-bottom: 1.5rem; }

.discuss-group-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  margin: 0 0 0.6rem;
}

.discuss-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.7rem;
  background: #fff;
}

.discuss-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.discuss-tag {
  font-size: 0.64rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-mismatch);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

.discuss-compare {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.discuss-side {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.discuss-side-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-muted);
}

.chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
  color: #fff;
}

.chip--status-unanswered,
.chip--desire-unanswered { background: var(--color-unanswered); color: var(--color-ink); }
.chip--status-unfulfilled { background: var(--color-unfulfilled); }
.chip--status-partial-no,
.chip--status-partial-yes { background: var(--color-partial); }
.chip--status-fulfilled { background: var(--color-fulfilled); }
.chip--desire-unwanted { background: var(--color-unwanted); }
.chip--desire-wanted { background: var(--color-wanted); }

/* ---------- Side panel ---------- */

.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 100vw);
  background: var(--color-panel-bg);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  z-index: 50;
  padding: 1.4rem 1.2rem 3rem;
}

.panel.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-muted);
}

#panel-title {
  margin: 0 2rem 0.25rem 0;
  font-size: 1.15rem;
}

.panel-framing {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--color-muted);
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}

.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.item-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.item-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.item-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.match-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1em;
  text-align: right;
}

.match-indicator--match { color: var(--color-match); }
.match-indicator--mismatch { color: var(--color-mismatch); }

.item-explain {
  margin: -0.1rem 0 0.5rem;
}

.item-explain summary {
  font-size: 0.72rem;
  color: var(--color-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.item-explain summary::-webkit-details-marker { display: none; }

.item-explain summary::before {
  content: '▸';
  font-size: 0.6rem;
  transition: transform 0.15s ease;
}

.item-explain[open] summary::before { transform: rotate(90deg); }

.item-explain summary:hover { color: inherit; text-decoration: underline; }

.item-translation {
  font-size: 0.74rem;
  color: var(--color-muted);
  line-height: 1.35;
  margin: 0.35rem 0 0;
}

.item-row-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.control-label {
  font-size: 0.68rem;
  color: var(--color-muted);
  min-width: 3.4rem;
}

.status-group,
.desire-group {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.status-btn,
.desire-btn {
  border: none;
  background: #fff;
  padding: 0.28rem 0.45rem;
  font-size: 0.64rem;
  white-space: nowrap;
  cursor: pointer;
  color: var(--color-muted);
}

.status-btn + .status-btn,
.desire-btn + .desire-btn { border-left: 1px solid var(--color-border); }

.status-btn--unanswered.active { background: var(--color-unanswered); color: var(--color-ink); }
.status-btn--unfulfilled.active { background: var(--color-unfulfilled); color: #fff; }
.status-btn--partial-no.active,
.status-btn--partial-yes.active { background: var(--color-partial); color: #fff; }
.status-btn--fulfilled.active { background: var(--color-fulfilled); color: #fff; }

.desire-btn--unanswered.active { background: var(--color-unanswered); color: var(--color-ink); }
.desire-btn--unwanted.active { background: var(--color-unwanted); color: #fff; }
.desire-btn--wanted.active { background: var(--color-wanted); color: #fff; }

.note-toggle {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.28rem 0.4rem;
  margin-left: auto;
}

.note-toggle.has-note { background: #fff6da; border-color: #e8b339; }

.item-note {
  width: 100%;
  margin-top: 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  resize: vertical;
  min-height: 2.4rem;
}

.hidden { display: none !important; }

/* ---------- Footer ---------- */

.app-footer {
  max-width: 700px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  font-size: 0.72rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.5;
}

.app-footer a { color: var(--color-muted); }

.app-version {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--color-muted);
  opacity: 0.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 480px) {
  .topbar-row { justify-content: center; }
  .app-title { width: 100%; text-align: center; }
}

/* ---------- Primary button (shared by wizard footer/done screen) ---------- */

.btn-primary {
  background: var(--color-ink);
  color: #fff;
  border-color: var(--color-ink);
}

.btn-primary:hover { background: #000; }

/* ---------- Wizard FAB ---------- */

.wizard-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.wizard-fab:hover { background: #000; }

.wizard-fab-icon { font-size: 1.05rem; line-height: 1; }

.wizard-fab-count {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.72rem;
  min-width: 1.3em;
  text-align: center;
}

.wizard-fab--done { background: var(--color-fulfilled); }
.wizard-fab--done:hover { background: var(--color-fulfilled); }

@media (max-width: 480px) {
  .wizard-fab-label { display: none; }
  .wizard-fab { padding: 0.65rem 0.8rem; }
}

/* ---------- Wizard overlay ---------- */
/* Mobile-first: base rules below render the wizard as a full-screen sheet,
   which is the easiest way to answer a long run of quick questions with a
   thumb. The min-width query further down turns it into a smaller centered
   modal once there's enough room to spare. */

.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.wizard-overlay.hidden { display: none; }

.wizard-card {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
  border-radius: 16px 16px 0 0;
}

.wizard-progress-track {
  height: 4px;
  background: var(--color-border);
  flex-shrink: 0;
}

.wizard-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-ink);
  transition: width 0.25s ease;
}

.wizard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem 0.1rem;
  flex-shrink: 0;
}

.wizard-counter {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-muted);
}

.wizard-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0.3rem;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}

.wizard-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--color-muted);
  margin-bottom: 0.3rem;
}

.wizard-item-label {
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.wizard-control { margin-top: 1.1rem; }

.wizard-control .control-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
}

/* Bigger, wrapping, individually-bordered choice chips — the panel's
   connected-pill grouping works for a dense list of items, but here each
   step gets the full width of a phone screen, so touch targets can (and
   should) be much larger. */
.status-group--wizard,
.desire-group--wizard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: none;
  border-radius: 0;
}

.status-group--wizard .status-btn,
.desire-group--wizard .desire-btn {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 84px;
}

.status-group--wizard .status-btn + .status-btn,
.desire-group--wizard .desire-btn + .desire-btn {
  border-left: 1px solid var(--color-border);
}

.wizard-footer {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.25rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.wizard-btn-prev,
.wizard-btn-next {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
}

.wizard-btn-prev:disabled {
  opacity: 0.4;
  cursor: default;
}

.wizard-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2.5rem 0.5rem;
}

.wizard-done-emoji { font-size: 2.6rem; }
.wizard-done h3 { margin: 0; font-size: 1.15rem; }
.wizard-done p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  max-width: 320px;
}
.wizard-done .btn-primary {
  margin-top: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
}

@media (min-width: 641px) {
  .wizard-overlay {
    align-items: center;
    padding: 2rem;
  }

  .wizard-card {
    max-height: 85vh;
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  }
}

/* ---------- QR share ---------- */

.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.qr-overlay.hidden { display: none; }

.qr-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 360px;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  padding: 1.6rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.qr-card h2 { margin: 0 0 0.2rem; font-size: 1.1rem; }

.qr-person-name {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

.qr-code-box {
  width: 100%;
  max-width: 260px;
  margin: 0.4rem 0;
}

.qr-code-box svg { width: 100%; height: auto; display: block; }

.qr-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.qr-import-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.qr-import-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
  width: 100%;
  justify-content: center;
}
