#quiz-screen {
  --eq-ink: #29262a;
  --eq-muted: #625d60;
  --eq-accent: #881738;
  --eq-border: #dfd9d3;
  color: var(--eq-ink);
}
#quiz-screen [hidden], #quiz-screen[hidden] { display: none !important; }
.eq-wrap, .eq-wrap *, #eq-dialog, #eq-dialog *, .eq-overlay * { box-sizing: border-box; }
.eq-wrap { width: min(100% - 48px, 1040px); margin: 0 auto; padding: 34px 0 64px; }
.eq-wrap button, #eq-dialog button { font: inherit; }
.eq-toolbar, .eq-meta, .eq-score, .eq-total, .eq-dialog-tools {
  display: flex; align-items: center;
}
.eq-toolbar { justify-content: space-between; gap: 16px; }
.eq-link {
  cursor: pointer; background: none; color: var(--eq-muted); border: 0;
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 5px 0 1px;
}
.eq-link:hover { color: var(--eq-accent); }
.eq-link span { font-size: 1.25em; }
.eq-score {
  background: #fff; border: 1px solid var(--eq-border); border-radius: 100px;
  padding: 8px 15px; gap: 5px; font-size: .84rem; color: var(--eq-muted);
}
.eq-score strong { color: var(--eq-accent); font-size: 1.22rem; font-variant-numeric: tabular-nums; }
.eq-title h1 { margin: 19px 0 25px; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.055em; line-height: 1.25; }
.eq-paper, .eq-notice {
  background: #fff; border: 1px solid var(--eq-border); padding: clamp(20px, 3.7vw, 42px);
  border-radius: 18px; min-width: 0;
}
.eq-paper { box-shadow: 0 6px 28px rgba(64, 34, 41, .045); }
.eq-notice { padding: 16px 20px; margin-bottom: 16px; color: var(--eq-muted); line-height: 1.6; }
.eq-notice button, .eq-dialog-tools button, #eq-image-retry {
  cursor: pointer; color: var(--eq-accent); padding: 7px 12px;
  border: 1px solid #ded5d6; background: #fff; border-radius: 8px;
}
.eq-notice button { margin-inline-start: 9px; }
#eq-image-error { padding: 12px; color: var(--eq-muted); background: #f6f3ef; line-height: 1.6; }
#eq-image-retry { margin-block: 6px; }
.eq-meta { gap: 9px; color: var(--eq-muted); font-size: .9rem; font-weight: 650; }
.eq-value {
  background: #f5eaf0; color: var(--eq-accent); padding: 4px 10px; font-size: .78rem;
  border-radius: 100px; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
#eq-prompt, .eq-choice-text, #eq-right { font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", sans-serif; }
#eq-prompt {
  margin: 18px 0 25px; font-size: clamp(1.13rem, 2vw, 1.48rem); font-weight: 650;
  line-height: 1.75; letter-spacing: -.013em; line-break: strict; white-space: pre-line;
  overflow-wrap: anywhere; word-break: normal;
}
#eq-prompt:focus, #eq-review:focus, #eq-done:focus { outline: 0; }
.eq-wrap button:focus-visible, #eq-dialog button:focus-visible, #eq-scroll:focus-visible {
  outline: 3px solid #126875; outline-offset: 3px;
}
.eq-question-grid { display: grid; gap: 24px; align-items: start; }
.eq-illustrated .eq-question-grid { grid-template-columns: minmax(0,.96fr) minmax(0,1.04fr); }
.eq-answer-area, .eq-choice-text, #eq-figure { min-width: 0; }
#eq-figure { margin: 0; }
#eq-open-image {
  width: 100%; display: grid; position: relative; align-items: center; justify-items: center;
  padding: 5px; border: 1px solid var(--eq-border); background: #fcfaf7; border-radius: 11px;
  overflow: hidden; cursor: zoom-in;
}
#eq-image { display: block; width: 100%; height: auto; max-height: 470px; object-fit: contain; }
.eq-image-label {
  display: block; justify-self: end; padding: 3px 8px 2px; border-radius: 30px; font-size: .77rem;
  font-weight: 650; background: #fff; color: #5b5153; border: 1px solid #e3dcda; margin-top: 3px;
}
.eq-instruction { margin: 0 0 11px; color: var(--eq-muted); font-size: .84rem; }
#eq-choices { display: grid; gap: 9px; }
.eq-choice {
  background: #fff; color: var(--eq-ink); border: 1px solid #d9d3cf; width: 100%; text-align: start;
  display: grid; grid-template-columns: 29px minmax(0,1fr); align-items: center; gap: 11px;
  padding: 12px 14px; min-height: 54px; cursor: pointer; border-radius: 10px; transition: background .14s, border-color .14s;
}
.eq-choice:disabled { cursor: default; opacity: 1; }
@media (hover: hover) {
  .eq-choice:not(:disabled):hover { border-color: var(--eq-accent); background: #fcf3f5; }
}
.eq-choice:not(:disabled):active { background: #f8e8ed; }
.eq-number {
  display: inline-grid; place-items: center; width: 26px; height: 26px; color: #4e484c;
  border: 1px solid #d7d1cd; border-radius: 50%; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.eq-choice-text { font-size: 1rem; line-height: 1.68; white-space: pre-line; line-break: strict; overflow-wrap: anywhere; }
.eq-right, .eq-wrong { grid-template-columns: 29px minmax(0,1fr) auto; }
.eq-choice.eq-right { border-color: #81ab97; background: #f0f8f2; }
.eq-choice.eq-wrong { border-color: #d8afb6; background: #fcf2f3; }
.eq-right .eq-number { color: #fff; background: #226047; border-color: #226047; }
.eq-wrong .eq-number { color: #fff; background: #8e3449; border-color: #8e3449; }
.eq-outcome { font-size: .75rem; font-weight: 750; }
.eq-right .eq-outcome { color: #1d573c; }
.eq-wrong .eq-outcome { color: #7d2a40; }
.eq-review { border-top: 1px solid var(--eq-border); margin-top: 27px; padding-top: 23px; }
.eq-review h3, .eq-complete h2 { margin: 0 0 13px; font-size: 1.3rem; letter-spacing: -.045em; }
.eq-correct { display: flex; align-items: baseline; gap: 10px; }
.eq-correct > span { color: #316247; font-size: .85rem; font-weight: 750; white-space: nowrap; }
#eq-right { font-size: 1.04rem; line-height: 1.6; font-weight: 650; overflow-wrap: anywhere; }
#eq-explanation, .eq-complete p { line-height: 1.75; margin: 11px 0 20px; white-space: pre-line; overflow-wrap: anywhere; }
.eq-primary {
  min-height: 45px; padding: 10px 20px; border: none; border-radius: 9px;
  background: var(--eq-accent); color: #fff; cursor: pointer; font-weight: 650 !important;
}
.eq-primary:disabled { background: #eee8e5; color: #625d5a; cursor: default; }
.eq-complete { text-align: center; padding-block: 45px; }
.eq-done-check, .eq-check { display: inline-grid; place-items: center; border-radius: 50%; }
.eq-done-check { color: #326947; background: #eaf5ec; width: 48px; height: 48px; margin: 0 0 15px; font-size: 1.5rem; }
.eq-overlay { position: fixed; inset: 0; z-index: 500; background: #25151e88; display: grid; place-items: center; padding: 20px; }
.eq-reward-card {
  width: min(340px,100%); overflow: hidden; border: 1px solid #fff5; border-radius: 20px; background: white;
  box-shadow: 0 16px 70px #321b2580; animation: eq-pop .19s ease-out both;
}
.eq-gain { background: #841735; color: #fff; display: grid; justify-items: center; padding: 26px 20px 29px; }
.eq-check { color: #841735; background: #fffaee; width: 43px; height: 43px; font-size: 1.65rem; font-weight: bold; }
.eq-gain > strong { font-size: 2.25rem; letter-spacing: -.075em; margin-top: 9px; }
.eq-gain > b { font-size: 2.9rem; font-weight: 800; line-height: 1.2; color: #ffe3ab; font-variant-numeric: tabular-nums; }
.eq-total { min-height: 59px; padding: 13px 19px; justify-content: space-between; gap: 8px; color: #625c5f; font-size: .9rem; }
.eq-total div { font-variant-numeric: tabular-nums; }
#eq-after { color: var(--eq-accent); font-size: 1.18rem; }
.eq-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#eq-dialog {
  width: min(94vw, 960px); max-width: 94vw; max-height: 92vh; max-height: 92dvh;
  margin: auto; padding: 0; border: 1px solid #d9d1cd; border-radius: 14px; overflow: hidden;
  color: var(--eq-ink); background: #fff;
}
#eq-dialog::backdrop { background: #25151ec2; }
.eq-dialog-tools { gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--eq-border); }
.eq-dialog-tools h2 { margin: 0 auto 0 0; font-size: 1rem; }
.eq-dialog-tools button { font-size: .85rem; min-height: 36px; }
.eq-zoom-scroll { width: 100%; max-height: calc(90vh - 62px); max-height: calc(90dvh - 62px); overflow: auto; overscroll-behavior: contain; }
#eq-large { display: block; width: 100%; max-width: 100%; height: auto; margin-inline: auto; }
.eq-original #eq-large { width: auto; max-width: none; }
.eq-wrap button, #eq-dialog button { touch-action: manipulation; }
@media(pointer: coarse) {
  .eq-dialog-tools button, .eq-notice button, #eq-image-retry { min-height: 44px; min-width: 44px; }
}
@keyframes eq-pop { from { opacity: .1; transform: translateY(9px) scale(.96); } to { opacity: 1; transform: none; } }
@media(max-width: 760px) {
  .eq-illustrated .eq-question-grid { grid-template-columns: minmax(0,1fr); }
  #eq-figure { width: min(100%,540px); margin-inline: auto; }
  #eq-image { max-height: 320px; }
  .eq-wrap { padding-top: 17px; padding-bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); }
  #eq-dialog { width: calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right))); }
  .eq-zoom-scroll { max-height: calc(88dvh - 64px - env(safe-area-inset-bottom)); }
}
@media(max-width: 520px) {
  .eq-wrap { width: calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right))); }
  .eq-title h1 { margin: 13px 0 17px; }
  .eq-paper { padding: 19px 15px 20px; border-radius: 13px; }
  .eq-choice { padding: 10px 9px; gap: 8px; grid-template-columns: 26px minmax(0,1fr); }
  .eq-right .eq-outcome, .eq-wrong .eq-outcome { grid-column: 2; }
  .eq-score { padding: 7px 11px; }
  #eq-prompt { margin: 12px 0 18px; }
  .eq-dialog-tools { padding: 8px; }
  #eq-next { width: 100%; min-height: 48px; }
}
@media(prefers-reduced-motion: reduce) {
  .eq-reward-card { animation: none; }
  .eq-choice { transition: none; }
}
