/* Shared workspace and navigation */
:root {
  --paper: #f5f6f2;
  --surface: #ffffff;
  --ink: #263c32;
  --muted: #69776e;
  --line: #e0e6dc;
  --accent: #356951;
  --accent-soft: #eaf1e7;
  --radius: 14px;
  color-scheme: light dark;
}
::selection { background: #dce9ce; color: #213c2c; }
body { font-size: calc(14px * var(--study-text-scale, 1)); }
.nav-link { gap: 12px; padding: 11px 13px; min-height: 46px; font-size: calc(13px * var(--study-text-scale, 1)); font-weight: 500; border-radius: 9px; }
.nav-link > svg { width: 19px; height: 19px; }
.nav-link:hover { color: var(--accent); background: #eef2e9; }
.nav-link.active { background: var(--accent); color: white; font-weight: 600; }
.nav-link .nav-number { min-width: 20px; font-size: calc(10px * var(--study-text-scale, 1)); color: var(--accent); background: #f5f9ef; border-radius: 5px; }
.topbar { height: 64px; padding: 0 36px; position: sticky; top: 0; z-index: 15; background: var(--surface); }

.sidebar-toggle { width: 34px; min-width: 34px; min-height: 36px; border-radius: 7px; }
.sidebar-toggle svg { width: 19px; }

.top-actions { display: flex; align-items: center; gap: 18px; margin-left: 18px; flex-shrink: 0; }

.keyboard-help-button { display: flex; gap: 8px; align-items: center; font-size: calc(10px * var(--study-text-scale, 1)); color: var(--muted); min-height: 40px; }
.keyboard-help-button:hover { color: var(--accent); }
.main { max-width: 1240px; padding: 34px 36px 48px; }
.main.listening-main { max-width: 1520px; padding: 30px 32px 40px; }
.page-head { margin-bottom: 25px; align-items: center; gap: 18px; }
.page-head h1 { font-size: calc(27px * var(--study-text-scale, 1)); letter-spacing: .015em; }
.page-head p { font-size: calc(12px * var(--study-text-scale, 1)); margin-top: 6px; color: var(--muted); }
.page-head .button { flex-shrink: 0; }
.keyboard-hints { font-size: calc(10px * var(--study-text-scale, 1)); gap: 16px; color: #748173; margin-top: -8px; margin-bottom: 24px; }
.keyboard-hints .text-link { font-size: calc(10px * var(--study-text-scale, 1)); font-weight: 400; }
kbd { background: #fff; box-shadow: none; color: #677363; border-color: #dfe5d9; font-size: calc(10px * var(--study-text-scale, 1)); border-radius: 4px; }
.button { border-radius: 8px; min-height: 44px; padding: 10px 17px; font-size: calc(12px * var(--study-text-scale, 1)); font-weight: 500; }
.button.primary { box-shadow: 0 2px 3px #274b2510; }
.button:hover:enabled { border-color: #a5b69b; background: #f1f5eb; }
.button.primary:hover:enabled { background: #28563f; border-color: #28563f; }
.text-link { font-weight: 500; font-size: calc(12px * var(--study-text-scale, 1)); }
.section-head { margin: 30px 0 16px; }
.section-head h2 { font-size: calc(16px * var(--study-text-scale, 1)); font-weight: 600; }

/* Lists and study entrances */
.study-paths { gap: 16px; margin-bottom: 24px; }
.study-path { border-radius: 12px; padding: 24px; box-shadow: 0 2px 3px #243c2210; }
.study-path:hover { background: #fcfff8; border-color: #a5b99a; }
.study-path .icon-tile { width: 38px; height: 38px; border-radius: 10px; background: #eef3e7; margin-bottom: 17px; }
.study-path:nth-child(2) .icon-tile { background: #eaf1ee; color: #3b6c5b; }
.study-path:nth-child(3) .icon-tile { background: #f4f0e4; color: #8b713e; }
.study-path strong { font-size: calc(18px * var(--study-text-scale, 1)); }
.study-path p { font-size: calc(12px * var(--study-text-scale, 1)); line-height: 1.9; margin-top: 7px; }
.path-action { font-size: calc(11px * var(--study-text-scale, 1)); }
.stats { border-radius: 12px; background: #fff; margin-bottom: 24px; }
.stat { padding: 19px 23px; }
.stat-label { font-size: calc(11px * var(--study-text-scale, 1)); }
.stat-value { font-size: calc(28px * var(--study-text-scale, 1)); margin-top: 4px; }
.stat-value small { font-size: calc(11px * var(--study-text-scale, 1)); }
.stat-foot { font-size: calc(10px * var(--study-text-scale, 1)); margin-top: 4px; }
.review-reminder { font-size: calc(12px * var(--study-text-scale, 1)); padding: 14px 17px; border: 1px solid #e0e7d7; background: #f0f4e9; border-radius: 9px; }
.module-grid { gap: 18px; }
.module { border-radius: 12px; }
.module-head { background: #fcfdf9; padding: 20px 21px 17px; align-items: center; }
.module-head h2 { font-size: calc(15px * var(--study-text-scale, 1)); font-weight: 600; }
.module-head p { font-size: calc(10px * var(--study-text-scale, 1)); }
.module-icon { width: 34px; height: 34px; border-color: #e1e7d9; background: #f1f5e9; border-radius: 8px; }
.module-count { padding: 2px 7px; border: 1px solid #e3e8dc; border-radius: 5px; font-size: calc(10px * var(--study-text-scale, 1)); background: #fff; }
.lesson-row { padding: 14px 21px; font-size: calc(13px * var(--study-text-scale, 1)); min-height: 59px; gap: 11px; }
.lesson-row:hover { background: #f5f8f0; }
.lesson-row .lesson-circle { width: 17px; height: 17px; border-color: #cad7c1; }
.lesson-row small { font-size: calc(10px * var(--study-text-scale, 1)); }
.home-review-links { margin-top: 26px; padding-top: 22px; }
.tabs { width: fit-content; border: 1px solid #e3e8dc; background: #eaf0e5; border-radius: 10px; padding: 4px; gap: 4px; margin: 0 0 23px; display: flex; }
.tabs .tab { border: 0; border-radius: 7px; min-height: 39px; padding: 8px 23px; font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); font-weight: 500; }
.tabs .tab.active { border: 0; color: var(--accent); background: #fff; box-shadow: 0 1px 4px #263e2410; }
.toolbar { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 19px 20px; margin: 0 0 18px; gap: 16px; }
.main[data-page=practice] .toolbar { display: grid; grid-template-columns: minmax(0,1fr) 130px 130px; }
.main[data-page=terms] .toolbar { display: grid; grid-template-columns: minmax(0,1fr) 208px; }
.toolbar .field { min-width: 0; gap: 0; }
.field label { display: block; font-size: calc(11px * var(--study-text-scale, 1)); color: #67775f; margin-bottom: 7px; font-weight: 500; }
.field input,.field select { width: 100%; min-height: 44px; border-radius: 8px; border-color: #dce4d4; background-color: #fdfefa; padding: 9px 11px; font-size: calc(12px * var(--study-text-scale, 1)); }
.field input::placeholder { color: #8a9383; }
.content-count { margin: 18px 1px 12px; font-size: calc(11px * var(--study-text-scale, 1)); color: var(--muted); }
.list-panel { border-radius: 12px; overflow: hidden; background: #fff; border-color: var(--line); }
.list-column-head { display: grid; grid-template-columns: 105px minmax(0,1fr) 84px 17px; gap: 17px; padding: 12px 22px; color: #7b8574; font-size: calc(10px * var(--study-text-scale, 1)); background: #fcfdf9; border-bottom: 1px solid var(--line); }
.list-column-head > span:nth-child(3) { text-align: right; }
.question-row { display: grid; grid-template-columns: 105px minmax(0,1fr) 84px 17px; align-items: center; gap: 17px; padding: 18px 22px; min-height: 81px; border-color: #edf0e9; }
.question-row:hover { background: #f6f9f0; }
.q-number { width: auto; color: #73806b; font-size: calc(10px * var(--study-text-scale, 1)); }
.q-number strong { font-weight: 600; font-size: calc(12px * var(--study-text-scale, 1)); color: var(--ink); margin-top: 1px; }
.q-row-title { font-size: calc(13px * var(--study-text-scale, 1)); line-height: 1.8; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-row-title small { font-size: calc(10px * var(--study-text-scale, 1)); margin-top: 2px; }
.status-icon { width: fit-content; margin-left: auto; border-radius: 6px; padding: 3px 7px; font-size: calc(10px * var(--study-text-scale, 1)); gap: 5px; white-space: nowrap; }
.status-icon.correct { background: #eef5e7; color: #477337; }
.status-icon.incorrect { background: #fbefdf; color: #95652f; }
.status-icon > svg { width: 14px; }
.row-arrow { width: 15px; color: #89977e; }
.pager { margin-top: 21px; font-size: calc(11px * var(--study-text-scale, 1)); }
.pager .button { min-height: 40px; font-size: calc(11px * var(--study-text-scale, 1)); padding: 8px 17px; }
.exam-grid { gap: 14px; }

.year-mark { background: #f1f5e9; color: var(--accent); }
.term-grid { gap: 18px; }
.term-card { padding: 25px; border-radius: 12px; }
.term-card h2 { font-size: calc(21px * var(--study-text-scale, 1)); color: #2f5f46; }
.term-card .full-name { font-size: calc(11px * var(--study-text-scale, 1)); margin-top: 4px; }
.term-card .meaning { font-size: calc(14px * var(--study-text-scale, 1)); line-height: 2; margin-top: 19px; }
.term-card .exam-note { padding: 12px 13px; background: #f6f8f0; border-radius: 8px; font-size: calc(11px * var(--study-text-scale, 1)); line-height: 1.95; color: #667359; }
.term-bottom { padding-top: 17px; margin-top: 18px; }
.term-bottom .button { font-size: calc(11px * var(--study-text-scale, 1)); }
.empty { border-radius: 12px; padding: 40px 22px; font-size: calc(13px * var(--study-text-scale, 1)); background: #fff; }

/* Reading and answer screens share the same paper and spacing */
.reading-layout { grid-template-columns: minmax(0,1fr) 226px; gap: 24px; }
.reading .article { padding: 35px; border-radius: 12px; }
.article-title h1 { font-size: calc(27px * var(--study-text-scale, 1)); line-height: 1.7; }
.article-title .objective { font-size: calc(13px * var(--study-text-scale, 1)); line-height: 2; }
.reading .body-copy { font-size: calc(15px * var(--study-text-scale, 1)); line-height: 2.2; }
.reading-section { margin: 30px 0 35px; }
.reading .dialogue { padding: 20px 23px; border-radius: 10px; background: #f3f6ec; border-left-color: #b2c69c; }
.reading .diagram { border-radius: 10px; background: #fbfcf7; }
.read-side { position: sticky; top: 86px; }
.side-box { border-radius: 11px; padding: 19px; }
.side-box h2 { font-size: calc(13px * var(--study-text-scale, 1)); }
.side-box .lesson-row { padding: 12px 0; font-size: calc(11px * var(--study-text-scale, 1)); }
.quiz-top { margin-bottom: 20px; font-size: calc(12px * var(--study-text-scale, 1)); }
.question-card { border-radius: 12px; padding: 32px; }
.question-text { font-size: calc(15px * var(--study-text-scale, 1)); line-height: 2.1; }
.question-head h1 { font-size: calc(21px * var(--study-text-scale, 1)); line-height: 1.8; }
.choice { border-radius: 10px; padding: 16px; font-size: calc(14px * var(--study-text-scale, 1)); }
:root:not(.keyboard-mode) .choice:hover:not(:disabled):not(.selected) { border-color: #9cb58c; background: #f8fbf3; }
.choice.selected { border-color: #6d9560; background: #f0f6e9; }
.choice .choice-label { border-radius: 7px; font-size: calc(12px * var(--study-text-scale, 1)); }
.flash-wrap { max-width: 690px; }
.flash-card { border-radius: 16px; background: #fffef9; border-color: #dbe3cf; box-shadow: 0 8px 30px #2b43200a; }
.flash-card .flash-term { font-size: calc(34px * var(--study-text-scale, 1)); }
.flash-actions .button { font-size: calc(12px * var(--study-text-scale, 1)); }
.settings-panel { border-radius: 12px; padding: 25px; }
.settings-panel h2 { font-size: calc(15px * var(--study-text-scale, 1)); }
.settings-panel p { font-size: calc(12px * var(--study-text-scale, 1)); line-height: 2; }
.history-list { border-radius: 12px; }
.history-row { padding: 17px 21px; font-size: calc(13px * var(--study-text-scale, 1)); }
.history-row:hover { background: #f6f9f0; }
.history-row .status-icon { margin-left: 0; }
.history-row small { font-size: calc(10px * var(--study-text-scale, 1)); }
.lecture-page .lecture-catalog { border-radius: 12px; }
.lecture-page .lecture-catalog-head h2 { font-size: calc(15px * var(--study-text-scale, 1)); }
.lecture-page .lecture-filters select,.lecture-page .lecture-search { border-color: #dce4d4; }
.lecture-view { container-type: inline-size; }
.lecture-page .listen-deck,.lecture-page .listen-card { height: auto; }
.lecture-page .video-heading { min-height: 68px; padding: 13px 20px 15px; }
.lecture-page .chalk-stage { flex: none; height: clamp(500px,68cqi,640px); }
.lecture-page .chalk-stage .listen-diagram { inset: 42px 24px 178px; }
.lecture-page .chalk-stage .diagram { padding: 18px; }
.lecture-page .chalk-stage .diagram img { max-height: none; }
.lecture-page .stage-character { width: clamp(110px,18cqi,150px); height: 156px; bottom: 4px; }
.lecture-page .stage-character.teacher { left: 10px; }
.lecture-page .stage-character.student { right: 10px; }
.lecture-page .listen-key-points { max-width: 680px; padding: 12px 24px; }
.lecture-page .listen-key-points ul { font-size: calc(17px * var(--study-text-scale, 1)); gap: 13px; }
.lecture-page .listen-caption { position: static; min-height: 104px; padding: 17px 22px; border: 0; border-left: 4px solid #bb739e; border-radius: 0; background: #fffdf7; box-shadow: none; }
.lecture-page .caption-role { color: #8e4e78; font-size: calc(11px * var(--study-text-scale, 1)); margin-bottom: 6px; }
.lecture-page .listen-caption p { color: #23362b; font-size: calc(18px * var(--study-text-scale, 1)); line-height: 1.85; }
.lecture-page .listen-caption.student-caption { background: #f6ffee; border-left-color: #6b9c38; }
.lecture-page .student-caption .caption-role { color: #4a7628; }
@keyframes chalk-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  .lecture-page .listen-card:not([hidden]) .listen-diagram > .diagram,
  .lecture-page .listen-card:not([hidden]) .listen-diagram > .listen-key-points {
    animation: chalk-fade-in 460ms ease-out backwards;
  }
}

.lecture-page .caption-next-button { min-height: 46px; padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 9px; gap: 10px; }
.lecture-page .caption-next-button:hover:enabled { background: #28563f; }
.lecture-page .caption-next-button kbd { color: white; background: #ffffff12; border-color: #ffffff50; padding: 0 5px; }
.lecture-audio-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: calc(11px * var(--study-text-scale, 1)); }
.lecture-audio-button svg { width: 17px; height: 17px; }
.lecture-audio-button:hover { background: var(--accent-soft); }
.lecture-audio-button[aria-pressed=true] { background: var(--accent-soft); border-color: #a8c29c; color: var(--accent); }
.lecture-status #caption-mode { background: #edf3e7; border-radius: 5px; padding: 1px 7px; font-size: calc(10px * var(--study-text-scale, 1)); }

.lecture-settings .caption-setting-help { flex-basis: 100%; font-size: calc(11px * var(--study-text-scale, 1)); color: var(--muted); margin: -5px 0 3px; line-height: 1.9; }
.continuous-option small { font-size: calc(9px * var(--study-text-scale, 1)); color: var(--muted); }
.footer { max-width: 1240px; margin: 0 auto; padding: 12px 36px 26px; color: #7d8776; font-size: calc(9px * var(--study-text-scale, 1)); }
.footer a { color: #718367; }
summary { scroll-margin-top: 90px; }
.reading-section { scroll-margin-top: 90px; }

@media(max-width:1100px) {
  .reading-layout { grid-template-columns: minmax(0,1fr); }
  .read-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .read-side .side-box + .side-box { margin-top: 0; }
  .question-row,.list-column-head { grid-template-columns: 83px minmax(0,1fr) 74px 14px; gap: 13px; }
  .study-path { padding: 21px; }
  .study-path p { font-size: calc(11px * var(--study-text-scale, 1)); }
}
@media(max-width:850px) {
  .main[data-page=practice] .toolbar { grid-template-columns: 1fr 1fr; }
  .main[data-page=practice] .toolbar .search { grid-column: 1 / -1; }
  .main { padding: 27px 24px 38px; }
  .main.listening-main { padding: 26px 22px 36px; }
  .topbar { padding: 0 23px; }
  .top-actions { gap: 10px; margin-left: 10px; }

  .keyboard-help-button > span { display: none; }
  .study-paths { grid-template-columns: 1fr; gap: 12px; }
  .study-path { position: relative; padding: 17px 18px 17px 72px; min-height: 113px; }
  .study-path .icon-tile { position: absolute; left: 18px; top: 21px; margin: 0; }
  .study-path strong { font-size: calc(16px * var(--study-text-scale, 1)); }
  .study-path p { margin: 4px 0 9px; }
  .stat { padding: 17px 14px; }
  .stat-value { font-size: calc(26px * var(--study-text-scale, 1)); }
  .page-head h1 { font-size: calc(25px * var(--study-text-scale, 1)); }
  .question-row,.list-column-head { grid-template-columns: 76px minmax(0,1fr) 65px; gap: 12px; padding-left: 17px; padding-right: 17px; }
  .row-arrow { display: none; }
  .main[data-page=terms] .toolbar { grid-template-columns: 1fr; }
  .term-grid,.module-grid { grid-template-columns: 1fr; }
  .term-card { padding: 22px; }
  .reading .article { padding: 28px; }
  .question-card { padding: 27px; }
  .footer { padding-left: 24px; padding-right: 24px; }
}
@media(max-width:620px) {

  .lecture-page .caption-next-button { justify-content: center; min-width: 0; font-size: calc(12px * var(--study-text-scale, 1)); padding: 10px 12px; }
  .lecture-audio-button { font-size: calc(11px * var(--study-text-scale, 1)); gap: 6px; }
  .lecture-audio-button kbd { display: none; }

  .lecture-settings .continuous-option { flex-wrap: wrap; gap: 5px; }
  .lecture-page .listen-deck { height: auto; }
  .lecture-page .video-heading { min-height: 65px; padding: 12px 15px; }
  .lecture-page .chalk-stage { height: 500px; }
  .lecture-page .chalk-stage .listen-diagram { inset: 34px 12px 148px; }
  .lecture-page .chalk-stage .diagram { padding: 12px; }
  .lecture-page .stage-character { width: 94px; height: 128px; bottom: 4px; }
  .lecture-page .stage-character.teacher { left: 4px; }
  .lecture-page .stage-character.student { right: 4px; }
  .lecture-page .listen-key-points { padding: 8px 12px; }
  .lecture-page .listen-key-points ul { font-size: calc(14px * var(--study-text-scale, 1)); gap: 10px; }
  .lecture-page .listen-caption { min-height: 100px; padding: 14px 15px; }
  .lecture-page .caption-role { font-size: calc(10px * var(--study-text-scale, 1)); }
  .lecture-page .listen-caption p { font-size: calc(15px * var(--study-text-scale, 1)); }
  .workspace,.sidebar-collapsed .workspace { margin-left: 0; }
  .sidebar { display: none; }
  .nav-link { min-height: 46px; }
  .topbar { padding: 0 13px; height: 58px; }

  .top-actions { gap: 8px; margin-left: 8px; }

  .keyboard-help-button { padding: 0; min-width: 26px; min-height: 40px; justify-content: center; }
  .keyboard-help-button kbd { font-size: calc(10px * var(--study-text-scale, 1)); }
  .main { padding: 25px 17px 35px; }
  .main.listening-main { padding: 24px 14px 32px; }
  .page-head { gap: 10px; margin-bottom: 22px; }
  .page-head h1 { font-size: calc(24px * var(--study-text-scale, 1)); }
  .page-head p { font-size: calc(11px * var(--study-text-scale, 1)); line-height: 1.9; max-width: 26em; }
  .page-head .button { font-size: calc(11px * var(--study-text-scale, 1)); padding: 9px 12px; }
  .keyboard-hints { margin-top: -7px; margin-bottom: 21px; gap: 9px 13px; font-size: calc(9px * var(--study-text-scale, 1)); }
  .keyboard-hints .text-link { font-size: calc(9px * var(--study-text-scale, 1)); }
  .mobile-nav { grid-template-columns: repeat(5,minmax(0,1fr)); background: var(--surface); padding: 6px 6px calc(7px + env(safe-area-inset-bottom)); border-color: var(--line); }
  .mobile-nav .nav-link { padding: 5px 2px; min-height: 48px; font-size: calc(10px * var(--study-text-scale, 1)); font-weight: 500; gap: 4px; }
  .mobile-nav .nav-link > svg { width: 19px; height: 19px; }
  .mobile-nav .nav-link.active { background: var(--accent-soft); color: var(--accent); }
  .mobile-nav .nav-link .nav-number { right: 6px; top: 1px; font-size: calc(8px * var(--study-text-scale, 1)); color: white; background: var(--accent); min-width: 14px; }
  .study-paths { gap: 11px; margin-bottom: 20px; }
  .study-path { min-height: 108px; border-radius: 11px; padding: 16px 16px 16px 69px; box-shadow: none; }
  .study-path .icon-tile { left: 16px; top: 19px; width: 35px; height: 35px; }
  .study-path strong { font-size: calc(16px * var(--study-text-scale, 1)); }
  .study-path p { font-size: calc(11px * var(--study-text-scale, 1)); }
  .path-action { font-size: calc(10px * var(--study-text-scale, 1)); }
  .stat { padding: 15px 10px; }
  .stat-label { font-size: calc(9px * var(--study-text-scale, 1)); }
  .stat-value { font-size: calc(24px * var(--study-text-scale, 1)); margin-top: 5px; }
  .stat-value small { display: block; font-size: calc(9px * var(--study-text-scale, 1)); margin: 0; }
  .stat-foot { font-size: calc(9px * var(--study-text-scale, 1)); }
  .review-reminder { padding: 12px; font-size: calc(10px * var(--study-text-scale, 1)); gap: 7px; }
  .review-reminder > span { gap: 6px; }
  .review-reminder .text-link { font-size: calc(10px * var(--study-text-scale, 1)); white-space: nowrap; }
  .section-head { margin: 25px 0 14px; }
  .section-head h2 { font-size: calc(15px * var(--study-text-scale, 1)); }
  .section-head .text-link { font-size: calc(10px * var(--study-text-scale, 1)); }
  .module-head { padding: 18px 17px 15px; }
  .module-head h2 { font-size: calc(14px * var(--study-text-scale, 1)); }
  .lesson-row { padding: 14px 17px; font-size: calc(12px * var(--study-text-scale, 1)); min-height: 58px; }
  .lesson-row small { font-size: calc(9px * var(--study-text-scale, 1)); }
  .tabs { margin-bottom: 19px; }
  .tabs .tab { padding: 8px 19px; min-height: 39px; font-size: calc(11px * var(--study-text-scale, 1)); }
  .toolbar { padding: 16px; gap: 13px; border-radius: 11px; }
  .field label { font-size: calc(10px * var(--study-text-scale, 1)); }
  .field input,.field select { min-height: 43px; font-size: calc(11px * var(--study-text-scale, 1)); padding: 9px; }
  .field input,.lecture-search input { font-size: calc(16px * var(--study-text-scale, 1)); }
  .main[data-page=practice] .toolbar { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .content-count { font-size: calc(10px * var(--study-text-scale, 1)); }
  .list-column-head { display: none; }
  .question-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; padding: 16px; min-height: 95px; }
  .q-number { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; font-size: calc(10px * var(--study-text-scale, 1)); }
  .q-number strong { font-size: calc(10px * var(--study-text-scale, 1)); margin: 0; font-weight: 500; }
  .q-row-title { font-size: calc(12px * var(--study-text-scale, 1)); }
  .q-row-title small { font-size: calc(9px * var(--study-text-scale, 1)); }
  .status-icon { font-size: calc(9px * var(--study-text-scale, 1)); padding: 3px 6px; }
  .status-icon > svg { width: 12px; }
  .pager .button { min-height: 44px; font-size: calc(11px * var(--study-text-scale, 1)); }

  .term-card { padding: 21px; }
  .term-card h2 { font-size: calc(20px * var(--study-text-scale, 1)); }
  .term-card .meaning { font-size: calc(13px * var(--study-text-scale, 1)); margin-top: 16px; }
  .term-card .exam-note { font-size: calc(11px * var(--study-text-scale, 1)); }
  .term-bottom { gap: 10px; }
  .term-bottom .button { min-height: 44px; font-size: calc(10px * var(--study-text-scale, 1)); padding: 8px 12px; }
  .term-bottom .text-link { font-size: calc(10px * var(--study-text-scale, 1)); }
  .reading .article { padding: 24px 20px; }
  .article-title h1 { font-size: calc(23px * var(--study-text-scale, 1)); }
  .reading .body-copy { font-size: calc(14px * var(--study-text-scale, 1)); line-height: 2.1; }
  .reading .dialogue { padding: 17px; }
  .read-side { grid-template-columns: 1fr; gap: 15px; }
  .question-card { padding: 23px 18px; }
  .question-head h1 { font-size: calc(17px * var(--study-text-scale, 1)); }
  .question-text { font-size: calc(14px * var(--study-text-scale, 1)); }
  .choice { padding: 14px 12px; font-size: calc(13px * var(--study-text-scale, 1)); }
  .flash-card .flash-term { font-size: calc(29px * var(--study-text-scale, 1)); }
  .flash-actions .button { min-height: 44px; }
  .settings-panel { padding: 21px; }
  .history-row { padding: 16px; font-size: calc(12px * var(--study-text-scale, 1)); }
  .footer { padding: 8px 17px calc(93px + env(safe-area-inset-bottom)); font-size: calc(9px * var(--study-text-scale, 1)); }
}
@media(max-width:360px) {
  .main { padding-left: 13px; padding-right: 13px; }

  .top-actions { gap: 4px; margin-left: 4px; }
  .main[data-page=practice] .toolbar { gap: 11px; padding: 13px; }
  .question-row { padding: 14px; }
  .q-row-title { font-size: calc(11px * var(--study-text-scale, 1)); }
  .stat-value { font-size: calc(22px * var(--study-text-scale, 1)); }
  .review-reminder { font-size: calc(9px * var(--study-text-scale, 1)); }
}
@media print {
  .sidebar,.topbar,.mobile-nav { display: none !important; }
  .workspace,.sidebar-collapsed .workspace { margin-left: 0; }
  .main,.main.listening-main { max-width: none; padding: 0; }
  .read-side { position: static; }
}
/* Reading navigation stays in view while the article scrolls. */
.reading .article-title{border-bottom:0;padding-bottom:0;margin-bottom:22px}
.lesson-navigation{position:sticky;top:64px;z-index:12;background:#fff;margin:0 -35px 26px;padding:0 35px}
.lesson-stages{display:flex;gap:24px;border-bottom:1px solid var(--line)}
.lesson-stages button{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;padding:10px 4px;border:0;border-radius:0;background:transparent;color:#69776e;font-size:calc(13px * var(--study-text-scale, 1));cursor:pointer}
.lesson-stages button:hover{color:#28553d;background:#f6f8f2}
.lesson-stages button.active{color:#28553d;font-weight:700}
.lesson-stages button.active::after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:3px;background:#356951;border-radius:2px 2px 0 0}
.reading .keyboard-hints{gap:8px;margin:0 0 24px}
.reading .keyboard-hints>.text-link{display:none}
.lesson-navigation progress{display:block;appearance:none;width:100%;height:3px;border:0;background:#dfe5da;color:#356951}
.lesson-navigation progress::-webkit-progress-bar{background:#dfe5da}
.lesson-navigation progress::-webkit-progress-value{background:#356951}
.lesson-navigation progress::-moz-progress-bar{background:#356951}
.reading [data-lesson-stage],.reading .reading-section{scroll-margin-top:140px}
.reading .lesson-section-title{font-size:calc(17px * var(--study-text-scale, 1));line-height:1.7;margin:0 0 15px}
.reading .dialogue-answer{margin-top:14px;padding:16px 18px;background:#fff;border:1px solid #dce5d5;border-radius:7px}
.answer-label{display:block;color:#356951;font-size:calc(11px * var(--study-text-scale, 1));font-weight:700;margin-bottom:8px}
.answer-open,details[open]>summary .answer-closed{display:none}
details[open]>summary .answer-open{display:inline}
.lesson-related-terms{margin-top:24px}
.related-terms-label{display:block;font-size:calc(11px * var(--study-text-scale, 1));color:#62715f;margin-bottom:8px}
.reading .check-choices{display:grid;gap:9px;margin:20px 0}
.reading .check-choice{display:flex;gap:12px;align-items:center;margin:0;padding:14px 16px;text-align:left;line-height:1.8}
.reading .check-choice:disabled{opacity:1;color:#58645c;cursor:default}
.check-choice-marker{display:grid;place-items:center;flex:0 0 25px;min-height:25px;border:1px solid #ccd5c7;border-radius:50%;font-size:calc(12px * var(--study-text-scale, 1))}
.check-choice-marker svg{width:19px;height:19px}
.reading .check-choice.correct{background:#edf5e8;border:2px solid #4c7c42;color:#284f25}
.reading .check-choice.incorrect{background:#fff0ed;border:2px solid #ba5b4a;color:#85362b}
.reading .check-choice.correct .check-choice-marker{background:#4c7c42;color:#fff;border-color:#4c7c42}
.reading .check-choice.incorrect .check-choice-marker{background:#a74839;color:#fff;border-color:#a74839}
.choice-verdict{display:block;font-size:calc(11px * var(--study-text-scale, 1));font-weight:700}
.reading .check-feedback{display:block;margin-top:18px;padding:18px 20px;background:#edf5e8;border:1px solid #a9c599;border-radius:8px;color:#284f25;scroll-margin-top:140px}
.reading .check-feedback.bad{background:#fff0ed;border-color:#dbab9f;color:#85362b}
.check-feedback-title{display:flex;align-items:center;gap:9px;font-size:calc(15px * var(--study-text-scale, 1))}
.check-feedback-title svg{width:22px;height:22px}
.reading .check-feedback p{font-size:calc(13px * var(--study-text-scale, 1));line-height:1.9;margin:10px 0 0}
.reading .check-feedback .button{margin-top:14px;color:inherit;background:#fff}
.reading .check-feedback .check-completion{font-size:calc(11px * var(--study-text-scale, 1))}
.lesson-practice{margin:28px 0;padding:24px 0;border-block:1px solid #e0e5da}
.lesson-practice>.button{max-width:100%;white-space:normal;line-height:1.7}
.lesson-practice>.muted{font-size:calc(11px * var(--study-text-scale, 1));margin:9px 0 12px}
.lesson-practice details{font-size:calc(12px * var(--study-text-scale, 1))}
.lesson-practice .lesson-row{padding:14px 0}
.reading .article-footer{align-items:stretch;flex-wrap:wrap}
.reading .lesson-next{display:grid;grid-template-columns:1fr auto;gap:5px 12px;text-align:left;margin-left:auto;font-size:calc(11px * var(--study-text-scale, 1));max-width:100%;white-space:normal}
.lesson-next strong{grid-column:1/-1;font-size:calc(13px * var(--study-text-scale, 1))}
.lesson-completion-note{color:#62715f;font-size:calc(11px * var(--study-text-scale, 1));line-height:1.9;margin:14px 0 26px}
.lesson-listen-link{margin-top:14px}
.main[data-page="lesson"] .read-side{top:86px}
.read-side .muted{font-size:calc(11px * var(--study-text-scale, 1));margin-bottom:12px}
.keyboard-hints .hint-dismiss{width:28px;height:28px;min-height:28px;padding:5px;margin-left:auto}
.hint-dismiss svg{width:14px;height:14px}
@media (hover:none),(pointer:coarse){.keyboard-hints,.keyboard-help-button{display:none!important}}
@media (min-width:621px) and (max-width:850px){.lesson-navigation{margin-inline:-28px;padding-inline:28px}}
@media (max-width:620px){
  .keyboard-hints,.keyboard-help-button{display:none!important}
  .lesson-navigation{top:58px;margin:0 -20px 22px;padding:0 20px}
  .lesson-stages{gap:20px}
  .lesson-stages button{flex:1;min-height:48px}
  .reading [data-lesson-stage],.reading .reading-section,.reading .check-feedback{scroll-margin-top:132px}
  .reading .lesson-section-title{font-size:calc(16px * var(--study-text-scale, 1))}
  .reading .article-footer{flex-direction:column;gap:12px}
  .reading .lesson-next{width:100%;margin-left:0}
  .reading .check-choice{padding:12px;gap:10px;font-size:calc(13px * var(--study-text-scale, 1))}
  .reading .check-feedback{padding:16px}
}
@media (max-width:479px){.reading .diagram-nodes.comparison{grid-template-columns:1fr}}
@media (prefers-reduced-motion:no-preference){
  .reading .dialogue details[open] .dialogue-answer{animation:answer-reveal 220ms ease-out}
  @keyframes answer-reveal{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
}
@media print{.lesson-navigation,.lesson-practice,.lesson-completion-note{display:none!important}}

/* Keep lecture playback, settings, and progress together below the board. */
.lecture-page .listen-deck{border-radius:12px 12px 0 0;box-shadow:none}
.lecture-console{padding:13px 17px 15px;background:#293f34;color:#eef4eb;border:1px solid #293f34;border-radius:0 0 12px 12px}
.lecture-page .lecture-console .audio-timeline{display:flex;align-items:center;gap:14px;margin:0 0 11px;padding:0;min-height:14px}
.lecture-console .audio-timeline progress{appearance:none;flex:1;min-width:0;height:4px;border:0;border-radius:4px;overflow:hidden;background:#ffffff23;color:#b9d58e}
.lecture-console progress::-webkit-progress-bar{background:#ffffff23}
.lecture-console progress::-webkit-progress-value{background:#b9d58e;border-radius:4px}
.lecture-console progress::-moz-progress-bar{background:#b9d58e;border-radius:4px}
.lecture-console .narration-position{color:#cfdbcf;font-size:calc(10px * var(--study-text-scale, 1));font-variant-numeric:tabular-nums;min-width:65px;text-align:right}
.lecture-transport{display:flex;align-items:center;justify-content:space-between;gap:12px}
.lecture-page .lecture-console .listen-controls{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0;min-width:0}
.lecture-page .lecture-console .lecture-audio-button{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 12px;border:1px solid #ffffff35;border-radius:7px;background:transparent;color:#f4f7ef;font-size:calc(12px * var(--study-text-scale, 1));white-space:nowrap}
.lecture-console .lecture-audio-button:hover,.lecture-console .lecture-audio-button[aria-pressed=true]{background:#ffffff18;border-color:#ffffff65}
.lecture-page .lecture-console .caption-next-button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 12px;gap:8px;border:1px solid #d4e4b8;border-radius:7px;background:#dcebc4;color:#203c29;font-size:calc(12px * var(--study-text-scale, 1));font-weight:650;white-space:nowrap}
.lecture-page .lecture-console .caption-next-button:hover:enabled{background:#e8f3d8;color:#203c29}
.lecture-console .caption-next-button:disabled{opacity:.45}
.lecture-console button svg{width:17px;height:17px;flex-shrink:0}
.lecture-console kbd{padding:0 4px;border:1px solid #ffffff40;background:#ffffff0a;color:#d7e4d4;font-size:calc(9px * var(--study-text-scale, 1));box-shadow:none}
.lecture-page .lecture-console .caption-next-button kbd{border-color:#829b6e66;background:#ffffff40;color:#47603a;padding:0 4px}
.lecture-console #caption-count{display:block;color:#c8d6c8;font-size:calc(10px * var(--study-text-scale, 1));white-space:nowrap;font-variant-numeric:tabular-nums}
.lecture-utility-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.lecture-console .lecture-tool{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:38px;padding:7px 9px;border:0;border-radius:7px;background:transparent;color:#dce6d8;font-size:calc(11px * var(--study-text-scale, 1));white-space:nowrap}
.lecture-console .lecture-tool:hover,.lecture-console .lecture-tool[aria-expanded=true]{background:#ffffff18;color:#fff}
.lecture-console button:focus-visible{outline:2px solid #d4e4b8;outline-offset:3px}
.lecture-page .lecture-console .listen-help{font-size:calc(11px * var(--study-text-scale, 1));line-height:1.8;margin:12px 0 0;min-height:0;text-align:left;color:#e4ebda}
.lecture-console #listen-help:empty{display:none}
.lecture-page .lecture-settings{margin:14px 0 0;padding:17px;background:#f8faf4;color:var(--ink);border:0;border-radius:8px}
.lecture-settings[hidden]{display:none}
.lecture-setting-toggles{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.lecture-settings .lecture-switch{display:flex;justify-content:space-between;align-items:center;gap:12px;cursor:pointer}
.lecture-switch>span{min-width:0}
.lecture-switch strong{display:block;font-size:calc(12px * var(--study-text-scale, 1));font-weight:600;line-height:1.7}
.lecture-switch small{display:block;color:#687460;font-size:calc(10px * var(--study-text-scale, 1));line-height:1.8;margin-top:3px}
.lecture-switch input{appearance:none;position:relative;flex:0 0 32px;width:32px;height:19px;border:1px solid #b6c0af;border-radius:20px;background:#c4ccbd;cursor:pointer}
.lecture-switch input::after{content:"";display:block;position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #20332426}
.lecture-switch input:checked{background:#46704c;border-color:#46704c}
.lecture-switch input:checked::after{left:15px}
.lecture-switch input:disabled{opacity:.4;cursor:default}
.lecture-switch:has(input:disabled){opacity:.6;cursor:default}
.lecture-setting-fields{display:grid;grid-template-columns:110px minmax(0,1fr);gap:14px;margin-top:18px;padding-top:15px;border-top:1px solid #e0e7d8}
.lecture-setting-fields label{display:grid;gap:7px;font-size:calc(11px * var(--study-text-scale, 1));font-weight:500;min-width:0}
.lecture-setting-fields select{width:100%;max-width:none;min-width:0;min-height:38px;border:1px solid #d7dfcf;border-radius:6px;background:#fff;padding:6px 9px;color:var(--ink);font:inherit}
.lecture-page .lecture-settings .caption-setting-help{font-size:calc(10px * var(--study-text-scale, 1));line-height:1.9;margin:12px 0 0;color:#687460}
.lecture-page .lecture-neighbors{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:12px 0;background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.lecture-page .lecture-neighbors button{padding:12px 15px;min-height:78px;border:0;border-radius:0;background:transparent;gap:12px}
.lecture-page .lecture-neighbors button+button{border-left:1px solid var(--line)}
.lecture-page .lecture-neighbors button:hover:enabled{background:#f0f5e9}
.lecture-page .lecture-neighbors button:disabled{opacity:1;color:#899286;background:#fafbf8}
.lecture-page .lecture-neighbors button:disabled>svg{color:#a6b2a0}
.lecture-page .lecture-neighbors small{font-size:calc(10px * var(--study-text-scale, 1));color:#78846e;gap:7px}
.lecture-page .lecture-neighbors strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:calc(12px * var(--study-text-scale, 1));line-height:1.7;margin-top:4px;font-weight:500}
.lecture-page .lecture-neighbors button>svg{width:16px;flex-shrink:0}
.lecture-page .lecture-notes{padding:0 16px;border:1px solid var(--line);border-radius:10px;background:#fff}
.lecture-page .lecture-notes summary{min-height:50px;font-size:calc(12px * var(--study-text-scale, 1))}
.lecture-notes summary>span{display:flex;align-items:center;gap:9px}
.lecture-notes summary>span>svg{width:16px;height:16px;color:#708169}
.lecture-page .narration-credit{display:flex;flex-wrap:wrap;gap:3px 15px;margin:15px 2px 0;font-size:calc(9px * var(--study-text-scale, 1));line-height:1.9;color:#7b8576}
.lecture-page .narration-credit a{color:#6b7c62}
@media(max-width:620px){
  .lecture-console{padding:12px}
  .lecture-transport{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .lecture-page .lecture-console .listen-controls{display:contents}
  .lecture-page .lecture-console .lecture-audio-button,.lecture-page .lecture-console .caption-next-button{width:100%;min-width:0;min-height:44px;padding:8px 9px;font-size:calc(12px * var(--study-text-scale, 1))}
  .lecture-page .lecture-console .caption-next-button kbd{display:none}
  .lecture-console #caption-count{grid-column:1;grid-row:2;font-size:calc(10px * var(--study-text-scale, 1));align-self:center}
  .lecture-utility-actions{grid-column:2;grid-row:2;justify-self:end}
  .lecture-console .lecture-tool{min-height:36px;min-width:40px;padding:6px 9px}
  .lecture-page .lecture-settings{padding:14px;margin-top:11px}
  .lecture-setting-toggles{grid-template-columns:1fr;gap:15px}
  .lecture-setting-fields{grid-template-columns:80px minmax(0,1fr);gap:10px}
  .lecture-setting-fields select{font-size:calc(16px * var(--study-text-scale, 1))}
  .lecture-page .lecture-neighbors button{padding:11px;min-height:80px;gap:7px}
  .lecture-page .lecture-neighbors strong{font-size:calc(11px * var(--study-text-scale, 1))}
  .lecture-page .lecture-notes{padding-inline:13px}
  .lecture-page .narration-credit{font-size:calc(9px * var(--study-text-scale, 1));gap:2px 12px}
}
.lesson-prerequisites{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;margin:15px 0 0;font-size:calc(11px * var(--study-text-scale, 1));color:var(--muted)}
.lesson-prerequisites a{color:var(--accent);text-underline-offset:3px}
.chapter-number{margin-right:7px;font-size:calc(9px * var(--study-text-scale, 1));font-variant-numeric:tabular-nums;color:#8b9a83}
.lecture-study-links{display:flex;align-items:center;gap:14px;flex:none}
.flash-card .flash-term.concept-question{font-size:calc(22px * var(--study-text-scale, 1));line-height:1.8;max-width:24em}
.flash-lesson{text-align:center;font-size:calc(12px * var(--study-text-scale, 1));margin-top:16px}
.flash-lesson a{display:inline-flex;align-items:center;gap:5px;color:var(--accent)}
.flash-lesson svg{width:14px;height:14px}
#lesson-checks{scroll-margin-top:145px}

/* Queue navigation, choice elimination, inline reasons, flashcard filter, and module stats */
.list-head-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:14px 1px 12px}
.list-head-bar .content-count{margin:0}
.list-head-bar .button{min-height:36px;padding:6px 13px;font-size:calc(11px * var(--study-text-scale, 1))}
.quiz-queue-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.quiz-queue-nav .button{min-height:32px;padding:4px 10px;font-size:calc(11px * var(--study-text-scale, 1))}
.choices legend{display:flex;align-items:baseline;justify-content:space-between;gap:12px;width:100%;flex-wrap:wrap}

.choice-row{display:flex;align-items:stretch;gap:8px}
.choice-row>.choice{flex:1;min-width:0}
.choice.eliminated{opacity:.52;background:var(--paper)}
.choice.eliminated .choice-body{text-decoration:line-through;color:var(--muted)}
.choice.selected.eliminated{opacity:.75;background:var(--bad-soft);border-color:#c3796d}
.choice.selected.eliminated .choice-body{text-decoration:line-through;color:var(--muted)}
.choice-eliminate{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:44px;flex-shrink:0;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);transition:background .15s,color .15s,border-color .15s;padding:4px 0}
.choice-eliminate svg{width:13px;height:13px}

.choice-eliminate:hover{background:var(--bad-soft);color:var(--bad);border-color:#dfb5ad}
.choice-eliminate.active{background:var(--bad-soft);color:var(--bad);border-color:#c3796d}
.choice-eliminate.pending-eliminate{background:var(--bad-soft);color:var(--bad);border-color:var(--bad);box-shadow:0 0 0 3px rgba(199,84,80,0.35);animation:pending-elim-pulse .7s ease-in-out infinite alternate}
@keyframes pending-elim-pulse{from{transform:scale(1.02);opacity:.85}to{transform:scale(1.1);opacity:1}}

.choice-reason-badge{display:inline-block;padding:1px 7px;border-radius:5px;font-size:calc(10px * var(--study-text-scale, 1));font-weight:700;background:var(--paper);color:var(--muted)}
.choice-reason-badge.correct{background:var(--accent-soft);color:var(--accent)}
.feedback{align-items:center}

#question-explanation{scroll-margin-top:84px}
.flash-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:23px}
.flash-toolbar .tabs{margin:0}
.module-stats-list{display:grid;gap:12px;margin-top:16px}
.module-stat-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}
.module-stat-info{flex:1;min-width:0}
.module-stat-info strong{display:block;font-size:calc(13px * var(--study-text-scale, 1))}
.module-stat-info small{display:block;font-size:calc(11px * var(--study-text-scale, 1));color:var(--muted);margin-top:3px}
.module-stat-bar{display:flex;height:6px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:8px}
.module-stat-bar .bar-correct{background:var(--accent);height:100%}
.module-stat-bar .bar-review{background:#d48a46;height:100%}
.module-stat-row .button{flex-shrink:0;min-height:38px;padding:7px 13px;font-size:calc(11px * var(--study-text-scale, 1))}
/* Practice 2-column layout and explanation sidebar */
.quiz-layout {
  max-width: 1240px;
  margin: 0 auto;
}
.quiz-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}
.quiz-primary-column {
  min-width: 0;
}
.quiz-secondary-column {
  min-width: 0;
}
.quiz-side-explanation {
  margin-top: 0;
  border-top: 0;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.quiz-side-explanation .explanation-head {
  margin-bottom: 16px;
}
.quiz-side-explanation .explanation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.quiz-side-explanation .explanation-badge svg {
  width: 15px;
  height: 15px;
}
.quiz-side-explanation h2 {
  font-size: calc(18px * var(--study-text-scale, 1));
  line-height: 1.6;
  color: var(--ink);
}
.quiz-side-explanation .explanation-body {
  margin-bottom: 16px;
}
.explanation-para {
  margin: 0 0 10px;
  font-size: calc(13.5px * var(--study-text-scale, 1));
  line-height: 1.95;
  color: var(--ink);
}
.explanation-para:last-child {
  margin-bottom: 0;
}
.explanation-para.explanation-lead {
  font-weight: 500;
  margin-bottom: 10px;
}
.explanation-para.explanation-verdict {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-weight: 500;
}
.choice-reason-para {
  margin: 4px 0 0;
  font-size: calc(13px * var(--study-text-scale, 1));
  line-height: 1.8;
  color: var(--ink);
}
.choice-reason-para + .choice-reason-para {
  margin-top: 6px;
}

/* Marker-style highlighters for dense study text */
.hl-verdict {
  background: linear-gradient(transparent 55%, rgba(47, 122, 91, 0.18) 55%);
  border-bottom: 2px solid var(--accent);
  font-weight: 700;
  color: var(--accent);
  padding: 0 1px;
}
.hl-diff {
  background: linear-gradient(transparent 60%, rgba(229, 133, 123, 0.22) 60%);
  border-bottom: 1.5px dashed rgba(201, 82, 70, 0.6);
  color: #c95246;
  font-weight: 600;
  padding: 0 1px;
}
.hl-keyword {
  background: linear-gradient(transparent 55%, rgba(214, 169, 92, 0.22) 55%);
  border-bottom: 1.5px solid rgba(214, 169, 92, 0.7);
  font-weight: 700;
  color: var(--ink);
  padding: 0 1px;
}
.hl-term {
  font-weight: 700;
  color: var(--accent);
}
.choice-reasons-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.choice-reason {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
}
.choice-reason.is-correct {
  border-color: rgba(47, 122, 91, 0.35);
  background: var(--surface);
  border-left: 3.5px solid var(--accent);
}
.choice-reason-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.choice-reason-head strong {
  font-size: calc(13.5px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--ink);
}
.explanation-placeholder {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: sticky;
  top: 84px;
}

.explanation-placeholder h2 {
  font-size: calc(16px * var(--study-text-scale, 1));
  color: var(--ink);
}
.explanation-placeholder p {
  font-size: calc(13px * var(--study-text-scale, 1));
  line-height: 1.9;
}

/* Term list & controls */
.term-controls-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.term-toolbar {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.term-initial-tabs {
  margin-top: 0;
}
.term-stats-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.term-stats-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: calc(12.5px * var(--study-text-scale, 1));
  color: var(--muted);
}
.term-stats-info .content-count {
  margin: 0;
  font-size: calc(12.5px * var(--study-text-scale, 1));
}
.term-known-stat strong {
  color: var(--accent);
  font-weight: 700;
}
.term-progress-track {
  width: 100%;
  height: 6px;
  background: var(--paper);
  border-radius: 999px;
  overflow: hidden;
}
.term-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.term-list-panel {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.term-list-head {
  display: grid;
  grid-template-columns: 200px 1.35fr 1.35fr 140px;
  gap: 16px;
  padding: 11px 20px;
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.term-row {
  display: grid;
  grid-template-columns: 200px 1.35fr 1.35fr 140px;
  gap: 16px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.term-row:last-child {
  border-bottom: none;
}
.term-row:hover {
  background: rgba(47, 122, 91, 0.03);
}
.term-row.is-known {
  background: rgba(47, 122, 91, 0.02);
}
.term-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.term-row-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.term-row-header .term-name {
  font-size: calc(15px * var(--study-text-scale, 1));
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
}
.term-row.is-known .term-name {
  color: var(--accent);
}
.term-known-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: calc(10px * var(--study-text-scale, 1));
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.term-known-badge svg {
  width: 11px;
  height: 11px;
}
.term-chapter-badge {
  font-size: calc(10px * var(--study-text-scale, 1));
  padding: 2px 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.term-fullname {
  font-size: calc(10.5px * var(--study-text-scale, 1));
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.term-meaning-text {
  font-size: calc(13px * var(--study-text-scale, 1));
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
.term-row-note {
  font-size: calc(12px * var(--study-text-scale, 1));
  line-height: 1.65;
  color: var(--muted);
  background: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.term-note-label {
  display: block;
  font-size: calc(9.5px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.term-note-text {
  margin: 0;
  font-size: calc(11.5px * var(--study-text-scale, 1));
  line-height: 1.6;
  color: var(--ink);
}
.term-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.term-lesson-link {
  font-size: calc(11px * var(--study-text-scale, 1));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(47, 122, 91, 0.25);
  background: var(--surface);
  white-space: nowrap;
}
.term-lesson-link:hover {
  background: var(--accent-soft);
}
.term-lesson-link svg {
  width: 12px;
  height: 12px;
}
.term-toggle-btn {
  font-size: calc(11px * var(--study-text-scale, 1));
  padding: 5px 10px;
  min-height: 32px;
  white-space: nowrap;
}

/* Card view enhancements */
.term-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.term-card-head h2 {
  font-size: calc(19px * var(--study-text-scale, 1));
  margin: 0;
}
.term-card.is-known {
  border-color: rgba(47, 122, 91, 0.35);
}
.exam-note-box {
  margin-top: 14px;
  padding: 10px 13px;
  background: var(--paper);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.exam-note-box .exam-note-label {
  display: block;
  font-size: calc(10px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.exam-note-box .exam-note {
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: calc(11.5px * var(--study-text-scale, 1));
  line-height: 1.8;
  color: var(--ink);
}

@media (min-width: 961px) {
  /* Prevent window vertical scrollbar entirely on practice & full quiz desktop view */
  html:has(.main[data-page="question"]),
  html:has(.main:is([data-page="full"],[data-page="afternoon-quiz"])),
  body:has(.main[data-page="question"]),
  body:has(.main:is([data-page="full"],[data-page="afternoon-quiz"])) {
    overflow: hidden;
    height: 100vh;
  }
  .layout:has(.main[data-page="question"]),
  .layout:has(.main:is([data-page="full"],[data-page="afternoon-quiz"])) {
    height: 100vh;
    overflow: hidden;
  }
  .layout:has(.main[data-page="question"]) .topbar,
  .layout:has(.main:is([data-page="full"],[data-page="afternoon-quiz"])) .topbar {
    height: 52px;
    padding: 0 28px;
  }
  .layout:has(.main[data-page="question"]) .workspace,
  .layout:has(.main:is([data-page="full"],[data-page="afternoon-quiz"])) .workspace {
    margin-top: 52px;
    height: calc(100vh - 52px);
    overflow: hidden;
  }
  .main[data-page="question"],
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) {
    min-height: auto;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 10px 28px 12px;
    display: flex;
    flex-direction: column;
  }
  .main[data-page="question"] + .footer,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) + .footer {
    display: none;
  }
  .main[data-page="question"] .keyboard-hints,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .keyboard-hints {
    display: none !important;
  }
  .main[data-page="question"] .quiz-layout,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-layout {
    max-width: 1260px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .main[data-page="question"] .quiz-top,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-top {
    flex-shrink: 0;
    margin-bottom: 6px;
    font-size: calc(11.5px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .full-progress,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .full-progress {
    flex-shrink: 0;
    margin-bottom: 6px;
  }
  .main[data-page="question"] .quiz-columns,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-columns {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 16px;
  }
  .main[data-page="question"] .quiz-primary-column,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-primary-column,
  .main[data-page="question"] .quiz-secondary-column,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-secondary-column {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .main[data-page="question"] .question-card,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-card {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 14px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .main[data-page="question"] .question-head,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-head {
    margin-bottom: 10px;
    gap: 10px;
  }
  .main[data-page="question"] .question-head h1,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-head h1 {
    font-size: calc(18px * var(--study-text-scale, 1));
    line-height: 1.3;
  }
  .main[data-page="question"] .question-head small,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-head small {
    font-size: calc(10.5px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .question-head .icon-button,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-head .icon-button {
    width: 36px;
    min-height: 36px;
  }
  .main[data-page="question"] .question-text,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-text {
    font-size: calc(14.5px * var(--study-text-scale, 1));
    line-height: 1.8;
    margin-bottom: 10px;
  }
  .main[data-page="question"] .question-figure,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-figure {
    margin: 8px 0;
    padding: 6px;
  }
  .main[data-page="question"] .question-figure img,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .question-figure img {
    max-height: clamp(140px, 26vh, 320px);
  }
  .main[data-page="question"] .choices,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choices {
    margin-top: 10px;
    gap: 8px;
  }
  .main[data-page="question"] .choices legend,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choices legend {
    margin-bottom: 6px;
    font-size: calc(11px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .choice,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice {
    padding: 8px 12px;
    min-height: 42px;
    font-size: calc(13px * var(--study-text-scale, 1));
    line-height: 1.6;
    gap: 10px;
  }

  .main[data-page="question"] .choice .choice-label,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice .choice-label {
    width: 25px;
    height: 25px;
    font-size: calc(11.5px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .choice-eliminate,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-eliminate {
    width: 40px;
    padding: 2px 0;
  }
  .main[data-page="question"] .choice-eliminate svg,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-eliminate svg {
    width: 12px;
    height: 12px;
  }

  .main[data-page="question"] .choice-key,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-key {
    font-size: calc(9.5px * var(--study-text-scale, 1));
    padding: 1px 5px;
  }
  .main[data-page="question"] .feedback,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .feedback {
    margin-top: 10px;
    padding: 8px 14px;
    gap: 10px;
    border-radius: 12px;
  }
  .main[data-page="question"] .feedback svg,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .feedback svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
  }

  .main[data-page="question"] .quiz-actions,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-actions {
    margin-top: 10px;
    padding-top: 10px;
    gap: 8px;
  }
  .main[data-page="question"] .quiz-actions .button,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-actions .button {
    min-height: 36px;
    padding: 6px 14px;
    font-size: calc(12px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .quiz-source,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-source {
    margin-top: 6px;
    font-size: calc(9.5px * var(--study-text-scale, 1));
    gap: 12px;
  }
  .main[data-page="question"] .quiz-side-explanation,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation {
    position: static;
    top: auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 14px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .main[data-page="question"] .quiz-side-explanation .explanation-head,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation .explanation-head {
    margin-bottom: 8px;
  }
  .main[data-page="question"] .quiz-side-explanation .explanation-badge,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation .explanation-badge {
    margin-bottom: 4px;
    font-size: calc(10.5px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .quiz-side-explanation h2,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation h2 {
    font-size: calc(14.5px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .explanation-para,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .explanation-para {
    font-size: calc(12.5px * var(--study-text-scale, 1));
    line-height: 1.75;
    margin: 0 0 8px;
  }
  .main[data-page="question"] .explanation-para.explanation-verdict,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .explanation-para.explanation-verdict {
    margin-top: 8px;
    padding: 6px 10px;
  }
  .main[data-page="question"] .choice-reasons-list,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reasons-list {
    margin-top: 10px;
    gap: 8px;
  }
  .main[data-page="question"] .choice-reason,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reason {
    padding: 8px 11px;
  }
  .main[data-page="question"] .choice-reason-head,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reason-head {
    margin-bottom: 4px;
    gap: 6px;
  }
  .main[data-page="question"] .choice-reason-head strong,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reason-head strong {
    font-size: calc(12px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .choice-reason-para,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reason-para {
    font-size: calc(12px * var(--study-text-scale, 1));
    line-height: 1.65;
    padding: 0;
    margin: 3px 0 0;
  }
  .main[data-page="question"] .choice-reason-para + .choice-reason-para,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .choice-reason-para + .choice-reason-para {
    margin-top: 4px;
  }
  .main[data-page="question"] .quiz-side-explanation .source-details,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation .source-details {
    margin-top: 8px;
    padding-top: 6px;
    font-size: calc(11px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .quiz-side-explanation .source-note,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .quiz-side-explanation .source-note {
    margin-top: 4px;
    font-size: calc(10px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .explanation-placeholder,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .explanation-placeholder {
    position: static;
    top: auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 16px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .main[data-page="question"] .explanation-placeholder h2,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .explanation-placeholder h2 {
    font-size: calc(14px * var(--study-text-scale, 1));
  }
  .main[data-page="question"] .explanation-placeholder p,
  .main:is([data-page="full"],[data-page="afternoon-quiz"]) .explanation-placeholder p {
    font-size: calc(12px * var(--study-text-scale, 1));
    line-height: 1.65;
  }

}
@media (max-width: 960px) {
  .quiz-layout {
    max-width: 850px;
  }
  .quiz-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .explanation-placeholder {
    display: none;
  }
  .quiz-side-explanation {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding: 24px 20px;
  }
  .term-list-head {
    display: none;
  }
  .term-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }
  .term-row-actions {
    justify-content: flex-start;
    padding-top: 4px;
    border-top: 1px dashed var(--line);
    margin-top: 4px;
  }
}

@media(max-width:620px){
  .choice-eliminate{width:36px}
  .feedback{flex-wrap:wrap}

  .module-stat-row{flex-direction:column;align-items:stretch;gap:10px}
  .module-stat-row .button{width:100%}
}

/* ==========================================================================
   25-Question Set Result & Donut Chart
   ========================================================================== */
.set-result-summary {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  margin: 16px 0 24px;
}

.donut-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.donut-chart {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.donut-center {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.donut-rate {
  font-size: calc(32px * var(--study-text-scale, 1));
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.donut-rate small {
  font-size: calc(16px * var(--study-text-scale, 1));
  font-weight: 500;
  margin-left: 2px;
  color: var(--muted);
}

.donut-sub {
  font-size: calc(11px * var(--study-text-scale, 1));
  color: var(--muted);
  margin-top: 4px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  width: 100%;
}

.donut-legend .legend-item {
  display: flex;
  align-items: center;
  font-size: calc(12px * var(--study-text-scale, 1));
  color: var(--ink-secondary);
}

.donut-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
  flex-shrink: 0;
}

.donut-legend .legend-dot.correct {
  background: var(--accent);
}

.donut-legend .legend-dot.wrong {
  background: var(--bad);
}

.donut-legend .legend-dot.unanswered {
  background: var(--line);
}

.donut-legend .legend-item strong {
  margin-left: auto;
  font-weight: 600;
  color: var(--ink);
}

.set-benchmark-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.benchmark-status {
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fbfcfb;
}

.benchmark-status.passed {
  background: #edf8f2;
  border-color: #9cd4ba;
}

.benchmark-status.failed {
  background: #fdf2f0;
  border-color: #f1b3ab;
}

.benchmark-status.in-progress {
  background: #f4f6f8;
  border-color: #d2d8df;
}

.benchmark-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.benchmark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.benchmark-status.passed .benchmark-icon {
  color: var(--accent);
}

.benchmark-status.failed .benchmark-icon {
  color: var(--bad);
}

.benchmark-status.in-progress .benchmark-icon {
  color: var(--muted);
}

.benchmark-header h3 {
  margin: 0;
  font-size: calc(17px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--ink);
}

.benchmark-desc {
  margin: 4px 0 0;
  font-size: calc(13px * var(--study-text-scale, 1));
  line-height: 1.5;
  color: var(--ink-secondary);
}

.benchmark-bar-wrap {
  margin-top: 14px;
}

.benchmark-labels {
  display: flex;
  justify-content: space-between;
  font-size: calc(12px * var(--study-text-scale, 1));
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.benchmark-target {
  color: var(--muted);
  font-weight: 500;
}

.benchmark-bar-track {
  position: relative;
  height: 12px;
  background: #e2e8e4;
  border-radius: 6px;
  overflow: visible;
}

.benchmark-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.benchmark-bar-fill.pass {
  background: linear-gradient(90deg, #3aa876, #238656);
}

.benchmark-bar-fill.fail {
  background: linear-gradient(90deg, #e57373, #d32f2f);
}

.benchmark-target-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #1e293b;
  border-radius: 1px;
  z-index: 2;
}

.benchmark-target-line::after {
  content: '60%';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(10px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--muted);
}

.result-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.set-result-tabs {
  margin-left: auto;
}

.set-result-row {
  grid-template-columns: 76px minmax(0, 1fr) auto 18px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.set-result-row .status-icon {
  font-size: calc(12px * var(--study-text-scale, 1));
  font-weight: 600;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.set-result-row .status-icon.correct {
  background: #edf8f2;
  color: #1e7049;
  border: 1px solid #c2e5d3;
}

.set-result-row .status-icon.incorrect {
  background: #fdf2f0;
  color: #b3392e;
  border: 1px solid #f6c8c3;
}

@media (max-width: 768px) {
  .set-result-summary {
    grid-template-columns: 1fr;
  }
  .donut-card {
    flex-direction: row;
    gap: 24px;
    text-align: left;
  }
  .donut-legend {
    margin-top: 0;
  }
}

/* ==========================================================================
   Practice Page Navigation & Modes
   ========================================================================== */
.practice-resume-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: #fbfbf4;
  border: 1px solid #e2ddc4;
  border-left: 5px solid var(--gold);
  border-radius: var(--radius-lg, 14px);
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.resume-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f4ecce;
  color: #8b6b1b;
  flex-shrink: 0;
}

.resume-content {
  flex: 1;
  min-width: 0;
}

.resume-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.resume-tag {
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eedfa9;
  color: #634b09;
}

.resume-header h3 {
  margin: 0;
  font-size: calc(16px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--ink);
}

.resume-desc {
  margin: 0;
  font-size: calc(13px * var(--study-text-scale, 1));
  color: var(--ink-secondary);
}

.resume-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Practice Modes Grid */
.practice-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.practice-mode-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.practice-mode-card:hover {
  border-color: #9cd4ba;
  box-shadow: 0 3px 8px rgba(36, 107, 93, 0.08);
}

.practice-mode-card.frequent-mode {
  border-color: #f6deb4;
  background: #fdfcf9;
}

.practice-mode-card.frequent-mode:hover {
  border-color: #d98e1f;
  box-shadow: 0 3px 8px rgba(201, 126, 22, 0.12);
}

.practice-mode-card.has-review {
  border-color: #f1b3ab;
  background: #fdfaf9;
}

.practice-mode-card.has-review:hover {
  border-color: var(--bad);
}

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef5e7;
  color: var(--accent);
}

.mode-icon.frequent {
  background: #fef7ea;
  color: #c97e16;
}

.mode-icon.review {
  background: #fdf0ee;
  color: var(--bad);
}

.mode-icon.unanswered {
  background: #ebf5fa;
  color: #2b7a9e;
}

.mode-icon.exam {
  background: #f6edf8;
  color: #7b438e;
}

.mode-meta {
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 600;
  color: var(--muted);
}

.mode-badge {
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f0f3ee;
  color: var(--ink-secondary);
}

.mode-badge.bad {
  background: #fce8e6;
  color: var(--bad);
}

.practice-mode-card h3 {
  margin: 0 0 6px;
  font-size: calc(16px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--ink);
}

.practice-mode-card p {
  margin: 0;
  font-size: calc(12px * var(--study-text-scale, 1));
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}

.mode-action {
  margin-top: 16px;
}

.mode-action .button {
  width: 100%;
  justify-content: center;
  font-size: calc(12px * var(--study-text-scale, 1));
}

/* Practice Top Tabs */
.practice-top-tabs {
  margin: 0 0 24px;
}

.practice-top-tabs .tabs {
  margin: 0;
  display: inline-flex;
}

/* Practice Modes Footer (Navigation to Exam / Single) */
.practice-modes-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.modes-footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modes-footer-card:hover {
  border-color: #9cd4ba;
  box-shadow: 0 2px 6px rgba(36, 107, 93, 0.08);
}

.modes-footer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.modes-footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modes-footer-title strong {
  font-size: calc(14px * var(--study-text-scale, 1));
  font-weight: 700;
  color: var(--ink);
}

.modes-footer-title .mode-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.modes-footer-title .mode-icon svg {
  width: 14px;
  height: 14px;
}

.modes-footer-title .mode-icon.search-icon {
  background: #f0f4f8;
  color: #3b6998;
}

.modes-footer-info p {
  margin: 0;
  font-size: calc(12px * var(--study-text-scale, 1));
  color: var(--muted);
  line-height: 1.5;
}

.modes-footer-card .button {
  flex-shrink: 0;
  font-size: calc(12px * var(--study-text-scale, 1));
  white-space: nowrap;
}

/* Status Chips */
.practice-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.practice-status-chips .chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: calc(12px * var(--study-text-scale, 1));
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.practice-status-chips .chip:hover {
  background: #f6f9f0;
  border-color: var(--accent);
}

.practice-status-chips .chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(46, 125, 90, 0.2);
}

/* Practice Toolbar */
.practice-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px 180px;
  gap: 16px;
  margin-bottom: 20px;
}

.mode-badge.gold {
  background: #fef3c7;
  color: #92400e;
}

/* Frequency Badges & Information Box */
.freq-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: calc(10px * var(--study-text-scale, 1));
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  line-height: 1.3;
  vertical-align: middle;
}
.freq-badge svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}
.freq-badge.freq-4 {
  background: #fef3c7;
  color: #854d0e;
  border-color: #f59e0b;
}
.freq-badge.freq-3 {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fb923c;
}
.freq-badge.freq-2 {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.question-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.question-head-meta small {
  margin: 0;
}
.question-freq-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: calc(11px * var(--study-text-scale, 1));
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.question-freq-tag svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}
.question-freq-tag.freq-4 {
  background: #fef3c7;
  color: #854d0e;
  border-color: #f59e0b;
}
.question-freq-tag.freq-3 {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fb923c;
}
.question-freq-tag.freq-2 {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.explanation-freq-box {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fdfaf3;
  border: 1px solid #f6deb4;
}
.freq-box-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(13px * var(--study-text-scale, 1));
  font-weight: 700;
  color: #92400e;
  margin-bottom: 6px;
}
.freq-box-head svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.freq-box-desc {
  margin: 0 0 10px;
  font-size: calc(11px * var(--study-text-scale, 1));
  color: var(--muted);
  line-height: 1.6;
}
.freq-box-occurrences {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.freq-occurrence-chip {
  font-size: calc(11px * var(--study-text-scale, 1));
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #ebd0a0;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.freq-occurrence-chip:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}
.freq-occurrence-chip.current {
  background: #fef3c7;
  border-color: #f59e0b;
  font-weight: 700;
  color: #92400e;
}

/* Exam Cards */
.exam-intro-box {
  background: #f9fbf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: calc(13px * var(--study-text-scale, 1));
  color: var(--ink-secondary);
  line-height: 1.6;
}

.exam-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 12px);
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease;
}

.exam-card:hover {
  border-color: var(--accent);
}

.exam-card.is-active {
  border-color: #9cd4ba;
  background: #fbfdfb;
}

.exam-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exam-card-info strong {
  display: block;
  font-size: calc(15px * var(--study-text-scale, 1));
  color: var(--ink);
  font-weight: 700;
}

.exam-card-info small {
  display: block;
  font-size: calc(12px * var(--study-text-scale, 1));
  color: var(--muted);
  margin-top: 3px;
}

.exam-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .practice-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .practice-resume-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .resume-actions {
    width: 100%;
    margin-top: 10px;
  }
  .resume-actions .button {
    flex: 1;
    justify-content: center;
  }
  .practice-modes-grid {
    grid-template-columns: 1fr;
  }
  .practice-modes-footer {
    grid-template-columns: 1fr;
  }
  .modes-footer-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .modes-footer-card .button {
    width: 100%;
    justify-content: center;
  }
  .practice-toolbar {
    grid-template-columns: 1fr;
  }
  .exam-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .exam-card-actions {
    justify-content: flex-end;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121916;
    --surface: #1a2420;
    --ink: #e5ece8;
    --muted: #98a8a0;
    --line: #2b3933;
    --accent: #63b592;
    --accent-soft: #1f352c;
    --gold: #d6a95c;
    --bad: #e5857b;
    --bad-soft: #38201e;
  }
  ::selection { background: #294c3c; color: #eef5f0; }
  .topbar, .sidebar, .article, .reading .article, .question-card, .list-panel, .term-card, .settings-panel, .history-list, .empty, .side-box, .study-path, .stats, .toolbar, .lecture-catalog, #image-dialog, #keyboard-dialog, .lecture-page .lecture-neighbors, .lecture-page .lecture-notes, .lecture-page .lecture-panel-dialog, .lecture-page .lecture-panel-dialog.lecture-notes, .lecture-page .listen-deck, .lecture-page .listen-card, .mobile-nav, .quiz-side-explanation, .explanation-placeholder {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
  }
  .module-head, .list-column-head, .reading .diagram, .diagram, .flash-card {
    background: #16201c;
    border-color: var(--line);
  }
  .button, .icon-button, .field input, .field select, .lecture-search, .lecture-filters select, .lecture-setting-fields select, .full-progress button, .term-pill, .module-count, kbd {
    background: #1f2b26;
    color: var(--ink);
    border-color: var(--line);
  }
  .button.primary {
    background: #2f7a5b;
    border-color: #2f7a5b;
    color: #fff;
  }
  .button.primary:hover:enabled {
    background: #398c69;
    border-color: #398c69;
  }
  .button:hover:enabled, .lesson-row:hover, .question-row:hover, .history-row:hover, .study-path:hover {
    background: #22312a;
    border-color: #3d5449;
  }
  .lesson-row, .question-row, .history-row, .key-list > div, .lecture-group {
    border-color: var(--line);
  }
  .reading .dialogue, .dialogue, .term-card .exam-note, .review-reminder {
    background: #17231e;
    border-color: #2f453a;
    color: var(--ink);
  }
  .reading .dialogue-answer, .diagram-node, .check-choice {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
  }
  .lesson-navigation {
    background: var(--surface);
  }
  .lesson-stages button:hover {
    background: #22312a;
    color: var(--accent);
  }
  .lesson-stages button.active {
    color: var(--accent);
  }
  .tabs, .learning-modes {
    background: #151e1a;
    border-color: var(--line);
  }
  .tabs .tab.active, .learning-modes a[aria-current] {
    background: var(--surface);
    color: var(--accent);
  }
  .choice {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
  }
  :root:not(.keyboard-mode) .choice:hover:not(:disabled):not(.selected) {
    background: #1c2823;
    border-color: #4a5f55;
  }
  .choice.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
  }
  .choice.selected.eliminated {
    background: rgba(199, 84, 80, 0.16);
    border-color: #9e5047;
  }
  .choice.is-correct, .reading .check-choice.correct, .reading .check-feedback {
    background: #1b3328;
    border-color: #468a6a;
    color: #cbead9;
  }
  .choice.is-incorrect, .reading .check-choice.incorrect, .reading .check-feedback.bad {
    background: var(--bad-soft);
    border-color: #9e5047;
    color: #f3c4be;
  }
  /* Keep official IPA figures and diagrams on a clean white canvas for legibility */
  .question-figure, .diagram-image {
    background: #ffffff;
    border-color: var(--line);
  }
  .hl-verdict {
    background: linear-gradient(transparent 55%, rgba(99, 181, 146, 0.25) 55%);
    color: var(--accent);
  }
  .hl-diff {
    background: linear-gradient(transparent 60%, rgba(229, 133, 123, 0.28) 60%);
    border-bottom-color: rgba(229, 133, 123, 0.7);
    color: #f0958b;
  }
  .hl-keyword {
    background: linear-gradient(transparent 55%, rgba(214, 169, 92, 0.25) 55%);
    border-bottom-color: rgba(214, 169, 92, 0.7);
    color: var(--ink);
  }
  .choice-reason {
    background: #141c18;
    border-color: var(--line);
  }
  .choice-reason.is-correct {
    background: #172820;
    border-color: var(--line);
    border-left-color: var(--accent);
  }
  .benchmark-status {
    background: #141c18;
    border-color: var(--line);
  }
  .benchmark-status.passed {
    background: #14271e;
    border-color: #29593e;
  }
  .benchmark-status.failed {
    background: #2a1918;
    border-color: #5d2b27;
  }
  .benchmark-status.in-progress {
    background: #18201d;
    border-color: #2e3a35;
  }
  .benchmark-icon {
    background: #1e2823;
  }
  .benchmark-bar-track {
    background: #23302a;
  }
  .benchmark-target-line {
    background: #e0e6e2;
  }
  .set-result-row .status-icon.correct {
    background: #172d22;
    color: #63b592;
    border-color: #29593e;
  }
  .set-result-row .status-icon.incorrect {
    background: #2f1a18;
    color: #e5857b;
    border-color: #5d2b27;
  }
  .practice-resume-card {
    background: #252014;
    border-color: #544520;
    border-left-color: var(--gold);
  }
  .resume-icon-badge {
    background: #362e18;
    color: #e2ba5d;
  }
  .resume-tag {
    background: #4a3e1b;
    color: #ecd79c;
  }
  .practice-mode-card.has-review {
    background: #261a19;
    border-color: #5a2825;
  }
  .mode-icon {
    background: #172a22;
  }
  .mode-icon.review {
    background: #2d1b1a;
  }
  .mode-icon.unanswered {
    background: #172733;
    color: #63b3db;
  }
  .mode-icon.exam {
    background: #26182e;
    color: #c98de0;
  }
  .mode-badge {
    background: #23302a;
    color: var(--ink);
  }
  .mode-badge.bad {
    background: #3d1c1a;
    color: var(--bad);
  }
  .practice-status-chips .chip {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
  }
  .practice-status-chips .chip:hover {
    background: #22312a;
    border-color: var(--accent);
  }
  .practice-status-chips .chip.active {
    background: var(--accent);
    color: #121916;
  }
  .exam-intro-box {
    background: #151e1a;
    border-color: var(--line);
  }
  .exam-card.is-active {
    background: #172520;
    border-color: #2b5442;
  }
  .mode-icon.frequent {
    background: #2d2416;
    color: #f59e0b;
  }
  .practice-mode-card.frequent-mode {
    background: #1c1813;
    border-color: #4a3b22;
  }
  .practice-mode-card.frequent-mode:hover {
    border-color: #d98e1f;
  }
  .mode-badge.gold {
    background: #332612;
    color: #fbbf24;
  }
  .freq-badge {
    background: #2a2012;
    color: #fcd34d;
    border-color: #614a22;
  }
  .freq-badge.freq-2 {
    background: #13281c;
    color: #86efac;
    border-color: #275238;
  }
  .question-freq-tag {
    background: #2a2012;
    color: #fcd34d;
    border-color: #614a22;
  }
  .question-freq-tag.freq-2 {
    background: #13281c;
    color: #86efac;
    border-color: #275238;
  }
  .explanation-freq-box {
    background: #1b1713;
    border-color: #443522;
  }
  .freq-box-head {
    color: #fcd34d;
  }
  .freq-occurrence-chip {
    background: #241f1a;
    border-color: #443725;
    color: var(--ink);
  }
  .freq-occurrence-chip:hover, .freq-occurrence-chip.current {
    background: #332717;
    border-color: #856123;
    color: #fcd34d;
  }
}

/* 直前対策 */
.cram-entry { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 20px; border: 1px solid var(--accent); border-radius: var(--radius-lg, 12px); background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.cram-entry:hover { border-color: var(--ink); }
.cram-entry-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cram-entry-body strong { font-size: calc(16px * var(--study-text-scale, 1)); }
.cram-entry-body span { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); }
.cram-entry .path-action { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cram-entry svg { width: 18px; height: 18px; }

.cram-actions { flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; justify-content: flex-start; }
.cram-note { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); line-height: 1.8; }
.cram-points { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 12px; }
.cram-points strong { font-size: calc(34px * var(--study-text-scale, 1)); line-height: 1; color: var(--ink); }
.cram-points small { color: var(--muted); }
.cram-points span { margin-left: auto; font-size: calc(13px * var(--study-text-scale, 1)); color: var(--bad); font-weight: 600; }
.cram-points span.is-reached { color: var(--accent); }
.cram-bar { position: relative; height: 10px; border-radius: 5px; background: var(--line); margin-bottom: 10px; }
.cram-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--accent); }
.cram-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.cram-bins .stat-foot { font-size: calc(11px * var(--study-text-scale, 1)); }
.cram-bin-solid .stat-value { color: var(--accent); }
.cram-bin-weak .stat-value { color: var(--bad); }
.cram-rounds { list-style: none; margin: 0; padding: 0; }
.cram-rounds li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: calc(13px * var(--study-text-scale, 1)); }
.cram-rounds li:first-child { border-top: 0; }
.cram-rounds small { color: var(--muted); margin-left: auto; }
.cram-confidence { margin-top: 16px; padding: 16px; border: 1px solid var(--accent); border-radius: var(--radius-lg, 12px); background: var(--accent-soft); }
.cram-confidence p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 12px; font-size: calc(14px * var(--study-text-scale, 1)); }
.cram-confidence p span { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); }

.cram-analysis h3 { font-size: calc(14px * var(--study-text-scale, 1)); margin: 18px 0 8px; }
.cram-summary { font-size: calc(15px * var(--study-text-scale, 1)); line-height: 1.9; }
.cram-focus { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius, 8px); background: var(--accent-soft); font-size: calc(14px * var(--study-text-scale, 1)); line-height: 1.8; }
.cram-focus strong { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--accent); }
.cram-topics { list-style: none; margin: 0; padding: 0; }
.cram-topics li { padding: 12px 0; border-top: 1px solid var(--line); }
.cram-topics li:first-child { border-top: 0; }
.cram-topics p { margin: 4px 0 8px; font-size: calc(14px * var(--study-text-scale, 1)); line-height: 1.8; }
.cram-analyzing { font-size: calc(14px * var(--study-text-scale, 1)); color: var(--muted); }
.cram-analyzing::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: cram-pulse 1.2s ease-in-out infinite; }
@keyframes cram-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .cram-analyzing::before { animation: none; } }
@media (max-width: 480px) { .cram-points span { margin-left: 0; width: 100%; } .cram-rounds small { margin-left: 0; width: 100%; } }
.cram-bins { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 24px; }
@media (max-width: 620px) { .cram-bins { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cram-bins .stat:nth-child(3) { border-left: 0; } .cram-bins .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
.quiz-actions[hidden] { display: none; }

/* 答え合わせの結果を選択肢のすぐ下にまとめる */
.verdict { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 16px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-soft); }
.verdict:focus { outline: none; }
.verdict.bad { border-color: var(--bad); background: var(--bad-soft); }
.verdict > svg { width: 22px; height: 22px; color: var(--accent); }
.verdict.bad > svg { color: var(--bad); }
.verdict-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.verdict-text strong { font-size: calc(17px * var(--study-text-scale, 1)); line-height: 1.5; color: var(--accent); }
.verdict.bad .verdict-text strong { color: var(--bad); }
.verdict-text span { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); }
.verdict-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.verdict-actions .button { min-height: 44px; }
.verdict-actions kbd, .quiz-actions kbd { font-size: calc(11px * var(--study-text-scale, 1)); padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .7; }
.verdict-ask { font-size: calc(13px * var(--study-text-scale, 1)); color: var(--muted); }
.verdict-jump { display: none; width: 100%; justify-content: flex-end; font-size: calc(12px * var(--study-text-scale, 1)); }
@media (max-width: 960px) { .verdict-jump { display: inline-flex; } }
@media (max-width: 620px) { .verdict-actions { width: 100%; margin-left: 0; } .verdict-actions .button { flex: 1; } }
.quiz-actions-main { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.choice-reason.is-chosen { border-color: var(--bad); }
.choice-reasons-rest { display: contents; }
.explanation-placeholder { padding: 20px 22px; }
.explanation-placeholder p { font-size: calc(13px * var(--study-text-scale, 1)); color: var(--muted); }
.explanation-placeholder .key-line { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: calc(12px * var(--study-text-scale, 1)); }
.explanation-placeholder kbd { font-size: calc(11px * var(--study-text-scale, 1)); padding: 0 5px; margin-right: 2px; border: 1px solid var(--line); border-radius: 4px; }
.calc-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: calc(13px * var(--study-text-scale, 1)); cursor: pointer; }
.calc-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.calc-toggle small { margin-left: 6px; color: var(--muted); }
.practice-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; margin: -8px 0 12px; }
.calc-field { flex: 0 0 auto; min-width: 0; align-self: end; }
@media (pointer: coarse) { .keyboard-hints, .explanation-placeholder .key-line, .choice-key, .verdict-actions kbd, .quiz-actions kbd { display: none; } }

/* 解説への追い質問 */
.ask-box { margin-top: 20px; padding: 16px; border: var(--region-border); border-radius: 10px; background: var(--region-background); box-shadow: 0 1px 3px var(--region-shadow); }
.ask-box h3 { font-size: calc(14px * var(--study-text-scale, 1)); margin-bottom: 10px; }
.ask-entry { padding: 10px 0; border-top: 1px solid var(--line); }
.ask-entry:first-child { border-top: 0; padding-top: 0; }
.ask-history { margin: 0 0 10px; }
.ask-history > summary { cursor: pointer; color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); font-weight: 600; }
.ask-history[open] > div { margin-top: 12px; }
.ask-q { font-size: calc(13px * var(--study-text-scale, 1)); font-weight: 600; color: var(--accent); }
.ask-a { margin-top: 6px; font-size: calc(14px * var(--study-text-scale, 1)); line-height: 1.9; overflow-wrap: anywhere; }
.ask-a p + p, .ask-a p + ul, .ask-a ul + p { margin-top: 10px; }
.ask-a ul { margin: 10px 0 0; padding-left: 1.2em; }
.ask-a li + li { margin-top: 4px; }
.ask-a .ask-tip { padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); }
.ask-a.pending { color: var(--muted); }
.ask-a.pending::after { content: '…'; animation: cram-pulse 1.2s ease-in-out infinite; }
.ask-a.error { color: var(--bad); }
.ask-status { margin-top: 8px; font-size: calc(12px * var(--study-text-scale, 1)); line-height: 1.8; color: var(--muted); }
.ask-status.error, .ask-error { color: var(--bad); }
.ask-retry { margin-top: 8px; }
.ask-entry .ask-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.ask-chips[hidden] { display: none; }
.ask-chips .term-pill { font-size: calc(12px * var(--study-text-scale, 1)); padding: 5px 10px; min-height: 32px; cursor: pointer; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.ask-form textarea { flex: 1; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: calc(14px * var(--study-text-scale, 1)); resize: vertical; }
.ask-form .button { flex-shrink: 0; }
.ask-form-hint, .ask-hint { margin-top: 7px; color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); line-height: 1.7; }
.ask-box .cram-note { margin-top: 8px; font-size: calc(12px * var(--study-text-scale, 1)); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .ask-a.pending::after { animation: none; } }
.cram-bin-parked .stat-value { color: var(--muted); }
@media (max-width: 620px) { .cram-bins .stat:nth-child(odd) { border-left: 0; } .cram-bins .stat:nth-child(n+3) { border-top: 1px solid var(--line); } .cram-bins .stat:nth-child(3) { border-left: 0; } .cram-bins .stat:nth-child(4) { border-left: 1px solid var(--line); } }

/* 得点の目安の推移 */
.cram-trend ol { list-style: none; margin: 8px 0 0; padding: 0; }
.cram-trend li { display: grid; grid-template-columns: 56px 1fr 40px 40px; align-items: center; gap: 10px; padding: 6px 0; font-size: calc(13px * var(--study-text-scale, 1)); }
.cram-trend .cram-bar { margin: 0; height: 8px; }
.cram-trend strong { text-align: right; font-variant-numeric: tabular-nums; }
.cram-trend small { font-variant-numeric: tabular-nums; color: var(--muted); }
.cram-trend small.up { color: var(--accent); }
.cram-trend small.down { color: var(--bad); }
.cram-trend-label { color: var(--muted); }
.cram-notes-link { margin-top: 14px; }
/* 復習ノート */
.notes-section h2 { font-size: calc(16px * var(--study-text-scale, 1)); }
.notes-summary { font-size: calc(14px * var(--study-text-scale, 1)) !important; line-height: 1.9; color: var(--ink) !important; margin-top: 6px; }
.notes-section ul { margin: 10px 0 0; padding-left: 1.2em; font-size: calc(14px * var(--study-text-scale, 1)); line-height: 1.9; }
.notes-section li + li { margin-top: 4px; }
.notes-tip { margin-top: 12px; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); font-size: calc(14px * var(--study-text-scale, 1)) !important; color: var(--ink) !important; }
.notes-questions { margin-top: 12px; }
.notes-questions .term-pill small { margin-left: 6px; color: var(--muted); font-size: calc(10px * var(--study-text-scale, 1)); }
@media print { .notes-section { break-inside: avoid; } }

/* 解いた問題の内訳 */
.answer-donut-body { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.answer-donut svg { width: 150px; height: 150px; flex-shrink: 0; }
.answer-donut circle { fill: none; stroke-width: 14; }
.answer-donut circle:hover { stroke-width: 17; }
.donut-correct { stroke: var(--accent); background: var(--accent); }
.donut-wrong { stroke: var(--bad); background: var(--bad); }
.donut-rest { stroke: var(--line); background: var(--line); }
.donut-value { font-size: calc(20px * var(--study-text-scale, 1)); font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.donut-label { font-size: calc(9px * var(--study-text-scale, 1)); fill: var(--muted); }
.answer-donut ul { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.answer-donut li { display: grid; grid-template-columns: 12px 1fr auto 52px; align-items: baseline; gap: 10px; padding: 6px 0; font-size: calc(14px * var(--study-text-scale, 1)); border-top: 1px solid var(--line); }
.answer-donut li:first-child { border-top: 0; }
.answer-donut li strong { font-variant-numeric: tabular-nums; }
.answer-donut li strong small { margin-left: 2px; color: var(--muted); font-weight: 400; }
.answer-donut li > small { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.donut-swatch { width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.donut-rest.donut-swatch { outline: 1px solid var(--muted); outline-offset: -1px; }

/* 結果画面は得点と問題を順に表示 */
.cram-result-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.cram-result-layout .settings-panel:first-child { margin-top: 0; }
.cram-result-side { position: sticky; top: 84px; max-height: calc(100dvh - 104px); overflow-y: auto; overscroll-behavior: contain; }
.cram-result-side .settings-panel:first-child { margin-top: 0; }
.cram-actions .button kbd { font-size: calc(11px * var(--study-text-scale, 1)); padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .7; }
@media (max-width: 960px) { .cram-result-layout { grid-template-columns: 1fr; } .cram-result-side { position: static; max-height: none; overflow: visible; } }
@media (pointer: coarse) { .cram-actions .button kbd { display: none; } }

/* 得点の目安の目盛 60〜80% */
.cram-estimate .cram-bar { margin-bottom: 4px; }
.cram-ticks { position: relative; height: 26px; margin-bottom: 6px; }
.cram-ticks span { position: absolute; top: 0; transform: translateX(-50%); padding-top: 8px; font-size: calc(11px * var(--study-text-scale, 1)); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cram-ticks span::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 6px; background: var(--muted); }
.cram-ticks span.is-passed { color: var(--accent); font-weight: 600; }
.cram-ticks span.is-passed::before { background: var(--accent); }
@media (max-width: 480px) { .cram-ticks span { font-size: calc(10px * var(--study-text-scale, 1)); } }
@media (max-width: 620px) {
  .cram-ticks span.is-minor { color: transparent; }
  .cram-actions .button { flex: 1 1 100%; }
  .cram-actions .calc-toggle { width: 100%; }
}
.explanation-study-diagram { margin: 24px 0; }
.explanation-study-diagram button { display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.explanation-study-diagram img { display: block; width: 100%; height: auto; }
.explanation-study-diagram button span { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; color: var(--accent); font-size: calc(13px * var(--study-text-scale, 1)); }
.explanation-study-diagram figcaption { margin-top: 6px; color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); }
.q-row-title .q-repeat-years { flex-basis: 100%; color: var(--muted); }
.priority-list { list-style: none; margin: 20px 0; padding: 0; }
.priority-list li { margin: 0; }
.priority-order { min-width: 2em; color: var(--accent); font-weight: 700; }

.priority-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.priority-parts .settings-panel { margin: 0; }

/* 直前演習は次の操作を先に置き 初回の結果と復習の記録を分ける */
.priority-page,.cram-page { max-width: 1040px; margin: 0 auto; }
.priority-page .quiz-top { margin-bottom: 18px; }
.priority-page .page-head,.cram-page .page-head { margin-bottom: 22px; }
.study-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.study-actions .text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.study-actions svg,.priority-part .button svg,.priority-list .history-row>svg { width: 16px; height: 16px; }
.study-tag { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: calc(11px * var(--study-text-scale, 1)); font-weight: 600; line-height: 1.8; white-space: nowrap; }
.study-meter { height: 5px; border-radius: 9px; background: var(--line); overflow: hidden; }
.study-meter>span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.priority-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px; margin-bottom: 20px; }
.priority-summary dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin: 0 0 18px; }
.priority-summary dl>div+div { border-left: 1px solid var(--line); padding-left: 24px; }
.priority-summary dt { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); }
.priority-summary dd { margin: 4px 0 0; font-size: calc(28px * var(--study-text-scale, 1)); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.6; }
.priority-summary dd small { font-size: calc(12px * var(--study-text-scale, 1)); font-weight: 400; color: var(--muted); }
.priority-continue { display: flex; align-items: center; gap: 16px; margin: 20px 0; }
.priority-continue>span { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); }
.priority-review-callout { display: flex; gap: 14px; align-items: center; padding: 18px 20px; margin: 20px 0 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.priority-review-callout.is-complete { background: var(--accent-soft); border-color: transparent; }
.priority-review-copy { flex: 1; min-width: 0; }
.priority-review-copy h2 { font-size: calc(14px * var(--study-text-scale, 1)); }
.priority-review-copy p { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); margin-top: 3px; line-height: 1.7; }
.entry-icon { display: inline-flex; color: var(--accent); flex-shrink: 0; }
.entry-icon svg { width: 21px; height: 21px; }
.priority-parts { display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.priority-part { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; gap: 28px; align-items: center; padding: 18px 22px; }
.priority-part+.priority-part { border-top: 1px solid var(--line); }
.priority-part-name h2 { font-size: calc(15px * var(--study-text-scale, 1)); }
.priority-part-name>span { color: var(--muted); font-size: calc(11px * var(--study-text-scale, 1)); }
.priority-part-progress p { display: flex; justify-content: space-between; gap: 10px; font-size: calc(12px * var(--study-text-scale, 1)); margin-bottom: 9px; }
.priority-part-progress p>span { color: var(--muted); font-variant-numeric: tabular-nums; }
.priority-dots { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: 4px; }
.priority-dots>span { height: 5px; border-radius: 3px; background: var(--line); }
.priority-dots .is-correct,.legend-correct { background: var(--accent); }
.priority-dots .is-wrong,.legend-wrong { background: var(--bad); }
.legend-new { background: var(--line); }
.priority-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 12px; }
.priority-legend>span { width: 7px; height: 7px; border-radius: 2px; }
.priority-legend>span:not(:first-child) { margin-left: 10px; }
.priority-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.priority-list .history-row { border-radius: 0; background: transparent; }
.priority-list .history-row>span:nth-child(2) { flex: 1; min-width: 0; }
.priority-list .history-row>svg { color: var(--muted); }
.priority-round-progress { padding: 18px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 20px 0; }
.priority-round-progress p { display: flex; gap: 5px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; font-size: calc(13px * var(--study-text-scale, 1)); }
.priority-round-progress p>span { color: var(--muted); margin-left: auto; font-size: calc(12px * var(--study-text-scale, 1)); }
.priority-detail-actions { margin-bottom: 20px; }
.priority-entry { margin: 0 0 20px; padding: 15px 18px; background: var(--surface); border-color: var(--line); }
.priority-entry.is-complete { border-color: var(--line); }
.priority-entry .cram-entry-body strong { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: calc(14px * var(--study-text-scale, 1)); }
.priority-entry .cram-entry-body>span { font-size: calc(12px * var(--study-text-scale, 1)); }
.cram-session-panel { padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cram-session-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cram-session-heading>div { display: flex; align-items: center; gap: 12px; }
.cram-session-heading h2 { font-size: calc(17px * var(--study-text-scale, 1)); }
.cram-session-count { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cram-session-count strong { font-size: calc(21px * var(--study-text-scale, 1)); color: var(--ink); }
.cram-main-actions { margin: 20px 0 10px; }
.cram-options { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; padding: 18px 4px; margin-bottom: 4px; }
.cram-options>span { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); }
.cram-options .calc-toggle { min-height: 36px; }
.cram-summary-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin-bottom: 22px; }
.cram-summary-grid>.settings-panel { margin: 0; min-width: 0; }
.cram-summary-grid .cram-points { flex-wrap: wrap; gap: 5px 10px; }
.cram-summary-grid .cram-points>span { flex-basis: 100%; margin-left: 0; font-size: calc(12px * var(--study-text-scale, 1)); }
.study-details { border: 1px solid var(--line); border-radius: 10px; padding: 0 20px; background: var(--surface); margin-bottom: 18px; }
.study-details>summary { cursor: pointer; min-height: 54px; padding: 14px 0; color: var(--ink); font-size: calc(13px * var(--study-text-scale, 1)); font-weight: 600; }
.study-details[open]>summary { margin-bottom: 12px; }
.study-details .cram-bins { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); }
@media(max-width:700px) {
  .priority-summary { padding: 18px; }
  .priority-summary dl { gap: 12px; }
  .priority-summary dl>div+div { padding-left: 12px; }
  .priority-summary dd { font-size: calc(24px * var(--study-text-scale, 1)); }
  .priority-summary dd small { display: block; font-size: calc(11px * var(--study-text-scale, 1)); }
  .priority-part { grid-template-columns: 78px minmax(0,1fr) auto; gap: 14px; padding: 16px; }
  .priority-part .button { padding: 8px 11px; font-size: calc(11px * var(--study-text-scale, 1)); }
  .priority-part .button svg { display: none; }
  .priority-part-progress p { flex-direction: column; gap: 0; margin-bottom: 6px; font-size: calc(11px * var(--study-text-scale, 1)); }
  .priority-review-callout { flex-wrap: wrap; padding: 16px; gap: 10px; }
  .priority-review-callout .study-actions { flex-basis: 100%; }
  .priority-review-callout .study-actions .button.primary { flex: 1; }
  .priority-review-callout.is-complete .entry-icon { align-self: flex-start; padding-top: 3px; }
  .priority-review-callout.is-complete .study-actions { padding-left: 31px; }
  .priority-list .history-row { gap: 10px; padding: 16px; }
  .priority-list .history-row>svg { display: none; }
  .priority-round-progress { padding: 16px; }
  .cram-summary-grid { grid-template-columns: 1fr; gap: 16px; }
  .cram-session-panel { padding: 18px; }
  .cram-session-heading { align-items: flex-start; }
  .cram-session-heading>div { flex-direction: column; align-items: flex-start; gap: 5px; }
  .cram-main-actions .button.primary { flex-basis: 100%; }
  .cram-options { gap: 5px 18px; }
  .cram-options>span { flex-basis: 100%; }
  .priority-entry { gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
  .priority-entry .path-action { margin-left: 31px; }
}
@media(max-width:380px) {
  .priority-part { grid-template-columns: 60px minmax(0,1fr); gap: 10px; }
  .priority-part>.button { grid-column: 2; justify-self: start; }
  .priority-summary { padding: 14px; }
  .priority-summary dl { gap: 8px; }
  .priority-summary dl>div+div { padding-left: 8px; }
}
.cram-summary-grid .cram-ticks .is-minor { display: none; }
.mvp-paths { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media(max-width:620px) { .mvp-paths { grid-template-columns: 1fr; } }
/* MVPのホームは演習開始と間違い復習に絞る */
.topbar .sidebar-toggle[hidden] { display: none; }
.practice-home-actions { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; margin-bottom: 24px; }
.practice-home-actions>section { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.practice-home-actions h2 { font-size: calc(16px * var(--study-text-scale, 1)); }
.practice-home-actions p { font-size: calc(12px * var(--study-text-scale, 1)); color: var(--muted); margin-top: 5px; }
.practice-home-actions .button { margin-top: auto; }
.practice-home-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.practice-home-help { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); margin-top: 16px; line-height: 2; }
.practice-home-help kbd { margin: 0 3px; }
@media(max-width:620px) {
  .practice-home-actions { grid-template-columns: 1fr; gap: 12px; }
  .practice-home-actions>section { padding: 18px; }
  .practice-home-actions .button { width: 100%; }
}

/* Short sets: keep starting actions close to their progress and settings. */
@media (min-width: 900px) {
  .priority-page,.cram-page { max-width: 1000px; }
  .priority-page .page-head h1,.cram-page .page-head h1 { font-size: calc(24px * var(--study-text-scale, 1)); }
  .priority-page .page-head p,.cram-page .page-head p { font-size: calc(13px * var(--study-text-scale, 1)); }
  .cram-page .quiz-top { margin-bottom: 18px; }
  .priority-summary { padding: 14px 20px; margin-bottom: 18px; }
  .priority-summary dl { margin: 0; gap: 20px; }
  .priority-summary dd { font-size: calc(22px * var(--study-text-scale, 1)); line-height: 1.4; margin-top: 3px; }
  .priority-continue { margin: 18px 0; }
  .priority-legend { justify-content: flex-start; margin: 0 0 10px; }
  .priority-parts { border-radius: 8px; }
  .priority-part { width: 100%; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; grid-template-columns: 104px minmax(0,1fr) 150px; gap: 24px; padding: 20px; min-height: 86px; }
  .priority-part:hover { background: var(--accent-soft); }
  .priority-part:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
  .priority-part.is-next { background: color-mix(in srgb,var(--accent-soft) 50%,var(--surface)); }
  .priority-part-name { display: grid; gap: 3px; }
  .priority-part-name strong { font-size: calc(15px * var(--study-text-scale, 1)); }
  .priority-part-progress { display: grid; gap: 9px; max-width: 440px; }
  .priority-part-count { color: var(--muted); font-size: calc(12px * var(--study-text-scale, 1)); font-variant-numeric: tabular-nums; }
  .priority-part-action { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: calc(13px * var(--study-text-scale, 1)); color: var(--accent); }
  .priority-part-action svg { width: 16px; height: 16px; }
  .priority-part.is-next .priority-part-action { padding: 10px 12px; border-radius: 6px; background: var(--palette-primary,var(--accent)); color: #fff; justify-content: center; }
  .cram-session-panel { padding: 20px 24px; margin-bottom: 24px; }
  .cram-session-heading { margin-bottom: 8px; }
  .cram-options { padding: 8px 0; margin: 0; gap: 8px 22px; }
  .cram-session-panel>.study-meter { margin: 16px 0 10px; }
  .cram-main-actions { margin: 10px 0 8px; }
  .cram-summary-grid { align-items: start; }
  .cram-summary-grid.is-pending { grid-template-columns: 1fr; gap: 12px; }
  .cram-estimate-hint { color: var(--muted); font-size: calc(13px * var(--study-text-scale, 1)); margin: 0; }
  .cram-estimate-hint strong { color: var(--ink); }
  .cram-estimate-hint>span { margin-left: 12px; font-size: calc(12px * var(--study-text-scale, 1)); }
  .cram-summary-grid.is-pending .answer-donut-body { max-width: 580px; }
  .cram-summary-grid.is-pending .answer-donut-body>svg { max-width: 150px; }
}
