.toeic-page { max-width: 67rem; padding-bottom: clamp(2.75rem, 7vw, 5rem); }
.toeic-page [hidden] { display: none !important; }
.toeic-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; color: var(--app-muted); font-size: .925rem; }
.toeic-crumb a, .back-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--app-rose); font-weight: 570; text-underline-offset: .18em; }
.toeic-crumb a[aria-current] { color: var(--app-muted); text-decoration: none; }
.toeic-intro { padding: clamp(1.3rem, 3vw, 2.6rem) 0 clamp(1.7rem, 3.5vw, 3rem); }
.toeic-intro h1, .exercise-intro h1 { max-width: 21ch; font-size: clamp(2.15rem, 4.1vw, 3.5rem); overflow-wrap: anywhere; }
.toeic-intro .app-lead { max-width: 53ch; margin-top: .8rem; }
.skill-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(.9rem,2vw,1.4rem); align-items: start; }
.skill-panel { min-width: 0; scroll-margin-top: 1rem; border: 1px solid #cfd9e0; border-radius: 1.1rem; padding: clamp(1rem,2vw,1.5rem); background: linear-gradient(145deg,#edf7fc,white 43%); box-shadow: var(--app-elevation); }
.skill-panel#reading { --app-rim: #e3d3de; background: linear-gradient(145deg,#fff1f9,white 43%); }
.skill-head { display: flex; align-items: center; gap: .75rem; }
.skill-head h2 { font-size: clamp(1.35rem,2.8vw,1.8rem); }
.skill-icon { display: inline-grid; place-items: center; width: 3.1rem; height: 3.1rem; border: 1px solid #bfd2dd; border-radius: 1rem; background: #f9fcff; box-shadow: inset 0 2px white,0 2px #c5d7e1; }
#reading .skill-icon { border-color: #dfc6d6; background: #fffafd; box-shadow: inset 0 2px white,0 2px #dfc6d6; }
.skill-panel > p { margin: .95rem 0; color: var(--app-muted); }
.part-list { list-style: none; margin: 0; padding: 0; }
.part-list li { border-top: 1px solid var(--app-line); }
.part-link { min-height: 3.55rem; display: grid; align-items: baseline; grid-template-columns: auto minmax(0,1fr) auto; gap: .55rem; padding: .85rem 0; text-decoration: none; }
.part-label, .part-count, .independent-note, #load-status, .part-context { color: var(--app-muted); font-size: .93rem; }
.part-link strong { color: #783651; font-weight: 600; text-decoration: underline; text-underline-offset: .18em; }
.part-link:hover strong { text-decoration-thickness: 2px; }
.toeic-page .independent-note { margin-top: 1.4rem; }
.toeic-page #load-status { margin-block: 1rem; }
.exercise-intro { padding: clamp(1.1rem,3vw,2.2rem) 0 clamp(1.25rem,3vw,2.25rem); }
.exercise-intro .part-context { margin-bottom: .5rem; font-weight: 570; }
.exercise-intro .instructions { max-width: 67ch; margin-top: .85rem; white-space: pre-line; }
.exercise-intro .score { width: fit-content; max-width: 100%; margin-top: 1.25rem; background: var(--app-sky-paper); border: 1px solid #bcd1df; border-radius: .65rem; padding: .7rem 1rem; font-size: 1.25rem; }
.question-group { border: 1px solid #ccd6df; border-radius: 1rem; padding: clamp(.95rem,2.15vw,1.5rem); margin-bottom: 1.2rem; box-shadow: 0 2px #dce6ed; }
.question-group .group-heading { font-size: clamp(1.1rem,2vw,1.4rem); margin-bottom: 1rem; }
.group-content.with-stimulus { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); gap: clamp(1rem,3vw,2.3rem); align-items: start; }
.group-questions { min-width: 0; }
.stimulus > * + * { margin-top: .75rem; }
.practice-photo { display: block; width: auto; max-width: 100%; height: auto; max-height: 24rem; object-fit: contain; border-radius: .7rem; }
.audio-player audio { display: block; width: min(100%,28rem); max-width: 100%; }
.passage { white-space: pre-line; padding: clamp(.85rem,2vw,1.25rem); border: 1px solid #ccdae3; border-radius: .8rem; background: #f5f9fc; line-height: 1.7; overflow-wrap: anywhere; }
.transcript { padding: .4rem .8rem; border: 1px solid #d7dce2; border-radius: .65rem; }
.transcript summary { min-height: 2.35rem; padding: .45rem 0; font-weight: 550; cursor: pointer; color: #703550; }
.transcript p { white-space: pre-line; margin-block: .45rem; }
.exercise-question { min-width: 0; padding: 0; margin: 0; border: 0; }
.exercise-question + .exercise-question { margin-top: 1.4rem; }
.exercise-question legend { max-width: 100%; padding: 0; margin-bottom: .55rem; font-size: 1.05rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.exercise-question .audio-player { margin-bottom: .7rem; }
.options { display: grid; gap: .4rem; }
.options.letters { grid-template-columns: repeat(auto-fit,minmax(3.8rem,1fr)); max-width: 23rem; }
.choice { display: flex; align-items: baseline; gap: .6rem; min-height: 2.8rem; margin: 0; padding: .6rem .8rem; background: #fff; border: 1px solid #bcc9d3; border-radius: .65rem; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.choice input { flex: none; margin: 0; accent-color: #883b60; }
.choice:has(input:checked) { border-color: #5e7690; background: #edf5fc; }
.choice.key-choice { border-color: #89637a; background: #fff4fa; }
.choice:has(:disabled) { cursor: default; }
.choice .letter { font-weight: 650; color: #514b51; }
.letters .choice { align-items: center; justify-content: center; }
.feedback { margin-top: .7rem; padding: .65rem .85rem; background: #fbf5fa; border-radius: .55rem; }
.feedback strong { color: #66324c; }
.feedback p { margin-top: .28rem; }
.practice-actions { display: flex; gap: .75rem 1rem; align-items: center; flex-wrap: wrap; }
.practice-button { display: inline-flex; min-height: 2.8rem; align-items: center; justify-content: center; padding: .65rem 1.1rem; border: 1px solid var(--app-ink); border-radius: .7rem; background: var(--app-ink); color: white; font: 550 1rem/1.4 var(--app-font); cursor: pointer; text-decoration: none; }
.toeic-page .practice-button.secondary { background: white; color: var(--app-ink); border-color: #bfcbd3; }
.practice-button:hover { box-shadow: 0 2px #b7cad5; }
.answer-error:not(:empty), .audio-error { margin: .75rem 0; color: #82264e; }
.inline-button { padding: .2rem .3rem; font: inherit; color: var(--app-rose); background: #fff; border: 0; text-decoration: underline; cursor: pointer; }
@media (max-width: 48rem) {
  .skill-grid, .group-content.with-stimulus { grid-template-columns: 1fr; }
}
@media (max-width: 29rem) {
  .part-link { grid-template-columns: auto minmax(0,1fr); gap: .12rem .6rem; }
  .part-count { grid-column: 2; }
  .options.letters { grid-template-columns: repeat(auto-fit,minmax(3rem,1fr)); }
  .letters .choice { padding-inline: .35rem; gap: .35rem; }
}

/* The exam uses its own navigation and keeps the reading area on a white canvas. */
body.toeic-testing > .app-header,
body.toeic-testing > .app-footer,
body.toeic-testing .toeic-crumb { display: none; }
body.toeic-testing .toeic-page { width: 100%; max-width: none; margin: 0; padding: 0; }
.exam-shell {
  --exam-navy: #173552;
  --exam-blue: #214b72;
  --exam-edge: #bed2e2;
  --exam-text: #192d40;
  --exam-gutter: clamp(1rem, 4vw, 3.75rem);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 18rem;
  background: white;
  color: var(--exam-text);
}
.exam-shell .exam-head,
.exam-shell .exam-controls {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem 1.2rem;
  padding: .8rem var(--exam-gutter);
  color: white;
}
.exam-shell .exam-head { justify-content: space-between; background: var(--exam-navy); }
.exam-heading, .exam-name { min-width: 0; }
.exam-head .exam-title {
  max-width: none;
  font: 620 clamp(1.17rem, 2.5vw, 1.65rem)/1.25 var(--app-font);
  letter-spacing: -.025em;
  color: white;
  overflow-wrap: anywhere;
}
.exam-name, .exam-meta, .exam-progress { font-size: .9rem; line-height: 1.4; }
.exam-head :is(.exam-name, .exam-meta, .exam-progress) { color: #e0ecf5; }
.exam-tools, .exam-timer, .exam-volume, .exam-clock, .exam-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .75rem;
}
.exam-tools, .exam-steps { margin-inline-start: auto; }
.exam-head :is(.exam-clock, .timer-value) { font-variant-numeric: tabular-nums; color: white; }
.exam-head .timer-value { font-size: 1.12rem; font-weight: 620; }
.exam-volume input[type="range"] { width: 5.25rem; height: 2.75rem; accent-color: #b7dfff; cursor: pointer; }
.exam-shell :is(.exam-head, .exam-controls) :is(button, summary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .42rem .85rem;
  border: 1px solid #b8cbdc;
  border-radius: .35rem;
  background: #fff;
  color: #173552;
  font: 580 .95rem/1.35 var(--app-font);
  cursor: pointer;
}
.exam-shell :is(.exam-head,.exam-controls) :is(button:hover:not(:disabled),summary:hover) { background: #dfedfa; }
.exam-shell :is(.exam-head,.exam-controls) button:disabled { background: #375774; color: #cbd9e4; border-color: #7991a7; cursor: default; }
.exam-shell .exam-body { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-gutter: stable; }
.exam-body .question-group {
  width: 100%;
  max-width: 92rem;
  margin: 0 auto;
  padding: clamp(1.1rem, 2.5vw, 2.35rem) var(--exam-gutter) 2rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}
.exam-body .group-content:not(.with-stimulus) { max-width: 51rem; }
.exam-body .group-content.with-stimulus { grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); }
.exam-body .passage { background: #f7fafc; border-color: #c6d4df; border-radius: .35rem; }
.exam-body .practice-photo { border-radius: .35rem; }
.exam-body .choice { border-color: #aabac7; border-radius: .35rem; }
.exam-body .choice:has(input:checked) { border-color: #285982; background: #e6f0fa; box-shadow: inset 3px 0 #285982; }
.exam-body .choice input, .exam-setup input { accent-color: #285982; }
.exam-shell .exam-controls {
  justify-content: space-between;
  border-top: 1px solid #112d4a;
  background: var(--exam-blue);
  padding-bottom: max(.8rem, env(safe-area-inset-bottom));
}
.mark-check { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; cursor: pointer; }
.mark-check input { width: 1.12rem; height: 1.12rem; margin: 0; accent-color: #b7dfff; }
.exam-shell :is(.exam-head, .exam-controls) :focus-visible { outline: 3px solid #fbd472; outline-offset: 2px; }
.exam-shell .exam-body :focus-visible, .exam-dialog :focus-visible { outline: 3px solid #285e95; outline-offset: 2px; }
.exam-body .choice:has(input:focus-visible) { outline: 3px solid #285e95; outline-offset: 2px; }
.exam-message:not(:empty) { padding: .55rem var(--exam-gutter); background: #fff3dc; color: #4f390e; }
.exam-player { margin-block: .75rem 1rem; }
.exam-player audio { max-width: 100%; }
.exam-player-status { color: #354f64; font-size: .94rem; }
.exam-setup {
  display: grid;
  justify-items: start;
  gap: .7rem;
  max-width: 43rem;
  margin-block: 1rem 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px solid #c5d5e1;
  border-radius: .55rem;
  background: #f4f8fc;
}
.exam-setup label { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
.exam-intro-note, .exam-result-note { max-width: 66ch; margin-block: .65rem 1rem; color: #415464; }
.exam-dialog {
  width: min(37rem, calc(100% - 2rem));
  max-height: min(85vh, 45rem);
  padding: clamp(1.15rem, 3.5vw, 1.8rem);
  border: 1px solid #a6bdce;
  border-radius: .65rem;
  background: white;
  color: #192d40;
  box-shadow: 0 12px 46px #152b4359;
}
.exam-dialog::backdrop { background: rgb(13 32 51 / 58%); }
.exam-dialog :is(h2,h3) { margin-block: 0 .6rem; }
.exam-dialog .practice-actions { margin-top: 1.15rem; }
.question-navigator summary { min-height: 2.75rem; cursor: pointer; }
.number-grid { display: flex; flex-wrap: wrap; gap: .43rem; margin-block: .85rem; }
.number-jump {
  position: relative;
  min-width: 2.8rem;
  min-height: 2.8rem;
  padding: .3rem .5rem;
  border: 1px solid #8fa4b6;
  border-radius: .35rem;
  background: white;
  color: #253d52;
  font: 570 1rem/1.4 var(--app-font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.number-jump[data-answered="true"] { background: #dfedf9; color: #173e61; border-bottom: 4px solid #3c6487; }
.number-jump[data-marked="true"]::after {
  content: "";
  position: absolute;
  inset: .18rem .18rem auto auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 .6rem .6rem 0;
  border-color: transparent #913e60 transparent transparent;
}
.number-jump[aria-current]:not([aria-current="false"]) { outline: 2px solid #244d73; outline-offset: 1px; font-weight: 750; }
.number-jump:focus-visible { outline: 3px solid #285e95; outline-offset: 3px; }
@media (max-width: 48rem) {
  .exam-body .group-content.with-stimulus { grid-template-columns: minmax(0, 1fr); }
  .exam-shell :is(.exam-head,.exam-controls) { gap: .4rem .75rem; padding-block: .55rem; }
  .exam-shell .exam-controls { padding-bottom: max(.55rem, env(safe-area-inset-bottom)); }
  .exam-tools, .exam-steps { gap: .35rem; }
}
@media (max-width: 32rem) {
  .exam-shell { --exam-gutter: .8rem; }
  .exam-shell .exam-head { align-items: flex-start; }
  .exam-tools { row-gap: .12rem; }
  .exam-steps { margin-inline-start: 0; }
  .exam-head :is(.exam-meta,.exam-progress), .exam-volume, .exam-timer { font-size: .82rem; }
  .exam-head .timer-value { font-size: 1rem; }
  .exam-volume input[type="range"] { width: 3.8rem; }
  .exam-shell :is(.exam-head,.exam-controls) :is(button,summary) { padding-inline: .58rem; font-size: .88rem; }
}
@media (max-height: 30rem) {
  .exam-shell { height: auto; min-height: 100vh; }
  .exam-shell .exam-body { overflow: visible; }
}
@media (forced-colors: active) {
  .number-jump[data-marked="true"]::after { border-right-color: LinkText; }
  .number-jump[data-answered="true"] { border-bottom: 4px double CanvasText; }
  .number-jump[aria-current]:not([aria-current="false"]) { outline-color: Highlight; }
}
.exam-setup > .audio-player { width: min(100%, 26rem); min-width: 0; }
.exam-setup .time-settings {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  min-width: 0;
  margin: 0;
  padding: .45rem 0 0;
  border: 0;
}
.time-settings legend { padding: 0; font-weight: 580; }
.time-settings .setting-option { color: #213e56; }
.answer-review .review-title { margin-block: .6rem 1rem; }
.exam-dialog .review-counts, .exam-dialog .review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin-block: .65rem 1rem;
}
.exam-dialog .review-count { color: #415464; font-size: .92rem; }
.exam-dialog .review-filters { gap: .4rem; }
.exam-dialog .review-filters .practice-button {
  min-height: 2.75rem;
  padding: .4rem .65rem;
  border-radius: .35rem;
  font-size: .9rem;
}
.exam-dialog .review-filters [aria-pressed="true"] {
  border-color: #285982;
  background: #e6f0fa;
  color: #173552;
  box-shadow: inset 0 -3px #285982;
}
.exam-dialog .number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.1rem, 1fr)); }
.exam-dialog .number-jump { display: grid; align-content: center; justify-items: center; gap: .12rem; }
.exam-dialog .number-jump strong { font-size: 1.12rem; }
.number-jump :is(.jump-state,.jump-flag) { font-size: .78rem; line-height: 1.25; }
.number-jump .jump-flag { color: #71324e; font-weight: 650; }
.exam-body .group-content.with-stimulus:has(.exam-player):not(:has(.practice-photo, .passage)) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 51rem;
  gap: .8rem;
}
.exam-body .exam-player { margin-block: .25rem .65rem; border-inline-start: 3px solid #4b7b9d; padding-inline-start: .7rem; }
.exam-player .practice-button { margin-top: .5rem; }
