/* Keep both exercise entrances ahead of the detailed learning options. */
.text-size-control{display:flex;align-items:center;gap:7px;font-size:calc(12px * var(--study-text-scale, 1));white-space:nowrap;color:var(--muted)}
.text-size-control select{max-width:125px;padding:5px 7px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font-size:calc(12px * var(--study-text-scale, 1))}
.topbar .top-actions{display:flex;align-items:center;gap:12px}
.topbar{height:auto;min-height:64px;padding-block:12px;flex-wrap:wrap;gap:10px}
.study-home-start,.study-home-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.study-home-start{margin-bottom:28px}
.study-home-start>.study-home-morning,.study-home-start>.af-home-entry{display:flex;flex-direction:column;align-items:stretch;gap:16px;min-width:0;margin:0;padding:22px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.study-home-heading{display:flex;align-items:baseline;gap:12px}
.study-home-start .study-home-heading h2{font-size:calc(20px * var(--study-text-scale, 1));margin:0}
.study-home-heading>span{color:var(--muted);font-size:calc(13px * var(--study-text-scale, 1))}
.study-home-start .study-home-buttons,.study-home-start .af-home-buttons{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:12px 18px;margin:0;max-width:none}
.study-home-start .button{min-height:44px;font-size:calc(14px * var(--study-text-scale, 1));padding:8px 14px}
.study-home-start .text-link{font-size:calc(13px * var(--study-text-scale, 1))}
.study-home-start .learning-progress{margin-top:4px}
.study-home-start .learning-progress-label,.study-home-start .learning-progress-label strong span{font-size:calc(12px * var(--study-text-scale, 1))}
.study-home-start .learning-progress-label strong{font-size:calc(14px * var(--study-text-scale, 1))}
.study-home-start p.study-home-note{font-size:calc(12px * var(--study-text-scale, 1));line-height:1.7;color:var(--muted);margin:-8px 0 0}
.study-home-options{min-width:0}
.study-home-summary,.study-home-review,.af-home-progress{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 14px;padding:0 0 16px;font-size:calc(13px * var(--study-text-scale, 1));color:var(--muted);border-bottom:1px solid var(--line)}
.study-home-summary strong,.study-home-review strong{color:var(--ink);font-weight:600;margin-left:5px}
.study-home-summary .text-link{font-size:calc(12px * var(--study-text-scale, 1))}
.study-home-review{padding:14px 0;color:var(--ink)}
.study-home-review .button{font-size:calc(13px * var(--study-text-scale, 1));min-height:36px;padding:5px 12px}
.study-home-methods{display:grid;margin-top:8px}
.study-home-methods a{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;font-size:calc(14px * var(--study-text-scale, 1));text-decoration:none;border-bottom:1px solid var(--line)}
.study-home-methods a:hover{background:var(--accent-soft)}
.study-home-methods svg{width:16px;height:16px}
.study-home-options .priority-entry{margin:16px 0 0;padding:14px;gap:10px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);box-shadow:none}
.study-home-options .priority-entry .cram-entry-body{flex:1;min-width:140px}
.study-home-options .priority-entry .cram-entry-body strong{font-size:calc(14px * var(--study-text-scale, 1))}
.study-home-options .priority-entry .cram-entry-body>span{font-size:calc(12px * var(--study-text-scale, 1))}
.study-home-options .priority-entry .path-action{font-size:calc(12px * var(--study-text-scale, 1));margin-left:auto}
.af-home-progress{justify-content:flex-start;min-height:40px}
.af-home-progress a{font-size:calc(13px * var(--study-text-scale, 1));color:var(--muted);text-decoration:none}
.af-home-progress a:hover{color:var(--accent)}
.af-home-progress strong{font-weight:600;color:var(--ink);margin-left:4px}
.af-home-practice .section-head{margin:18px 0 10px;gap:8px;flex-wrap:wrap}
.af-home-practice h3{font-size:calc(14px * var(--study-text-scale, 1))}
.af-home-practice .section-head>span{font-size:calc(12px * var(--study-text-scale, 1));color:var(--muted)}
.af-home-practice .af-starter-list{grid-template-columns:1fr;gap:0;border-top:1px solid var(--line)}
.af-home-practice .af-starter-list>a{padding:12px 0;gap:12px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
.af-home-practice .af-starter-list>a:hover{background:var(--accent-soft)}
.af-home-practice .af-starter-list strong{font-size:calc(14px * var(--study-text-scale, 1))}
.af-home-practice .af-starter-list small{font-size:calc(12px * var(--study-text-scale, 1));display:block;margin:2px 0 0}
.af-home-practice .af-starter-list>a>span:nth-child(2){display:block}
.af-home-practice .af-status{display:none}
/* Narrow desktop windows keep the afternoon entrance above extra morning links. */
@media(max-width:1050px){
 .study-home-start,.study-home-details{grid-template-columns:1fr;gap:18px}
 .study-home-start>.study-home-morning,.study-home-start>.af-home-entry{padding:18px 20px;gap:12px}
 .study-home-start{margin-bottom:24px}
}
@media(min-width:900px){
 .layout[data-scope=study]{min-height:calc(100dvh - 64px)}
 .sidebar .study-side-nav{margin:0;padding:14px 9px;gap:8px}
 .sidebar .study-side-nav a{min-height:44px;padding:8px 12px}
 .sidebar .study-side-nav svg{width:20px;height:20px;flex:none}
 .sidebar-collapsed .study-side-nav a{padding:0}
 .study-side-note{padding:14px 20px;font-size:calc(9px * var(--study-text-scale, 1));line-height:1.8}
 .main[data-page=home],.main[data-page=terms]{padding:26px 30px 30px}
 .main[data-page=home]>.page-head>.page-head,.main[data-page=terms]>.page-head{margin-bottom:20px}
 .main[data-page=terms] .term-controls-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'filters filters' 'index view';gap:10px 16px;margin:0 0 8px}
 .main[data-page=terms] .term-toolbar{grid-area:filters;display:grid;grid-template-columns:minmax(180px,1.35fr) minmax(160px,1fr) minmax(150px,.85fr);gap:12px;margin:0;padding:13px 15px;border-radius:9px}
 .main[data-page=terms] .term-toolbar .field{min-width:0}
 .main[data-page=terms] .term-toolbar .field label{margin-bottom:4px;font-size:calc(10px * var(--study-text-scale, 1))}
 .main[data-page=terms] .term-toolbar input,.main[data-page=terms] .term-toolbar select{min-height:37px;padding:6px 9px;font-size:calc(11px * var(--study-text-scale, 1))}
 .main[data-page=terms] .term-initial-tabs{grid-area:index}
 .main[data-page=terms] .term-view-tabs{grid-area:view}
 .main[data-page=terms] .term-controls-wrap .tabs{margin:0;gap:2px;padding:3px;border-radius:7px;align-self:start}
 .main[data-page=terms] .term-controls-wrap .tab{min-height:31px;padding:5px 11px;font-size:calc(10px * var(--study-text-scale, 1))}
 .main[data-page=terms] .term-stats-bar{display:block;border:0;background:transparent;padding:5px 0 8px;margin:0;border-radius:0}
 .main[data-page=terms] .term-stats-info,.main[data-page=terms] .term-stats-info .content-count{font-size:calc(11px * var(--study-text-scale, 1));line-height:1.8}
 .main[data-page=terms] .term-progress-track{height:2px;margin-top:5px}
 .main[data-page=terms] .term-list-head,.main[data-page=terms] .term-row{display:grid;grid-template-columns:minmax(130px,.9fr) minmax(160px,1.25fr) minmax(160px,1.25fr) 105px;gap:14px;padding:11px 16px}
 .main[data-page=terms] .term-list-head>span{text-align:left}
 .main[data-page=terms] .term-list-head>span:last-child{text-align:right}
 .main[data-page=terms] .term-row-actions{justify-content:flex-end;border:0;margin:0;padding:0}
 .main[data-page=terms] .term-row-note{padding:0 0 0 10px;border-radius:0;background:transparent;border-left-width:2px}
 .main[data-page=terms] .term-row .term-note-label{display:none}
 .main[data-page=terms] .term-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 .main[data-page=terms] .term-card{padding:19px 20px}

 .record-summary-grid,.record-activity-grid,.record-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start;margin-bottom:18px}
 .home-records .settings-panel{margin:0;padding:18px 20px;border-radius:9px;min-width:0}
 .home-records .section-head{margin:0 0 12px;gap:12px;align-items:center}
 .home-records .section-head h2,.home-records .settings-panel>h2{font-size:calc(14px * var(--study-text-scale, 1))}
 .home-records .section-head a,.home-records .section-head>span{font-size:calc(10px * var(--study-text-scale, 1));color:var(--muted)}
 .home-records .settings-panel>p{font-size:calc(11px * var(--study-text-scale, 1));line-height:1.9;margin:10px 0}
 .record-morning .stats{margin:0;border:0;border-radius:0;background:transparent;grid-template-columns:repeat(3,minmax(0,1fr))}
 .record-morning .stat{padding:8px 10px;min-width:0}
 .record-morning .stat:first-child{padding-left:0}
 .record-morning .stat-label{font-size:calc(10px * var(--study-text-scale, 1))}
 .record-morning .stat-value{font-size:calc(24px * var(--study-text-scale, 1))}
 .record-morning .stat-value small{display:block;margin:0;font-size:calc(10px * var(--study-text-scale, 1))}
 .record-morning .stat-foot{display:block;font-size:calc(9px * var(--study-text-scale, 1));line-height:1.8}
 .home-records .af-history>p{font-size:calc(10px * var(--study-text-scale, 1));margin:0 0 10px}
 .home-records .af-history .af-question-row{grid-template-columns:60px minmax(0,1fr) 55px 12px;min-height:60px;padding:10px 0;gap:9px}
 .home-records .af-history .af-question-title strong{font-size:calc(11px * var(--study-text-scale, 1))}
 .home-records .af-history .af-question-title small{font-size:calc(9px * var(--study-text-scale, 1))}
 .home-records .af-history .af-status{font-size:calc(9px * var(--study-text-scale, 1))}
 .home-records .record-module-section{margin-bottom:18px}
 .record-table-scroll{overflow:auto}
 .record-module-table{width:100%;border-collapse:collapse;font-size:calc(12px * var(--study-text-scale, 1));line-height:1.6}
 .record-module-table th,.record-module-table td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left}
 .record-module-table thead th{font-size:calc(10px * var(--study-text-scale, 1));color:var(--muted);font-weight:500;white-space:nowrap;background:var(--paper)}
 .record-module-table tbody th{font-size:calc(12px * var(--study-text-scale, 1));font-weight:500;max-width:280px}
 .record-module-table td{font-size:calc(11px * var(--study-text-scale, 1));color:var(--muted);white-space:nowrap}
 .record-module-table td:last-child,.record-module-table th:last-child{text-align:right}
 .record-module-table tr:last-child>*{border-bottom:0}
 .record-module-table .module-stat-bar{width:110px;max-width:100%;height:5px;margin:0}
 .record-module-table .button{font-size:calc(10px * var(--study-text-scale, 1));min-height:29px;padding:4px 9px;white-space:nowrap}
 .home-records .record-chart{height:110px;margin-top:14px;gap:8px}
 .home-records .record-chart .chart-day{font-size:calc(9px * var(--study-text-scale, 1))}
 .home-records .history-list{margin:0;max-height:210px;overflow:auto;border:0;border-radius:0}
 .home-records .history-row{padding:9px 0;gap:9px;font-size:calc(11px * var(--study-text-scale, 1));min-height:52px}
 .home-records .history-row>svg{width:13px;flex:none;margin-left:auto}
 .home-records .history-row small{font-size:calc(9px * var(--study-text-scale, 1))}
 .record-empty{display:flex;align-items:flex-start;flex-direction:column;gap:10px;padding:12px 0 6px;color:var(--muted);font-size:calc(12px * var(--study-text-scale, 1))}
 .record-empty .text-link{font-size:calc(11px * var(--study-text-scale, 1))}
 .record-settings-grid .settings-actions{gap:8px;flex-wrap:wrap;margin-top:12px}
 .record-settings-grid .button{font-size:calc(11px * var(--study-text-scale, 1));min-height:35px;padding:6px 11px}
}
@media(min-width:900px) and (max-width:1150px){
 .main[data-page=home],.main[data-page=terms]{padding-inline:22px}
 .main[data-page=terms] .term-list-head,.main[data-page=terms] .term-row{grid-template-columns:minmax(110px,.8fr) minmax(130px,1fr) minmax(130px,1fr) 90px;gap:10px;padding-inline:12px}
 .record-summary-grid,.record-activity-grid,.record-settings-grid{gap:14px}
 .home-records .settings-panel{padding:15px}
 .record-module-table th,.record-module-table td{padding:8px}
 .record-module-table .module-stat-bar{width:80px}
}
/* Keep answer checking visible while the problem scrolls independently. */
@media(min-width:900px){
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .quiz-columns{grid-template-columns:minmax(0,1.2fr) minmax(0,.9fr);gap:20px}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .question-card,.main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .quiz-side-explanation{border:var(--region-border);background:var(--surface)}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-row{position:relative;gap:0}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice{padding:12px 46px 12px 14px;line-height:1.8}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-eliminate{position:absolute;right:8px;top:50%;transform:translateY(-50%);z-index:1;width:30px;height:32px;min-height:32px;padding:4px;border:0;border-radius:5px;background:transparent;color:var(--muted)}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-eliminate:hover,.main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-eliminate.active{background:var(--bad-soft);color:var(--bad)}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-eliminate:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .choice-key{display:none}
 .quiz-answer-panel{padding:24px;border:var(--region-border);border-radius:10px;background:var(--surface);box-shadow:0 2px 6px var(--region-shadow);font-size:calc(14px * var(--study-text-scale, 1));line-height:1.8}
 .quiz-answer-panel>p{margin:0 0 18px}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .quiz-answer-panel .quiz-actions{margin:0;padding:0;border:0}
 .quiz-answer-panel .quiz-actions-main{width:100%;justify-content:flex-start;gap:12px}
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .quiz-answer-panel .button{min-height:42px;padding:9px 16px;font-size:calc(14px * var(--study-text-scale, 1))}
 .quiz-answer-panel p.quiz-answer-note{margin:16px 0 0;font-size:calc(12px * var(--study-text-scale, 1));color:var(--muted)}
 .quiz-key-help{margin-top:24px;padding-top:16px;border-top:1px solid var(--line);font-size:calc(12px * var(--study-text-scale, 1));color:var(--muted)}
 .quiz-key-help summary{cursor:pointer;width:fit-content}
 .quiz-key-help p{margin:12px 0 0;line-height:2.2}
 .quiz-key-help kbd{border:1px solid var(--line);border-radius:3px;padding:1px 4px;font-size:calc(11px * var(--study-text-scale, 1))}
}
/* Card review keeps the prompt, answer, and key actions in one stable area. */
@media(min-width:900px){
 .main[data-page=flash]{padding:26px 32px 30px}
 .main[data-page=flash] .page-head{margin-bottom:24px}
 .main[data-page=flash] .page-head h1{font-size:calc(24px * var(--study-text-scale, 1))}
 .main[data-page=flash] .flash-toolbar{max-width:760px;margin:0 auto 20px;gap:16px}
 .main[data-page=flash] .flash-toolbar .tabs{border:0;padding:0;background:transparent;gap:4px}
 .main[data-page=flash] .flash-toolbar .tab{min-height:38px;padding:7px 12px;border-radius:5px;font-size:calc(13px * var(--study-text-scale, 1))}
 .main[data-page=flash] .flash-wrap{max-width:760px;margin:0 auto}
 .flash-session-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
 .flash-session-tools .flash-counter{margin:0;font-size:calc(12px * var(--study-text-scale, 1));color:var(--muted);text-align:left}
 .flash-session-tools>div{display:flex;gap:18px;flex-shrink:0}
 .flash-session-tools .text-link{font-size:calc(12px * var(--study-text-scale, 1));min-height:32px;padding:0}
 .main[data-page=flash] .flash-card{position:relative;min-height:340px;padding:32px;border:var(--region-border);border-radius:10px;box-shadow:0 2px 6px var(--region-shadow);gap:18px}
 .main[data-page=flash] .flash-card .flash-term{font-size:calc(28px * var(--study-text-scale, 1));line-height:1.6}
 .main[data-page=flash] .flash-card .concept-question{font-size:calc(23px * var(--study-text-scale, 1))}
 .main[data-page=flash] .flash-card .full-name{font-size:calc(13px * var(--study-text-scale, 1));line-height:1.6;color:var(--muted)}
 .main[data-page=flash] .flash-card small{font-size:calc(12px * var(--study-text-scale, 1));color:var(--muted)}
 .main[data-page=flash] .flash-answer{font-size:calc(16px * var(--study-text-scale, 1));line-height:1.9;text-align:left;max-width:38em}
 .main[data-page=flash] .flash-answer p{font-size:calc(14px * var(--study-text-scale, 1));line-height:1.9;margin-top:20px;color:var(--muted)}
 .flash-known-label{position:absolute;top:14px;right:18px;font-size:calc(11px * var(--study-text-scale, 1));color:var(--accent)}
 .main[data-page=flash] .flash-actions{margin:20px 0 0;display:flex;gap:16px;min-height:46px}
 .main[data-page=flash] .flash-actions .button{flex:1;min-height:46px;font-size:calc(14px * var(--study-text-scale, 1));padding:9px 16px}
 .main[data-page=flash] kbd{display:inline-block;margin-left:6px;padding:0 5px;border:1px solid currentColor;border-radius:4px;opacity:.7;font-size:calc(11px * var(--study-text-scale, 1));line-height:1.6;white-space:nowrap}
 .flash-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:18px}
 .flash-footer .button{font-size:calc(12px * var(--study-text-scale, 1));min-height:36px;padding:5px 10px;background:transparent;border-color:transparent}
 .flash-footer>span{font-size:calc(11px * var(--study-text-scale, 1));color:var(--muted)}
 .main[data-page=flash] button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
}
/* Reserve a result band below both scrolling panes so the next action stays visible. */
@media(min-width:900px){
 .main:is([data-page=question],[data-page=full],[data-page=afternoon-quiz]) .quiz-columns{height:auto}
 .quiz-layout>.verdict{position:sticky;bottom:0;z-index:2;flex:none;margin:12px 0 0;padding:14px 20px;border:var(--region-border);border-top:3px solid var(--accent);border-radius:6px;background:var(--accent-soft);box-shadow:0 -3px 10px var(--region-shadow);gap:12px 20px}
 .quiz-layout>.verdict.bad{border-color:var(--region-line);border-top-color:var(--bad);background:var(--bad-soft)}
 .quiz-layout>.verdict .verdict-text strong{font-size:calc(18px * var(--study-text-scale, 1))}
 .quiz-layout>.verdict .verdict-text span{font-size:calc(12px * var(--study-text-scale, 1))}
 .quiz-layout>.verdict .verdict-actions .button{min-height:44px;padding:9px 18px;font-size:calc(14px * var(--study-text-scale, 1))}
 .quiz-layout>.verdict .verdict-jump{display:none}
}
