body[data-scene="quiz"] #app,
body[data-scene="start"] #app {
  min-height: calc(100vh - var(--masthead-height));
  min-height: calc(100dvh - var(--masthead-height));
}

.quiz-sheet {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 3.6rem) var(--page-inset) 3.4rem;
  color: var(--neo-ink);
  font-family: var(--font-ui);
}

.quiz-sheet h1:focus { outline: none; }

.quiz-meter {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.quiz-position {
  font-size: 0.92rem;
  color: var(--neo-muted);
  font-variant-numeric: tabular-nums;
}

.quiz-position strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--neo-ink);
}

.quiz-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quiz-save::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neo-celadon);
}

.quiz-save .status {
  font-size: 0.82rem;
  color: var(--neo-muted);
}

.quiz-sheet .progress {
  height: 4px;
  margin-top: 0.7rem;
  border-radius: 999px;
  background: rgba(44, 36, 26, 0.1);
  overflow: hidden;
}

.quiz-sheet .progress span {
  display: block;
  height: 100%;
  background: var(--neo-celadon);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.quiz-sheet.quiz .question-card {
  margin-top: 1.65rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--neo-surface);
  border: 1px solid var(--neo-line);
  border-radius: 24px;
  box-shadow: var(--neo-shadow);
}

.quiz-sheet.quiz .question-card h1 {
  margin: 0 0 2.1rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 3.4em;
  color: var(--neo-ink);
  scroll-margin-top: 90px;
}

.quiz-sheet .scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.quiz-sheet .option {
  min-width: 0;
  min-height: 86px;
  padding: 0.75rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  text-align: center;
  border: 1px solid rgba(44, 36, 26, 0.14);
  border-radius: 15px;
  background: #fdfbf7;
  color: var(--neo-ink);
  cursor: pointer;
  transition: all 0.16s ease;
}

.quiz-sheet .option strong {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quiz-sheet .option span {
  font-size: 0.82rem;
  line-height: 1.35;
}

.quiz-sheet .option:has(input:checked) {
  background: var(--neo-celadon);
  border-color: var(--neo-celadon);
  color: #faf6ee;
  box-shadow: 0 8px 20px rgba(38, 86, 80, 0.22);
}

@media (hover: hover) {
  .quiz-sheet .option:hover:not(:has(input:checked)):not(.is-checked) {
    background: var(--neo-subtle);
    border-color: rgba(38, 86, 80, 0.32);
  }
}

.quiz-sheet .missing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.quiz-sheet .missing .option {
  min-height: 44px;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
}

.quiz-sheet .quiz-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.quiz-forward::after {
  content: "→";
  margin-left: 0.35rem;
}

.quiz-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.35rem;
  padding: 0 0.25rem;
  color: var(--neo-muted);
  font-size: 0.82rem;
}

.quiz-tool-links, .quiz-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.quiz-tool-links a, .quiz-tool-links .text-button {
  color: var(--neo-muted);
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.quiz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.quiz-intro form {
  background: var(--neo-surface);
  border: 1px solid var(--neo-line);
  border-radius: 22px;
  padding: clamp(1.6rem, 3.6vw, 2.4rem);
  box-shadow: var(--neo-shadow);
}

.quiz-intro form h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.quiz-page-heading {
  margin-bottom: 1.5rem;
}

.quiz-page-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.3rem);
  font-weight: 700;
  margin: 0.35rem 0 0.65rem;
}

.quiz-edition {
  font-size: 0.84rem;
  color: var(--neo-celadon);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
}

.quiz-consents {
  margin: 1.25rem 0;
}

.quiz-consents .check {
  padding: 0.5rem 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .quiz-sheet .scale { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .quiz-sheet .scale .option { padding: 0.7rem 0.2rem; }
  .quiz-sheet .scale .option span { font-size: 0.78rem; white-space: nowrap; }
}

@media (max-width: 350px) {
  .quiz-sheet .scale .option span { font-size: 0.72rem; }
}

@media (max-width: 420px) {
  .quiz-sheet .missing { grid-template-columns: 1fr; }
}

/* Explicit selected state for WebViews without :has() */
.option.is-checked,
.quiz-sheet .option.is-checked {
  background: var(--neo-celadon, #265650);
  border-color: var(--neo-celadon, #265650);
  color: #faf6ee;
  box-shadow: 0 8px 20px rgba(38, 86, 80, 0.22);
}
