/* Pillow — dark, warm, mobile first. No inline styles anywhere (CSP style-src 'self'). */

:root {
  --bg: #1a1218;
  --bg-2: #22161f;
  --surface: #2c1d28;
  --surface-2: #3a2633;
  --surface-3: #4a3141;
  --line: rgba(255, 228, 214, 0.1);
  --line-2: rgba(255, 228, 214, 0.18);
  --text: #f6ece6;
  --muted: #bfa7b2;
  --accent: #e8875f;
  --accent-2: #ff9f6e;
  --accent-ink: #2a1208;
  --rose: #d9607e;
  --gold: #f5c542;
  --yes: #58b368;
  --maybe: #d9d26a;
  --no: #6f6f78;
  --hardno: #7a2a2a;
  --hardno-bright: #e0534f;
  --flame: #ff8a4c;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232, 135, 95, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(217, 96, 126, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

body.sheet-open { overflow: hidden; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 6.4vw, 2.4rem); }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-2); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
button, input { font: inherit; color: inherit; }
img, svg { max-width: 100%; }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
h1:focus, main:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.noscript { padding: 24px 16px; }

/* ------------------------------------------------------------------ header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(26, 18, 24, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand img { display: block; border-radius: 6px; }

.lang-toggle { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-toggle .sep { color: var(--muted); opacity: 0.5; font-size: 0.85rem; }
.lang-btn {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 0.9rem; color: var(--muted); min-height: 36px;
}
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.net-banner {
  position: sticky; top: 57px; z-index: 19;
  margin: 0; padding: 10px 16px; text-align: center; font-size: 0.95rem;
  background: #5a3a14; color: #ffe7c2; border-bottom: 1px solid rgba(255, 200, 120, 0.3);
}

/* ------------------------------------------------------------------ layout */
main { display: block; padding: 0 16px 48px; }
.screen { max-width: 640px; margin: 0 auto; padding-top: 24px; }
.screen.narrow { max-width: 540px; }
.screen.wide { max-width: 1100px; }
.screen.center { text-align: center; padding-top: 18vh; }

.lead { font-size: 1.2rem; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.eyebrow { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-2); font-weight: 700; margin-bottom: 8px; }
.rule { font-weight: 650; border-left: 3px solid var(--accent); padding-left: 12px; }
.callout {
  background: rgba(232, 135, 95, 0.1); border: 1px solid rgba(232, 135, 95, 0.35);
  border-radius: var(--radius); padding: 14px 16px; margin: 0 0 18px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .btn { margin-top: 4px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); }
.btn.primary:hover { background: linear-gradient(135deg, #ffb08a, var(--accent-2)); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface); }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 0.92rem; }
.btn.link { background: none; border: 0; padding: 8px 4px; min-height: 40px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.btn.danger { color: #ff9c95; }
.btn.danger-solid { background: #a8322e; color: #fff; }
.btn .icon svg { width: 1.15em; height: 1.15em; display: block; }

.stack-buttons { display: grid; gap: 12px; margin: 18px 0; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.row-buttons .btn { flex: 1 1 auto; }

/* ------------------------------------------------------------------ landing */
.hero { text-align: center; margin: 8px 0 22px; }
.hero-mark { width: 120px; margin: 0 auto 8px; }
.hero-mark svg, .pulse svg { width: 100%; height: auto; display: block; }
.hero h1 { margin-bottom: 0.4em; }
.age-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 20px 0 6px; }
.age-box p { margin: 6px 0 0; }
.check { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; font-size: 1.1rem; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; margin: 0; }
.form-error { color: #ffaaa3; min-height: 1.4em; margin: 8px 0 0; font-weight: 600; }
.form-error:empty { min-height: 0; margin: 0; }
.code-panel { margin: 4px 0 18px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-2);
  font-size: 1.3rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.code-row input::placeholder { letter-spacing: 0.02em; text-transform: none; color: #7f6a75; font-family: var(--font); font-size: 1rem; }
.options { margin: 8px 0 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.options summary { cursor: pointer; color: var(--muted); font-weight: 650; min-height: 32px; }
.radio-list { display: grid; gap: 8px; margin: 10px 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radio input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.continue { margin: 18px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; background: var(--surface-2); color: var(--text); white-space: nowrap; margin: 0;
}
.code-chip { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.1em; text-decoration: none; padding: 8px 14px; font-size: 1rem; border: 1px solid var(--line-2); }
.anon { margin-top: 24px; }

/* value chips */
.v-superlike { background: var(--gold); color: #2b2004; }
.v-yes { background: var(--yes); color: #0f2614; }
.v-maybe { background: var(--maybe); color: #2a280a; }
.v-no { background: var(--no); color: #f1f1f4; }
.v-hardno { background: var(--hardno); color: #ffdcdc; }
.v-none { background: transparent; color: var(--muted); border: 1px dashed var(--line-2); }

/* ------------------------------------------------------------------ share */
.share-block { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin: 8px 0 20px; text-align: center; }
.big-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 800;
  font-size: clamp(2.1rem, 11vw, 3.2rem); letter-spacing: 0.12em; margin: 0 0 14px; color: var(--accent-2);
  word-break: break-all;
}
.code-gap { display: inline-block; width: 0.35em; }
.share-link { margin: 0 0 6px; word-break: break-all; }
.share-link code { background: var(--bg-2); padding: 6px 10px; border-radius: 8px; display: inline-block; font-size: 0.95rem; }
.share-block .row-buttons { justify-content: center; }

/* ------------------------------------------------------------------ progress */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
.progress.thin { height: 4px; margin: 6px 0 14px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--accent-2)); border-radius: inherit; transition: width 0.3s; }

.intro { text-align: center; padding-top: 10vh; }
.intro .lead { margin-bottom: 0.6em; }
.intro .btn.big { margin-top: 8px; }

/* ------------------------------------------------------------------ deck */
.screen.deck { max-width: 460px; padding-top: 10px; }
.deck-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.deck-progress { margin: 0; font-size: 0.9rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.undo .icon svg { width: 18px; height: 18px; }

.card-stack {
  /* The fly-out animation must not overflow the page: on phones, content wider
     than the viewport makes the browser zoom the layout out and fixed elements
     (the bottom sheet) land off screen. So the stack clips, with room for the
     card's shadow: it is pulled out to the gutters and the cards are inset. */
  position: relative;
  height: calc(min(60vh, 520px) + 48px);
  height: calc(min(60svh, 520px) + 48px);
  min-height: 388px;
  margin: 4px -16px 18px;
  padding: 0;
  overflow: hidden;
  overflow: clip;
}
.card {
  position: absolute; inset: 8px 16px 40px;
  border-radius: 24px;
  background: linear-gradient(160deg, #432a3b 0%, #2f1f2b 55%, #281a24 100%);
  border: 1px solid rgba(255, 220, 200, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 20px 22px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.card.back { pointer-events: none; }
.card.back1 { transform: translateY(10px) scale(0.955); opacity: 0.7; }
.card.back2 { transform: translateY(20px) scale(0.91); opacity: 0.4; }
.card.top {
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  will-change: transform;
}
.card.top.dragging { cursor: grabbing; }
.card-cat { margin: 0 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-2); font-weight: 700; }
.card-main { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; overflow: hidden; }
.card-text { font-size: clamp(1.55rem, 7vw, 2.1rem); line-height: 1.18; margin: 0 0 14px; font-weight: 800; overflow-wrap: anywhere; }
.card-detail { font-size: 1.02rem; color: var(--muted); margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; min-height: 30px; }

.flames { display: inline-flex; gap: 1px; vertical-align: middle; }
.flames .icon svg { width: 20px; height: 20px; display: block; }
.flames .on { color: var(--flame); }
.flames .off { color: rgba(255, 230, 220, 0.14); }

.overlay {
  position: absolute; pointer-events: none; opacity: 0;
  font-weight: 900; font-size: clamp(1.7rem, 8vw, 2.4rem); letter-spacing: 0.04em;
  padding: 2px 14px; border: 4px solid currentColor; border-radius: 12px;
  background: rgba(20, 12, 18, 0.35);
  white-space: nowrap;
}
.ov-yes { top: 28px; left: 20px; color: #6fd383; transform: rotate(-14deg); }
.ov-no { top: 28px; right: 20px; color: #b9b9c4; transform: rotate(14deg); }
.ov-superlike { bottom: 70px; left: 50%; color: var(--gold); transform: translateX(-50%) rotate(-6deg); }
.ov-hardno { top: 36px; left: 50%; color: var(--hardno-bright); transform: translateX(-50%) rotate(4deg); }
.ov-maybe { top: 42%; left: 50%; color: var(--maybe); transform: translate(-50%, -50%); }

.card.enter-below { animation: rise 0.28s ease-out; }
.card.enter-top { animation: drop-in 0.32s ease-out; }
.card.enter-back { animation: pop 0.3s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes rise { from { transform: translateY(10px) scale(0.955); opacity: 0.7; } to { transform: none; opacity: 1; } }
@keyframes drop-in { from { transform: translateY(-40px) scale(1.04) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

.deck-buttons { display: flex; justify-content: center; align-items: flex-start; gap: 4px; max-width: 420px; margin: 0 auto; }
.deck-btn {
  flex: 1 1 0; max-width: 78px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.deck-btn .icon {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--surface); border: 2px solid currentColor;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s, background 0.15s;
}
.deck-btn .icon svg { width: 26px; height: 26px; display: block; }
.deck-btn:hover .icon { background: var(--surface-2); }
.deck-btn:active .icon { transform: scale(0.92); }
.deck-btn-label { font-size: 0.74rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.b-hardno { color: var(--hardno-bright); }
.b-no { color: #b9b9c4; }
.b-maybe { color: var(--maybe); }
.b-maybe .icon { width: 46px; height: 46px; margin: 7px 0; }
.b-yes { color: #6fd383; }
.b-yes .icon, .b-no .icon { width: 60px; height: 60px; }
.b-hardno .icon, .b-superlike .icon { margin: 3px 0; }
.b-superlike { color: var(--gold); }
.deck-hint { text-align: center; margin: 16px 0 0; }
.deck-hint .keys { display: none; }
@media (hover: hover) and (pointer: fine) { .deck-hint .keys { display: inline; } }

/* ------------------------------------------------------------------ sheet */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 4, 8, 0.6); opacity: 0; transition: opacity 0.22s; }
.sheet {
  position: absolute; left: 50%; bottom: 0; width: min(100%, 560px);
  max-height: 88vh; max-height: 88svh; overflow-y: auto; overscroll-behavior: contain;
  transform: translate(-50%, 100%); transition: transform 0.24s cubic-bezier(.2, .8, .3, 1);
  background: #2a1b26; border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
}
.sheet-root.show .sheet { transform: translate(-50%, 0); }
.sheet-root.show .sheet-backdrop { opacity: 1; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; }
.sheet h2 { font-size: 1.45rem; }

/* ------------------------------------------------------------------ how hard? */
.rate-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rate-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 10px;
}
.rate-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rate-text { font-weight: 700; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; }
.rate-head .chip { flex: none; margin-top: 2px; }

.flame-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
.flame-btn {
  min-height: 52px; min-width: 0; padding: 0; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center;
  background: var(--bg-2); border: 2px solid transparent; color: rgba(255, 230, 220, 0.16);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background 0.12s, color 0.12s, transform 0.1s;
}
.flame-btn .icon svg { width: 30px; height: 30px; display: block; }
.flame-btn.on { color: var(--flame); background: rgba(255, 138, 76, 0.12); }
.flame-btn.sel { border-color: var(--accent-2); }
.flame-btn:active { transform: scale(0.94); }
.flame-picker.suggested .flame-btn.on { color: rgba(255, 138, 76, 0.55); background: rgba(255, 138, 76, 0.06); }
.flame-picker.suggested .flame-btn.sel { border-color: rgba(255, 159, 110, 0.4); border-style: dashed; }
.rate-level { margin: 8px 2px 4px; font-size: 0.95rem; font-weight: 650; min-height: 1.5em; }
.rate-level-n { color: var(--accent-2); }
.rate-suggested { color: var(--muted); font-weight: 500; font-style: italic; }

/* comments (rating screen and review) */
.comment { margin: 2px 0 0; }
.comment-add, .comment-text {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px 6px 6px;
  background: none; border: 0; border-radius: 10px; cursor: pointer; color: var(--muted);
  font-size: 0.92rem; font-weight: 650; text-align: left; -webkit-tap-highlight-color: transparent;
}
.comment-add:hover, .comment-text:hover { background: rgba(255, 255, 255, 0.04); }
.comment-add .icon svg, .comment-text .icon svg { width: 18px; height: 18px; display: block; }
.comment-text { color: var(--text); font-weight: 500; font-style: italic; max-width: 100%; }
.comment-text .icon { flex: none; color: var(--accent-2); align-self: flex-start; margin-top: 2px; }
.comment-text span { overflow-wrap: anywhere; }
.comment-input {
  width: 100%; min-height: 44px; padding: 8px 12px; margin: 4px 0;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2);
  font-size: 1rem; /* 16px+ keeps iOS from zooming */
}
.comment-input::placeholder { color: #8a7480; }
.comment-input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* ------------------------------------------------------------------ review */
.review-tools { margin: 4px 0 0; }
.review-tools .icon svg { width: 18px; height: 18px; display: block; color: var(--flame); }
.review-row { padding-bottom: 6px; }
.review-row.unanswered { padding-bottom: 0; }
.row-level { display: flex; align-items: center; gap: 8px; padding: 0 4px; margin-top: -4px; }
.row-level .flames .icon svg { width: 16px; height: 16px; }
.row-level.suggested .flames { opacity: 0.55; }
.review-row .comment { padding: 0 0 0 0; }
.review-group { margin: 26px 0; }
.review-group h2 { font-size: 1.1rem; color: var(--accent-2); }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 56px;
  background: none; border: 0; text-align: left; cursor: pointer; border-radius: 10px;
}
.row:hover { background: rgba(255, 255, 255, 0.03); }
.row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-sub { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.row-meta { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.row-meta .flames .icon svg { width: 14px; height: 14px; }
.row-arrow { color: var(--muted); font-size: 1.4rem; line-height: 1; }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; margin: 24px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(26, 18, 24, 0), rgba(26, 18, 24, 0.94) 30%);
}
.sticky-actions p { margin: 8px 0 0; text-align: center; }

.danger-zone { margin: 36px 0 8px; text-align: center; }
.confirm { background: rgba(168, 50, 46, 0.12); border: 1px solid rgba(255, 120, 110, 0.35); border-radius: var(--radius); padding: 16px; text-align: left; }

/* ------------------------------------------------------------------ waiting */
.waiting { text-align: center; }
.pulse { width: 110px; margin: 10px auto 12px; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
.partner-status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 18px 0; text-align: left; }
.partner-line { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin: 0; }
.partner-status .progress { margin: 12px 0 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--no); flex: none; }
.p-going .dot { background: var(--maybe); animation: blink 1.4s ease-in-out infinite; }
.p-done .dot { background: var(--yes); }
@keyframes blink { 50% { opacity: 0.3; } }
.waiting .btn.big { margin-top: 6px; }

/* ------------------------------------------------------------------ results */
.results-head { text-align: center; margin-bottom: 4px; }
.results-head p { margin: 0; }
.tree-section { margin: 8px 0 18px; }
.tree-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.list-toggle { display: none; }
.tree-scroll {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  border-radius: 20px;
  background: radial-gradient(70% 60% at 50% 55%, rgba(232, 135, 95, 0.07), transparent 70%);
}
.tree-inner { width: 100%; max-width: 860px; margin: 0 auto; }
.pillow-tree { width: 100%; height: auto; display: block; }
.pillow-tree .leaf { cursor: pointer; }
.pillow-tree .leaf:focus { outline: none; }
.pillow-tree .leaf:hover .half, .pillow-tree .leaf:focus-visible .half { stroke: #fff4ea; stroke-width: 1.6; }
.tree-section.list-only .tree-scroll { display: none; }

@media (max-width: 699px) {
  .tree-inner { min-width: 900px; max-width: none; }
  .list-toggle { display: inline-flex; }
  .tree-tools { justify-content: space-between; }
}

.legend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
.legend h2 { margin-bottom: 10px; }
.swatches, .legend-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.swatches li, .legend-notes li { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.legend-notes { margin-top: 12px; flex-direction: column; gap: 6px; color: var(--muted); }
.swatch { width: 18px; height: 18px; border-radius: 5px 50% 5px 50%; display: inline-block; flex: none; }
.swatch.none { border: 1.5px solid #6a5866; }
.swatch.hidden { border: 1.5px dashed #9a9aa3; }

.leaf-dot { display: inline-flex; flex: none; width: 22px; height: 22px; }
.leaf-dot.big { width: 26px; height: 26px; }
.leaf-dot .half { flex: 1; height: 100%; }
.leaf-dot .ha { border-radius: 100% 0 0 100% / 50% 0 0 50%; border-right: 1px solid rgba(20, 10, 16, 0.5); }
.leaf-dot .hb { border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.leaf-dot .none { border: 1.5px solid #6a5866; }
.leaf-dot .hidden { border: 1.5px dashed #9a9aa3; }

.summary { max-width: 680px; margin: 26px auto; text-align: center; }
.summary-main { font-size: clamp(1.25rem, 4.8vw, 1.6rem); font-weight: 750; line-height: 1.3; }

.lists { display: grid; gap: 10px 28px; }
@media (min-width: 900px) { .lists { grid-template-columns: 1fr 1fr; } }
.result-list { margin: 14px 0; }
.result-list h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.result-list .count { font-size: 0.85rem; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 2px 10px; }
.l-both h2 { color: #8fe0a0; }
.l-talk h2 { color: var(--maybe); }
.l-one h2 { color: var(--accent-2); }
.l-no h2, .l-un h2 { color: var(--muted); }

.results-foot { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 12px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.results-foot .danger-zone { margin: 8px 0 0; width: 100%; max-width: 520px; }

.detail .answers { display: grid; gap: 10px; margin: 18px 0; }
.ans-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); padding: 10px 14px; border-radius: 12px; }
.ans-who { font-weight: 750; min-width: 110px; }
.ans-level { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.ans-level .flames .icon svg { width: 15px; height: 15px; }
.ans-comment { flex-basis: 100%; margin-top: 2px; }
.ans-comment .label { margin-bottom: 2px; font-size: 0.72rem; }
.ans-comment-text { margin: 0; font-style: italic; overflow-wrap: anywhere; white-space: pre-wrap; }
.row-comment { flex: none; color: var(--muted); }
.row-comment .icon svg { width: 18px; height: 18px; display: block; }
.starter { border-left: 4px solid var(--accent); background: rgba(232, 135, 95, 0.08); padding: 12px 16px; border-radius: 0 12px 12px 0; }
.starter p:last-child { margin: 0; font-size: 1.08rem; }
.starter.o-match, .starter.o-match_super { border-color: var(--yes); }
.starter.o-match_super { border-color: var(--gold); }
.starter.o-talk { border-color: var(--maybe); }
.starter.o-no, .starter.o-hidden, .starter.o-unanswered { border-color: var(--no); }

/* ------------------------------------------------------------------ tooltip and toast */
.tip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 280px;
  background: #f6e7dc; color: #1f141b; font-size: 0.92rem; font-weight: 650; line-height: 1.3;
  padding: 7px 11px; border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); width: max-content;
  background: #f6e7dc; color: #1f141b; font-weight: 650; padding: 10px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: #ffd9a8; }

/* ------------------------------------------------------------------ larger screens */
@media (min-width: 700px) {
  main { padding: 0 24px 64px; }
  .screen { padding-top: 40px; }
  .stack-buttons { grid-template-columns: 1fr 1fr; }
  .card { padding: 26px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
