/* register_flow.css -- Registration redesign (2026-12-02). Commit 1: the dark top bar, the 4-step
   stepper, and the field components used by the "About you" and "Sign-in" steps. Commit 2: the
   "Your places" step (map, Born in / Live in panel, search menus, "Can't find it?", mother tongue).
   Commit 3: the compact Review cards, "Create my account", and the "Is this you?" dialog.

   Loaded after register.css and cosmic.css, and only by templates/register.html. Colours come from
   cosmic.css's tokens (--qm-bg-deep, --qm-accent-saffron, --qm-accent-gold, --qm-text-primary,
   --qm-text-muted). Input rules are scoped through the step screens' ids so they win over
   cosmic.css's catch-all `body.qm-cosmic-register input:not(...)` fallback without !important.

   Plan: https://claude.ai/artifact/Pz8S528tErFJNRtwY7KqQK */

/* The page background is painted on <body>; keep <html> dark too so nothing light shows past it. */
html:has(> body.qm-cosmic-register) { background: var(--qm-bg-deep, #0a0a1a); }
/* Components below set their own display; [hidden] must still hide them. */
body.qm-cosmic-register [hidden] { display: none !important; }

body.qm-cosmic-register {
  --rf-panel: rgba(21, 21, 58, 0.72);
  --rf-line: rgba(245, 245, 220, 0.14);
  --rf-line-strong: rgba(245, 245, 220, 0.24);
  --rf-field: rgba(10, 10, 26, 0.6);
  --rf-ok: #3ecf8e;
  --rf-bad: #ff7a7a;
  --rf-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --rf-body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-family: var(--rf-body);
}

/* ---------- Top bar ---------- */
.qm-reg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(4vw, 16px);
  background: rgba(10, 10, 26, 0.92);
  border-bottom: 1px solid var(--qm-cosmic-border-soft);
}
.qm-reg-brand { display: inline-flex; align-items: center; line-height: 0; }
.qm-reg-top .qm-logo { height: 40px; width: auto; filter: none; }
.qm-reg-top-signin { margin: 0; font-size: 0.92rem; color: var(--qm-text-muted); text-align: right; }
.qm-reg-top-signin a { color: var(--qm-accent-gold); font-weight: 600; text-decoration: none; margin-left: 4px; white-space: nowrap; }
.qm-reg-top-signin a:hover { text-decoration: underline; }

/* ---------- Stepper ---------- */
.qm-stepper { max-width: 880px; margin: 0 auto; padding: 22px max(4vw, 16px) 6px; }
.qm-stepper ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qm-stepper-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qm-stepper-item.is-reachable { cursor: pointer; }
.qm-stepper-bar { display: block; height: 4px; border-radius: 4px; background: rgba(245, 245, 220, 0.12); transition: background 0.25s; }
.qm-stepper-item.is-active .qm-stepper-bar { background: linear-gradient(90deg, var(--qm-accent-saffron), var(--qm-accent-gold)); }
.qm-stepper-item.is-done .qm-stepper-bar { background: var(--rf-ok); }
.qm-stepper-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qm-stepper-label b { font-weight: 500; font-size: 0.88rem; color: var(--qm-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-stepper-label small { font-size: 0.75rem; color: rgba(160, 160, 176, 0.75); }
.qm-stepper-item.is-active .qm-stepper-label b { color: var(--qm-text-primary); font-weight: 650; }
.qm-stepper-item.is-done .qm-stepper-label b { color: var(--qm-text-primary); }
.qm-stepper-item.is-done .qm-stepper-num { font-size: 0; }
.qm-stepper-item.is-done .qm-stepper-num::before { content: "\2713"; font-size: 0.88rem; color: var(--rf-ok); }
.qm-stepper-item.is-reachable:hover .qm-stepper-label b { color: var(--qm-accent-gold); }
.qm-stepper-compact { display: none; margin: 8px 0 0; font-size: 0.85rem; color: var(--qm-text-muted); }

/* Assisted sign-up ("registering for someone else") -- one slim bar under the stepper. */
.qm-assist-bar {
  max-width: 880px;
  margin: 10px auto 0;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--qm-cosmic-border);
  color: var(--qm-text-primary);
  font-size: 0.88rem;
}
.qm-stepper + .qm-assist-bar { width: calc(100% - 2 * max(4vw, 16px)); }

/* ---------- Step screens (About you, Sign-in) ---------- */
.qm-flow-form { max-width: 600px; margin: 0 auto; padding-top: 18px; }
#screen-private h2.qm-flow-title,
#screen-places h2.qm-flow-title,
#screen-review h2.qm-flow-title,
#screen-signin h2.qm-flow-title {
  font-family: var(--rf-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--qm-text-primary);
  margin: 6px 0 6px;
}
.qm-flow-sub { margin: 0 0 18px; color: var(--qm-text-muted); font-size: 0.98rem; }
.qm-flow-summary {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 122, 122, 0.45);
  background: rgba(255, 122, 122, 0.08);
  color: #ffc2c2;
  font-size: 0.92rem;
}
.qm-flow-card {
  background: var(--rf-panel);
  border: 1px solid var(--rf-line);
  border-radius: 16px;
  padding: 22px 22px 8px;
}

/* A field: label above, box, then hint / error / ok line. */
.qm-f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.qm-f[hidden] { display: none; }
.qm-f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.qm-f-row:has(> #field-middle-name-wrap:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qm-f-row-birth { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.qm-f-label { font-size: 0.86rem; font-weight: 550; color: var(--qm-text-primary); }
.qm-f-label em { font-style: normal; font-weight: 400; color: var(--qm-text-muted); }
.qm-f-box { position: relative; display: flex; align-items: center; }
.qm-f-icon {
  position: absolute; left: 13px; width: 17px; height: 17px; pointer-events: none;
  fill: none; stroke: var(--qm-text-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rf-line-strong);
  border-radius: 10px;
  background: var(--rf-field);
  color: var(--qm-text-primary);
  font: 400 16px/1.2 var(--rf-body);
  transition: border-color 0.15s, box-shadow 0.15s;
}
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-f-icon + .qm-input { padding-left: 40px; }
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-f-box-btn .qm-input { padding-right: 46px; }
:is(#screen-private, #screen-places, #screen-signin, #screen-review) select.qm-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--qm-text-muted) 50%), linear-gradient(135deg, var(--qm-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input:hover { border-color: rgba(245, 245, 220, 0.38); }
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input:focus {
  outline: none;
  border-color: var(--qm-accent-saffron);
  box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.2);
}
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input::placeholder { color: rgba(160, 160, 176, 0.7); }
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input:disabled { opacity: 0.45; cursor: not-allowed; }
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-f.is-invalid .qm-input,
:is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-f.is-invalid .qm-seg { border-color: var(--rf-bad); }
.qm-f-error { margin: 0; font-size: 0.82rem; color: var(--rf-bad); }
.qm-f-ok { margin: 0; font-size: 0.82rem; color: var(--rf-ok); }
.qm-f-ok::before { content: "\2713  "; }
.qm-f-hint { margin: -8px 0 16px; font-size: 0.82rem; color: var(--qm-text-muted); }
.qm-f-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 0; padding: 8px 10px;
  border-radius: 8px; background: rgba(212, 175, 55, 0.08); font-size: 0.8rem; color: var(--qm-text-muted);
}
.qm-f-note[hidden] { display: none; }
.qm-f-note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; fill: none; stroke: var(--qm-accent-gold); stroke-width: 1.8; }
.qm-f-optional { border-top: 1px solid var(--rf-line); padding-top: 16px; }

/* Icon button inside a box (clock picker, PIN show/hide). */
.qm-f-iconbtn {
  position: absolute; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--qm-text-muted); display: grid; place-items: center; cursor: pointer;
}
.qm-f-iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qm-f-iconbtn:hover, .qm-f-iconbtn.is-on { color: var(--qm-accent-gold); background: rgba(212, 175, 55, 0.1); }
.qm-f-iconbtn:focus-visible { outline: 2px solid var(--qm-accent-saffron); outline-offset: 1px; }
.qm-f-iconbtn:disabled { opacity: 0.4; cursor: not-allowed; }
#tob-field.is-tob-unknown .qm-f-label { opacity: 0.55; }

/* Choice row (gender). */
.qm-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rf-line-strong); border-radius: 10px; overflow: hidden; }
.qm-seg-btn {
  min-height: 46px; padding: 8px 6px; border: 0; border-right: 1px solid var(--rf-line);
  background: var(--rf-field); color: var(--qm-text-muted); font: 500 0.95rem var(--rf-body); cursor: pointer;
}
.qm-seg-btn:last-child { border-right: 0; }
.qm-seg-btn:hover { color: var(--qm-text-primary); background: rgba(255, 153, 51, 0.06); }
.qm-seg-btn.is-active { background: rgba(255, 153, 51, 0.18); color: var(--qm-text-primary); font-weight: 650; box-shadow: inset 0 -2px 0 var(--qm-accent-saffron); }
.qm-seg-btn:focus-visible { outline: 2px solid var(--qm-accent-saffron); outline-offset: -2px; }

/* Date of birth: three menus. */
.qm-dob { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
#screen-private .qm-dob select.qm-input { padding: 0 24px 0 10px; background-position: calc(100% - 15px) 21px, calc(100% - 10px) 21px; }

/* Checkbox lines. */
.qm-check { display: flex; align-items: center; gap: 9px; margin: -6px 0 16px; font-size: 0.88rem; color: var(--qm-text-muted); cursor: pointer; width: fit-content; }
.qm-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--qm-accent-saffron); }

/* Buttons and actions. */
.qm-flow-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.qm-flow-consent { margin: 18px 0 0; font-size: 0.82rem; color: var(--qm-text-muted); }
.qm-flow-consent a { color: var(--qm-accent-gold); }
.qm-flow-btn {
  margin-left: auto;
  min-height: 48px; padding: 0 30px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, #ff9933, #ffb24d); color: #1a0e00;
  font: 650 1rem var(--rf-body); cursor: pointer; box-shadow: 0 8px 24px rgba(255, 153, 51, 0.22);
}
.qm-flow-btn:hover { filter: brightness(1.06); }
.qm-flow-btn:focus-visible { outline: 2px solid #fff3; outline-offset: 3px; }
.qm-flow-back, .qm-flow-link {
  border: 0; background: none; padding: 10px 4px; color: var(--qm-text-muted);
  font: 500 0.95rem var(--rf-body); cursor: pointer;
}
.qm-flow-back::before { content: "\2190  "; }
.qm-flow-back:hover, .qm-flow-link:hover { color: var(--qm-text-primary); }
.qm-flow-link { color: var(--qm-accent-gold); padding: 0; margin: -6px 0 16px; }

/* ---------- Your places (commit 2) ---------- */
.qm-places-head { max-width: 1240px; margin: 0 auto; padding-top: 18px; }
#screen-places .qm-flow-summary { max-width: 1240px; margin-left: auto; margin-right: auto; }
.qm-places {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start;
}
.qm-places-map { position: sticky; top: 16px; }
.qm-map {
  position: relative; height: min(72vh, 640px); min-height: 460px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #151a4a 0%, #0b0d22 70%);
  border: 1px solid var(--rf-line);
}
.qm-map .leaflet-container, .qm-map.leaflet-container { background: transparent; font-family: var(--rf-body); }
.qm-map[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; z-index: 500; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.04) 50%, transparent 70%);
  background-size: 200% 100%; animation: qm-map-shimmer 1.2s linear infinite;
}
@keyframes qm-map-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.qm-map-crumb {
  position: absolute; z-index: 600; top: 12px; left: 12px; display: flex; gap: 2px; padding: 3px;
  border-radius: 999px; background: rgba(10, 10, 26, 0.82); border: 1px solid var(--rf-line);
}
.qm-map-crumb button {
  border: 0; background: none; color: var(--qm-text-muted); font: 500 0.82rem var(--rf-body);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.qm-map-crumb button:hover { color: var(--qm-text-primary); }
.qm-map-crumb button.is-current { background: rgba(255, 153, 51, 0.18); color: var(--qm-text-primary); font-weight: 600; }
.qm-map-zoom {
  position: absolute; z-index: 600; top: 12px; right: 12px; display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden; background: rgba(10, 10, 26, 0.82); border: 1px solid var(--rf-line);
}
.qm-map-zoom button {
  width: 38px; height: 38px; border: 0; border-bottom: 1px solid var(--rf-line); background: none;
  color: var(--qm-text-primary); font: 500 1.1rem var(--rf-body); cursor: pointer;
}
.qm-map-zoom button:last-child { border-bottom: 0; font-size: 0.95rem; }
.qm-map-zoom button:hover { background: rgba(255, 153, 51, 0.14); }
.qm-map-legend {
  position: absolute; z-index: 600; left: 12px; bottom: 12px; margin: 0; display: flex; gap: 14px;
  padding: 7px 12px; border-radius: 999px; background: rgba(10, 10, 26, 0.82); border: 1px solid var(--rf-line);
  font-size: 0.8rem; color: var(--qm-text-primary);
}
.qm-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.qm-map-legend i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.qm-map-crumb button:focus-visible, .qm-map-zoom button:focus-visible { outline: 2px solid var(--qm-accent-saffron); outline-offset: -2px; }
.qm-map-tip.leaflet-tooltip {
  background: rgba(10, 10, 26, 0.94); color: var(--qm-text-primary); border: 1px solid var(--rf-line-strong);
  border-radius: 8px; padding: 6px 10px; box-shadow: none; font: 400 0.82rem var(--rf-body);
}
.qm-map-tip.leaflet-tooltip::before { display: none; }
.qm-map-tip b { display: block; font-weight: 600; }
.qm-map-tip span { color: var(--qm-text-muted); font-size: 0.75rem; }
.qm-map-pin i {
  display: block; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff7e0; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.qm-map-pin-birth i { background: var(--qm-accent-gold); }
.qm-map-pin-present i { background: var(--qm-accent-saffron); }
.qm-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The panel: Born in, Live in (one open at a time), then mother tongue and the Q-Map box. */
.qm-places-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qm-who { border: 1px solid var(--rf-line); border-radius: 16px; background: var(--rf-panel); }
.qm-who[data-target="birth"] { --who: var(--qm-accent-gold); }
.qm-who[data-target="present"] { --who: var(--qm-accent-saffron); }
.qm-who.is-open { border-color: color-mix(in srgb, var(--who) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--who) 20%, transparent); }
.qm-who-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: none;
  color: inherit; text-align: left; cursor: pointer; font-family: var(--rf-body);
}
.qm-who-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--who); box-shadow: 0 0 0 4px color-mix(in srgb, var(--who) 22%, transparent); }
.qm-who-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qm-who-text b { font-size: 1.02rem; font-weight: 650; color: var(--qm-text-primary); }
.qm-who-text small { font-size: 0.85rem; color: var(--qm-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-who-tick { color: var(--rf-ok); font-weight: 700; }
.qm-who-head:focus-visible { outline: 2px solid var(--who); outline-offset: -2px; border-radius: 16px; }
.qm-who-body { padding: 2px 16px 4px; }
.qm-who-body[hidden] { display: none; }
.qm-who-body .qm-f { margin-bottom: 14px; }
.qm-who-body .qm-f-hint { margin: -2px 0 0; }
.qm-who-body .qm-f-hint[hidden] { display: none; }
.qm-who-body > .qm-f-note { margin: -4px 0 14px; }
.qm-same-as-birth { margin: 0 0 12px; }
.qm-account-badge {
  margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; color: var(--qm-text-primary);
  background: rgba(255, 153, 51, 0.1); border: 1px solid rgba(255, 153, 51, 0.3);
}

/* Search menus (register_combobox.js). */
.qm-combo { position: relative; }
.qm-combo .qm-input { padding-right: 34px !important; }
.qm-combo::after {
  content: ""; position: absolute; right: 15px; top: 20px; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.6px solid var(--qm-text-muted); border-bottom: 1.6px solid var(--qm-text-muted); transform: rotate(45deg);
}
.qm-combo.is-open::after { transform: rotate(225deg); top: 23px; }
.qm-combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
  list-style: none; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  background: #10132f; border: 1px solid var(--rf-line-strong); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.qm-combo-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 10px; border-radius: 8px; font-size: 0.95rem; color: var(--qm-text-primary); cursor: pointer;
}
.qm-combo-list li small { color: var(--qm-text-muted); font-size: 0.78rem; text-align: right; flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qm-combo-list li.is-active { background: rgba(255, 153, 51, 0.16); }
.qm-combo-list li[aria-selected="true"] span::after { content: "  \2713"; color: var(--rf-ok); }
.qm-combo-list li.qm-combo-empty { color: var(--qm-text-muted); font-size: 0.85rem; cursor: default; }
/* "Can't find it?" -- always the very last row: small, right-aligned, a tick box look. */
.qm-combo-list li.qm-combo-cant {
  justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 10px;
  border-top: 1px solid var(--rf-line); border-radius: 0 0 8px 8px; font-size: 0.82rem; color: var(--qm-text-muted);
}
.qm-combo-cant i { width: 15px; height: 15px; border: 1.5px solid var(--qm-text-muted); border-radius: 4px; }
.qm-combo-list li.qm-combo-cant.is-active, .qm-combo-list li.qm-combo-cant:hover { color: var(--qm-text-primary); background: rgba(255, 153, 51, 0.1); }
.qm-combo.is-disabled .qm-input { cursor: not-allowed; }
.qm-combo.is-replaced .qm-input { opacity: 0.4; }

.qm-f-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qm-cantfind { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--qm-text-muted); cursor: pointer; }
.qm-cantfind[hidden] { display: none; }
.qm-cantfind input { width: 15px; height: 15px; margin: 0; accent-color: var(--qm-accent-saffron); }
.qm-newplace { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.qm-newplace[hidden] { display: none; }
.qm-newplace .qm-f-hint { margin: 0; }
.qm-newplace-matches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.qm-newplace-matches[hidden] { display: none; }
.qm-newplace-matches button {
  border: 1px solid rgba(212, 175, 55, 0.45); background: rgba(212, 175, 55, 0.08); color: var(--qm-accent-gold);
  border-radius: 999px; padding: 5px 11px; font: 500 0.82rem var(--rf-body); cursor: pointer;
}

/* Mother tongue, right under Live in. */
.qm-tongue { border: 1px solid rgba(255, 153, 51, 0.35); border-radius: 16px; background: var(--rf-panel); padding: 14px 16px 0; }
.qm-tongue .qm-f { margin-bottom: 14px; }
.qm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qm-chips:empty { display: none; }
.qm-chip {
  min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--rf-line-strong);
  background: var(--rf-field); color: var(--qm-text-primary); font: 500 0.88rem var(--rf-body); cursor: pointer;
}
.qm-chip:hover { border-color: rgba(255, 153, 51, 0.6); }
.qm-chip.is-on { border-color: var(--qm-accent-saffron); background: rgba(255, 153, 51, 0.18); }
.qm-chip.is-on::before { content: "\2713  "; color: var(--qm-accent-saffron); }

/* Q-Map consent, folded away. */
.qm-gps-fold { border: 1px solid var(--rf-line); border-radius: 14px; padding: 0 16px; background: rgba(10, 10, 26, 0.35); }
.qm-gps-fold[hidden] { display: none; }
.qm-gps-fold summary { padding: 13px 0; cursor: pointer; font-size: 0.9rem; color: var(--qm-text-muted); }
.qm-gps-fold summary:hover { color: var(--qm-text-primary); }
.qm-gps-fold[open] summary { color: var(--qm-text-primary); }
.qm-gps-fold .qm-check { margin: 0 0 12px; align-items: flex-start; width: auto; font-size: 0.84rem; }
.qm-gps-fold .qm-check input { margin-top: 2px; flex: none; }
.qm-gps-fold > .qm-f-note { margin: 0 0 12px; }
.qm-gps-fold > .qm-f-note:empty { display: none; }
.qm-places-actions { max-width: 1240px; margin-left: auto; margin-right: auto; }

@media (max-width: 1000px) {
  .qm-places { grid-template-columns: minmax(0, 1fr); }
  .qm-places-map { position: static; }
  .qm-map { height: 360px; min-height: 0; }
}

/* ---------- Review (commit 3) ---------- */
.qm-review { max-width: 760px; }
.qm-rv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qm-rv-card { background: var(--rf-panel); border: 1px solid var(--rf-line); border-radius: 16px; padding: 14px 16px 12px; min-width: 0; }
.qm-rv-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.qm-rv-card h3 { margin: 0; font: 600 0.82rem var(--rf-body); color: var(--qm-text-muted); letter-spacing: 0; text-transform: none; }
.qm-rv-card p { margin: 0 0 4px; font-size: 0.95rem; color: var(--qm-text-primary); overflow-wrap: anywhere; }
.qm-rv-card p.qm-rv-main { font-size: 1.05rem; font-weight: 600; }
.qm-rv-card p.qm-rv-muted, .qm-rv-muted { color: var(--qm-text-muted); font-size: 0.88rem; }
.qm-rv-edit { border: 0; background: none; padding: 4px 2px; color: var(--qm-accent-saffron); font: 600 0.85rem var(--rf-body); cursor: pointer; }
.qm-rv-edit:hover { text-decoration: underline; }
.qm-rv-place { display: flex; gap: 10px; align-items: flex-start; }
.qm-rv-place span { display: flex; flex-direction: column; min-width: 0; }
.qm-rv-place small { font-size: 0.75rem; color: var(--qm-text-muted); }
.qm-rv-place b { font-weight: 500; }
.qm-rv-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.qm-rv-dot.is-birth { background: var(--qm-accent-gold); }
.qm-rv-dot.is-present { background: var(--qm-accent-saffron); }
.qm-rv-badge { display: inline-block; margin-top: 4px !important; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem !important; font-weight: 600; color: var(--qm-accent-saffron) !important; background: rgba(255, 153, 51, 0.14); }
.qm-rv-create { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; }
.qm-rv-create-btn {
  width: 100%; min-height: 60px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(90deg, #ff9933, #ffb24d); color: #1a0e00; font: 700 1.2rem var(--rf-body);
  box-shadow: 0 14px 34px rgba(255, 153, 51, 0.3);
}
.qm-rv-create-btn:hover { filter: brightness(1.06); }
.qm-rv-create-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.qm-rv-create-btn.is-busy { opacity: 0.75; cursor: progress; }
.qm-rv-create-note { margin: 0; font-size: 0.85rem; color: var(--qm-text-muted); text-align: center; }
.qm-rv-assisted { margin-top: 20px; padding: 18px; border-radius: 16px; border: 1px solid var(--qm-cosmic-border); background: var(--rf-panel); }
.qm-rv-assisted h3 { margin: 0 0 6px; font-family: var(--rf-display); color: var(--qm-text-primary); }
.qm-rv-assisted p { color: var(--qm-text-muted); }
.qm-rv-ids p { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--qm-text-primary); }
.qm-rv-ids small { min-width: 7em; color: var(--qm-text-muted); }
.qm-rv-ids code { font-size: 1.15rem; color: var(--qm-accent-gold); }
.qm-dup {
  max-width: 440px; width: calc(100% - 32px); padding: 22px; border-radius: 18px;
  border: 1px solid var(--qm-cosmic-border); background: #12143a; color: var(--qm-text-primary);
}
.qm-dup::backdrop { background: rgba(5, 6, 15, 0.7); }
.qm-dup h3 { margin: 0 0 8px; font-family: var(--rf-display); font-size: 1.5rem; }
.qm-dup p { margin: 0 0 18px; color: var(--qm-text-muted); }
.qm-dup-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.qm-dup-actions .qm-flow-btn { margin: 0; display: grid; place-items: center; text-decoration: none; }
.qm-dup-new::before { content: none; }
.qm-reg-foot { text-align: center; font-size: 0.78rem; padding: 18px 16px 28px; }
.qm-reg-foot a { color: var(--qm-text-muted); }

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  .qm-reg-top { padding: 10px 16px; }
  .qm-reg-top .qm-logo { height: 32px; }
  .qm-reg-top-signin > span { display: none; }
  .qm-stepper { padding: 14px 16px 0; }
  .qm-stepper ol { gap: 4px; }
  .qm-stepper-label { display: none; }
  .qm-stepper-compact { display: block; }
  .qm-f-row,
  .qm-f-row-birth,
  .qm-f-row:has(> #field-middle-name-wrap:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .qm-flow-card { padding: 18px 16px 4px; border-radius: 14px; }
  .qm-flow-actions { position: sticky; bottom: 0; z-index: 5; margin: 16px -16px 0; padding: 12px 84px calc(12px + env(safe-area-inset-bottom, 0px)) 16px; background: rgba(10, 10, 26, 0.96); border-top: 1px solid var(--rf-line); }
  .qm-flow-btn { flex: 1 1 auto; }
  .qm-map { height: 300px; border-radius: 14px; }
  .qm-rv-grid { grid-template-columns: minmax(0, 1fr); }
  .qm-map-crumb button { padding: 6px 9px; }
  /* the right 84px of the bar is left for the floating support button, which sits over it */
}
@media (prefers-reduced-motion: reduce) {
  .qm-stepper-bar, :is(#screen-private, #screen-places, #screen-signin, #screen-review) .qm-input { transition: none; }
  .qm-map[aria-busy="true"]::after { animation: none; }
}
