/* Match the existing student sheet, colors and type. */
.student-secondary-modal-sheet.student-notebook-review-sheet {
  height: 92vh;
  max-height: 92vh;
  padding-bottom: max(12px, var(--android-nav-safe, 0px), env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
@supports (height: 100dvh) {
  .student-secondary-modal-sheet.student-notebook-review-sheet {
    height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
  }
}
.student-secondary-modal-sheet.student-notebook-review-sheet > .admin-modal-head { flex: 0 0 auto; }
.student-secondary-modal-sheet > .admin-modal-head.has-review-status { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding-bottom: 8px; }
.student-secondary-modal-sheet > .admin-modal-head.has-review-status h2 { min-width: 0; font-size: 20px; line-height: 1.3; white-space: nowrap; }
/* Grid gaps also work in WebViews that predate flex gap support. */
.admin-modal-head.has-review-status .notebook-review-topline { display: grid; grid-template-columns: max-content max-content; min-width: 0; gap: 8px; }
.admin-modal-head.has-review-status .notebook-review-position { display: flex; flex-direction: column; align-items: center; gap: 0; font-size: 11px; line-height: 1.3; white-space: nowrap; }
.admin-modal-head.has-review-status [data-review-coins] { flex: 0 0 auto; }
.admin-modal-head.has-review-status .galaxy-coin-balance.compact { display: inline-grid; grid-template-columns: 27px max-content; min-height: 44px; gap: 4px; padding: 4px 8px 4px 5px; box-shadow: none; }
.admin-modal-head.has-review-status .galaxy-coin-balance.compact > strong { min-width: max-content; font-size: 14px; white-space: nowrap; }
.admin-modal-head.has-review-status .modal-close { flex: 0 0 56px; min-width: 56px; min-height: 44px; padding: 4px 8px; }
.student-notebook-modal-sheet .modal-close:focus { outline: none !important; box-shadow: 0 0 0 2px rgba(112, 66, 168, .6) !important; }
.student-notebook-modal-sheet .modal-close:focus:not(:focus-visible) { box-shadow: none !important; }
@media (max-width: 360px) {
  .student-secondary-modal-sheet > .admin-modal-head.has-review-status { gap: 4px; }
  .student-secondary-modal-sheet > .admin-modal-head.has-review-status h2 { font-size: 18px; }
  .admin-modal-head.has-review-status .notebook-review-topline { gap: 4px; }
  .admin-modal-head.has-review-status .notebook-review-position { font-size: 10px; }
  .admin-modal-head.has-review-status .modal-close { min-width: 44px; }
}
.student-secondary-modal-sheet.notebook-review-motion { animation: none !important; }
.student-secondary-modal-sheet[data-review-transition] { pointer-events: none; }
.has-notebook-review { flex: 1; overflow: hidden; }
.has-notebook-review:not([data-review-active]) .student-notebook-results { flex: 1; }
.student-notebook[data-review-active=true] > :not(.notebook-review-stage) { display: none !important; }
.notebook-review-stage[hidden] { display: none; }
.student-secondary-modal-backdrop[data-review-phase=mode] { align-items: center !important; }
.student-secondary-modal-sheet[data-review-phase=mode] { width: min(420px, calc(100% - 32px)); height: auto; max-height: min(92vh, calc(100vh - 24px)); border-radius: 24px; }
@supports (height: 100dvh) {
  .student-secondary-modal-sheet[data-review-phase=mode] { max-height: min(92dvh, calc(100dvh - 24px)); }
}
.notebook-review-mode-options { display: grid; gap: 16px; padding: 28px 8px 12px; }
.notebook-review-mode-options:focus { outline: none; }
.student-notebook .notebook-review-mode-options button { min-height: 56px; margin: 0; font-size: 18px; }
.student-notebook .notebook-review-mode-options button:disabled { color: #807789; background: #e4e0e8; border-color: #d0cad6; box-shadow: none; opacity: 1; cursor: not-allowed; }
.notebook-review-step { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; color: #655078; }
.notebook-review-structures { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0; }
.student-notebook .notebook-review-structure { min-height: 48px; margin: 0; padding: 8px 12px; font-size: 24px; color: #593391; background: #faf5ff; border: 1px solid #d2bfdf; border-radius: 8px; }
.student-notebook .notebook-review-structure.active { border-color: #7042a8; background: #eee2f7; }
.notebook-review-structure .soft-blur { filter: blur(5px); }
.notebook-review-structure span { display: inline-block; min-width: 12px; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-cue { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-image { flex: 0 0 auto; width: 160px; height: 160px; margin: 0 auto; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-prompt { width: 100%; }
.notebook-review-tools { display: flex; justify-content: center; align-items: center; gap: 12px; }
.student-notebook .notebook-review-tools > button { flex: 0 0 96px; min-width: 0; min-height: 44px; margin: 0; }
.notebook-review-fixed-cue { flex: 0 0 auto; padding: 0 8px 0; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-content { padding: 0 0 8px; }
.student-notebook .notebook-review-structure { display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; padding: 6px 10px; font-size: 22px; line-height: 1.35; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-structure span { min-width: 10px; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-structured-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); }
.notebook-review-stage[data-review-mode=structured] .notebook-review-prompt .student-word-audio-status:empty { display: none; }
.notebook-review-stage[data-review-mode=structured] .notebook-review-progress { margin-block: 0 8px; }
.notebook-review-commands.has-hidden-command { display: none; }
.notebook-review-commands:empty,
.notebook-review-stage[data-review-phase=mode] .notebook-review-commands { display: none; }
.notebook-review-stage[data-review-mode=structured][data-review-result=correct] .notebook-review-structure.active { border-color: #65a47c; color: #275b3c; box-shadow: 0 0 12px rgba(43, 162, 85, .32); }
.notebook-review-stage[data-review-mode=structured][data-review-result=incorrect] .notebook-review-structure.active { border-color: #d77788; color: #842638; box-shadow: 0 0 12px rgba(218, 54, 77, .32); }
.has-notebook-review .student-notebook-results { padding-inline: 3px; }
.notebook-review-footer { flex: 0 0 auto; border-top: 1px solid #d9c9e7; padding: 12px 2px 2px; }
.student-notebook .notebook-review-resume { width: 100%; min-height: 44px; margin: 0 0 12px; }
.notebook-review-caption { margin: 0 0 12px; font-size: 13px; color: #655078; line-height: 1.6; }
.notebook-review-actions { display: flex; gap: 12px; }
.student-notebook .notebook-review-actions > button { flex: 1; min-width: 0; margin: 0; align-self: stretch; }
.student-notebook .notebook-review-actions > .primary { flex: 1.6; }
.student-notebook .notebook-review-footer button:disabled,
.student-notebook .notebook-review-footer button[aria-disabled=true] { color: #807789; background: #e4e0e8; border-color: #d0cad6; box-shadow: none; opacity: 1; cursor: not-allowed; }
.notebook-task-toast { position: fixed; left: 50%; bottom: calc(72px + max(var(--android-nav-safe, 0px), env(safe-area-inset-bottom, 0px))); z-index: 150; width: max-content; max-width: min(320px, calc(100% - 40px)); padding: 12px 20px; border-radius: 24px; background: #323232; color: #fff; box-shadow: 0 4px 16px #0003; font-size: 14px; line-height: 22px; text-align: center; transform: translateX(-50%); pointer-events: none; animation: notebook-task-toast-in 180ms ease-out; }
@keyframes notebook-task-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .notebook-task-toast { animation: none; } }
.student-notebook .primary { background: #7042a8; border-color: #7042a8; color: #fff; }
.notebook-review-stage { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.notebook-review-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 2px 20px 20px; }
.notebook-review-commands { flex: 0 0 auto; padding: 16px 24px 36px; }
.notebook-review-commands > .notebook-review-full { margin-top: 0; }
.notebook-review-stage[data-review-phase=recall] .notebook-review-commands { padding-bottom: 36px; }
.student-secondary-modal-sheet[data-review-phase=recall] { padding-bottom: max(8px, var(--android-nav-safe, 0px), env(safe-area-inset-bottom, 0px)); }
.notebook-review-image { display: block; width: 160px; height: 160px; max-width: 100%; object-fit: contain; margin: 0 auto 16px; }
.notebook-review-stage[data-review-phase=spell] .notebook-review-image { width: 96px; height: 96px; margin-bottom: 12px; }
.notebook-review-stage button { min-height: 44px; }
.notebook-review-record-cue { text-align: center; padding-top: 24px; }
.notebook-review-record-cue h3 { color: #35235f; font-size: 28px; line-height: 1.4; margin: 0 0 8px; overflow-wrap: anywhere; }
.notebook-review-record-cue p { color: #655078; margin: 8px 0 16px; }
.notebook-review-record-controls { text-align: center; padding-block: 24px 8px; }
.notebook-review-record-controls > button { min-width: 132px; }
.notebook-review-record-controls [role=status] { min-height: 24px; margin: 12px 0; color: #655078; font-size: 14px; }
.notebook-review-record-controls .recording-now { background: #b34059; border-color: #b34059; }
.notebook-review-topline { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: 13px; color: #655078; }
.notebook-review-progress { width: 100%; height: 5px; display: block; margin: 16px 0 24px; border: 0; border-radius: 5px; overflow: hidden; background: #e7daef; accent-color: #7042a8; }
.notebook-review-progress::-webkit-progress-bar { background: #e7daef; border-radius: 5px; }
.notebook-review-progress::-webkit-progress-value { background: #7042a8; border-radius: 5px; }
.notebook-review-progress::-moz-progress-bar { background: #7042a8; }
.notebook-review-prompt { text-align: center; }
.notebook-review-prompt h3, .notebook-review-summary h3 { margin: 0 0 16px; color: #35235f; font-size: 24px; line-height: 1.45; overflow-wrap: anywhere; text-wrap: balance; }
.notebook-review-prompt h3:focus, .notebook-review-summary h3:focus { outline: none; }
.notebook-review-prompt .audio-text-glow { color: #b45309; }
.notebook-review-word { margin: 0 0 8px; color: #35235f; font-size: 18px; overflow-wrap: anywhere; }
.notebook-review-prompt > button { min-width: 100px; }
.notebook-review-prompt .notebook-review-caption { margin-bottom: 8px; }
.notebook-review-instruction { text-align: center; margin: 24px 0; color: #655078; font-size: 14px; line-height: 1.65; }
.notebook-review-full { width: 100%; margin-top: 20px; }
.notebook-review-reveal { text-align: center; margin: 24px 0 4px; }
.notebook-review-reveal > strong, .notebook-review-feedback > strong { display: block; font-size: 32px; font-weight: 500; overflow-wrap: anywhere; }
.notebook-review-reveal p { color: #655078; margin: 8px 0 0; }
.notebook-review-answer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 42px; margin: 24px 0 8px; }
.notebook-review-answer span { min-width: 23px; padding: 0 1px 3px; border-bottom: 2px solid #d2bfdf; color: #35235f; font-size: 25px; text-align: center; line-height: 1.3; }
.notebook-review-answer .is-next { border-color: #7042a8; }
.notebook-review-edit { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 4px 0 16px; }
.notebook-review-edit > div { display: flex; gap: 8px; }
.student-notebook .notebook-review-edit button { padding-inline: 12px; }
.student-notebook .notebook-review-bank { display: flex; flex-wrap: wrap; width: 100%; justify-content: center; gap: 8px; margin: 0; padding: 4px 0 8px; box-sizing: border-box; }
.student-notebook .notebook-review-bank button { flex: 0 0 44px; width: 44px; height: 48px; padding: 4px; border-radius: 12px; font-size: 24px; background: #faf5ff; color: #593391; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #c6b2dc; transition: transform 160ms ease-out, opacity 160ms ease-out; }
.student-notebook .notebook-review-bank button:disabled { opacity: .3; box-shadow: none; }
.student-notebook .notebook-review-bank button:not(:disabled):active { transform: translateY(2px); }
.notebook-review-bank-slot { min-width: 0; }
.notebook-review-feedback {
  --review-result-glow: rgba(218, 54, 77, .32);
  text-align: center; margin: 0; padding: 16px 12px; border: 1px solid #d77788;
  border-radius: 8px; background: #fbeaec; color: #842638;
  box-shadow: 0 0 16px var(--review-result-glow), inset 0 0 12px var(--review-result-glow);
  animation: notebookReviewResultGlow 240ms cubic-bezier(.22, 1, .36, 1);
}
.notebook-review-feedback[data-correct=true] { --review-result-glow: rgba(43, 162, 85, .32); border-color: #65a47c; background: #eaf3eb; color: #275b3c; }
.notebook-review-feedback > strong { text-shadow: 0 0 12px var(--review-result-glow); font-size: 28px; }
.notebook-review-stage[data-review-result=correct] .notebook-review-answer { color: #275b3c; text-shadow: 0 0 12px rgba(43, 162, 85, .45); }
.notebook-review-stage[data-review-result=incorrect] .notebook-review-answer { color: #842638; text-shadow: 0 0 12px rgba(218, 54, 77, .45); }
.notebook-review-stage[data-review-result] .notebook-review-answer span { color: inherit; border-color: currentColor; transition: color 180ms ease-out, border-color 180ms ease-out; }
@keyframes notebookReviewResultGlow {
  from { box-shadow: 0 0 0 transparent, inset 0 0 0 transparent; }
}
.notebook-review-feedback h4 { font-size: 17px; margin: 0 0 8px; }
.notebook-review-feedback p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.notebook-review-summary { padding: 12px 0 4px; }
.notebook-review-summary > h3, .notebook-review-summary > .notebook-review-caption { text-align: center; }
.notebook-review-totals { margin: 24px 0; border-block: 1px solid #d9c9e7; padding: 8px 0; }
.notebook-review-totals > div { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; gap: 12px; }
.notebook-review-totals dt { font-size: 15px; color: #655078; }
.notebook-review-totals dd { margin: 0; font-size: 22px; color: #35235f; font-variant-numeric: tabular-nums; }
.notebook-review-totals dd small { font-size: 13px; margin-left: 6px; }
.notebook-review-needs { list-style: none; padding: 0; margin: 0 0 20px; }
.notebook-review-needs li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-bottom: 1px solid #d9c9e7; padding: 10px 4px; overflow-wrap: anywhere; }
.notebook-review-needs span { color: #655078; }
.notebook-review-error { color: #842638; font-size: 14px; line-height: 1.6; }
.has-notebook-review .student-notebook-results li.is-selecting { grid-template-columns: 32px minmax(0, 1fr) 56px; gap: 8px; cursor: pointer; }
.student-notebook .notebook-review-select { min-height: 44px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; background: transparent; box-shadow: none; cursor: pointer; }
body.app-mode .admin-modal-sheet .notebook-review-select input[type="checkbox"] { flex: 0 0 20px; width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; accent-color: #7042a8; background: transparent !important; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.notebook-review-select input:focus-visible { outline: 2px solid #7042a8; outline-offset: 2px; }
.student-notebook-word > .notebook-review-history { flex-shrink: 0; color: #275b3c; font-size: 12px; margin-left: auto; }
.student-notebook-word > .notebook-review-history[data-needs-practice=true] { flex: 0 0 22px; width: 22px; margin: 0 0 0 auto; color: #c53245; font-family: Arial, sans-serif; font-size: 22px; line-height: 1; text-align: center; }
@media (max-height: 660px) {
  .notebook-review-prompt h3 { font-size: 22px; margin-bottom: 12px; }
  .notebook-review-progress { margin-block: 12px 16px; }
  .notebook-review-answer { margin-top: 16px; }
  .notebook-review-stage[data-review-mode=structured] .notebook-review-image { width: 128px; height: 128px; }
  .notebook-review-stage[data-review-mode=structured] .notebook-review-structures { margin-block: 8px; }
}
@media (max-height: 740px) {
  .notebook-review-stage[data-review-phase=spell] .notebook-review-image { width: 72px; height: 72px; margin-bottom: 8px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; text-align: left; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt > .notebook-review-caption { display: none; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-word { flex-basis: 100%; margin: 0; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt h3 { flex: 1; min-width: 0; margin: 0; font-size: 20px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt > button { min-width: 88px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt .student-word-audio-status:empty { display: none; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-prompt .student-word-audio-status { flex-basis: 100%; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-progress { margin-block: 8px 12px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-answer { gap: 3px; min-height: 32px; margin: 12px 0 6px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-edit { margin-bottom: 8px; }
  .notebook-review-answer span { flex: 0 0 20px; width: 20px; min-width: 20px; padding-inline: 0; font-size: 22px; }
  .student-notebook .notebook-review-bank { gap: 6px 8px; }
  .student-notebook .notebook-review-bank button { height: 46px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue.has-review-image { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue .notebook-review-image { width: 64px; height: 64px; margin: 0; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue.has-review-image .notebook-review-prompt { display: block; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue.has-review-image h3 { margin-bottom: 4px; font-size: 18px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue.has-review-image [data-review-listen] { min-width: 64px; }
  .notebook-review-stage[data-review-phase=spell] .notebook-review-cue.has-review-image + .notebook-review-answer { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .student-notebook .notebook-review-bank button { transition: none; }
  .notebook-review-feedback { animation: none; }
  .notebook-review-stage[data-review-result] .notebook-review-answer span { transition: none; }
}

.notebook-review-answer .notebook-review-fixed { flex: 0 0 auto; min-width: 0; width: auto; border: 0; padding-inline: 1px; }
.notebook-review-answer .notebook-review-fixed.is-space { width: .45em; white-space: pre; }
.notebook-review-structure .notebook-review-fixed { white-space: pre; }
