:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  line-height: 1.6;
  --ink: #262745;
  --muted: #626b85;
  --primary: #525adb;
  --primary-dark: #3f46bb;
  --page: #f3f4fd;
  --surface: #fff;
  --service: #f5f5fe;
  --line: #e1e5f3;
  --icon-blue: invert(35%) sepia(58%) saturate(1457%) hue-rotate(215deg) brightness(92%) contrast(88%);
}
* { box-sizing: border-box; }
html { min-width: 0; scroll-padding-top: 140px; }
body { min-width: 0; margin: 0; padding-bottom: calc(32px + env(safe-area-inset-bottom)); color: var(--ink); background: linear-gradient(180deg, #e8eafe 0, var(--page) 320px) no-repeat, var(--page); font-size: 1rem; }
body.large-text { font-size: 1.15rem; }
[hidden] { display: none !important; }
button, input, select, summary { font: inherit; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { min-height: 56px; padding: 10px 14px; color: inherit; background: var(--surface); border: 1px solid #aeb5da; border-radius: 14px; line-height: 1.4; cursor: pointer; }
button:disabled { color: #6f7590; background: #e9ebf5; border-color: #c5c9dd; cursor: default; }
button:hover:not(:disabled) { background-color: #eef0ff; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #343bb1; outline-offset: 4px; }
button img, summary img { flex: 0 0 auto; }
img { max-width: 100%; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.4; font-weight: 600; }
.app-shell { width: min(100%, 760px); margin-inline: auto; }
.site-header { padding: 16px 16px 8px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { flex: 1; min-width: 0; font-size: 26px; }
h1 span { display: inline-block; white-space: nowrap; }
body.large-text h1 { font-size: 29px; }
.font-button { flex: 0 0 auto; padding: 8px 10px; color: var(--primary-dark); background: rgb(255 255 255 / 80%); border-color: #c4c9ee; font-size: 1rem; white-space: nowrap; }
.opening-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 86px; margin-top: 12px; padding: 14px 16px; background: var(--surface); border-color: #d6daf2; border-radius: 20px; text-align: left; }
.opening-symbol { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 44px; }
.opening-symbol img, .opening-card .entry-arrow { filter: var(--icon-blue); }
.opening-copy { flex: 1; min-width: 0; }
.opening-copy > span { display: block; }
.opening-kicker { margin-bottom: 3px; color: var(--muted); font-size: 20px; line-height: 1.45; }
#opening-title { font-size: 1em; line-height: 1.45; text-wrap: balance; }
.entry-arrow { flex: 0 0 auto; width: 22px; height: 22px; }
[aria-expanded="true"] > .entry-arrow { transform: rotate(90deg); }
.emergency-strip { position: sticky; top: 0; z-index: 10; padding: 8px 16px 10px; background: var(--page); }
.emergency-entry { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 10px; color: #913e2c; background: #fff4ee; border: 1px solid #eac9bb; border-radius: 16px; text-align: left; }
.emergency-entry:hover:not(:disabled) { background: #ffede2; }
.emergency-icon { width: 22px; height: 22px; filter: invert(26%) sepia(27%) saturate(1821%) hue-rotate(337deg) brightness(91%) contrast(89%); }
.emergency-entry .entry-arrow { width: 18px; height: 18px; opacity: .75; }
#emergency-copy { flex: 1; min-width: 0; font-size: 20px; line-height: 1.55; overflow-wrap: anywhere; }
body.large-text #emergency-copy { font-size: 22px; }
main { padding-inline: 16px; }
.load-status { padding: 18px; background: var(--surface); border-radius: 18px; }
.retry-button { display: block; margin-top: 14px; color: var(--primary-dark); }
.stage-choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 0 22px; }
.stage-choices button { min-width: 0; min-height: 68px; padding: 12px 8px; color: var(--ink); background: var(--surface); border-color: #aeb5de; border-radius: 16px; font-size: 1.08em; font-weight: 500; white-space: nowrap; }
.stage-choices button[aria-pressed="true"] { color: #fff; background: var(--primary); border-color: var(--primary-dark); }
.stage-choices button[aria-pressed="true"]:hover { background: var(--primary-dark); }
.stage-group { margin-top: 24px; }
.stage-group:first-child { margin-top: 0; }
.stage-group-title { margin: 0 4px 10px; color: var(--ink); font-size: 1em; line-height: 1.5; }
.clip-list { overflow: hidden; background: var(--surface); border: 1px solid #e4e7f5; border-radius: 20px; }
.clip-item { min-width: 0; border-bottom: 1px solid var(--line); }
.clip-item:last-child { border-bottom: 0; }
.clip-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 76px; padding: 16px; background: var(--surface); border: 0; border-radius: 0; text-align: left; }
.clip-entry:focus-visible { outline-offset: -4px; }
.clip-entry[aria-expanded="true"] { background: #eef0ff; box-shadow: inset 3px 0 var(--primary); }
.clip-entry-title { flex: 1; min-width: 0; font-size: 1em; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.clip-play-symbol { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; background: #edf0ff; border-radius: 50%; }
.clip-play-symbol img { width: 22px; height: 22px; filter: var(--icon-blue); }
.clip-entry[aria-expanded="true"] .clip-play-symbol img { transform: rotate(90deg); }

/* A single readable player stays below the chosen question. */
.player-panel { min-width: 0; margin: 0; padding: 0; }
.inline-player { min-width: 0; margin-top: 8px; padding: 14px; background: var(--service); border: 1px solid #dce0f4; border-radius: 18px; }
.clip-item > .inline-player { margin: 0; border-width: 1px 0 0; border-radius: 0; }
.inline-player.is-global { margin: 8px 16px 12px; }
.scope-note { margin: 0 0 14px; padding: 12px; color: #754b36; background: #fff4eb; border: 1px solid #ecd8c8; border-radius: 12px; font-size: 1em; line-height: 1.7; overflow-wrap: anywhere; }
.audio-card { min-width: 0; }
.inline-control-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.play-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 96px; max-width: 148px; min-height: 56px; padding: 10px; color: #fff; background: var(--primary); border: 0; border-radius: 14px; font-size: 1em; font-weight: 500; }
.play-button:hover:not(:disabled), .play-button.is-playing { background: var(--primary-dark); }
.play-button img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
#play-label { min-width: 0; overflow-wrap: anywhere; }
.progress-row { display: flex; flex-direction: column; align-items: stretch; min-width: 0; color: var(--muted); font-size: 1em; }
#audio-progress { width: 100%; min-width: 0; min-height: 56px; height: 56px; margin: 0; accent-color: var(--primary); cursor: pointer; }
#playback-time { align-self: flex-end; font-variant-numeric: tabular-nums; line-height: 1.4; white-space: nowrap; }
.player-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: end; gap: 12px; margin-top: 14px; }
.restart-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-width: 0; min-height: 56px; padding: 10px 7px; color: var(--primary-dark); background: var(--surface); border-color: #b7bde3; border-radius: 12px; font-size: 1em; white-space: nowrap; }
.restart-button img { width: 22px; height: 22px; filter: var(--icon-blue); }
.speed-label { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--muted); font-size: 1em; line-height: 1.4; }
#playback-speed { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 56px; padding: 9px 6px; color: var(--ink); background: var(--surface); border: 1px solid #aeb5da; border-radius: 12px; font-size: 1em; line-height: 1.4; cursor: pointer; }
.audio-status { margin-top: 12px; color: var(--muted); font-size: 1em; line-height: 1.6; }
.audio-status:empty { display: none; }
.transcript-details { margin-top: 14px; padding-inline: 12px; background: var(--surface); border-radius: 12px; }
.transcript-details > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-block: 10px; font-size: 1em; line-height: 1.5; cursor: pointer; list-style: none; }
.transcript-details > summary::-webkit-details-marker { display: none; }
.transcript-details > summary img { width: 24px; height: 24px; filter: var(--icon-blue); }
.transcript-details > summary::after { content: ""; flex: 0 0 22px; width: 22px; height: 22px; margin-left: auto; background: url("assets/icons/chevron-right.svg") center / contain no-repeat; filter: var(--icon-blue); }
.transcript-details[open] > summary::after { transform: rotate(90deg); }
.speech-text { padding: 2px 0 18px; font-size: 1em; line-height: 1.8; overflow-wrap: anywhere; }
.speech-text ol { margin: 0; padding-left: 1.5em; }
.speech-text li { padding-left: .1em; }
.speech-text li + li { margin-top: .7em; }
.skip-link { position: fixed; top: -140px; left: 16px; z-index: 30; display: inline-flex; align-items: center; min-height: 56px; padding: 12px 16px; color: var(--primary-dark); background: var(--surface); border: 2px solid var(--primary); border-radius: 14px; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 600px) {
  .site-header { padding: 20px 24px 8px; }
  h1, body.large-text h1 { font-size: 32px; }
  main, .emergency-strip { padding-inline: 24px; }
  .inline-player.is-global { margin-inline: 24px; }
}
@media (max-width: 359px) {
  .site-header { padding-inline: 14px; }
  .top-row { gap: 10px; }
  .font-button { padding-inline: 8px; }
  main, .emergency-strip { padding-inline: 14px; }
  .inline-player.is-global { margin-inline: 14px; }
  .opening-card { gap: 8px; padding-inline: 12px; }
  .opening-symbol { flex-basis: 32px; width: 32px; }
  .inline-player { padding: 10px; }
  .inline-control-row { gap: 10px; }
  .player-tools { gap: 8px; }
  .restart-button { gap: 5px; padding-inline: 5px; }
  body.large-text .player-tools { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
