:root {
  --ivory: #ffffff;
  --paper: rgba(255, 255, 255, 0.72);
  --ink: #000000;
  --muted: rgba(0, 0, 0, .76);
  --line: rgba(0, 0, 0, 0.12);
  --bordeaux: #d21624;
  --green: #1664b0;
  --blue: #1664b0;
  --orange: #d21624;
  --pink: #efe8de;
  --acid: #ffffff;
  --powder: #efe8de;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 108% 8%, rgba(22, 100, 176, .10), transparent 30%),
    radial-gradient(circle at -10% 38%, rgba(210, 22, 36, .08), transparent 29%),
    radial-gradient(circle at 84% 72%, rgba(22, 100, 176, .06), transparent 34%),
    var(--ivory);
  color: var(--ink);
  font-family: "Helvetica Neue", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

body::before { display: none; }

button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.screen { display: none; }
.screen--active { display: block; animation: enter 260ms ease-out; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro { padding-top: 6px; }
.topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(50px, 10vh, 86px); }
.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: var(--ivory);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.04em;
}
.version-pill {
  padding: 9px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255,255,255,.34);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--bordeaux);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(43px, 11vw, 68px);
  font-weight: 550;
  line-height: .91;
  letter-spacing: -.055em;
}

.lead { color: var(--muted); font-size: 17px; line-height: 1.48; }
.intro-lead { max-width: 480px; margin: 22px 0 24px; }

.intro-visual {
  position: relative;
  display: grid;
  height: 180px;
  margin: 0 0 12px;
  overflow: hidden;
  place-content: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 32px;
  background:
    radial-gradient(circle at 52% 48%, rgba(255,255,255,.92) 0 8%, transparent 28%),
    radial-gradient(circle at 68% 75%, rgba(210,22,36,.82), transparent 33%),
    radial-gradient(circle at 25% 22%, rgba(22,100,176,.7), transparent 36%),
    var(--pink);
  box-shadow: inset 0 0 50px rgba(255,255,255,.42), 0 18px 46px rgba(0,0,0,.08);
  text-align: center;
}
.intro-visual strong { position: relative; z-index: 2; font-size: 76px; font-weight: 500; line-height: .76; letter-spacing: -.08em; }
.intro-visual small { position: relative; z-index: 2; margin-top: 8px; font-size: 11px; font-weight: 600; line-height: 1.1; text-transform: uppercase; }
.shape { position: absolute; border: 1px solid rgba(255,255,255,.62); filter: blur(1px); }
.shape--blue { width: 190px; height: 190px; left: -50px; top: -60px; border-radius: 50%; background: rgba(22,100,176,.78); }
.shape--red { width: 145px; height: 145px; right: -22px; bottom: -46px; border-radius: 42% 58% 50% 45%; background: rgba(210,22,36,.82); transform: rotate(26deg); }
.shape--green { width: 84px; height: 84px; left: 52%; top: -42px; border-radius: 50%; background: rgba(255,255,255,.58); }

.intro-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px 0 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 18px;
  background: rgba(255,255,255,.46);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0,0,0,.06);
}
.intro-card div { padding: 16px 5px; text-align: center; }
.intro-card div + div { border-left: 1px solid rgba(0,0,0,.12); }
.intro-card strong { display: block; font-size: 19px; font-weight: 600; }
.intro-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; }

.field-label { display: block; margin: 0 0 8px 2px; font-size: 12px; font-weight: 600; }
.select-input {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 999px;
  outline: none;
  background: rgba(255,255,255,.38);
  backdrop-filter: blur(16px);
  color: var(--ink);
  font-weight: 500;
}
.select-input:focus { box-shadow: 0 0 0 4px rgba(22, 100, 176, .18); }
.privacy-note { margin: 10px 2px 18px; color: var(--muted); font-size: 11px; }

.primary-button, .secondary-button {
  min-height: 56px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}
.primary-button {
  width: 100%;
  padding: 0 20px;
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 28px rgba(22,100,176,.18);
}
.primary-button:active, .secondary-button:active { transform: translateY(3px); box-shadow: none; }
.primary-button:disabled { cursor: not-allowed; opacity: .3; box-shadow: none; }
.secondary-button { padding: 0 17px; background: var(--acid); color: var(--ink); }

.test { min-height: calc(100vh - 48px); }
.test-header { display: flex; align-items: center; gap: 13px; }
.icon-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 21px;
  cursor: pointer;
}
.progress-wrap { flex: 1; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.progress-copy span:first-child { color: var(--ink); font-weight: 600; }
.progress-track { height: 7px; overflow: hidden; border: 1px solid var(--ink); border-radius: 99px; background: var(--paper); }
.progress-bar { width: 0; height: 100%; background: var(--orange); transition: width 240ms ease; }

.question-card { margin-top: 50px; }
.question-number { display: inline-flex; margin: 0; padding: 7px 10px; border-radius: 999px; background: rgba(22,100,176,.10); color: var(--blue); font-size: 11px; font-weight: 650; }
.question-card h2 { margin: 16px 0 13px; font-size: clamp(29px, 7vw, 40px); font-weight: 600; line-height: 1.06; letter-spacing: -.04em; }
.question-help { max-width: 510px; margin: 0 0 25px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.question-help:empty { display: none; }
.answers { display: grid; gap: 9px; }

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 22px;
  background: rgba(255,255,255,.32);
  -webkit-backdrop-filter: blur(22px) saturate(115%);
  backdrop-filter: blur(22px) saturate(115%);
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
}
.answer-option::before {
  content: "";
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 50%;
  background: transparent;
}
.answer-option[data-type="multi"]::before { border-radius: 5px; }
.answer-option.selected {
  border-color: rgba(22,100,176,.48);
  background: rgba(22,100,176,.13);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}
.answer-option.selected::before { border: 5px solid var(--blue); background: white; }
.answer-option[data-type="multi"].selected::before { border: 4px solid var(--blue); border-radius: 4px; background: white; }
.test-actions { margin-top: 28px; padding-bottom: 14px; }

.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.result-heading h1 { font-size: clamp(43px, 11vw, 64px); }
.result-stamp {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  font-size: 12px;
  font-weight: 600;
}
.result-summary { margin: 18px 0 23px; color: var(--muted); line-height: 1.48; }
.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 128px;
  padding: 22px;
  border: 1px solid var(--ink);
  border-radius: 24px;
  background:
    radial-gradient(circle at 104% -10%, rgba(22,100,176,.12), transparent 48%),
    rgba(255,255,255,.78);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(22,100,176,.10);
  backdrop-filter: blur(18px);
}
.total-score { color: var(--blue); font-size: 60px; font-weight: 500; line-height: .8; letter-spacing: -.07em; }
.total-score small { color: rgba(0,0,0,.76); font-size: 15px; letter-spacing: 0; }
.score-card strong { display: block; font-size: 18px; line-height: 1.15; }
.score-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

.logic-alerts:empty { display: none; }
.logic-alerts { margin-top: 16px; }
.logic-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(210,22,36,.38);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
}
.logic-mark { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--bordeaux); color: white; font-weight: 700; }
.logic-card strong { display: block; margin: 1px 0 4px; font-size: 13px; }
.logic-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

.history-card {
  margin-top: 14px;
  padding: 17px 18px;
  border: 1px solid rgba(22,100,176,.18);
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.history-card:empty { display: none; }
.history-card > span { font-size: 11px; font-weight: 600; }
.history-card > div { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 5px; }
.history-card > div strong { color: var(--blue); font-size: 30px; font-weight: 500; }
.history-card > div b { font-size: 14px; font-weight: 600; }
.history-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.history-card--first strong { font-size: 14px; font-weight: 600; }

.wheel-card { margin: 30px 0 14px; padding: 17px 8px 8px; border: 1px solid rgba(22,100,176,.08); border-radius: 34px; background: rgba(255,255,255,.82); color: var(--ink); box-shadow: 0 20px 60px rgba(22,100,176,.10); backdrop-filter: blur(18px); }
.wheel-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 10px 5px; }
.wheel-header div { display: grid; gap: 2px; }
.wheel-header span { font-size: 13px; font-weight: 600; }
.wheel-header small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.wheel-scale { padding: 6px 9px; border: 1px solid rgba(22,100,176,.16); border-radius: 999px; color: var(--blue); font-size: 10px !important; }
#balance-wheel { display: block; width: 100%; height: auto; }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 40px; }
.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
  font-size: 11px;
}
.legend-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.legend-item strong { color: var(--ink); }
.legend-item::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--orange)); }

.focus-section { margin-top: 18px; }
.recommendation {
  position: relative;
  margin-bottom: 11px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 19px;
  background: var(--paper);
}
.recommendation:nth-child(1) { border-color: rgba(22,100,176,.28); background: rgba(255,255,255,.82); color: var(--ink); }
.recommendation:nth-child(1) p, .recommendation:nth-child(1) .action { color: var(--muted); }
.recommendation:nth-child(2) { background: rgba(255,255,255,.78); }
.recommendation:nth-child(3) { background: rgba(255,255,255,.78); }
.recommendation--logic:nth-child(1) { border-color: rgba(210,22,36,.46); background: rgba(255,255,255,.86); color: var(--ink); }
.recommendation--logic:nth-child(1) p, .recommendation--logic:nth-child(1) .action { color: var(--muted); }
.recommendation-index { font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.recommendation h3 { max-width: 420px; margin: 9px 0; font-size: 20px; line-height: 1.05; letter-spacing: -.025em; }
.recommendation p { margin: 0; color: rgba(0,0,0,.76); font-size: 13px; line-height: 1.46; }
.recommendation .action { margin-top: 12px; color: var(--ink); }

.repeat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 13px;
  padding: 19px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  border-color: rgba(22,100,176,.14);
  background: rgba(255,255,255,.78);
  color: var(--ink);
}
.repeat-card p { margin: 5px 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.repeat-card .secondary-button { border-color: var(--blue); background: var(--blue); color: white; }

.export-button {
  width: 100%;
  min-height: 56px;
  margin: 0 0 12px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 380px) {
  .app-shell { padding-inline: 14px; }
  .intro-card span { font-size: 9px; }
  .legend { grid-template-columns: 1fr; }
  .score-card { gap: 14px; padding: 18px; }
  .total-score { font-size: 52px; }
  .repeat-card { align-items: stretch; flex-direction: column; }
}

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

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: white !important; }
  .app-shell { width: 100%; max-width: none; padding: 0; }
  .results { display: block !important; }
  .intro, .test, .repeat-card, .export-button, #restart-button { display: none !important; }
  .score-card, .history-card, .wheel-card, .recommendation, .legend-item, .logic-card {
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .wheel-card, .score-card, .history-card, .logic-card, .recommendation { break-inside: avoid; }
  .focus-section { break-before: page; }
}
