:root {
  --purple: #6b2fa0;
  --purple-dark: #4b1f73;
  --purple-soft: #f2ebfa;
  --ink: #1d1426;
  --muted: #645a70;
  --line: #e7dff0;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-color: #ffffff;
  background-image:
    radial-gradient(60rem 40rem at 8% -10%, #f3ecfb 0%, transparent 60%),
    radial-gradient(50rem 30rem at 100% 0%, #f8f3fd 0%, transparent 60%);
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }

.top-right { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; justify-content: flex-end; }

.top-right .progress { min-width: 40px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 6px var(--purple-soft);
}

.progress {
  flex: 1;
  max-width: 220px;
  height: 6px;
  border-radius: 99px;
  background: var(--purple-soft);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), #a46be0);
  transition: width 600ms cubic-bezier(.2, .8, .2, 1);
}

.banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--purple-soft);
  box-shadow: inset 0 0 0 1px #e3d4f5;
  color: var(--purple-dark);
  font-size: 14px;
  font-weight: 700;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  outline: none;
}

.enter { animation: rise 520ms cubic-bezier(.2, .8, .2, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
  outline: none;
}

h1.subject { display: flex; align-items: center; gap: 14px; }

.lead {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
}

.hint { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.label { margin: 0; font-size: 13px; font-weight: 700; color: var(--purple-dark); letter-spacing: .02em; }

.e { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

legend { display: block; width: 100%; padding: 0; margin: 0 0 12px; font-size: 18px; font-weight: 700; line-height: 1.35; }

.opt { font-size: 14px; font-weight: 600; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.tile { position: relative; display: block; cursor: pointer; }

.tile input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.tile span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: background 220ms, color 220ms, box-shadow 220ms, transform 220ms;
}

.tile:hover span { transform: translateY(-1px); box-shadow: inset 0 0 0 1px #c9b2e6; }

.tile input:checked + span {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(107, 47, 160, .8);
}

.tile input:focus-visible + span { outline: 3px solid #b48ee8; outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip { position: relative; display: inline-flex; cursor: pointer; }

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 52px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
  color: var(--ink);
  transition: background 220ms, color 220ms, box-shadow 220ms, transform 220ms;
}

.chip:hover span { transform: translateY(-1px); box-shadow: inset 0 0 0 1px #c9b2e6; }

.chip input:checked + span {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(107, 47, 160, .8);
}

.chip input:focus-visible + span { outline: 3px solid #b48ee8; outline-offset: 2px; }

.chip.big span { min-width: 120px; padding: 16px 24px; font-size: 18px; }

.chips.grades .chip span { min-width: 48px; padding: 10px 14px; }

.slider-box { display: grid; gap: 8px; }

.slider-top { display: flex; align-items: baseline; gap: 8px; }

.slider-value {
  min-width: 1.4ch;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

.slider-top .hint { font-weight: 700; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 99px;
  background: var(--purple-soft);
  box-shadow: inset 0 0 0 1px #e3d4f5;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -11px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple), 0 6px 14px -4px rgba(107, 47, 160, .7);
}

.slider::-moz-range-track {
  height: 10px;
  border-radius: 99px;
  background: var(--purple-soft);
  box-shadow: inset 0 0 0 1px #e3d4f5;
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple), 0 6px 14px -4px rgba(107, 47, 160, .7);
}

.slider.untouched::-webkit-slider-thumb { background: #b8aec4; box-shadow: 0 0 0 1px #b8aec4; }
.slider.untouched::-moz-range-thumb { background: #b8aec4; box-shadow: 0 0 0 1px #b8aec4; }

.slider:focus-visible { outline: 3px solid #b48ee8; outline-offset: 4px; border-radius: 99px; }

.ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.scale-labels { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.scale-labels span { min-width: 0; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 28px -12px rgba(107, 47, 160, .7);
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms, background 200ms, opacity 200ms;
}

.btn:hover:not(:disabled) { background: var(--purple-dark); transform: translateY(-1px); }

.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.btn.ghost {
  color: var(--purple-dark);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn.ghost:hover:not(:disabled) { background: var(--purple-soft); }

.btn:focus-visible, .link:focus-visible { outline: 3px solid #b48ee8; outline-offset: 3px; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.two .btn {
  min-height: 96px;
  padding: 16px 14px;
  border-radius: 22px;
  font-size: 17px;
  line-height: 1.25;
  text-wrap: balance;
}

.link {
  appearance: none;
  padding: 6px 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--purple-dark);
  text-decoration: underline;
  text-decoration-color: #c9b2e6;
  text-underline-offset: 4px;
  cursor: pointer;
  justify-self: start;
}

.preview { display: grid; justify-items: center; gap: 16px; }

.card-img {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 18px;
  background: #0a0a0a;
  box-shadow: 0 1px 2px rgba(60, 20, 90, .1), 0 24px 50px -24px rgba(20, 5, 40, .7);
}

.card-img.square { max-width: 440px; }

.notice { margin: 0; display: grid; gap: 10px; min-width: 0; }

.row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.row dt { font-size: 13px; font-weight: 700; color: var(--purple-dark); }

.row dd { margin: 0; font-size: 16px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }

.error { margin: 0; font-weight: 700; color: #9b1c1c; }

.foot { display: flex; justify-content: center; padding-top: 8px; }

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