/* Authored overview/topic reading pages only; retain the existing theme. */
body.overview-reading main { max-width:1240px; padding:38px 30px 70px; }
.overview-reading main > .toc-box { display:none; }
.ov-layout { display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:46px; align-items:start; }
.ov-body { min-width:0; }
.ov-body > h1 { margin:0 0 24px; font-size:clamp(28px,3vw,38px); line-height:1.45; }
.ov-body p,.ov-body li { line-height:1.9; }
.ov-body p { margin:20px 0; }
.ov-body h2 { margin:48px 0 24px; padding-top:25px; line-height:1.55; }
.ov-body h3 { margin:32px 0 20px; line-height:1.6; }
.ov-body > hr { display:none; }
/* Legacy tables use max-content. Authored prose tables need bounded wrapping;
   retain native table layout and the external scroller for genuinely wide data. */
body:is(.topic-reading,.prose-tables) .table-scroll table { min-width:560px; width:100%; table-layout:auto; }
body:is(.topic-reading,.prose-tables) .table-scroll table:has(thead tr:first-child th:nth-child(2):last-child) { min-width:420px; }
body:is(.topic-reading,.prose-tables) .table-scroll :is(th,td) { line-height:1.8; }
.ov-body h2,.ov-body h3,.ov-body [id] { scroll-margin-top:100px; }
.ov-rail { position:sticky; top:85px; max-height:calc(100dvh - 110px); overflow:auto; padding:18px; border:1px solid var(--border); border-radius:14px; background:var(--card); font-size:14px; }
.ov-rail p { line-height:1.7; color:var(--muted); }
.ov-rail nav { display:grid; gap:5px; margin:18px 0; }
.ov-rail nav a { padding:10px; border-radius:8px; line-height:1.6; color:var(--muted); text-decoration:none; }
.ov-rail nav a[aria-current=location] { background:var(--accent-soft); color:var(--accent); box-shadow:inset 3px 0 var(--accent); }
.ov-rail button,.ov-formula-buttons button,.ov-dialog button,.ov-choice-save { min-height:44px; padding:10px 14px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--fg); font:inherit; cursor:pointer; }
.ov-route-toggle { width:100%; text-align:left; font-weight:700!important; }
.ov-save { width:100%; }
.ov-entry,.ov-example { padding:26px; margin:28px 0; border:1px solid var(--border); border-left:4px solid var(--accent); border-radius:14px; background:var(--card); }
.ov-entry > :first-child,.ov-example > :first-child { margin-top:0; }
.ov-entry > :last-child,.ov-example > :last-child { margin-bottom:0; }
.ov-start-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin:24px 0; }
.ov-start-card { display:block; min-width:0; padding:22px; border:1px solid var(--border); border-radius:12px; background:var(--card); color:var(--fg); text-decoration:none; }
.ov-start-card strong { display:block; margin-bottom:12px; font-size:19px; color:var(--accent); }
.ov-start-card span { display:block; line-height:1.8; }
.ov-start-card:hover { border-color:var(--accent); }
.ov-route-links { display:flex; flex-wrap:wrap; gap:10px; margin:20px 0; }
.ov-route-links a { padding:10px 14px; border:1px solid var(--border); border-radius:8px; background:var(--card); min-height:44px; }
.ov-body .ov-process { margin:22px 0; padding:0; list-style:none; counter-reset:ov-step; }
.ov-body .ov-process li { position:relative; padding:16px 18px 16px 60px; margin:12px 0; border:1px solid var(--border); border-radius:10px; background:var(--card); counter-increment:ov-step; }
.ov-process li::before { content:counter(ov-step); position:absolute; left:18px; top:16px; color:var(--accent); font-weight:700; }
.ov-formula { margin:30px 0; padding:22px; background:var(--card); border:1px solid var(--border); border-radius:12px; }
.ov-formula-buttons { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.ov-formula-cue { color:var(--muted); font-size:15px; }
.ov-formula .katex-html { pointer-events:none; }
.ov-formula [data-ov-term] { pointer-events:auto; position:relative; z-index:2; cursor:pointer; border-bottom:2px dotted var(--accent); scroll-margin:100px 0; }
.ov-formula { scroll-margin-top:100px; }
.ov-dialog { width:min(640px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; padding:26px; border:1px solid var(--border); border-radius:14px; background:var(--card); color:var(--fg); }
.ov-dialog::backdrop { background:rgb(0 0 0 / .45); }
.ov-dialog h2 { margin:10px 0 24px; font-size:24px; }
.ov-dialog h3 { margin:24px 0 10px; font-size:17px; }
.ov-dialog p { line-height:1.85; }
.ov-dialog-close { position:sticky; top:0; display:block; margin-left:auto; z-index:1; }
.ov-choice label { display:block; margin:20px 0 10px; }
.ov-choice input,.ov-choice textarea { width:100%; box-sizing:border-box; padding:12px; min-height:48px; border:1px solid var(--border); border-radius:8px; font:inherit; color:var(--fg); background:var(--bg); }
.ov-choice textarea { min-height:90px; resize:vertical; }
.ov-score { margin:26px 0; }
.ov-score label { display:block; margin:16px 0 10px; }
.ov-score select { min-height:44px; padding:9px; border:1px solid var(--border); border-radius:8px; color:var(--fg); background:var(--card); font:inherit; max-width:100%; }
.ov-score td select { min-width:125px; }
.ov-score output { white-space:nowrap; font-weight:700; }
.ov-example svg { display:block; width:100%; height:auto; }
.ov-example figcaption { margin-top:20px; line-height:1.85; color:var(--muted); }
.ov-body figure.ov-example { padding:22px 24px 24px; }
.ov-body figure.ov-example figcaption { margin:18px 0 0; padding:0; text-align:left; font-size:16px; line-height:1.85; }
.ov-choice-status { color:var(--muted); }
.ov-save-floating { display:none; }
.ov-save-feedback { display:none; position:fixed; z-index:210; right:16px; bottom:76px; max-width:min(440px,calc(100vw - 32px)); box-sizing:border-box; margin:0; padding:12px 16px; border:1px solid var(--border); border-radius:10px; background:var(--card); color:var(--fg); line-height:1.7; box-shadow:0 4px 18px rgb(0 0 0 / .12); }
.ov-save-feedback.is-visible { display:block; }
.ov-save-floating:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.ov-layout :is(button,a,input,textarea,[role=button]):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.ov-dialog :focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
@media(max-width:980px) {
 body.overview-reading main { padding:24px 20px 105px; }
 .ov-layout { display:flex; flex-direction:column; gap:22px; }
 .ov-rail { order:-1; position:static; max-height:none; width:100%; box-sizing:border-box; }
 .ov-body { width:100%; }
 .ov-rail .ov-save { display:none; }
 .ov-save-floating { display:block; position:fixed; z-index:200; right:16px; bottom:max(16px,env(safe-area-inset-bottom)); min-height:44px; max-width:calc(100vw - 32px); padding:10px 16px; border:1px solid var(--border); border-radius:10px; background:var(--card); color:var(--accent); box-shadow:0 3px 14px rgb(0 0 0 / .10); font:inherit; cursor:pointer; }
}
@media(max-width:600px) {
 .ov-start-grid { grid-template-columns:minmax(0,1fr); }
 .ov-entry,.ov-example,.ov-formula { padding:20px 17px; }
 .ov-body h2 { margin-top:38px; }
 .ov-dialog { padding:20px; }
}
@media(prefers-reduced-motion:reduce) { .overview-reading { scroll-behavior:auto; } }
