:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #000;
  --muted: var(--ink);
  --line: #ddd8ec;
  --field: #faf9fe;
  --violet: #7869e6;
  --soft: #f3f0ff;
  --orange: #f97c46;
  --orange-hover: #ff905e;
  --danger: #932137;
  --heading: "Montserrat Alternates", "Montserrat", system-ui, sans-serif;
  --body: "Montserrat", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17132b;
  --ink: #f6f2ff;
  --line: #484064;
  --field: #211b39;
  --violet: #a99bff;
  --soft: #30274e;
  --danger: #ff9bad;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 1rem/1.55 var(--body); }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
[hidden] { display: none !important; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .shell { width: min(100% - 32px, 696px); margin-inline: auto; }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { flex: 0 0 auto; padding: 4px 8px; margin-inline-start: -8px; border-radius: 8px; }
.logo img { display: block; width: auto; height: 52px; }
:root[data-theme="dark"] .logo { background: #fff; }
.theme-button { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; background: var(--bg); }
.shell { padding-block: 22px 64px; }
.panel { margin-top: clamp(24px, 6vw, 52px); overflow-wrap: anywhere; }
.stack { display: grid; gap: 12px; }
.flow { display: grid; gap: 24px; }
h1, h2, p, fieldset { margin: 0; }
h1, h2 { font-family: var(--heading); line-height: 1.16; }
h1 { font-size: clamp(1.6rem, 4.4vw, 2.7rem); text-wrap: pretty; }
h1.question-title { font-size: clamp(1.46rem, 3.5vw, 2rem); }
h2 { font-size: 1.2rem; }
.muted, .hint { color: var(--muted); }
.hint, .error, .saved { font-size: .88rem; }
.error { color: var(--danger); font-weight: 600; }
.gift { border-radius: 22px; background: #6454cc; color: #fff; padding: clamp(18px, 5vw, 28px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; }
.gift strong { font: 700 clamp(2rem, 7vw, 2.7rem)/1 var(--heading); white-space: nowrap; grid-column: 1; }
.gift span { grid-column: 2; grid-row: 1 / 3; align-self: start; padding: 5px 12px; background: #ffffff22; border-radius: 10px; font-weight: 700; }
.gift p { grid-column: 1 / -1; }
fieldset { padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
label.field { display: grid; gap: 6px; font-weight: 600; }
.input { display: block; width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 11px 13px; }
textarea.input { min-height: 90px; resize: vertical; }
.option-list { display: grid; gap: 8px; }
.option { min-height: 49px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px; display: flex; align-items: center; gap: 11px; cursor: pointer; overflow-wrap: anywhere; }
.option input { flex: 0 0 auto; width: 19px; height: 19px; margin: 0; accent-color: var(--violet); }
.option:hover, .option:has(:checked) { border-color: var(--violet); }
.option:has(:checked) { background: var(--soft); }
.score-options { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: clamp(2px, .7vw, 8px); }
.score-options .option { position: relative; justify-content: center; padding-inline: 2px; gap: 4px; white-space: nowrap; }
.score-options .option:has(input:focus-visible) { outline: 2px solid var(--violet); outline-offset: -3px; }
@media (max-width: 600px) {
  .score-options .option { padding-inline: 0; border-radius: 8px; }
  .score-options .option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .score-options .option:has(input:checked) { font-weight: 700; box-shadow: inset 0 0 0 1px var(--violet); }
}
.brand-custom { border: 1px solid var(--line); border-radius: 13px; }
.brand-custom > .option { min-height: 47px; border: 0; background: transparent; }
.brand-custom:has(> .option:hover), .brand-custom:has(> .option input:checked) { border-color: var(--violet); }
.brand-custom:has(> .option input:checked) { background: var(--soft); }
.brand-custom-fields { padding: 0 14px 13px 44px; }
.brand-custom-fields .input { background: var(--bg); }
.actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 24px; background: var(--orange); color: #000; padding: 10px 20px; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.button:hover { background: var(--orange-hover); }
.button.secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { border-color: var(--violet); }
.actions .primary { margin-inline-start: auto; }
.progress-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--muted); font-size: .88rem; }
.progress { display: block; width: 100%; height: 7px; border-radius: 10px; overflow: hidden; border: 0; background: var(--soft); color: var(--violet); }
.progress::-webkit-progress-bar { background: var(--soft); }
.progress::-webkit-progress-value { background: var(--violet); border-radius: 10px; }
.progress::-moz-progress-bar { background: var(--violet); }
.terms { display: grid; gap: 8px; padding-inline-start: 24px; margin: 0; }
.result { border: 1px solid var(--line); background: var(--field); border-radius: 18px; padding: 20px; }
.recovery summary { cursor: pointer; color: var(--muted); text-decoration: underline; }
.recovery[open] summary { margin-bottom: 12px; }
@media (max-width: 440px) {
  .header-inner { min-height: 64px; }
  .actions > .button { flex: 1 1 auto; }
}
