.display-control{display:flex;align-items:center;gap:8px;flex:none;margin-left:18px;font-size:13px;color:#666}
.display-control select{font:inherit;color:#333;background:#fff;border:1px solid #ccc;border-radius:0;min-height:36px;padding:6px 24px 6px 10px;cursor:pointer}
.mobile-filter-button,.mobile-filter-done,.mobile-filter-shade{display:none}
/* Phone layout has one scrolling reading surface, not stacked desktop panels. */
html:has(body.mobile-layout){height:100%;overflow:hidden;scrollbar-gutter:auto}
body.mobile-layout{height:100dvh;overflow:hidden;max-width:600px;margin:0 auto;display:flex;flex-direction:column;--atlas-top:112px;--atlas-side:0px;background:#fff}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:48px 44px;gap:0 12px;height:112px;flex:0 0 112px;padding:4px 14px 10px;border-bottom:1px solid #ddd}
body.mobile-layout>header .brand{grid-column:1;grid-row:1;font-size:19px;gap:8px;letter-spacing:1px;min-width:0}
body.mobile-layout>header .brand small{font-size:8px;letter-spacing:1px}
body.mobile-layout>header .symbol{width:28px;padding-right:4px}body.mobile-layout>header .symbol svg{width:24px;height:28px}
body.mobile-layout>header .display-control{grid-column:2;grid-row:1;margin:0;gap:0}
body.mobile-layout .display-control>span{display:none}body.mobile-layout .display-control select{min-height:44px;font-size:16px;max-width:112px}
body.mobile-layout>header .search{grid-column:1/-1;grid-row:2;width:100%;max-width:none;margin:0;display:flex;gap:10px}
body.mobile-layout>header .search input{font-size:16px;min-height:44px;min-width:0;width:100%}body.mobile-layout>header .search>span{font-size:13px}
body.mobile-layout .app,body.mobile-layout.reader-open .app,body.mobile-layout.graph-page .app{display:block;flex:1;min-height:0;height:0;overflow:hidden}
body.mobile-layout .workspace,body.mobile-layout.graph-page .workspace{height:100%;min-height:0;width:100%;padding:6px 12px 0;display:flex;flex-direction:column;overflow:hidden}
body.mobile-layout .workspace .selection-bar{height:44px;min-height:44px;max-height:44px;margin:0;gap:8px;overflow:hidden;flex-wrap:nowrap}
body.mobile-layout .selection-bar .layout-controls{display:none}
body.mobile-layout .mobile-filter-button{display:block;flex:none;min-height:44px;padding:6px 14px;font-size:15px}
body.mobile-layout .domain-controls{display:none}body.mobile-layout #selection-summary{min-width:0;flex:1;overflow-x:auto;white-space:nowrap;flex-wrap:nowrap}
body.mobile-layout .workspace .workspace-head{display:none}
body.mobile-layout .workspace .views{height:48px;min-height:48px;max-height:48px;margin:4px 0 0;padding:0;gap:0;touch-action:pan-x}
body.mobile-layout .views button{min-height:44px;font-size:15px;padding:8px 12px}
body.mobile-layout .period-nav{height:68px;min-height:68px;max-height:68px;padding:6px 0;gap:8px}
body.mobile-layout .period-track{height:56px;max-height:56px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-gutter:auto;touch-action:pan-x;gap:8px}
body.mobile-layout .period-track button{height:54px;min-height:54px;max-height:54px;padding:5px 12px;white-space:nowrap;font-size:14px}
body.mobile-layout .period-track button small{font-size:12px}
body.mobile-layout .back-to-top{width:32px;min-width:32px;height:54px;min-height:54px}
body.mobile-layout .content-scroll,body.mobile-layout.graph-page .content-scroll{height:0;flex:1;min-height:0;max-height:none;padding:0 0 max(10px,env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;scrollbar-gutter:auto;-webkit-overflow-scrolling:touch}
body.mobile-layout .content-scroll.map-reading{overflow:hidden}
body.mobile-layout .graph-bar{height:48px;min-height:48px;gap:8px;margin-bottom:6px}
body.mobile-layout .graph-switch button,body.mobile-layout .graph-expand{min-height:44px;padding:6px 9px;font-size:14px}
body.mobile-layout .map-zoom button{min-width:44px;min-height:44px}
body.mobile-layout .map-stage.node-layout .map-person:hover .graph-label{transform:none}
body.mobile-layout .workspace .cards{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:12px}
body.mobile-layout .workspace .person-card{width:100%;min-width:0;max-width:none}
body.mobile-layout .workspace .term-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
body.mobile-layout .workspace .term-tile{width:100%;min-width:0;max-width:none;height:144px;min-height:144px;max-height:144px;padding:14px 10px}
body.mobile-layout .event-row{grid-template-columns:1fr;gap:6px;padding:18px 0}
body.mobile-layout .event-row button{font-size:16px;line-height:1.8;min-height:44px;text-align:left}
body.mobile-layout .time-row{grid-template-columns:1fr}
body.mobile-layout .filters,body.mobile-layout.side-collapsed .filters{display:none}
body.mobile-layout.mobile-filters-open .filters{display:block;position:fixed;inset:0 auto 0 0;width:min(88vw,360px);height:100dvh;max-height:none;padding:18px 20px max(24px,env(safe-area-inset-bottom));z-index:101;background:white;overflow:auto;overscroll-behavior:contain}
body.mobile-layout .mobile-filter-done{display:block;min-height:44px;font-size:16px;padding:6px 12px}
body.mobile-layout .filter-title{position:sticky;top:-18px;background:#fff;z-index:2;padding:10px 0;border-bottom:1px solid #ddd;gap:8px}
body.mobile-layout .filter-title h1{flex:1;font-size:19px}
body.mobile-layout .mobile-filter-shade:not([hidden]){display:block;position:fixed;inset:0;z-index:100;background:#0004;border:0;width:100%;height:100%}
body.mobile-layout .reader-slot:not([hidden]){position:fixed;inset:0;z-index:110;width:100%;max-width:600px;height:100dvh;min-height:0;margin:0 auto;padding:0;border:0;background:#fff}
body.mobile-layout #reader.unified-reader{height:100%;max-height:none;width:100%;max-width:none;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
body.mobile-layout .reader-resizer{display:none}
body.mobile-layout .reader-tools{height:58px;min-height:58px;padding:6px 14px;top:0}
body.mobile-layout .reader-tools button{min-height:44px;min-width:44px;font-size:16px}
body.mobile-layout #reader-body{padding:22px 18px max(32px,env(safe-area-inset-bottom));font-size:17px;overflow-wrap:break-word}
body.mobile-layout #reader-body h2{font-size:28px}
body.mobile-layout #reader .profile-tabs{top:58px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;gap:2px;padding:6px 0;touch-action:pan-x}
body.mobile-layout #reader .profile-tabs button{flex:none;min-height:44px;padding:8px 12px;font-size:15px;white-space:nowrap}
body.mobile-layout #reader .profile-tabs .reader-top{padding:8px;min-width:32px}
body.mobile-layout #reader-body .profile-photo{width:84px;margin-left:16px}body.mobile-layout #reader-body .profile-photo img{width:84px;height:116px}
body.mobile-layout #reader .profile-facts{grid-template-columns:86px minmax(0,1fr);gap:12px}
body.mobile-layout #reader .source-details>div{grid-template-columns:1fr;gap:8px}
body.mobile-layout #reader .reader-source{overflow-wrap:anywhere}
body.mobile-layout button,body.mobile-layout select{touch-action:manipulation}
@media(prefers-reduced-motion:reduce){body.mobile-layout *{scroll-behavior:auto!important;transition:none!important}}
/* Explicit desktop mode keeps the full canvas even in a narrow window. */
body[data-display-mode="desktop"]{min-width:1280px;--atlas-top:80px}
body[data-display-mode="desktop"]>header{height:80px;flex-basis:80px;flex-direction:row}
body[data-display-mode="desktop"] .app{display:grid;grid-template-rows:auto;grid-template-columns:var(--atlas-side) minmax(0,1fr)}
body[data-display-mode="desktop"].reader-open .app{grid-template-columns:var(--atlas-side) minmax(0,1fr) var(--reader-width)}
body[data-display-mode="desktop"] .filters{position:sticky;top:0;height:calc(100dvh - var(--atlas-top));max-height:none;padding:24px}
body[data-display-mode="desktop"] .workspace{padding:10px 28px 12px}
body[data-display-mode="desktop"] .reader-slot{position:sticky;top:0;width:auto;height:calc(100dvh - var(--atlas-top));min-height:500px;padding-left:10px;border-top:0}
body[data-display-mode="desktop"] .reader-resizer{display:flex}
body[data-display-mode="desktop"] .term-grid{grid-template-columns:repeat(auto-fill,215px)}
body[data-display-mode="desktop"] .term-tile{width:215px;min-width:215px;max-width:215px}
body.mobile-layout .workspace .selection-bar #selection-summary{height:44px;min-height:44px;max-height:44px;padding:4px 0}

/* Frame the supplied logo without its generous outer white margins. */
body>header .symbol{width:40px;height:40px;flex:0 0 40px;overflow:hidden;justify-content:center;padding:0}
body>header .symbol img{display:block;width:60px;height:60px;max-width:none;flex:none;object-fit:contain}
body.mobile-layout>header .symbol{width:30px;height:30px;flex-basis:30px;padding:0}
body.mobile-layout>header .symbol img{width:45px;height:45px}

/* Standalone masthead mark. */
body>header .brand{gap:0;flex-shrink:0}
body>header .symbol{width:64px;height:64px;flex-basis:64px}
body>header .symbol img{width:96px;height:96px}
body.mobile-layout>header .brand{gap:0}
body.mobile-layout>header .symbol{width:44px;height:44px;flex-basis:44px}
body.mobile-layout>header .symbol img{width:66px;height:66px}
/* Quiet navigation: spacing and pale surfaces replace repeated rules. */
body>header{border-bottom-color:transparent}
body>header .symbol{width:56px;height:56px;flex-basis:56px}
body>header .symbol img{width:84px;height:84px}
body>header .search{width:280px;max-width:45vw;min-height:44px;margin-left:auto;padding:0 15px;gap:10px;background:#f4f4f4;border:0;border-radius:24px;box-sizing:border-box}
body>header .search .search-icon{width:20px;height:20px;flex:0 0 20px;fill:none;stroke:#333;stroke-width:1.6;stroke-linecap:round}
body>header .search input{width:100%;min-width:0;min-height:44px;padding:0;background:transparent;border:0;outline:none;font-size:15px}
body>header .search:focus-within{outline:2px solid #666;outline-offset:3px}
body .filters{border-right-color:transparent}
body .filters .domain-row,body .filters .domain,body .filters details{border-bottom-color:transparent}
body .workspace .selection-bar,body .workspace .views,body .period-nav{border-color:transparent}
body .selection-bar .layout-controls,body .selection-bar .layout-controls button+button{border-color:transparent}
body .selection-bar .layout-controls button:hover{background:#f1f1f1}
body .selection-bar .chip{border-color:transparent;background:#f5f5f5}
body .period-track button:not([aria-current="location"]){border-color:transparent;background:#f5f5f5}
body .period-track button:not([aria-current="location"]):hover{background:#e9e9e9}
body .back-to-top{border-color:transparent;background:#f5f5f5}
body .back-to-top:hover{background:#303030;color:white}
body .map-desk{border-color:transparent}
body .graph-switch button,body .graph-expand{border-color:transparent}
body .graph-switch button:not([aria-pressed="true"]),body .graph-expand{background:#f5f5f5}
body .map-stage.group-layout .map-school{border-color:transparent;background:#f7f7f7}
body .map-stage.group-layout .map-school-title{border-bottom-color:transparent}
body .map-stage.group-layout .map-person:not(.graph-current):not(:hover){border-color:transparent}
body.mobile-layout{--atlas-top:76px}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{height:76px;flex-basis:76px;grid-template-columns:44px minmax(0,1fr);grid-template-rows:44px;gap:14px;padding:16px 14px;border-bottom-color:transparent}
body.mobile-layout>header .brand{grid-column:1;grid-row:1}
body.mobile-layout>header .symbol{width:44px;height:44px;flex-basis:44px}
body.mobile-layout>header .symbol img{width:66px;height:66px}
body.mobile-layout>header .search{grid-column:2;grid-row:1;max-width:none;width:100%;margin:0;padding:0 12px;gap:8px}
body.mobile-layout>header .search input{font-size:16px}
body .filters .domain-row,body .filters .domain,body .filters details{border-color:transparent}
/* Keep selected subjects on a single, height-stable scrolling line. */
body .workspace .selection-bar{display:flex;align-items:center;flex-wrap:nowrap;min-width:0;height:44px;min-height:44px;max-height:44px;padding:0;overflow:hidden}
body .selection-bar .layout-controls,body .selection-bar .domain-controls{flex-shrink:0;margin-bottom:0}
body .workspace .selection-bar #selection-summary{display:flex;flex:1 1 0;min-width:0;flex-wrap:nowrap;align-items:center;gap:8px;height:44px;min-height:44px;max-height:44px;padding:5px 0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scrollbar-gutter:auto;overscroll-behavior-x:contain;touch-action:pan-x;overflow-anchor:none}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar{display:none;width:0;height:0}
body .selection-bar #selection-summary>*{flex-shrink:0;white-space:nowrap}
body .selection-bar #selection-summary .chip{height:34px;min-height:34px;margin:0}
body>header{padding-top:12px}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{padding-top:22px;padding-bottom:10px}
/* The same toolbar geometry in every view; reserve scrollbar space. */
body .workspace .selection-bar,body.graph-page .workspace .selection-bar{height:52px;min-height:52px;max-height:52px;margin-bottom:12px;padding:0}
body .workspace .selection-bar #selection-summary,body.graph-page .workspace .selection-bar #selection-summary{height:50px;min-height:50px;max-height:50px;padding:4px 0 6px;scrollbar-width:thin;scrollbar-color:#b8b8b8 transparent;overflow-x:auto;overflow-y:hidden}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar{display:block;height:5px}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar-thumb{background:#b8b8b8;border-radius:3px}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar-track{background:transparent}
body .workspace .workspace-head,body.graph-page .workspace .workspace-head{height:42px;min-height:42px;max-height:42px}
body .workspace h2,body.graph-page .workspace h2{font-size:26px;line-height:1.35}
body.mobile-layout .workspace .selection-bar,body.mobile-layout.graph-page .workspace .selection-bar{height:52px;min-height:52px;max-height:52px;margin-bottom:0}
/* Scrollbar visibility must never change the text row's position. */
body .workspace .selection-bar #selection-summary,body.graph-page .workspace .selection-bar #selection-summary{align-items:flex-start;padding:8px 0 0;overflow-x:scroll;overflow-y:hidden;scrollbar-color:transparent transparent}
body .workspace .selection-bar #selection-summary:hover,body .workspace .selection-bar #selection-summary.is-scrolling,body .workspace .selection-bar #selection-summary:has(:focus-visible){scrollbar-color:#b8b8b8 transparent}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar-thumb{background:transparent}
body .workspace .selection-bar #selection-summary:hover::-webkit-scrollbar-thumb,body .workspace .selection-bar #selection-summary.is-scrolling::-webkit-scrollbar-thumb,body .workspace .selection-bar #selection-summary:has(:focus-visible)::-webkit-scrollbar-thumb{background:#b8b8b8}
body .workspace .selection-bar #selection-summary::-webkit-scrollbar-button{display:none;width:0;height:0}
body .selection-bar #selection-summary .hint{margin:0;line-height:34px}
/* Leave enough room for the platform scrollbar and focus scrolling. */
body .workspace .selection-bar,body.graph-page .workspace .selection-bar,body.mobile-layout .workspace .selection-bar,body.mobile-layout.graph-page .workspace .selection-bar{height:60px;min-height:60px;max-height:60px}
body .workspace .selection-bar #selection-summary,body.graph-page .workspace .selection-bar #selection-summary{height:60px;min-height:60px;max-height:60px;padding-top:13px}
/* Do not create native scrollbar arrows when every subject fits. */
body .workspace .selection-bar #selection-summary,body.graph-page .workspace .selection-bar #selection-summary{overflow-x:auto}

/* Keep full names readable and card widths consistent on phones. */
body.mobile-layout .workspace .cards{grid-template-columns:1fr}
