/* ==========================================================================
   SETL MAP — questions.css  (questions agent)
   Screens 02–05: who · grow · tuesday · plan.   Prefix: .q-
   Hover states use CSS translate/scale/rotate on elements that GSAP only touches
   transiently (entrance tweens end with clearProps:'transform').
   ========================================================================== */

.q-screen {
  --q-h2: clamp(2.125rem, 3.1vw, 3.1rem);
  --q-ribbon-h: 0px;
  --q-top: clamp(16px, 4svh, 48px);   /* one fixed offset: the eyebrow starts at the same y on every step */
}
.q-screen--tuesday { --q-ribbon-h: 0px; }

/* ───── Scene slot: fallback sky when no scene is docked, manifest strip on top ───── */
.q-slot { overflow: hidden; }
.q-slot--bare { background: var(--grad-sky); }
@media (max-width: 1023px) { .q-slot { border-radius: 0; } }

.q-manifest {
  position: absolute; z-index: 6; left: 12px; right: 12px; bottom: calc(12px + var(--q-ribbon-h));
  display: block;
  padding: 12px 18px; border-radius: var(--r-lg);
  background: var(--glass-paper); box-shadow: var(--shadow-soft);
  font: italic 500 var(--fs-manifest)/1.2 var(--font-display); font-variant-numeric: lining-nums; color: var(--ink);
  pointer-events: none;
}
.q-manifest__label { color: var(--ink-2); white-space: nowrap; display: inline; }
.q-manifest__words { display: inline; }
.q-manifest__empty { color: var(--ink-2); }
.q-manifest.is-empty .q-manifest__label, .q-manifest.is-empty .q-manifest__words { display: none; }
.q-manifest:not(.is-empty) .q-manifest__empty { display: none; }
.q-w { display: inline-flex; gap: .45em; overflow: hidden; padding-block: .14em; margin-block: -.14em; margin-right: .45em; white-space: nowrap; vertical-align: bottom; }
.q-manifest__label { margin-right: .45em; }
.q-w:last-child .q-w__sep { display: none; }
.q-w__sep { color: var(--sun-deep); font-style: normal; margin-left: -.45em; }   /* comma sits flush against the word */
.q-w__in, .q-w__sep { display: inline-block; }
@media (max-width: 1023px) {
  .q-screen--tuesday .q-manifest { display: none; }   /* the film ribbon owns the bottom of the scene on phones */
}
@media (min-width: 1024px) { .q-screen--tuesday { --q-ribbon-h: 76px; } }

/* ───── Head: step label, headline, hint, talking feedback ───── */
.q-head { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.q-step { display: flex; align-items: center; gap: 12px; color: var(--sun-deep); }
.q-pips { display: inline-flex; align-items: center; gap: 4px; }
.q-pips i { display: block; width: 14px; height: 3px; border-radius: 3px; background: var(--line); transition: background-color var(--dur-s), width var(--dur-s) var(--ease-out); }
.q-pips i.is-done { background: var(--ink); }
.q-pips i.is-cur { width: 24px; background: var(--terra); }

.q-title { font-size: var(--q-h2); line-height: .98; margin-top: 2px; text-wrap: balance; }
.q-screen--who .q-title { font-size: var(--fs-h2); }
/* flex column = no margin collapsing between the masked lines (keeps the line-height honest) */
.q-title .sl-vis.sl-vis--lines { display: flex; flex-direction: column; }
.q-hint { font: 400 var(--fs-body)/1.45 var(--font-text); color: var(--ink-2); max-width: 30em; margin-top: 10px; }

/* a quiet margin note (no box): reserves two lines so nothing jumps when the answer talks back */
.q-feedback {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  padding: 0; min-height: calc(2 * 1.4 * .9375rem);
  font: 500 .9375rem/1.4 var(--font-text); color: var(--ink); max-width: 34em;
  transition: color var(--dur-s);
}
.q-feedback.is-idle { color: var(--ink-2); font-weight: 400; }
.q-feedback__icon { flex: none; display: inline-flex; margin-top: 1px; color: var(--sun-deep); }
.q-feedback__text { min-width: 0; text-wrap: pretty; }

.q-counter { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--ink-2); }
.q-counter__n { color: var(--ink); font: 600 1.125rem/1 var(--font-text); letter-spacing: 0; transition: color var(--dur-s); }
.q-counter.is-zero .q-counter__n { color: var(--ink-3); }

/* ───── Panel layout ───── */
.q-panel { min-width: 0; }
.q-scroll { display: contents; }
.q-body { margin-top: var(--space-4); }
.q-cta .cta-bar__hint:empty { display: none; }
.q-cta .cta-bar__hint { order: -1; }
.q-cta .cta-bar__hint.is-nudge { animation: q-nudge 1.1s var(--ease-out); }
@keyframes q-nudge { 0%, 100% { color: var(--ink-3); } 25% { color: var(--err); } }
.q-screen--who .q-cta .cta-bar__hint:empty { display: block; }
.q-back { display: none; }
.q-skipto { align-self: center; }

/* desktop + landscape phones: head and options scroll inside; the buttons stay put underneath */
@media (min-width: 1024px), (orientation: landscape) and (max-height: 520px) {
  /* top-anchored: eyebrow + heading sit at the same y on every step, the CTA row rests on the bottom edge */
  .q-panel { grid-row: 1; display: flex; flex-direction: column; justify-content: flex-start; align-self: stretch; overflow: hidden; }
  .q-slot { grid-row: 1; }
  .q-scroll {
    display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    padding: var(--q-top) 10px 26px 0; margin: 0;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 min(var(--q-top), 28px), #000 calc(100% - 26px), transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0, #000 min(var(--q-top), 28px), #000 calc(100% - 26px), transparent 100%);
  }
  .q-scroll::-webkit-scrollbar { width: 6px; }
  .q-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
  .q-cta { flex: none; flex-wrap: wrap; margin: auto 0 0; padding-top: 14px; }
  .q-cta .cta-bar__hint { order: 3; }
  .q-back { display: inline-flex; }
  .q-skipto { margin-left: auto; }
}
/* desktop: leave breathing room above the demo tag that sits in the bottom-left corner */
@media (min-width: 1024px) {
  .q-screen { padding-bottom: 52px; }
  .q-slot { height: calc(100vh - var(--header-h) - var(--safe-t) - 68px); height: calc(100svh - var(--header-h) - var(--safe-t) - 68px); }
}

/* ───── WHO: five tactile cards ───── */
.q-cards {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 4px calc(-1 * (var(--page-pad) + var(--safe-r))) 0 calc(-1 * (var(--page-pad) + var(--safe-l)));
  padding: 10px calc(var(--page-pad) + var(--safe-r)) 16px calc(var(--page-pad) + var(--safe-l));
  scroll-padding-inline: calc(var(--page-pad) + var(--safe-l)); scrollbar-width: none;
}
.q-cards::-webkit-scrollbar { display: none; }
.q-card {
  --focus-radius: var(--r-card);
  position: relative; flex: 0 0 152px; height: 192px; min-width: 0; scroll-snap-align: start;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 6px; padding: 14px 14px 16px;
  border-radius: var(--r-card); border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-card); text-align: left; -webkit-tap-highlight-color: transparent;
  transition: translate var(--dur-xs) var(--ease-out), rotate var(--dur-xs) var(--ease-out), scale var(--dur-press),
              border-color var(--dur-xs), background-color var(--dur-xs), opacity var(--dur-s) var(--ease-standard), box-shadow var(--dur-xs);
}
.q-card__artbox { display: block; min-height: 0; margin: 0 -2px; }
.q-card__art { width: 100%; height: 100%; overflow: visible; }
.q-card__label { font: 600 1rem/1.2 var(--font-text); color: var(--ink); overflow-wrap: anywhere; }
.q-card__sub { font: 400 .8125rem/1.35 var(--font-text); color: var(--ink-2); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.q-card:active { scale: .98; }
.q-card:focus-visible { box-shadow: var(--ring), var(--shadow-card); }
.q-card[aria-checked="true"] {
  border-width: 2px; padding: 13.5px 13.5px 15.5px; border-color: var(--ink); background: var(--card-2);
  box-shadow: var(--shadow-pick), var(--shadow-card);
}
.q-card[aria-checked="true"]:focus-visible { box-shadow: var(--ring), var(--shadow-pick), var(--shadow-card); }
.q-cards.has-pick .q-card:not([aria-checked="true"]) { opacity: .78; }

.q-card__check {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  scale: .4; opacity: 0; transition: scale .35s var(--ease-spring), opacity var(--dur-xs);
}
.q-card__check svg { width: 16px; height: 16px; }
.q-card__check path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s var(--ease-out) .12s; }
.q-card[aria-checked="true"] .q-card__check { scale: 1; opacity: 1; }
.q-card[aria-checked="true"] .q-card__check path { stroke-dashoffset: 0; }

/* the little faceless people */
.q-art__sun { fill: var(--paper-2); transition: fill .45s var(--ease-standard); }
.q-art__ground { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.q-fig__part { fill: var(--c); fill-opacity: .55; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; transition: fill-opacity .35s var(--ease-standard); }
.q-fig__shadow { fill: color-mix(in srgb, var(--ink) 14%, transparent); }
.q-fig--ghost .q-fig__part { fill: none; fill-opacity: 1; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.q-art__link { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; opacity: .85; }
.q-art__q { font: 600 46px var(--font-display); fill: var(--terra); }
.q-card[aria-checked="true"] .q-fig__part, .q-fly .q-fig__part { fill-opacity: 1; }
.q-card[aria-checked="true"] .q-fig--ghost .q-fig__part { stroke: var(--ink); }
.q-card[aria-checked="true"] .q-art__sun, .q-fly .q-art__sun { fill: var(--glow); }
.q-cards.has-pick .q-card:not([aria-checked="true"]) .q-fig__part { fill-opacity: .35; }
@keyframes q-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@media (hover: hover) and (pointer: fine) {
  .q-card:hover:not([aria-checked="true"]) { translate: 0 -4px; rotate: -.4deg; border-color: var(--line-strong); opacity: 1; }
  .q-card:hover .q-figs { animation: q-bob 2s var(--ease-breath) infinite; }
}
.q-fly { display: block; width: 100%; height: 100%; padding: 6px; border-radius: 16px; background: var(--card-2); border: 1.5px solid var(--ink); box-shadow: var(--shadow-pick); }
.q-fly--disc { display: grid; place-items: center; padding: 0; border-radius: 50%; background: var(--sun); box-shadow: none; color: var(--ink); }

/* tablet portrait + desktop with room: the five cards fill the row */
@media (min-width: 640px) and (max-width: 1023px) and (min-height: 521px), (min-width: 1024px) and (min-height: 600px) {
  .q-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gutter); overflow: visible; margin: 8px 0 0; padding: 0; }
  .q-card { flex: none; height: clamp(190px, 28svh, 260px); }
}
@media (min-width: 1024px) and (min-height: 600px) {
  /* the scene band takes whatever height the cards and the CTA leave over, so the whole room stays visible */
  .q-screen--who { grid-template-rows: minmax(220px, 1fr) auto auto; row-gap: var(--space-5); align-content: stretch; }
  .q-screen--who .q-panel, .q-screen--who .q-scroll { display: contents; }
  .q-screen--who .q-head { grid-column: 1 / span 5; grid-row: 1; align-self: start; margin: 0; padding-top: var(--q-top); }
  /* the caption rides the ceiling beams, not the floor and the furniture */
  .q-screen--who .q-manifest {
    top: 12px; bottom: auto; padding: 8px 16px; font-size: clamp(1.125rem, 1.4vw, 1.5rem);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .q-screen--who .q-manifest__empty { white-space: nowrap; }
  .q-screen--who .q-slot { grid-column: 6 / -1; grid-row: 1; height: 100%; align-self: stretch; position: relative; }
  .q-screen--who .q-cards { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .q-screen--who .q-cta { grid-column: 1 / span 8; grid-row: 3; margin: 0; padding: 0; }
  .q-card { padding: 18px 18px 20px; gap: 8px; }
  .q-card[aria-checked="true"] { padding: 17.5px 17.5px 19.5px; }
  .q-card__label { font-size: 1.0625rem; }
  .q-card__sub { font-size: .875rem; }
}

/* ───── GROW: chips ───── */
.q-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q-chip { width: 100%; min-width: 0; padding-right: 14px; }
.q-chip .chip__label { overflow-wrap: break-word; line-height: 1.2; }
@media (max-width: 479px) {
  .q-chip { padding-right: 10px; }
  .q-chip .chip__check { display: none; }
}
@media (max-width: 380px) {
  .q-chip { gap: 8px; padding-left: 6px; padding-right: 8px; }
  .q-chip .chip__disc { width: 36px; height: 36px; }
  .q-chip .chip__label { font-size: 13px; overflow-wrap: normal; hyphens: none; }
}

/* ───── TUESDAY: phrase rows ───── */
.q-rows { display: flex; flex-direction: column; gap: 8px; }
.q-row {
  --focus-radius: var(--r-lg);
  display: grid; grid-template-columns: 3.4em 24px minmax(0, 1fr) 26px; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 12px 16px; border-radius: var(--r-lg);
  border: 1.5px solid var(--line); background: var(--card); box-shadow: var(--shadow-soft); text-align: left; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: translate var(--dur-xs) var(--ease-out), scale var(--dur-press), border-color var(--dur-xs), background-color var(--dur-xs), box-shadow var(--dur-xs);
}
.q-row__time {
  justify-self: start; min-width: 3.4em; padding: 5px 7px; border-radius: var(--r-pill); text-align: center;
  font: 500 var(--fs-caption)/1 var(--font-text); letter-spacing: var(--track-caption); color: var(--sun-deep); font-variant-numeric: tabular-nums lining-nums;
  transition: background-color var(--dur-xs), color var(--dur-xs);
}
.q-row__icon { display: inline-flex; color: var(--ink-2); }
.q-row__label { font: 600 .9375rem/1.3 var(--font-text); text-wrap: pretty; }
.q-row__check {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: var(--paper);
  transition: background-color var(--dur-xs), border-color var(--dur-xs);
}
.q-row__tick { width: 14px; height: 14px; }
.q-row__tick path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s var(--ease-out) .05s; }
.q-row:active { scale: .985; }
.q-row:focus-visible { box-shadow: var(--ring), var(--shadow-soft); }
.q-row[aria-checked="true"] { border-width: 2px; padding: 11.5px 15.5px; border-color: var(--ink); background: var(--card-2); box-shadow: var(--shadow-pick); }
.q-row[aria-checked="true"]:focus-visible { box-shadow: var(--ring), var(--shadow-pick); }
.q-row[aria-checked="true"] .q-row__time { background: var(--glow); color: var(--ink); }
.q-row[aria-checked="true"] .q-row__icon { color: var(--ink); }
.q-row[aria-checked="true"] .q-row__check { background: var(--ink); border-color: var(--ink); }
.q-row[aria-checked="true"] .q-row__tick path { stroke-dashoffset: 0; }
@media (hover: hover) and (pointer: fine) {
  .q-row:hover:not([aria-checked="true"]) { translate: 4px 0; border-color: var(--line-strong); }
}
@media (min-width: 1024px) {
  .q-row { min-height: 56px; padding-block: 8px; }
  .q-row[aria-checked="true"] { padding-block: 7.5px; }
  .q-rows { gap: 6px; }
}

/* ───── PLAN: three cream blocks ───── */
.q-blocks { display: flex; flex-direction: column; gap: 12px; }
.q-block {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; border-radius: var(--r-card);
  background: var(--paper); border: 1.5px solid var(--line); min-width: 0;
}
@media (min-width: 1024px) { .q-block { background: var(--card); box-shadow: var(--shadow-soft); } }
.q-block__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; }
.q-block__cap { font: 500 var(--fs-caption)/1.2 var(--font-text); text-transform: uppercase; letter-spacing: var(--track-caption); color: var(--ink-3); }
.q-block__title { font: 600 1rem/1.3 var(--font-text); letter-spacing: 0; color: var(--ink); overflow-wrap: normal; }
.q-block__note { font: 400 var(--fs-small)/1.4 var(--font-text); color: var(--ink-2); }

.q-budget__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; color: var(--ink); font-size: var(--fs-num-lg); min-height: 1.25em; }
.q-budget__w { font-size: .62em; font-weight: 500; color: var(--ink-2); white-space: pre; }
.q-budget__n { display: inline-flex; }
.q-matches { padding: 9px 14px; min-height: 3.9rem; border-radius: var(--r-field); background: var(--paper-2); display: flex; flex-direction: column; gap: 2px; justify-content: center; }
@media (min-width: 1024px) { .q-matches { background: var(--paper); } }
.q-matches__main { font: 500 .9375rem/1.35 var(--font-text); color: var(--ink); }
.q-matches__main .num { font-weight: 600; }
.q-matches__main .nr { white-space: nowrap; }
.q-matches__sub { font: 400 .8125rem/1.35 var(--font-text); color: var(--ink-2); }

/* sun-on-sky slider */
.q-slider { margin-top: 4px; }
.q-range { position: relative; height: 44px; margin-inline: 22px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.q-range__track { position: absolute; left: 0; right: 0; top: 50%; height: 12px; margin-top: -6px; border-radius: var(--r-pill); background: var(--grad-budget); overflow: hidden; }
.q-range__track::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px var(--ink); pointer-events: none; z-index: 2; }
.q-range__dim { position: absolute; top: 0; bottom: 0; width: 100%; background: var(--glass-paper); background: color-mix(in srgb, var(--paper) 68%, transparent); }
.q-range__dim--l { left: 0; transform-origin: 0 50%; transform: scaleX(0); }
.q-range__dim--r { right: 0; transform-origin: 100% 50%; transform: scaleX(0); }
.q-thumb {
  --focus-radius: 50%;
  position: absolute; left: 0; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.q-thumb--max { z-index: 2; }
.q-thumb__halo { position: absolute; width: 56px; height: 56px; border-radius: 50%; background: var(--glow-soft); scale: .5; opacity: 0; transition: scale .3s var(--ease-spring), opacity var(--dur-xs); pointer-events: none; }
.q-thumb__disc {
  position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--grad-sun); border: 2px solid var(--ink);
  transition: scale var(--dur-xs) var(--ease-out); box-shadow: var(--shadow-soft);
}
.q-thumb__rays { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink); opacity: 0; transition: opacity var(--dur-xs); pointer-events: none; }
.q-thumb__rays svg { width: 44px; height: 44px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.q-thumb:focus-visible { box-shadow: none; }
.q-thumb:focus-visible .q-thumb__disc { box-shadow: var(--ring); }
.q-thumb:focus-visible .q-thumb__halo, .q-thumb.is-active .q-thumb__halo { scale: 1; opacity: 1; }
.q-thumb.is-active { cursor: grabbing; }
.q-thumb.is-active .q-thumb__disc { scale: 1.08; }
.q-thumb.is-active .q-thumb__rays, .q-thumb:focus-visible .q-thumb__rays { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .q-thumb:hover .q-thumb__halo { scale: 1; opacity: 1; }
  .q-thumb:hover .q-thumb__rays { opacity: 1; }
}
.q-ruler { position: relative; height: 32px; margin-inline: 22px; margin-top: 2px; }
.q-ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 3px, transparent 3px 7px); }
.q-ruler__tick { position: absolute; top: 0; width: 1.5px; height: 7px; margin-left: -.75px; background: var(--line-strong); }
.q-ruler__tick.is-major { height: 11px; }
.q-ruler__label { position: absolute; top: 15px; translate: -50% 0; font: 500 .6875rem/1 var(--font-text); letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .q-ruler__label { font-size: .75rem; } }

/* horizon segmented control */
.q-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; border-radius: var(--r-pill); background: var(--paper-2); }
@media (max-width: 1023px) { .q-seg { background: var(--paper-3); } }
.q-seg__btn {
  --focus-radius: var(--r-pill);
  position: relative; min-height: 48px; border-radius: var(--r-pill); display: grid; place-items: center; padding-left: 12px;
  font: 600 .9375rem/1 var(--font-text); color: var(--ink-2); transition: color var(--dur-xs); -webkit-tap-highlight-color: transparent;
}
.q-seg__btn[aria-checked="true"] { color: var(--ink); }
.q-seg__btn:active { scale: .97; }
.q-seg__label { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.q-seg__ind { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--card-2); border: 1.5px solid var(--ink); box-shadow: var(--shadow-soft); pointer-events: none; }
.q-seg__sun { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--grad-sun); border: 1.5px solid var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .q-seg__btn:hover:not([aria-checked="true"]) { color: var(--ink); }
}

/* rooms */
.q-rooms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.q-roomchip { min-width: 56px; }

/* ───── Phones & small tablets: a tighter sheet, the scene gets a little less room ───── */
@media (max-width: 1023px) {
  .q-screen { --scene-h: 33svh; }
  .q-manifest { bottom: 34px; left: 10px; right: 10px; padding: 8px 14px; border-radius: var(--r-sm); }
  .q-feedback, .q-feedback.is-idle { min-height: calc(2 * 1.4 * .9375rem); margin-top: 0; }
  .q-hint { margin-top: 6px; }
  .q-card { height: 184px; }
  .q-screen--who .q-head { gap: 6px; }
}
/* a soft fade above the sticky CTA tells the sheet there is more to scroll */
@media (max-width: 1023px) and (min-height: 521px) {
  .q-cta::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--card));
  }
}

/* small phones (portrait): a slimmer scene and a tighter heading, so a whole row of options is visible */
@media (max-width: 1023px) and (orientation: portrait) and (max-height: 760px) {
  .q-screen { --scene-h: 22svh; }
  .panel.q-panel { padding-top: var(--space-4); }
  .q-panel::before { margin-bottom: var(--space-3); }
  .q-title { font-size: 1.75rem; }
  .q-hint { font-size: .9375rem; line-height: 1.4; margin-top: 4px; }
  .q-feedback.is-idle { display: none; }
  .q-body { margin-top: var(--space-3); }
  .q-card { height: 168px; }
  .q-card__sub { min-height: 0; }
  .q-manifest.is-empty { display: none; }            /* the empty-state line would eat the whole scene */
  .q-manifest { bottom: 32px; padding: 6px 12px; font-size: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .q-manifest__words .q-w { margin-right: .35em; }
}
@media (max-width: 1023px) and (orientation: portrait) and (max-height: 680px) {
  .q-title { font-size: 1.625rem; }
  .q-card { height: 156px; padding: 12px 12px 14px; }
  .q-card[aria-checked="true"] { padding: 11.5px 11.5px 13.5px; }
  .q-card__label { font-size: .9375rem; }
  .q-row { min-height: 56px; padding-block: 8px; }
  .q-row[aria-checked="true"] { padding-block: 7.5px; }
}

/* tablets in portrait: bigger cards and type, the options sit centred in the free space */
@media (min-width: 560px) and (max-width: 1023px) and (min-height: 760px) {
  .q-body { margin-block: auto; padding-block: var(--space-4); }
  .q-cta { margin-top: 0; }
  .q-title { font-size: clamp(2.25rem, 5.4vw, 3rem); }
  .q-hint { font-size: 1.0625rem; }
  .q-feedback { font-size: 1rem; }
  .q-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); }
  .q-card { grid-column: span 2; height: clamp(184px, 17svh, 232px); padding: 16px 18px 18px; gap: 6px; }
  .q-card[aria-checked="true"] { padding: 15.5px 17.5px 17.5px; }
  .q-card:nth-child(4) { grid-column: 2 / span 2; }
  .q-card:nth-child(5) { grid-column: 4 / span 2; }
  .q-card__label { font-size: 1.125rem; }
  .q-card__sub { font-size: .875rem; -webkit-line-clamp: 3; min-height: 0; }
  .q-chips { gap: 12px; }
  .q-chip .chip__label { font-size: 1.0625rem; }
  .q-row__label { font-size: 1.0625rem; }
  .q-row { min-height: 68px; }
}

/* ───── Short landscape phones: the question gets ~65% of the width, the scene shrinks to a strip ───── */
@media (orientation: landscape) and (max-height: 520px) {
  .q-screen {
    --q-top: 2px;
    padding-top: calc(var(--header-h) + var(--safe-t) + 8px); padding-bottom: calc(10px + var(--safe-b));
  }
  .q-panel { grid-column: 1 / span 8; max-width: none; }
  .q-slot { grid-column: 9 / -1; height: calc(100vh - var(--header-h) - var(--safe-t) - 18px); height: calc(100svh - var(--header-h) - var(--safe-t) - 18px - var(--safe-b)); }
  .q-title { font-size: clamp(1.375rem, 3.2vw, 1.75rem); line-height: 1.05; margin-top: 0; }
  .q-hint, .q-feedback, .q-step, .q-counter { display: none; }
  .q-card { flex: 0 0 132px; height: 156px; padding: 12px 12px 14px; }
  .q-card[aria-checked="true"] { padding: 11.5px 11.5px 13.5px; }
  .q-card__sub { min-height: 0; }
  .q-cards { margin-inline: 0; padding-inline: 0; }
  .q-body { margin-top: var(--space-2); }
  .q-back { display: none; }
  .q-cta { flex-wrap: nowrap; padding-top: 10px; }
  .q-cta .cta-bar__hint { flex: 1 1 0; min-width: 0; font-size: .75rem; line-height: 1.25; }
  .q-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .q-chip .chip__check { display: none; }
  .q-chip .chip__label { font-size: .8125rem; overflow-wrap: normal; hyphens: none; word-break: normal; }
  .q-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .q-row { min-height: 48px; padding: 6px 10px; gap: 8px; grid-template-columns: auto 22px minmax(0, 1fr) 22px; }
  .q-row[aria-checked="true"] { padding: 5.5px 9.5px; }
  .q-row__label { font-size: .8125rem; }
  .q-manifest.is-empty { display: none; }
  .q-manifest { left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; font-size: 1rem; }
  .q-blocks { gap: 8px; }
  .q-block { padding: 12px 14px 14px; gap: 8px; }
}
/* desktop windows that are wide but short: who falls back to the swipe row inside the panel */
@media (min-width: 1024px) and (max-height: 599px) {
  .q-cards { margin-inline: 0; padding-inline: 0; }
}
/* desktop laptops: a slightly tighter rhythm so more of the list is visible */
@media (min-width: 1024px) and (max-height: 800px) {
  .q-screen { --q-h2: clamp(1.75rem, 2.6vw, 2.5rem); --q-top: 12px; }
  .q-screen--who .q-title { font-size: clamp(1.875rem, 3.2vw, 2.75rem); }
  .q-feedback { min-height: calc(1.4 * .9375rem); margin-top: 10px; }
  .q-hint { margin-top: 8px; }
  .q-body { margin-top: var(--space-3); }
  .q-row { min-height: 50px; padding-block: 5px; }
  .q-row[aria-checked="true"] { padding-block: 4.5px; }
  .q-rows { gap: 5px; }
  .q-chips { gap: 8px; }
  .q-scroll { padding-bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .q-card:hover .q-figs { animation: none; }
  .q-cta .cta-bar__hint.is-nudge { animation: none; }
}
html.rm .q-card:hover .q-figs { animation: none; }
