:root {
  --accent: #0f9f85;
  --accent-soft: #dff7f0;
  --bg: #fafcfb;
  --fg: #15201d;
  --muted: #5c6b67;
  --line: #dfe7e4;
  --card: #ffffff;
  --bad: #c23a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Rubik", "Heebo", sans-serif; font-weight: 700; font-size: 18px; min-width: 0; }
.brand img { height: 56px; max-width: 190px; object-fit: contain; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { display: flex; align-items: center; gap: 8px; flex: none; }
.lang { font-size: 12.5px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.table { flex: none; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 12px; border-radius: 999px; }
.steps { display: flex; gap: 5px; margin-bottom: 8px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .2s; }
.steps i.on { background: var(--accent); }
.screen { flex: 1; display: flex; flex-direction: column; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }

.intro { margin: 10px 0 4px; }
.intro h2 { font-family: "Rubik", "Heebo", sans-serif; font-weight: 700; font-size: 20px; margin: 0 0 6px; }
.intro p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.qimg { width: 100%; max-height: 190px; object-fit: cover; border-radius: 14px; margin-top: 14px; display: block; }
.intro + .qimg, .qimg + .q { margin-top: 12px; }
.q { font-family: "Rubik", "Heebo", sans-serif; font-weight: 700; font-size: 24px; line-height: 1.25; margin: 20px 0 6px; text-wrap: balance; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.scale { display: flex; gap: 6px; justify-content: space-between; }
.scale button {
  flex: 1; aspect-ratio: 1; min-width: 0; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .12s, border-color .12s, background .12s;
}
.scale button:active, .scale button.sel { transform: scale(1.06); border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.scale button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale.stars button { font-size: 34px; color: #cfd8d4; }
.scale.stars button.sel { color: var(--accent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.hint { margin-top: auto; text-align: center; color: #8a9994; font-size: 12.5px; padding-top: 24px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chips button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--fg); }
.chips button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.field { display: block; margin: 0 0 10px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--fg);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border: none; border-radius: 14px; background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; margin-top: 10px; }
.btn:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.btn.secondary { background: var(--card); color: var(--fg); border: 1.5px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); font-weight: 500; min-height: 44px; }
.btn[disabled] { opacity: .5; cursor: default; }
.gdot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(#4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75%); }

.big { font-size: 56px; text-align: center; margin: 28px 0 6px; }
.thanks { font-family: "Rubik", "Heebo", sans-serif; font-weight: 700; font-size: 24px; text-align: center; margin: 0 0 6px; }
.center { text-align: center; }
.draft { background: var(--card); border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; padding: 12px 14px; margin: 16px 0 6px; font-size: 15px; }
.draft small { display: block; color: var(--accent); font-weight: 700; margin-top: 6px; font-size: 12.5px; }
.note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }
.error { color: var(--bad); font-size: 14px; margin: 6px 0; }
.foot { text-align: center; padding-top: 24px; font-size: 12px; }
.foot a { color: #8a9994; text-decoration: none; }

/* 4-answer labels mode (legacy QSM answers) */
.answers { display: grid; gap: 10px; margin-top: 6px; }
.answers button {
  min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg);
  font: inherit; font-size: 17px; font-weight: 500; text-align: start; padding: 10px 16px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.answers button.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 700; }
.answers button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Google Translate: widget hidden, our own menu in the top bar */
.lang { font-size: 13px; color: var(--fg); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--card); font-family: inherit; }
select.lang { appearance: none; -webkit-appearance: none; padding-inline-end: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
[dir="rtl"] select.lang { background-position: 14px 55%, 9px 55%; }
.gt-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body { top: 0 !important; }
.goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame, .goog-tooltip, .goog-text-highlight, .skiptranslate iframe { display: none !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }
font[style] { background: transparent !important; box-shadow: none !important; }

/* ===== UI presets (chosen per customer in the dashboard) ===== */
.hero { display: none; }

/* --- A · night: full-bleed photo hero, dark glass answers, gold accent by default --- */
.preset-night { --bg: #0f0d0b; --fg: #f5efe6; --muted: #b9ad9c; --line: rgba(255,255,255,0.14); --card: rgba(255,255,255,0.06); --accent: #e9c46a; --accent-soft: rgba(233,196,106,0.14); }
.preset-night .app { position: relative; padding-top: 0; }
.preset-night .hero { display: block; height: 46vh; min-height: 300px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left))); background-size: cover; background-position: center; position: relative; }
.preset-night .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,13,11,0.55) 0%, rgba(15,13,11,0) 30%, rgba(15,13,11,0) 55%, #0f0d0b 100%); }
.preset-night .hero[hidden] { display: none; }
.preset-night .top { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); z-index: 2; padding: 0; }
.preset-night .hero[hidden] ~ .top { position: static; padding: 16px 0 10px; }
.preset-night .brand { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); }
.preset-night .hero[hidden] ~ .top .brand { position: static; transform: none; }
.preset-night .brand img { height: 62px; max-width: 170px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5)); }
.preset-night .lang { background: rgba(255,255,255,0.10); color: var(--fg); border-color: rgba(255,255,255,0.22); backdrop-filter: blur(8px); }
.preset-night .table { background: rgba(233,196,106,0.16); color: var(--accent); border: 1px solid rgba(233,196,106,0.5); }
.preset-night .steps { margin-top: -22px; position: relative; z-index: 2; }
.preset-night .steps i { height: 3px; background: rgba(255,255,255,0.16); }
.preset-night .steps i.on { background: var(--accent); }
.preset-night .q { color: #fbf7ef; font-size: 26px; margin-top: 14px; }
.preset-night .intro h2 { color: #fbf7ef; }
.preset-night .intro p, .preset-night .sub { color: var(--muted); }
.preset-night .answers button { background: var(--card); border-color: var(--line); color: var(--fg); border-radius: 14px; min-height: 56px; }
.preset-night .answers button.sel { background: var(--accent-soft); border-color: rgba(233,196,106,0.7); box-shadow: none; color: #fbf7ef; }
.preset-night .scale button { background: var(--card); border-color: var(--line); }
.preset-night .scale button.sel { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,196,106,0.3); }
.preset-night .chips button { background: var(--card); border-color: var(--line); color: var(--fg); }
.preset-night .chips button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.preset-night .field input, .preset-night .field textarea { background: var(--card); border-color: var(--line); color: var(--fg); }
.preset-night .btn { background: var(--accent); color: #1a150e; }
.preset-night .btn.secondary { background: var(--card); color: var(--fg); border-color: var(--line); }
.preset-night .btn.ghost { color: var(--muted); }
.preset-night .draft { background: var(--card); border-color: rgba(233,196,106,0.5); color: var(--fg); }
.preset-night .hint, .preset-night .note, .preset-night .foot a { color: #8d8273; }
.preset-night .qimg { border-radius: 14px; }

/* --- B · editorial: warm paper, serif display, numbered answer rows --- */
.preset-editorial { --bg: #f6f1e8; --fg: #1f1a14; --muted: #8a7a62; --line: #d9cfbe; --card: #f6f1e8; --accent: #c9a34a; --accent-soft: #efe4c8; }
.preset-editorial .q, .preset-editorial .thanks, .preset-editorial .intro h2 { font-family: "Frank Ruhl Libre", "Heebo", serif; }
.preset-editorial .q { font-size: 29px; line-height: 1.15; }
.preset-editorial .intro h2 { font-size: 15px; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.preset-editorial .brand img { height: 48px; }
.preset-editorial .lang { background: transparent; border-color: #cfc4b2; }
.preset-editorial .table { background: transparent; color: #8a6a1f; border-radius: 0; border-bottom: 2px solid var(--accent); padding: 0 2px 1px; font-family: "Frank Ruhl Libre", serif; }
.preset-editorial .steps i { height: 2px; background: var(--line); border-radius: 0; }
.preset-editorial .steps i.on { background: var(--accent); }
.preset-editorial .qimg { border-radius: 6px; }
.preset-editorial .sub { font-family: "Frank Ruhl Libre", serif; }
.preset-editorial .answers { gap: 0; counter-reset: ans; }
.preset-editorial .answers button { counter-increment: ans; display: flex; align-items: center; gap: 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 2px; font-size: 18px; }
.preset-editorial .answers button::before { content: counter(ans, decimal-leading-zero); font-family: "Frank Ruhl Libre", serif; font-size: 13px; color: var(--muted); width: 18px; flex: none; }
.preset-editorial .answers button::after { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-inline-start: auto; background: transparent; }
.preset-editorial .answers button.sel { background: transparent; box-shadow: none; font-weight: 700; }
.preset-editorial .answers button.sel::before { color: var(--accent); }
.preset-editorial .answers button.sel::after { background: var(--accent); }
.preset-editorial .scale button { background: #fffdf9; border-color: var(--line); border-radius: 6px; }
.preset-editorial .scale button.sel { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.preset-editorial .chips button { background: #fffdf9; border-color: var(--line); border-radius: 4px; }
.preset-editorial .chips button.on { background: var(--accent-soft); border-color: var(--accent); color: #5f480f; }
.preset-editorial .field input, .preset-editorial .field textarea { background: #fffdf9; border-color: var(--line); border-radius: 6px; }
.preset-editorial .btn { background: #1f1a14; color: #f6f1e8; border-radius: 6px; }
.preset-editorial .btn.secondary { background: #fffdf9; color: var(--fg); border-color: var(--line); }
.preset-editorial .btn.ghost { background: transparent; color: var(--muted); }
.preset-editorial .draft { background: #fffdf9; border-color: var(--accent); border-radius: 6px; }
.preset-editorial .foot a { font-family: "Frank Ruhl Libre", serif; font-weight: 700; }

.prelander { display: block; width: 100%; max-width: 320px; margin: 24px auto 8px; border-radius: 12px; }
