.memorize-page{max-width:1040px;margin:0 auto;min-width:0;padding-bottom:18px;color:var(--text,#0f172a)}
.memorize-toolbar,.memorize-toolbar>div,.memorize-context{display:flex;align-items:center;gap:12px;justify-content:space-between}.memorize-toolbar>div{justify-content:flex-start;flex-wrap:wrap}.memorize-toolbar strong{font-size:17px}
.memorize-badge{font-size:14px;font-weight:600;padding:6px 10px;border:1px solid #a7d9c7;background:#edf8f3;color:#17664d;border-radius:8px;white-space:nowrap}
.memorize-context{color:var(--muted,#64748b);font-size:13px;margin:8px 0 18px;flex-wrap:wrap}.memorize-context p{margin:0}
.memorize-card{padding:28px!important;border-radius:12px!important}.memorize-meta{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px;color:var(--muted,#64748b);margin-bottom:18px}.memorize-card h1{font-size:21px;line-height:1.8;margin:0 0 22px;white-space:pre-wrap;overflow-wrap:anywhere}.memorize-card .case-box p{white-space:pre-wrap;line-height:1.8;margin:6px 0 0}
.memorize-options{display:grid;gap:10px}.memorize-option{display:flex;align-items:flex-start;gap:12px;padding:13px 16px;border:1px solid var(--border,#e2e8f0);border-radius:8px;font-size:16px;line-height:1.7}.memorize-option>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}.memorize-letter{font-weight:700;min-width:18px}.memorize-option.is-answer{background:#edf8f3;border-color:#a7d9c7;color:#14553f}.memorize-correct{font-size:12px;white-space:nowrap;padding-top:3px}
.memorize-answer{margin-top:24px;padding:16px 20px;background:#edf8f3;border-left:3px solid #229b73;border-radius:8px;color:#14553f}.memorize-answer h2,.memorize-explanation>h2{font-size:15px;margin:0 0 8px}.memorize-answer p{margin:0;font-size:18px;line-height:1.8;font-weight:600;white-space:pre-wrap;overflow-wrap:anywhere}
.memorize-explanation{margin-top:24px;border-top:1px solid var(--border,#e2e8f0);padding-top:20px;line-height:1.8;overflow-wrap:anywhere}.memorize-explanation .structured-explanation{display:block!important}.memorize-brief{margin:0 0 12px}.memorize-empty{color:var(--muted,#64748b);font-size:14px}.memorize-explanation .feedback-section-header{margin:0 0 8px}
.memorize-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;position:sticky;bottom:12px;margin-top:18px;padding:12px;background:var(--surface,#fff);border:1px solid var(--border,#e2e8f0);border-radius:12px;box-shadow:0 3px 12px #0f172a08;z-index:5}.memorize-controls .button{min-width:0}.memorize-help{font-size:12px;color:var(--muted,#64748b);text-align:center;margin:14px 0 0}.chapter-read-entry{display:flex;justify-content:flex-end;padding:0 4px 10px}.chapter-read-entry .chapter-tool{min-height:36px;color:#17664d}
.offline-pack-chapter-row{display:flex;min-width:0;align-items:stretch;gap:12px}.offline-pack-chapter-row>[data-pack-practice]{flex:1;min-width:0}.offline-pack-chapter-row>[data-pack-read]{font-size:13px;flex:none;color:#17664d!important}
@media(max-width:760px){.memorize-card{padding:20px!important}.memorize-card h1{font-size:18px}.memorize-controls{bottom:calc(10px + env(safe-area-inset-bottom,0px));gap:8px;padding:10px}.memorize-controls .button{font-size:14px;padding:12px 5px}.memorize-option{padding:12px;gap:9px;font-size:15px}.memorize-correct{font-size:11px}.memorize-toolbar{gap:8px}.memorize-toolbar strong{font-size:15px}}
@media(max-width:360px){.memorize-card{padding:16px!important}.memorize-correct{display:none}.memorize-context{gap:6px}.memorize-toolbar>.button{padding:10px;font-size:13px}.memorize-help{line-height:1.7}}
html[data-theme=dark] .memorize-answer,html[data-theme=dark] .memorize-option.is-answer,html[data-theme=dark] .memorize-badge{background:#173c2f;color:#b9efd9;border-color:#377f62}

/* Visible, generously sized chapter actions; one group beside the chapter. */
.chapter-actions{--chapter-action-ink:#334155;--chapter-action-line:#cbd5e1;--chapter-action-read:#17664d;--chapter-action-blue:#1d4ed8;--chapter-action-danger:#b42318;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:4px 0 0}
.chapter-actions.chapter-actions--single{grid-template-columns:1fr}
.chapter-actions .chapter-tool{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:0;padding:10px 12px;border:1px solid var(--chapter-action-line);border-radius:8px;background:#fff;color:var(--chapter-action-ink);font-size:14px;font-weight:600;line-height:1.4;cursor:pointer;text-decoration:none;touch-action:manipulation;transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
.chapter-actions .chapter-tool .ui-icon{width:18px;height:18px;flex:none}
.chapter-actions .chapter-action--read{background:#edf8f3;border-color:#a7d9c7;color:var(--chapter-action-read)}
.chapter-actions .chapter-action--overview{background:#eff6ff;border-color:#b5ccf5;color:var(--chapter-action-blue)}
.chapter-actions .chapter-tool.danger{background:#fff5f4;border-color:#edb1aa;color:var(--chapter-action-danger)}
.chapter-actions .chapter-tool:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
.chapter-actions .chapter-tool:active:not(:disabled){box-shadow:inset 0 0 0 2px currentColor}
.chapter-actions .chapter-tool:disabled{opacity:.55;cursor:wait}
@media(hover:hover){.chapter-actions .chapter-tool:hover:not(:disabled){background:#f1f5f9;border-color:#94a3b8;color:var(--chapter-action-ink);text-decoration:none;box-shadow:0 2px 6px #0f172a0a}.chapter-actions .chapter-action--read:hover:not(:disabled){background:#daf1e6;border-color:#75b69e;color:var(--chapter-action-read)}.chapter-actions .chapter-action--overview:hover:not(:disabled){background:#dbeafe;border-color:#7da4ed;color:var(--chapter-action-blue)}.chapter-actions .chapter-tool.danger:hover:not(:disabled){background:#fee4e2;border-color:#dc8c82;color:var(--chapter-action-danger)}}
@media(min-width:1380px){.chapter-actions:not(.chapter-actions--single){grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.chapter-actions .chapter-tool{transition:none}}
