:root {
  color-scheme: light;
  --navy: #0b1d41;
  --text: #15213a;
  --muted: #7180a1;
  --border: #d7deeb;
  --lime: #d8f24d;
  --lime-soft: #f1f8c5;
  --blue-soft: #edf3ff;
  --green-soft: #edf9f1;
  --peach-soft: #fff0ea;
  --violet-soft: #f3edff;
  --yellow-soft: #fff7d9;
  --surface: #ffffff;
  --page: #f7f9fc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
}

button, input, textarea { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(1564px, calc(100% - 36px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}

.topbar {
  height: 74px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  position: relative;
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .045em;
  text-decoration: none;
}

.brand span {
  position: absolute;
  width: 14px;
  height: 14px;
  top: -8px;
  right: 54px;
  border-radius: 50%;
  background: var(--lime);
}

.support { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.avatar { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; background: var(--lime); color: var(--navy); font-weight: 800; }

.screen { width: min(1260px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 54px; }
.progress { margin-bottom: 16px; color: var(--muted); font-size: 18px; }
h1 { margin: 0; color: var(--navy); font-size: clamp(38px, 4.4vw, 62px); line-height: 1.06; letter-spacing: .01em; outline: none; }
h2 { color: var(--navy); }
.lead { margin: 20px 0; color: var(--muted); font-size: clamp(22px, 2.2vw, 30px); }

.hero { max-width: 1000px; padding-top: 72px; }
.hero-copy { max-width: 970px; margin: 38px 0 70px; font-size: clamp(20px, 2vw, 27px); line-height: 1.35; }
.official-note { display: inline-block; margin: 0 0 50px; padding: 18px 34px; border: 1px solid #dbe79b; border-radius: 16px; background: var(--lime-soft); color: var(--navy); font-size: 20px; font-weight: 800; }
.hero .button { display: block; }

.question-badge { display: inline-block; margin-bottom: 34px; padding: 10px 20px; border-radius: 14px; background: var(--lime-soft); font-weight: 800; }
.question h1 { font-size: clamp(34px, 3.7vw, 54px); }
.helper { margin: 24px 0; color: var(--muted); font-size: 20px; }

.fields { display: grid; gap: 28px; margin-top: 40px; }
.field { display: grid; gap: 12px; color: var(--text); font-size: 18px; font-weight: 750; }
.field input, .field textarea {
  width: 100%;
  padding: 20px 26px;
  border: 1px solid #c6d1e2;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font-size: 21px;
  font-weight: 450;
  outline: none;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 29, 65, .1); }
.field input:disabled { background: #f0f2f7; }
.field--grade { max-width: 730px; }

.options { display: grid; gap: 12px; margin-top: 28px; }
.options--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option {
  min-height: 66px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.option:hover { border-color: #9cabc2; transform: translateY(-1px); }
.option:focus-within { outline: 3px solid rgba(11, 29, 65, .12); }
.option input { width: 21px; height: 21px; margin: 0; accent-color: var(--navy); flex: 0 0 auto; }
.option span { font-size: 17px; line-height: 1.3; }
.option.is-selected { border-color: #b8cc43; background: var(--lime-soft); }
.tone-0:not(.is-selected) { background: var(--blue-soft); }
.tone-1:not(.is-selected) { background: var(--green-soft); }
.tone-2:not(.is-selected) { background: var(--peach-soft); }
.tone-3:not(.is-selected) { background: var(--violet-soft); }

.conditional { margin-top: 34px; }
.conditional h2 { margin: 0 0 14px; font-size: 26px; }
.privacy-warning { color: var(--muted); font-size: 15px; }
.form-error { margin: 22px 0 0; padding: 13px 16px; border-left: 4px solid #c53d46; background: #fff1f1; color: #8f1821; font-weight: 700; }

.navigation { margin-top: 50px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.button { min-height: 58px; padding: 0 32px; border: 1px solid var(--navy); border-radius: 15px; font-weight: 850; cursor: pointer; }
.button--primary { background: var(--navy); color: #fff; }
.button--primary:hover { background: #142c59; }
.button--secondary { background: #fff; color: var(--navy); border-color: var(--border); }

.result > h1 { font-size: clamp(36px, 3.8vw, 54px); }
.result-block { padding: 22px 26px; border: 1px solid var(--border); border-radius: 18px; }
.result-block h2, .result-section > h2 { margin: 0 0 12px; font-size: 25px; }
.result-block p, .result-block li { line-height: 1.5; }
.result-conclusion { margin: 28px 0 34px; background: var(--lime-soft); }
.directions-grid, .fallback-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.direction-tier + .direction-tier, .fallback-grid { margin-top: 18px; }
.result-card { min-height: 185px; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--blue-soft); }
.result-card:nth-child(3n + 2) { background: var(--green-soft); }
.result-card:nth-child(3n) { background: var(--violet-soft); }
.result-card h3 { margin: 0 0 14px; color: var(--navy); font-size: 20px; }
.result-card p { margin: 9px 0; line-height: 1.4; }
.card-note { color: var(--muted); font-size: 14px; }
.tie-label { margin: 0 0 12px; padding: 10px 15px; border-radius: 12px; background: var(--yellow-soft); font-weight: 700; }
.fallback-card { background: var(--yellow-soft); }
.result-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 28px 0; }
.result-fork { background: var(--violet-soft); }
.result-factors { background: var(--peach-soft); }
.result-checks { background: var(--blue-soft); }
.result-block ul { margin: 0; padding-left: 22px; }
.disclaimer { margin: 24px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .options--compact, .directions-grid, .fallback-grid, .result-columns { grid-template-columns: 1fr 1fr; }
  .screen { width: min(100% - 32px, 760px); }
  .support { font-size: 0; }
}

@media (max-width: 620px) {
  .app-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .topbar { height: 66px; padding: 0 18px; }
  .brand { font-size: 20px; }
  .brand span { width: 10px; height: 10px; top: -5px; right: 39px; }
  .avatar { width: 40px; height: 40px; font-size: 14px; }
  .screen { width: calc(100% - 32px); padding: 24px 0 38px; }
  .hero { padding-top: 30px; }
  .hero-copy { margin: 28px 0 38px; }
  .official-note { padding: 14px 18px; margin-bottom: 32px; font-size: 16px; }
  .options--compact, .directions-grid, .fallback-grid, .result-columns { grid-template-columns: 1fr; }
  .question-badge { margin-bottom: 24px; }
  .navigation { position: static; margin-top: 34px; }
  .button { min-height: 54px; padding: 0 20px; }
}

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