.spell-page { background: var(--surface-sunken); color: var(--ink); min-height: 100vh; margin: 0; }
.spell-page *, .spell-page *::before, .spell-page *::after { box-sizing: border-box; }
.spell-page [hidden] { display: none !important; }
.spell-header { padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.spell-header img { display: block; height: auto; }
.spell-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#home { display: inline-flex; align-items: center; gap: 8px; }
#home[hidden] { display: none; }
#home span { font-family: var(--font-ui); font-size: 14px; color: inherit; }
#home kbd, .spell-skip kbd { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; line-height: 1.5; padding: 2px 5px; border: 1px solid var(--chrome-line-control); border-radius: 4px; background: var(--surface); }
.spell-header #question-count { padding: 6px 12px; border-radius: var(--pill); background: var(--chrome-accent-tint); color: var(--chrome-accent-deep); font-family: var(--font-ui); font-weight: 500; }
.spell-header span, .spell-eyebrow, .spell-meta, #time-left { font-family: var(--font-mono); font-size: 12px; color: var(--chrome-ink-soft); }
main.spell-main { width: min(100% - 48px, 1000px); margin: clamp(20px, 4vh, 40px) auto; padding: clamp(24px, 3vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--chrome-radius-card); }
.spell-welcome, #results { text-align: center; }
main.spell-main:has(#welcome:not([hidden])) { width: min(100% - 32px, 980px); margin-top: 24px; }
.spell-welcome h1 { font-size: 40px; margin-bottom: 12px; }
.spell-welcome .spell-description { font-size: 16px; margin: 0 0 20px; }
.spell-level-filter { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 20px; padding: 4px; border: 1px solid var(--chrome-line-control); border-radius: 12px; background: var(--surface-sunken); }
.spell-level-filter legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spell-level-filter label { cursor: pointer; }
.spell-level-filter input { position: absolute; opacity: 0; pointer-events: none; }
.spell-level-filter span { display: grid; place-items: center; min-width: 46px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.spell-level-filter input:checked + span { background: var(--chrome-accent-deep); color: var(--surface); }
.spell-level-filter input:focus-visible + span { outline: 2px solid var(--chrome-accent); outline-offset: 2px; }
.spell-home-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.spell-home-actions .spell-mode { margin: 0; }
.spell-speed { margin: 0; padding: 12px 16px 16px; border: 1px solid var(--chrome-accent); border-radius: 12px; background: var(--surface-sunken); text-align: left; }
.spell-speed legend { padding: 0 6px; font-size: 16px; font-weight: 600; color: var(--chrome-accent); }
.spell-speed legend label { display: inline-flex; align-items: center; gap: 8px; }
.spell-speed-options { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.spell-speed-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13px; cursor: pointer; }
.spell-speed input { accent-color: var(--chrome-accent); }
.spell-blank-timer { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 12px; line-height: 1; color: var(--ink-muted); pointer-events: none; }
.spell-sentence .spell-blank:has(.spell-blank-timer:not([hidden])) input[type="text"] { padding-right: 40px; }
.spell-continue { display: inline-flex; align-items: center; gap: 12px; }
.spell-continue kbd { font-family: var(--font-mono); font-size: 10px; font-weight: 400; line-height: 1.5; padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--surface) 25%, transparent); border-radius: 4px; color: var(--surface); opacity: .8; }
.spell-shortcuts { color: var(--ink-muted); font-size: 12px; line-height: 1.7; }
.spell-shortcuts kbd { font-family: var(--font-mono); font-size: 12px; }
.spell-action-row { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 12px 24px; margin-top: 32px; }
.spell-skip { margin-left: auto; padding: 10px 14px; min-height: 44px; border: 1px solid var(--chrome-line-control); border-radius: 10px; background: transparent; color: var(--chrome-accent-deep); font-family: var(--font-ui); font-size: 14px; cursor: pointer; }
.spell-skip:hover { background: var(--chrome-accent-tint); }
.spell-skip, .spell-skip-shortcut { display: inline-flex; align-items: center; gap: 6px; }
.spell-skip { gap: 10px; }
.spell-skip-shortcut { font-size: 10px; }
.spell-skip kbd .spell-icon { width: 12px; height: 12px; }
.spell-reader { display: flex; align-items: center; font-size: 12px; color: var(--ink-muted); }
.spell-reader-control { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 8px; border: 1px solid var(--chrome-line-control); border-radius: 12px; background: var(--surface); }
.spell-reader-flag { display: block; width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.spell-reader-flag { margin-left: -4px; margin-right: 8px; }
.spell-reader-control #reader { field-sizing: content; }
.spell-reader-control #reader { max-width: 100px; min-height: 40px; padding: 0; border: 0; appearance: none; background: transparent; font-weight: 600; cursor: pointer; }
.spell-reader-control #change-voice { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: transparent; color: var(--chrome-accent-deep); cursor: pointer; font-size: 10px; }
.spell-reader-control #change-voice:hover { background: var(--chrome-accent-tint); }
.spell-reader-control kbd { font-family: var(--font-mono); font-size: 10px; padding: 2px 4px; border: 1px solid var(--chrome-line-control); border-radius: 4px; }
.spell-reader-caret { width: 7px; height: 7px; margin: 0 2px 4px 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.spell-reader-portrait { display: inline-block; position: relative; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--chrome-accent-tint); }
.spell-reader-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.spell-reader-portrait.is-changing #reader-image { animation: spell-reader-in 320ms ease-out both; }
.spell-reader-portrait.is-changing #reader-outgoing { animation: spell-reader-out 320ms ease-out both; }
@keyframes spell-reader-in { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spell-reader-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-8px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .spell-reader-portrait.is-changing img { animation: none !important; } .spell-reader-portrait #reader-outgoing { display: none; } }
.spell-text-action { min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--chrome-accent-deep); font-size: 12px; cursor: pointer; }
.spell-correction-cue { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-muted); }
#game { position: relative; }
.spell-celebration { position: absolute; bottom: 60px; left: 50%; width: 0; height: 0; pointer-events: none; }
.spell-confetti { position: absolute; width: 5px; height: 8px; border-radius: 2px; background: var(--chrome-accent); animation: spell-confetti 850ms ease-out both; }
.spell-confetti:nth-child(3n) { background: var(--score-pill-weak-line); }
.spell-confetti:nth-child(3n + 1) { background: var(--score-pill-strong-line); }
@keyframes spell-confetti { from { opacity: 0; transform: translate(0, 0) rotate(0); } 15% { opacity: .8; } to { opacity: 0; transform: translate(var(--confetti-x), var(--confetti-y)) rotate(var(--confetti-turn)); } }
@media (prefers-reduced-motion: reduce) { .spell-celebration { display: none; } }
.spell-reader select { max-width: 190px; min-height: 44px; padding: 8px; border: 1px solid var(--chrome-line-control); border-radius: var(--radius); background: var(--surface); }
.spell-passes { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.spell-passes li { padding: 6px 10px; border-radius: var(--pill); color: var(--chrome-ink-muted); font-size: 12px; }
.spell-passes li[aria-current="step"] { background: var(--chrome-accent-tint); color: var(--chrome-accent-deep); font-weight: 600; }
.spell-passes li[data-done="true"] { color: var(--score-pill-strong-ink); }
.spell-passes li { display: inline-flex; align-items: center; gap: 6px; }
.spell-phase-check { display: none; width: 13px; height: 13px; stroke-width: 2.2; }
.spell-passes li[data-done="true"] { background: var(--chrome-accent-tint); }
.spell-passes li[data-done="true"] .spell-phase-check { display: inline-block; }
.spell-replay { display: inline-flex; align-items: center; border-radius: 12px; background: var(--chrome-accent-deep); padding: 4px; gap: 4px; }
.spell-replay #next, .spell-replay #slow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--surface); font-size: 14px; }
.spell-replay #slow { position: relative; }
.spell-replay #slow::before { content: ''; position: absolute; left: -3px; top: 3px; bottom: 3px; width: 2px; background: var(--surface); opacity: .2; }
.spell-replay kbd { font-family: var(--font-mono); font-size: 10px; font-weight: 400; line-height: 1.5; padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--surface) 38%, transparent); border-radius: 4px; color: var(--surface); }
.spell-replay #next:hover { background: var(--chrome-accent); }
.spell-replay #slow:hover { background: var(--chrome-accent); }
.spell-feedback:empty { display: none; }
.spell-blank { display: inline-grid; position: relative; width: 208px; max-width: 100%; vertical-align: baseline; }
.spell-inline-replay-hint { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); font-family: var(--font-ui); font-size: 10px; line-height: 1.2; color: var(--chrome-ink-muted); white-space: nowrap; pointer-events: none; }
.spell-inline-replay-hint kbd { font-family: var(--font-mono); font-size: 10px; line-height: 1.4; padding: 2px 5px; border: 1px solid var(--chrome-line-control); border-radius: 4px; background: var(--surface); color: var(--chrome-accent-deep); }
.spell-sentence .spell-blank input[type="text"] { width: 100%; padding: 12px 28px 0 8px; }
.spell-blank input::placeholder { font-family: var(--font-ui); font-size: 12px; color: var(--chrome-ink-muted); }
.spell-idle-count { display: none; }
.spell-blank-hint { position: absolute; left: 0; bottom: 0; font-family: var(--font-ui); font-size: 12px; line-height: 18px; color: var(--chrome-ink-muted); white-space: nowrap; }
#completed { color: var(--ink-muted); }
.spell-sentence .spell-locked { color: var(--skill-accent-deep-listening); background: var(--correct-bg); padding: 2px 4px; border-radius: var(--radius-sm); }
.spell-picker-host { text-align: left; }
.spell-picker-host .questions-panel-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.spell-picker-host .questions-panel-progress { font-size: 14px; color: var(--chrome-ink-soft); margin: 0; }
.spell-picker-host .questions-panel-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.spell-picker-host .questions-filter, .spell-picker-host .questions-fold { min-height: 44px; border: 1px solid var(--chrome-line-control); border-radius: var(--pill); padding: 8px 12px; color: var(--chrome-ink-soft); background: var(--surface); cursor: pointer; }
.spell-picker-host .questions-filter[aria-pressed="true"] { background: var(--chrome-accent-deep); border-color: var(--chrome-accent-deep); color: var(--surface); }
.spell-picker-host .questions-panel-go-to { position: relative; flex: 1; min-width: 160px; }
.spell-picker-host .questions-panel-go-to input { width: 100%; height: 44px; padding: 8px 32px 8px 12px; margin: 0; border-radius: var(--pill); border: 1px solid var(--chrome-line-control); }
.spell-picker-host .questions-panel-search-affordance { position: absolute; right: 12px; top: 14px; width: 16px; color: var(--chrome-ink-muted); pointer-events: none; }
.spell-picker-host .questions-panel-search-affordance svg { width: 16px; height: 16px; }
.spell-picker-host .questions-view-end { display: none; }
.spell-picker-host .questions-panel-meter { height: 3px; background: var(--chrome-track); border-radius: var(--pill); overflow: hidden; margin: 16px 0 12px; }
.spell-picker-host .questions-panel-meter-fill { display: block; height: 100%; background: var(--score-pill-strong-line); }
.spell-picker-host .questions-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.spell-picker-host .question-pill { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; text-align: left; padding: 10px 12px; border: 1px solid var(--chrome-line); border-radius: var(--radius); background: var(--surface); color: var(--chrome-ink); cursor: pointer; }
.spell-picker-host .question-pill-number { font-family: var(--font-mono); font-size: 12px; }
.spell-picker-host .question-pill-text { font-size: 14px; line-height: 1.4; }
.spell-picker-host .question-pill-mark { font-size: 12px; white-space: nowrap; }
.spell-picker-host .question-pill-mark svg { width: 14px; height: 14px; }
.spell-picker-host .question-pill[data-current="true"] { background: var(--chrome-accent-deep); color: var(--surface); border-color: var(--chrome-accent-deep); }
.spell-picker-host .question-pill[data-state="doing"]:not([data-current="true"]) { background: var(--pill-doing-bg); color: var(--pill-doing-ink); border-color: var(--pill-doing-line); }
.spell-picker-host .question-pill[data-state="done-strong"]:not([data-current="true"]) { background: var(--score-pill-strong-bg); color: var(--score-pill-strong-ink); border-color: var(--score-pill-strong-line); }
.spell-picker-host .question-pill[data-state="done-weak"]:not([data-current="true"]) { background: var(--score-pill-weak-bg); color: var(--score-pill-weak-ink); border-color: var(--score-pill-weak-line); }
.spell-picker-host .question-pill[data-current="true"][data-state="done-strong"] { background: var(--score-pill-strong-bg); color: var(--score-pill-strong-ink); border-color: var(--score-pill-strong-line); }
.spell-picker-host .question-pill[data-current="true"][data-state="done-weak"] { background: var(--score-pill-weak-bg); color: var(--score-pill-weak-ink); border-color: var(--score-pill-weak-line); }
.spell-picker-host .questions-panel-status { font-size: 12px; color: var(--ink-muted); }
.spell-eyebrow { letter-spacing: .08em; margin: 0 0 24px; }
.spell-main h1 { font-family: var(--font-passage); font-weight: 600; font-size: clamp(48px, 8vw, 72px); line-height: 1.1; margin: 0 0 24px; color: var(--chrome-accent-deep); }
.spell-description { font-size: 20px; line-height: 1.6; }
.spell-rules { color: var(--ink-muted); font-size: 14px; line-height: 1.7; margin: 24px 0; }
.spell-voice { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; margin: 24px 0; }
.spell-mode { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-muted); margin: 0 0 24px; min-height: 44px; }
.spell-voice select { background: var(--surface); border: 1px solid var(--chrome-line-control); border-radius: var(--radius); padding: 12px; max-width: 220px; }
.spell-primary, .spell-secondary { min-height: 48px; padding: 12px 24px; border-radius: var(--pill); font-size: 16px; cursor: pointer; }
.spell-primary { color: var(--surface); background: var(--chrome-accent-deep); border: 1px solid var(--chrome-accent-deep); }
.spell-primary:hover { background: var(--chrome-accent); }
.spell-secondary { color: var(--chrome-accent-deep); background: var(--chrome-accent-tint); border: 1px solid var(--chrome-accent); }
.spell-main button:disabled { opacity: .55; cursor: default; }
.spell-main :focus-visible { outline: 2px solid var(--chrome-accent); outline-offset: 3px; }
.spell-footnote { font-size: 12px; color: var(--ink-muted); line-height: 1.7; margin: 24px 0 0; }
.spell-meta { display: flex; justify-content: space-between; gap: 16px; }
.spell-timer { display: none; }
#timer-bar { width: 100%; height: 100%; background: var(--skill-accent-listening); }
.spell-listen-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.spell-audio-status { color: var(--ink-muted); font-size: 14px; min-height: 24px; margin: 16px 0; }
.spell-sentence { font-family: var(--font-passage); font-weight: 400; font-size: 24px; line-height: 1.9; margin: 0 0 24px; overflow-wrap: anywhere; }
.spell-karaoke-word { border-radius: var(--radius-sm); }
.spell-collocation-partner { font-weight: 600; }
.spell-sense-group { border-radius: var(--radius-sm); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.spell-sense-group.is-sense-playing { background: color-mix(in srgb, var(--skill-accent-listening) 12%, transparent); }
.spell-sentence .spell-sense-group .is-playing,
.spell-sentence .spell-sense-group input[type="text"].is-playing { background: color-mix(in srgb, var(--skill-accent-listening) 32%, var(--surface)); color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--skill-accent-listening) 32%, var(--surface)); }
#paragraph { transition: opacity .15s; }
#paragraph.spell-pass-reset { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #paragraph { transition: none; } }
.spell-sentence .is-playing { background: var(--score-pill-weak-bg); color: var(--score-pill-weak-ink); box-shadow: 0 0 0 2px var(--score-pill-weak-bg); }
.spell-sentence input[type="text"].is-playing { background: var(--score-pill-weak-bg); border-color: var(--score-pill-weak-line); }
.spell-sentence input[type="text"] { width: 160px; max-width: 100%; height: 44px; font-size: 22px; border: 0; border-bottom: 2px solid var(--skill-accent-listening); border-radius: 0; background: var(--skill-accent-tint-listening); text-align: center; padding: 4px 8px; }
.spell-sentence input.correct { background: var(--correct-bg); border-color: var(--correct-border); }
.spell-sentence input.incorrect { background: var(--incorrect-bg); border-color: var(--incorrect-border); }
.spell-verdict { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 4px 12px; border: 1px solid var(--incorrect-border); border-radius: var(--radius); background: var(--incorrect-bg); font-family: var(--font-ui); font-size: 20px; line-height: 1.8; vertical-align: baseline; max-width: 100%; }
.spell-verdict del { color: var(--skill-label-reading); overflow-wrap: anywhere; }
.spell-verdict strong { color: var(--skill-accent-deep-listening); font-weight: 600; }
.spell-verdict[data-correct="true"] { background: var(--correct-bg); border-color: var(--correct-border); }
.spell-feedback { min-height: 52px; font-size: 16px; line-height: 1.5; margin-bottom: 16px; }
.spell-feedback[data-correct="true"] { color: var(--skill-accent-deep-listening); }
.spell-result-list { padding: 0; list-style-position: inside; margin: 24px 0; text-align: left; }
.spell-result-list li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.6; }
@media (max-width: 768px) {
  .spell-reader-control #change-voice { min-height: 44px; min-width: 44px; }
  .spell-header { padding: 20px 16px; }
  .spell-header span { font-size: 12px; max-width: 140px; text-align: right; }
  main.spell-main { width: calc(100% - 32px); margin: 20px auto; padding: 24px; }
  .spell-sentence { font-size: 22px; }
  .spell-description { font-size: 18px; }
}
/* The same controls move into the keyboard's room; the passage scrolls alone. */
.spell-top, .spell-scroll { display: contents; }
.spell-dock-only, .spell-level-icon, #reader-tray { display: none; }
.spell-page[data-dock] { overflow: hidden; }
.spell-page[data-dock] main.spell-main { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; }
.spell-page[data-dock] #game { display: flex; flex-direction: column; height: calc(var(--room, 100dvh) - var(--dock-header, 0px)); overflow: hidden; background: var(--surface); }
.spell-page[data-dock][data-keyboard] .spell-header { display: none; }
.spell-page[data-dock][data-keyboard] #game { position: fixed; top: var(--dock-top, 0px); left: 0; right: 0; height: var(--room, 100dvh); }
.spell-page[data-dock] .spell-top { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; flex: none; border-bottom: 1px solid var(--chrome-line); }
.spell-page[data-dock] .spell-dock-only { display: inline-flex; }
.spell-page[data-dock] #home { min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: var(--radius); background: transparent; }
.spell-page[data-dock] #home > span { display: none; }
.spell-page[data-dock] #pass-label { font-family: var(--font-ui); font-size: 14px; color: var(--chrome-ink-soft); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spell-page[data-dock] #pass-progress { gap: 4px; }
.spell-page[data-dock] #pass-progress i { width: 20px; height: 4px; border-radius: var(--radius-sm); background: var(--chrome-track); }
.spell-page[data-dock] #pass-progress i[data-current] { background: var(--chrome-accent); }
.spell-page[data-dock] #pass-progress i[data-done] { background: var(--score-pill-strong-line); }
.spell-page[data-dock] #question-count { min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: var(--chrome-ink-soft); }
.spell-page[data-dock] .spell-skip { margin-left: 0; padding: 8px; flex: none; }
.spell-page[data-dock] .spell-skip[data-armed] { background: var(--chrome-accent-tint); }
.spell-page[data-dock] .spell-passes { display: none; }
.spell-page[data-dock] #timer-track { display: block; height: 4px; background: var(--chrome-track); flex: none; }
.spell-page[data-dock] .spell-scroll { display: block; flex: 1; min-height: 0; overflow-y: auto; position: relative; padding: 12px 16px; scroll-padding-bottom: 56px; scroll-behavior: smooth; }
.spell-page[data-dock] .spell-sentence { font-family: var(--font-passage); font-weight: 400; font-size: 22px; line-height: 1.7; margin: 0; }
.spell-page[data-dock] .spell-sentence .is-playing { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.spell-page[data-dock] .spell-sentence .spell-blank input[type="text"] { height: 44px; padding-top: 0; }
.spell-page[data-dock] .spell-inline-replay-hint { top: 100%; font-size: 12px; line-height: 1.4; }
.spell-page[data-dock] .spell-feedback { display: block; flex: none; min-height: 20px; margin: 0; padding: 0 12px; font-size: 14px; color: var(--chrome-ink-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spell-page[data-dock] .spell-feedback:has(.spell-verdict) { white-space: normal; }
.spell-page[data-dock] .spell-verdict { font-size: 14px; }
.spell-page[data-dock] .spell-feedback > .nav-icon { width: 14px; height: 14px; vertical-align: middle; }
.spell-page[data-dock] .spell-dock { flex: none; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 4px 12px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--chrome-line); background: var(--surface-sunken); min-height: 68px; }
.spell-page[data-dock][data-keyboard] .spell-dock { padding-bottom: 4px; }
.spell-page[data-dock] .spell-reader { order: -1; flex: none; }
.spell-page[data-dock] .spell-reader-control { position: relative; padding: 0; border: 0; background: transparent; }
.spell-page[data-dock] #reader, .spell-page[data-dock] .spell-reader-caret { display: none; }
.spell-page[data-dock] .spell-reader-control #change-voice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 4px; border-radius: var(--radius); }
.spell-page[data-dock] #change-voice > kbd, .spell-page[data-dock] #change-voice > span:not(.spell-reader-portrait) { display: none; }
.spell-page[data-dock] #change-voice::after { content: ''; width: 4px; height: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.spell-page[data-dock] .spell-reader-portrait { flex: none; width: 36px; height: 36px; }
.spell-page[data-dock] .spell-reader-flag { position: absolute; bottom: 8px; right: 4px; width: 16px; height: 12px; margin: 0; border-radius: var(--radius-sm); pointer-events: none; }
.spell-page[data-dock] .spell-replay { flex: 1; min-width: 0; gap: 8px; padding: 0; border-radius: 0; background: transparent; }
.spell-page[data-dock] .spell-replay #next, .spell-page[data-dock] .spell-replay #slow { justify-content: center; min-height: 48px; border: 1px solid var(--chrome-line-control); border-radius: var(--radius); padding: 8px; }
.spell-page[data-dock] .spell-replay #next { flex: 1; background: var(--chrome-accent-deep); border-color: var(--chrome-accent-deep); }
.spell-page[data-dock] .spell-replay #slow { min-width: 84px; background: var(--surface); color: var(--chrome-accent-deep); }
.spell-page[data-dock] .spell-replay #slow::before { display: none; }
.spell-page[data-dock] .spell-replay #slow kbd { color: inherit; border-color: var(--chrome-line-control); }
.spell-page[data-dock] .spell-replay #next:hover:not(:disabled) { background: var(--chrome-accent); }
.spell-page[data-dock] .spell-replay #slow:hover:not(:disabled) { background: var(--chrome-accent-tint); }
.spell-page[data-dock] #next[data-state="error"] { border: 2px solid var(--rubric); }
.spell-page[data-dock] #next[data-state="playing"] .spell-listen-icon { display: none; }
.spell-page[data-dock] #next[data-state="playing"] .spell-level-icon { display: inline-flex; }
.spell-page[data-dock]:not(.hw) #game kbd, .spell-page[data-dock]:not(.hw) .spell-skip-shortcut { display: none; }
.spell-page[data-dock] #reader-tray { display: flex; align-items: center; gap: 4px; height: 56px; flex: 1; min-width: 0; overflow-x: auto; }
.spell-page[data-dock] #reader-tray button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 56px; min-height: 48px; padding: 0 4px; border: 2px solid transparent; border-radius: var(--radius); background: transparent; color: var(--chrome-ink); font-size: 12px; line-height: 1; cursor: pointer; }
/* A reader whose reading of this item was dropped (ADR-0153) is not offered. */
.spell-page[data-dock] #reader-tray button[hidden] { display: none; }
/* The tray is one tab stop; its roving cursor lights the face's border, the
   same accent as the chrome ring, because a 3px-offset ring would clip in the 56px row. */
.spell-page[data-dock] #reader-tray button[aria-selected="true"], .spell-page[data-dock] #reader-tray button[data-roving] { border-color: var(--chrome-accent); }
.spell-page[data-dock] .spell-tray-face { position: relative; width: 32px; height: 32px; }
.spell-page[data-dock] .spell-tray-face img:first-child { width: 100%; height: 100%; border-radius: var(--pill); object-fit: cover; }
.spell-page[data-dock] .spell-tray-face img:last-child { position: absolute; bottom: 0; right: -4px; width: 16px; height: 12px; }
.spell-page[data-dock] .spell-dock:has(#reader-tray:not([hidden])) > .spell-replay { display: none; }
.spell-page[data-dock] #change-voice[aria-expanded="true"]::after { transform: rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { .spell-page[data-dock] .spell-scroll { scroll-behavior: auto; } }
@media (max-height: 559px) {
  .spell-page[data-dock][data-dock-short] #game { display: grid; grid-template-columns: 44px 56px minmax(0, 1fr) 84px 60px; grid-template-rows: auto minmax(0, 1fr) 44px; gap: 0 4px; padding: 0 4px; }
  .spell-page[data-dock][data-dock-short]:not([data-keyboard]) #game { padding-bottom: env(safe-area-inset-bottom); }
  .spell-page[data-dock][data-dock-short]:not([data-keyboard]) .spell-feedback { bottom: calc(44px + env(safe-area-inset-bottom)); }
  .spell-page[data-dock][data-dock-short] .spell-top, .spell-page[data-dock][data-dock-short] .spell-dock, .spell-page[data-dock][data-dock-short] .spell-replay { display: contents; }
  .spell-page[data-dock][data-dock-short] #timer-track { grid-area: 1 / 1 / 2 / -1; }
  .spell-page[data-dock][data-dock-short] .spell-scroll { grid-area: 2 / 1 / 3 / -1; padding-bottom: 24px; }
  .spell-page[data-dock][data-dock-short] .spell-sentence { font-family: var(--font-passage); font-weight: 400; font-size: 18px; line-height: 1.5; }
  .spell-page[data-dock][data-dock-short] #home { grid-area: 3 / 1; }
  .spell-page[data-dock][data-dock-short] .spell-reader { grid-area: 3 / 2; }
  .spell-page[data-dock][data-dock-short] #next { grid-area: 3 / 3; }
  .spell-page[data-dock][data-dock-short] #slow { grid-area: 3 / 4; }
  .spell-page[data-dock][data-dock-short] #skip { grid-area: 3 / 5; margin-left: auto; }
  .spell-page[data-dock][data-dock-short] #home, .spell-page[data-dock][data-dock-short] #skip, .spell-page[data-dock][data-dock-short] .spell-replay #next, .spell-page[data-dock][data-dock-short] .spell-replay #slow { min-height: 44px; align-self: center; }
  .spell-page[data-dock][data-dock-short] .spell-reader-control #change-voice { height: 44px; }
  .spell-page[data-dock][data-dock-short] #change-voice .spell-reader-portrait { width: 28px; height: 28px; }
  .spell-page[data-dock][data-dock-short] #pass-label, .spell-page[data-dock][data-dock-short] #pass-progress, .spell-page[data-dock][data-dock-short] #question-count { display: none; }
  .spell-page[data-dock][data-dock-short] .spell-feedback { position: absolute; bottom: 44px; left: 0; right: 0; font-size: 12px; background: var(--surface-sunken); }
  .spell-page[data-dock][data-dock-short] #reader-tray { grid-area: 3 / 3 / 4 / -1; height: 44px; align-self: center; }
  .spell-page[data-dock][data-dock-short] #game:has(#reader-tray:not([hidden])) .spell-reader { grid-area: 3 / 1 / 4 / 3; }
  .spell-page[data-dock][data-dock-short] #reader-tray button { min-height: 44px; gap: 0; font-size: 12px; }
  .spell-page[data-dock][data-dock-short] .spell-tray-face { width: 28px; height: 28px; flex: none; }
  .spell-page[data-dock][data-dock-short] #game:has(#reader-tray:not([hidden])) #home, .spell-page[data-dock][data-dock-short] #game:has(#reader-tray:not([hidden])) #skip, .spell-page[data-dock][data-dock-short] #game:has(#reader-tray:not([hidden])) #next, .spell-page[data-dock][data-dock-short] #game:has(#reader-tray:not([hidden])) #slow { display: none; }
}
