/* Dedicated reading layout; content, questions and correction screens stay with their own components. */
:root{--reader-header-height:90px;--reader-bar-height:56px}
html[data-density]:has(body.theory-reader){scroll-padding-top:calc(var(--reader-header-height) + var(--reader-bar-height) + 12px);scroll-padding-bottom:90px}
body.theory-reader .theory-page>.page-heading{margin:0 0 12px;gap:12px}
body.theory-reader .theory-page>.page-heading h1{font-size:28px;line-height:1.25;margin-bottom:8px;max-width:40ch}
body.theory-reader .theory-page>.page-heading .lead{font-size:15px;line-height:1.65;max-width:88ch;margin:0}
body.theory-reader .theory-breadcrumb,body.theory-reader .theory-meta{gap:8px;margin-bottom:12px;font-size:12px}
body.theory-reader .theory-breadcrumb .button{font-size:12px;min-height:36px;padding:6px 10px}
body.theory-reader .theory-reading-layout{grid-template-columns:225px minmax(0,1fr);gap:14px;align-items:start}
body.theory-reader .theory-reader-bar{position:sticky;top:var(--reader-header-height);z-index:32;display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--canvas);border-block:1px solid var(--line);padding:7px 0;margin:0 0 12px;min-height:54px}
.reader-current{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.reader-count{font-size:12px;white-space:nowrap;color:var(--muted);font-weight:600}.reader-current-title{font-size:14px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.reader-controls{display:flex;gap:6px;align-items:center;flex-shrink:0}
body.theory-reader .reader-controls .button{min-height:38px;margin:0;padding:6px 10px;font-size:13px}.reader-controls>[data-reader-previous],.reader-controls>[data-reader-next]{min-width:38px}.reader-label-short{display:none}body.theory-reader .reader-controls .reader-open-contents{display:none}
body.theory-reader .theory-toc{position:sticky;top:calc(var(--reader-header-height) + var(--reader-bar-height) + 12px);max-height:calc(100dvh - var(--reader-toc-top,var(--reader-header-height)) - 16px);display:flex;flex-direction:column;overflow:hidden;padding:14px!important;min-height:0}
body.theory-reader .theory-toc h2{font-size:16px;margin:0 0 10px;line-height:1.4}
body.theory-reader .theory-toc nav{display:flex;flex-direction:column;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;margin:0 0 12px;gap:0}
body.theory-reader .theory-toc nav a{font-size:13px;line-height:1.5;min-height:44px;padding:9px 4px;gap:8px;overflow-wrap:break-word;align-items:baseline;flex-shrink:0}
body.theory-reader .theory-toc nav a[aria-current]{padding-left:7px}
body.theory-reader .theory-toc>.button{font-size:12px;line-height:1.5;min-height:40px;margin:0;flex-shrink:0}
body.theory-reader .theory-section{padding:22px 24px;margin-bottom:14px;scroll-margin-top:0;max-width:82ch;overflow-wrap:break-word}
body.theory-reader .theory-section h2{font-size:23px;line-height:1.4;margin-bottom:14px;hyphens:auto;max-width:48ch}
body.theory-reader .theory-section>p{font-size:17px;line-height:1.75;margin:14px 0;max-width:74ch}
body.theory-reader .theory-section-number{font-size:12px;letter-spacing:.08em;margin-bottom:10px}
body.theory-reader .theory-keypoints,body.theory-reader .theory-pitfalls{padding:14px 16px;margin-top:16px}
body.theory-reader .theory-keypoints li,body.theory-reader .theory-pitfalls li,body.theory-reader .theory-example p,body.theory-reader .theory-example li{font-size:16px;line-height:1.75}
body.theory-reader .theory-keypoints h3,body.theory-reader .theory-pitfalls h3{font-size:15px;line-height:1.5;margin:0}
body.theory-reader .theory-example{padding:16px;margin:16px 0 8px}.theory-reader .theory-example h3{font-size:19px;line-height:1.5}
body.theory-reader .theory-related,body.theory-reader .theory-sources a{font-size:14px;line-height:1.7}
body.theory-reader .theory-sources summary,body.theory-reader .theory-related summary{min-height:44px;align-content:center;line-height:1.6;cursor:pointer}
body.theory-reader .theory-section .exercise-inline-link{font-size:14px;line-height:1.5;min-height:44px;white-space:normal}
body.theory-reader .theory-next .button{font-size:14px;line-height:1.5;min-height:44px}
body.theory-reader:has(.theory-reader-bar) .layout-back-top{display:none}
.reader-map-dialog{width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 40px);border:1px solid var(--line);border-radius:8px;padding:16px;background:var(--white);color:var(--ink);overflow:auto;overscroll-behavior:contain}.reader-map-dialog::backdrop{background:#17292566}.reader-map-head{position:sticky;top:-16px;z-index:1;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:0 0 12px;background:var(--white)}.reader-map-head h2{margin:0;font-size:20px}.reader-map-head .button{min-height:44px;font-size:14px}.reader-map-dialog nav{display:flex;flex-direction:column}.reader-map-dialog nav a{display:flex;gap:10px;align-items:baseline;padding:11px 8px;font-size:15px;line-height:1.6;min-height:44px;border-bottom:1px solid var(--line)}.reader-map-dialog nav a span{font-size:12px;color:var(--muted)}.reader-map-dialog nav a[aria-current]{background:var(--uui-soft);border-left:3px solid var(--green);font-weight:650}
@media(max-width:1100px){body.theory-reader .theory-reading-layout{grid-template-columns:minmax(0,1fr)}body.theory-reader .theory-toc{display:none}body.theory-reader .reader-controls .reader-open-contents{display:inline-flex}body.theory-reader .theory-section{max-width:82ch;margin-inline:auto}body.theory-reader .theory-reader-bar{gap:8px}.reader-current{gap:8px}}
@media(max-width:700px){body.theory-reader #drones-account-bar{position:absolute}body.theory-reader .topbar{position:static}body.theory-reader .theory-reader-bar{top:0;display:flex;flex-wrap:wrap;gap:6px;padding:6px 0;margin-bottom:10px}.reader-current{flex-basis:100%;justify-content:space-between;gap:10px}.reader-current-title{font-size:12px}.reader-count{font-size:11px}.reader-controls{width:100%;display:flex;gap:6px}body.theory-reader .reader-controls .button{min-height:44px;padding:7px 9px;font-size:13px}body.theory-reader .reader-controls .reader-open-contents{flex:1}.reader-return{flex:1;min-width:0}.reader-label-long{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.reader-label-short{display:inline}.reader-controls>[data-reader-previous],.reader-controls>[data-reader-next]{min-width:44px}body.theory-reader .theory-section{padding:17px 16px;margin-bottom:12px}body.theory-reader .theory-section>p{font-size:17px;line-height:1.75}body.theory-reader .theory-section h2{font-size:22px;line-height:1.4}body.theory-reader .theory-page>.page-heading h1{font-size:25px}body.theory-reader .theory-keypoints,body.theory-reader .theory-pitfalls,body.theory-reader .theory-example{padding:13px}body.theory-reader .theory-breadcrumb .button{min-height:44px;width:auto;margin-left:0}body.theory-reader .reader-index-return{min-height:44px;margin-bottom:12px}body.theory-reader .theory-related a{font-size:15px;line-height:1.7}.reader-map-dialog{padding:12px}.reader-map-head{top:-12px}}
@media print{.theory-reader-bar,.reader-map-dialog,.reader-index-return{display:none!important}body.theory-reader .theory-reading-layout{display:block}body.theory-reader .theory-toc{display:none}body.theory-reader .theory-section{max-width:none}body.theory-reader .theory-section p{font-size:11pt}}

body.theory-reader .reader-overview{margin:0 0 12px;border-bottom:1px solid var(--line)}body.theory-reader .reader-overview>summary{font-size:13px;line-height:1.5;min-height:36px;padding:7px 0;color:var(--muted);cursor:pointer}body.theory-reader .reader-overview>.lead{font-size:15px;line-height:1.7;max-width:88ch;margin:6px 0 14px}body.theory-reader .reader-overview .theory-meta{margin-top:0}@media(max-width:700px){body.theory-reader .reader-overview>summary{min-height:44px;padding:10px 0}}

body.theory-reader{overflow-anchor:none}
/* Header controls already sit above the reading inset; focusing them must not move the article. */
body.theory-reader .topbar button,body.theory-reader .reader-controls .button{scroll-margin-top:calc(-1 * (var(--reader-header-height) + var(--reader-bar-height) + 12px))}
.reader-map-dialog[open]{display:flex;flex-direction:column;overflow:hidden}.reader-map-head{flex-shrink:0;position:static}.reader-map-dialog nav{min-height:0;overflow-y:auto;overscroll-behavior:contain}

.reader-bar-slot{height:var(--reader-bar-height);margin-bottom:12px}body.theory-reader .theory-reader-bar{position:static;margin:0}body.theory-reader .theory-reader-bar.reader-is-fixed{position:fixed;top:var(--reader-header-height)}@media print{.reader-bar-slot{display:none!important}}
