/* Outer modal styles stay scoped; native reader styles load independently inside its shadow root. */
#atlas-material-dialog{width:min(1120px,calc(100vw - 48px));height:min(900px,calc(100dvh - 48px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid var(--ui-line-strong);border-radius:20px;background:var(--ui-panel);color:var(--ui-text);overflow:hidden;box-shadow:var(--ui-menu-shadow)}
#atlas-material-dialog[open]{display:flex;flex-direction:column}#atlas-material-dialog::backdrop{background:#000b;backdrop-filter:blur(7px)}
#atlas-material-dialog .atlas-material-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:15px 20px;border-bottom:1px solid var(--ui-line);background:var(--ui-panel-top);flex-shrink:0}#atlas-material-dialog .atlas-material-header>div{min-width:0}#atlas-material-dialog .atlas-material-header span{display:block;color:var(--ui-muted);font-size:10px;letter-spacing:.08em;margin-bottom:5px}#atlas-material-dialog .atlas-material-header h2{margin:0;font-size:17px;line-height:1.4;font-weight:600;overflow-wrap:anywhere}#atlas-material-dialog .atlas-material-close{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:10px;background:var(--ui-control);color:var(--ui-text);font:28px/1 inherit;cursor:pointer}#atlas-material-dialog .atlas-material-close:focus-visible{outline:2px solid var(--ui-accent-ink);outline-offset:2px}#atlas-material-dialog .atlas-material-host{flex:1;min-height:0;overflow:hidden;display:block}#atlas-material-dialog [hidden]{display:none!important}#atlas-material-dialog .atlas-material-status{padding:24px;font-size:14px;line-height:1.6;color:var(--ui-muted-strong)}
@media(max-width:760px){#atlas-material-dialog{position:fixed;inset:0;width:100vw;height:100dvh;margin:0;border:0;border-radius:0}#atlas-material-dialog .atlas-material-header{padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));gap:10px}#atlas-material-dialog .atlas-material-header h2{font-size:14px}#atlas-material-dialog .atlas-material-header span{font-size:9px}}
#atlas-material-dialog .atlas-material-notice{flex-shrink:0;padding:11px 20px;background:var(--ui-selected);color:var(--ui-text);font-size:12px;line-height:1.6;border-bottom:1px solid var(--ui-line)}#atlas-material-dialog .atlas-material-notice a{color:var(--ui-accent-ink);font-weight:600;white-space:nowrap}
/* Everything below lives only in the shadow tree (:host does not select the document). */

:host *{box-sizing:border-box}:host html,:host body{margin:0;padding:0;width:100%;height:100%;min-height:0;overflow:hidden;background:var(--ui-panel);color:var(--ui-text)}:host button,:host input,:host select{font:inherit}:host [hidden]{display:none!important}:host button{cursor:pointer}:host button:disabled{cursor:default;opacity:.4}:host :is(button,a,input,summary):focus-visible{outline:2px solid var(--ui-accent-ink);outline-offset:3px}:host .materials-library{width:100%;height:100%;padding:0;margin:0;border:0;overflow:hidden}:host .materials-workspace{display:block!important;width:100%;height:100%;min-height:0;margin:0;border:0;overflow:hidden}:host .materials-browser,:host .materials-tabs,:host [data-materials-description],:host .reader-mobile-bar,:host [data-reader-back]{display:none!important}:host .materials-reader{position:static!important;display:block!important;width:100%!important;height:100%!important;max-height:none!important;min-height:0!important;border:0!important;margin:0!important;padding:0!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-color:var(--ui-scroll) var(--ui-bg-soft)}
:host .guide-reader-shell{width:100%;max-width:none;min-height:100%}:host .guide-reader-toolbar{position:sticky;top:0;z-index:5;background:var(--ui-panel-top);padding:12px 16px}:host .guide-toolbar-meta{min-width:0;width:100%}:host .guide-toolbar-meta>span{overflow-wrap:anywhere}:host .guide-page-frame{margin:16px auto;max-width:800px;width:calc(100% - 32px)}:host .guide-reader-nav{padding:14px 20px}:host .guide-page-picker-menu{max-height:min(55dvh,430px);overflow:auto}:host .article-reader-card,:host .audio-reader-card,:host .video-reader-card{border:0;border-radius:0;max-width:850px;margin:0 auto}:host .materials-empty{padding:24px;margin:0;width:100%;line-height:1.7}:host .materials-empty span{display:block;margin-top:8px}
@media(max-width:760px){:host .guide-page-frame{width:100%;margin:0 auto}:host .guide-reader-toolbar{padding:10px 12px}:host .guide-toolbar-meta{gap:10px}:host .guide-reader-nav{padding:12px}:host .materials-reader{padding-bottom:env(safe-area-inset-bottom)!important}}
:host .preview-material-card{height:100%;overflow:auto;padding:clamp(24px,5vw,64px);line-height:1.8;color:var(--ui-text)}:host .preview-material-format{font-size:11px;letter-spacing:.1em;color:var(--ui-accent-ink)}:host .preview-material-card h2{font-size:clamp(24px,4vw,38px);line-height:1.25;font-weight:500;max-width:760px;margin:16px 0 24px}:host .preview-material-card p{max-width:760px;font-size:16px;color:var(--ui-muted-strong)}:host .preview-material-card .preview-access-note{font-size:13px;line-height:1.8;color:var(--ui-muted);margin-top:28px}:host .preview-material-action,:host .preview-example-action{display:inline-flex;align-items:center;justify-content:center;padding:13px 18px;border-radius:10px;margin:16px 12px 0 0;text-decoration:none;border:0;background:var(--ui-accent-fill);color:var(--ui-on-accent);font:600 13px/1.5 inherit;cursor:pointer}:host .preview-example-action{background:var(--ui-control);color:var(--ui-text);border:1px solid var(--ui-line-strong)}
#atlas-material-dialog .atlas-material-close{font-family:inherit;font-size:28px;line-height:1}:host .preview-material-action,:host .preview-example-action{font-family:inherit;font-size:13px;font-weight:600;line-height:1.5}
@media(prefers-reduced-motion:reduce){:host *{scroll-behavior:auto!important;transition:none!important}}
/* Size reflowable guide covers against the embedded reader, preserving whole words. */
@media(max-width:760px){
  :host .guide-sheet-cover-source{min-height:calc(100cqw * 1.4142857);padding:28px 24px}
  :host .guide-sheet-cover-source .guide-cover-author{margin-bottom:32px}
  :host .guide-sheet-cover-source h2{font-size:clamp(20px,6.8cqw,30px);line-height:1.04;overflow-wrap:normal;word-break:normal;hyphens:none}
  :host .guide-sheet-cover-source p{font-size:16px;margin-top:24px}
  :host .guide-reader-toolbar>.guide-toolbar-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;margin:0;gap:8px}
  :host .guide-reader-toolbar>.guide-toolbar-meta>span{display:block;font-size:11px}
}

