:root {
  --navy: #13213f;
  --navy-2: #1d2f57;
  --gold: #d6a64f;
  --gold-soft: #f3e6c6;
  --orange: #c4600c;
  --orange-dark: #a84f08;
  --cream: #f7f4ec;
  --white: #ffffff;
  --ink: #13213f;
  --muted: #4b5875;
  --line: #d9d2c0;
  --ok: #2f7d4f;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.55;
}

.strip {
  background: var(--gold);
  color: var(--navy);
  text-align: center;
  font-family: var(--serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 9px 12px;
}

.topbar { background: var(--navy); }
.topbar .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px;
}
.brand {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-size: 26px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
}
.brand span { color: var(--gold); }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) 48px max(20px, env(safe-area-inset-left));
  min-height: 62vh;
  min-height: 62dvh;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 2px 0 rgba(19, 33, 63, 0.04);
}

h1, h2 {
  font-family: var(--serif);
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--navy);
}
h1 { font-size: 34px; }
h2 { font-size: 28px; }
h1:focus, h2:focus { outline: none; }

p { margin: 0 0 14px; }
.lead { font-size: 21px; color: var(--muted); }
.small { font-size: 16px; color: var(--muted); }

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  padding: 18px 20px;
  min-height: 64px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--orange-dark); }
}
.btn:active { background: var(--orange-dark); }
.btn:focus-visible, .opt:focus-visible, .link-btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.progress { margin-bottom: 18px; }
.progress .label {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.bar {
  height: 10px;
  background: var(--gold-soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.options { display: grid; gap: 12px; margin: 18px 0 8px; }
.opt {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 12px;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  padding: 16px 18px;
  min-height: 64px;
  cursor: pointer;
}
/* No hover or pressed color on answers: on phones the next question lands under the finger. */
.opt, .opt:hover, .opt:active, .opt:focus { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.opt:not(.is-selected), .opt:not(.is-selected):hover, .opt:not(.is-selected):active, .opt:not(.is-selected):focus { background: var(--white); border-color: var(--navy); color: var(--navy); }
.opt.is-selected, .opt.is-selected:hover, .opt.is-selected:active, .opt.is-selected:focus { background: var(--navy); border-color: var(--navy); color: var(--white); }
.opt.is-selected { background: var(--navy); color: var(--white); border-color: var(--navy); }

.link-btn {
  background: none;
  border: 0;
  color: var(--navy-2);
  font: inherit;
  font-size: 17px;
  text-decoration: underline;
  padding: 14px 8px;
  min-height: 52px;
  cursor: pointer;
}

.loader-list { list-style: none; padding: 0; margin: 22px 0 6px; }
.loader-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.3s ease;
}
.loader-list li .tick {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--white);
  flex: none;
}
.loader-list li.on { opacity: 1; color: var(--ink); }
.loader-list li.done .tick { background: var(--ok); border-color: var(--ok); }
.spinner {
  width: 34px;
  height: 34px;
  border: 4px solid var(--gold-soft);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 6px 0 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 22px; }
.scale div {
  border: 2px solid var(--line);
  border-radius: 10px;
  text-align: center;
  padding: 10px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: var(--cream);
}
.scale div.active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}
.badge {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.note {
  border-left: 4px solid var(--gold);
  padding: 4px 0 4px 14px;
  margin: 18px 0;
  color: var(--muted);
}

footer {
  background: var(--navy);
  color: #d4dbea;
  font-size: 15px;
  line-height: 1.6;
}
footer .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
}
footer a { color: #f3e6c6; }
footer nav { margin-bottom: 12px; }
footer nav a { display: inline-block; margin: 0 18px 8px 0; padding: 6px 0; }

.hidden { display: none !important; }

.doc h1 { font-size: 30px; }
.doc h2 { font-size: 22px; margin-top: 26px; }
.doc p, .doc li { font-size: 17px; }

@media (max-width: 480px) {
  body { font-size: 18px; }
  main { padding-top: 18px; }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  .card { padding: 22px 18px; }
  .strip { letter-spacing: 0.14em; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .bar > i, .loader-list li { transition: none; }
}
