/* Calm subject navigation; reading modes remain anchored below the heading. */
body>header{grid-template-columns:66px 76px minmax(0,1fr) minmax(160px,250px) 36px;gap:14px;padding:24px 28px 16px}
.culture-region select{border:0;background:#fff;color:#555;font:15px/1.5 inherit;padding:10px 4px;max-width:80px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.culture-fields{display:flex;gap:clamp(4px,1vw,20px);align-items:center;overflow:auto;white-space:nowrap;scrollbar-width:none;overscroll-behavior:contain;min-width:0}
.culture-fields button{position:relative;border:0;background:none;padding:10px 9px;flex:none;font-size:18px;color:#555;min-height:44px}
.culture-fields button:hover{background:#f4f4f4;color:#222}.culture-fields button[aria-pressed=true]{color:#222}.culture-fields button[aria-pressed=true]:after{content:'';position:absolute;height:2px;background:#333;bottom:2px;left:9px;right:9px}
body .workspace>.views,body.graph-page .workspace>.views{display:flex;gap:4px;align-items:center;padding:0;margin-top:8px;height:46px;min-height:46px;max-height:46px;border:0;overflow:auto;scrollbar-width:none}
body .workspace>.views button{height:40px;min-height:40px;padding:8px 14px;font-size:17px;line-height:24px;border:0;background:transparent;color:#333;flex:none}
body .workspace>.views button:hover{background:#f3f3f3}body .workspace>.views button.active{background:#303030;color:white}
.culture-context{display:flex;gap:16px;align-items:center;height:34px;min-height:34px;font-size:13px;color:#777;white-space:nowrap;overflow:hidden}.culture-context>span:first-child{color:#444}.culture-context-note{overflow:hidden;text-overflow:ellipsis}
.culture-layout-toggle,body .layout-controls button{display:grid;place-items:center;width:36px;height:36px;min-width:36px;border:0;border-radius:9px;background:transparent;color:#777;padding:7px}
.culture-layout-toggle:hover,body .layout-controls button:hover{background:#eee;color:#333}.culture-layout-toggle svg,body .layout-controls svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5}.culture-layout-toggle[hidden],body .layout-controls button[hidden]{display:none}
.filter-title{gap:4px}.filter-title h1{margin-right:auto}.filter-title .culture-layout-toggle{flex:none}
body .layout-controls{margin:0;gap:3px}body .layout-controls:has(button:not([hidden])){margin-right:4px}
.school-evolution .content-scroll #content{display:flex;flex-direction:column;min-height:0}.evolution-scroll{overflow:auto;overscroll-behavior:contain;padding:24px 8px 60px;flex:1;min-height:0}.evolution-intro{font-size:24px;line-height:1.8;margin:0 0 32px}.evolution-intro small{font-size:14px;color:#777}
.evolution-row{display:flex;align-items:center;gap:22px;min-width:720px;margin-bottom:36px;max-width:1100px}.evolution-node{border:0;background:#f5f5f5;min-height:148px;flex:1;text-align:left;padding:24px;min-width:210px;max-width:350px;color:#333}.evolution-node:hover{background:#e9e9e9}.evolution-node strong,.evolution-node span,.evolution-node small{display:block}.evolution-node strong{font-size:20px;line-height:1.6;margin:8px 0}.evolution-node span,.evolution-node small{font-size:13px;color:#777}
.evolution-connection{width:230px;flex:none;text-align:center;font-size:13px;color:#666}.evolution-connection svg{display:block;width:100%;height:22px;fill:none;stroke:#999;stroke-width:1.3}.evolution-connection small{display:block;line-height:1.65;margin:5px 0}.evolution-connection a{font-size:12px;color:#777}
.parallel-movements{margin-top:40px}.parallel-movements h3{font-size:18px}.parallel-movements p{font-size:13px;color:#777}.parallel-movements>div{display:flex;gap:16px;flex-wrap:wrap}.parallel-movements .evolution-node{flex:0 0 260px}
.culture-empty{padding:48px 12px;max-width:660px}.culture-empty h3{font-size:25px}.culture-empty p{line-height:1.9;color:#777}.culture-empty button{padding:12px 18px;border:0;background:#f4f4f4;margin:12px 10px 0 0;min-height:44px}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{height:124px;flex-basis:124px;grid-template-columns:44px 76px minmax(0,1fr);grid-template-rows:44px 44px;padding:16px 14px 8px;gap:12px 8px}
body.mobile-layout>header .brand{grid-column:1;grid-row:1}body.mobile-layout>header .culture-region{grid-column:2;grid-row:1}body.mobile-layout>header .search{grid-column:3;grid-row:1;min-width:0}body.mobile-layout>header .culture-fields{grid-column:1/-1;grid-row:2;gap:10px}body.mobile-layout>header .culture-layout-toggle{display:none}.mobile-layout .culture-fields button{font-size:16px}.mobile-layout .culture-context-note{display:none}.mobile-layout .culture-context{height:28px;min-height:28px}.mobile-layout .filter-title .culture-layout-toggle{display:none}.mobile-layout .evolution-row{min-width:640px;gap:12px}.mobile-layout .evolution-node{padding:16px;min-width:180px}.mobile-layout .evolution-connection{width:210px}
@media(min-width:801px) and (max-width:1150px){body>header{grid-template-columns:54px 70px minmax(0,1fr) 170px 32px;padding-left:20px;padding-right:20px;gap:8px}.culture-fields button{font-size:16px;padding-left:7px;padding-right:7px}.culture-fields{gap:2px}}


.culture-shortcuts{margin:14px 0 24px}.culture-shortcuts p{font-size:12px;color:#888;margin:0 0 8px}.culture-shortcuts button{display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;border:0;background:none;padding:10px 4px;font-size:14px;color:#555;min-height:40px}.culture-shortcuts button:hover{background:#f4f4f4}.culture-shortcuts span{color:#aaa}.domain-row[hidden]{display:none}

.school-dot{position:absolute;left:0;top:calc(50% - 5px);width:10px;height:10px;border:1.5px solid #555;border-radius:50%;background:#fff}.school-map-node[aria-pressed=true] .school-dot{background:#222}

body>header{grid-template-columns:66px 76px minmax(0,1fr) minmax(160px,250px)}.culture-layout-toggle,body .layout-controls button{border-radius:0;color:#333;font-size:12px}.culture-layout-toggle:hover,body .layout-controls button:hover{background:#f3f3f3}@media(min-width:801px) and (max-width:1150px){body>header{grid-template-columns:54px 70px minmax(0,1fr) 170px}}
/* Align the main navigation independently of its secondary role badges. */
body>header{padding:0 28px;gap:14px;grid-template-columns:56px 70px minmax(0,1fr) minmax(180px,250px)}
.culture-fields{height:92px;gap:8px;align-items:center}
.culture-fields [data-culture-field]{display:flex;align-items:center;justify-content:center;position:relative;width:72px;min-width:72px;height:40px;min-height:40px;padding:6px 8px;font-size:18px;line-height:28px}
.culture-fields [data-culture-field]:hover{background:transparent;color:#171717}
.culture-fields [data-culture-field][aria-pressed=true]:after{bottom:0;left:18px;right:18px;height:1px}
.culture-fields [data-culture-field]:focus-visible{outline-offset:-2px}
.culture-role-chip{position:absolute;top:43px;left:0;display:flex;align-items:center;justify-content:center;width:72px;height:22px;background:var(--wash,#f3f3f3);color:#666;font-size:11px;font-weight:400;line-height:22px;border-radius:0}
.culture-role-menu{position:fixed;z-index:100;width:168px;padding:4px;background:#fff;border:1px solid #e5e5e5;box-shadow:0 4px 12px #0000000c;overflow:auto;overscroll-behavior:contain}
.culture-role-menu[hidden]{display:none}
.culture-role-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:34px;border:0;border-radius:0;background:#fff;color:#333;text-align:left;padding:6px 10px;font-family:inherit;font-size:14px;line-height:22px;cursor:pointer}
.culture-role-menu button:hover,.culture-role-menu button:focus-visible,.culture-role-menu button[aria-checked=true]{background:var(--wash,#f3f3f3)}
.culture-role-menu small{font-size:11px;color:#888;font-variant-numeric:tabular-nums}
body .graph-switch{gap:4px;background:transparent}
body .graph-switch button+button{border-left:0}
@media(min-width:801px) and (max-width:1150px){body>header{padding:0 20px;gap:8px;grid-template-columns:48px 64px minmax(0,1fr) 180px}.culture-fields{gap:4px}.culture-fields [data-culture-field]{width:68px;min-width:68px;font-size:17px}.culture-role-chip{left:-2px}}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{height:148px;flex-basis:148px;grid-template-rows:44px 76px;padding:12px 14px 8px;gap:8px}
body.mobile-layout>header .culture-fields{height:76px;align-items:flex-start;padding-top:3px;gap:4px}
body.mobile-layout .culture-fields [data-culture-field]{width:72px;min-width:72px;font-size:16px}
/* Titles keep a stable baseline; inline links inherit the surrounding sentence. */
.workspace #title{white-space:nowrap}
.workspace #title .view-title-en{display:inline;font-family:inherit;font-size:15px;font-weight:400;letter-spacing:.2px;color:#777;margin-left:10px}
#reader-body p .text-button,#reader-body li .text-button,#reader-body dd .text-button,#reader-body blockquote .text-button,#reader-body .connection-description .text-button{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit}
#reader-body p a,#reader-body li a{font-family:inherit}
@media(max-width:600px){.workspace #title .view-title-en{font-size:12px;margin-left:6px;letter-spacing:0}}
.culture-region select:focus,.culture-region select:focus-visible{outline:none;box-shadow:none}
.culture-region select.keyboard-focus:focus{outline:1px solid #888;outline-offset:2px}
/* Boundless Thought: one aligned mark and bilingual wordmark. */
body>header{grid-template-columns:236px 64px minmax(0,1fr) minmax(180px,240px)}
body>header .brand{display:flex;align-items:center;gap:12px;white-space:nowrap;letter-spacing:0}
body>header .symbol{position:relative;display:block;width:52px;height:52px;flex:0 0 52px;overflow:hidden;border-radius:50%}
body>header .symbol img{position:absolute;width:87px;height:87px;max-width:none;left:-17.5px;top:-16.5px;object-fit:contain}
body>header .brand-wordmark{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px}
body>header .brand-zh{font:500 24px/1.15 var(--serif);letter-spacing:2px}
body>header .brand-en{font:500 10px/1.2 var(--sans);letter-spacing:1.55px;word-spacing:3px;color:#555}
@media(min-width:801px) and (max-width:1150px){body>header{grid-template-columns:214px 58px minmax(0,1fr) 180px;gap:8px}body>header .brand{gap:10px}body>header .brand-zh{font-size:22px}body>header .brand-en{font-size:9px;letter-spacing:1.3px}}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{grid-template-columns:minmax(0,1fr) 64px;grid-template-rows:48px 38px 76px;height:198px;flex-basis:198px;padding:10px 14px;gap:8px}
body.mobile-layout>header .brand{grid-column:1;grid-row:1;gap:10px}
body.mobile-layout>header .culture-region{grid-column:2;grid-row:1}
body.mobile-layout>header .search{grid-column:1/-1;grid-row:2;min-height:36px}
body.mobile-layout>header .culture-fields{grid-column:1/-1;grid-row:3}
body.mobile-layout>header .symbol{width:42px;height:42px;flex-basis:42px}
body.mobile-layout>header .symbol img{width:70px;height:70px;left:-14px;top:-13.5px}
body.mobile-layout>header .brand-zh{font-size:20px;letter-spacing:1.5px}
body.mobile-layout>header .brand-en{font-size:8px;letter-spacing:1.3px;word-spacing:2px}
body.mobile-layout>header .brand-wordmark{gap:4px}
.loading-title{letter-spacing:1px}
body>header{grid-template-columns:236px 64px minmax(0,1fr) 310px}
body>header .search{min-width:0;width:100%}
@media(min-width:801px) and (max-width:1150px){body>header{grid-template-columns:214px 58px minmax(0,1fr) 290px}}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{grid-template-columns:minmax(0,1fr) 64px}
/* Shared spacing and typography for cross-period comparisons. */
.views [hidden]{display:none!important}
.style-note{color:#666;font-size:14px;margin:10px 0 18px}
.style-member{min-width:0}.style-member .person-card{width:100%}
.style-era{display:block;color:#777;font-size:13px;margin:0 0 8px}
.music-lane{box-sizing:border-box;border-top:1px solid #e7e7e7;padding:16px 0 0;margin-top:12px}
.music-lane h4{font-size:14px;font-weight:400;color:#666;margin:0 0 12px}
.music-lane .map-person{min-height:72px;margin:8px 0}
.group-layout .music-lane .map-person{background:var(--wash,#f5f5f5)}
#music-genre-filter{margin-top:12px;border-top:1px solid #e7e7e7;padding-top:10px}
#music-genre-filter summary{font-size:14px;cursor:pointer;margin-bottom:8px}

.style-branch>.style-branch{margin:24px 0 0 18px;padding-left:18px;border-left:1px solid #e7e7e7}.style-branch h4{font-size:16px;font-weight:500;margin:0 0 18px}.style-branch h3 small,.style-branch h4 small{font-size:13px;color:#777;font-weight:400}.style-branch>.cards:empty{display:none}.style-branch h3 button,.style-branch h4 button{font:inherit}.style-tags{display:flex;flex-wrap:wrap;gap:6px 10px}.style-tag{font-size:14px}.styled-person-card{min-width:0}.styled-person-card>.person-card{width:100%}.card-style-tags{margin-top:8px;padding:0 4px 12px}.style-member .style-tags{margin-bottom:8px}

/* Small separate digit tiles, inspired by split-flap clocks. */
body>header{grid-template-columns:236px 64px minmax(0,1fr) 400px}
.count-search{display:flex;align-items:center;gap:16px;min-width:0}
body>header .count-search .search{width:310px;flex:1;min-width:0}
.atlas-counter{display:flex;flex-direction:column;align-items:center;gap:3px;flex:none;line-height:1}
.counter-caption{font-size:11px;color:#777;letter-spacing:1px}
.counter-digits{display:flex;gap:3px;perspective:180px}
.counter-digit{position:relative;display:grid;place-items:center;width:20px;height:28px;border-radius:2px;color:#fff;background:linear-gradient(#353535 49%,#242424 51%);font:600 21px/1 Arial,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:0;text-align:center;padding:0 0 1px}
.counter-digit:after{content:'';position:absolute;top:50%;left:0;right:0;height:1px;background:#1118;pointer-events:none}
.genre-map-node[aria-pressed=true] .graph-dot{background:#222}
@media(min-width:801px) and (max-width:1150px){body>header{grid-template-columns:214px 58px minmax(0,1fr) 370px}}
body.mobile-layout>header,body.mobile-layout.top-collapsed>header{grid-template-columns:minmax(0,1fr) 64px}
body.mobile-layout>header .count-search{grid-row:3;grid-column:1/-1;gap:12px;width:100%;min-width:0}
body.mobile-layout>header .count-search .search{grid-area:auto;min-width:0;width:auto}
body.mobile-layout .counter-digit{width:18px;height:26px;font-size:19px;line-height:1}

.role-count-note{margin:6px 8px 4px;padding-top:8px;border-top:1px solid #e7e7e7;font-size:12px;line-height:1.6;color:#777}

/* Keep every scrollport inside the viewport, including its bottom padding. */
html:has(body:not(.mobile-layout)){height:100%;overflow:hidden}
body:not(.mobile-layout){height:100dvh;overflow:hidden;display:flex;flex-direction:column}
body:not(.mobile-layout)>header{flex-shrink:0}
body:not(.mobile-layout) .app{flex:1;min-height:0;height:0;overflow:hidden}
body:not(.mobile-layout) .workspace{height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column}
body:not(.mobile-layout) .content-scroll{flex:1;min-height:0;height:0;max-height:none}
body:not(.mobile-layout) .filters,body:not(.mobile-layout) .reader-slot{height:100%;min-height:0;max-height:100%;position:relative;top:auto}
body:not(.mobile-layout).graph-expanded .workspace{height:100dvh}
body:not(.mobile-layout).graph-expanded .reader-slot{position:fixed;top:0;height:100dvh}
body .content-scroll:not(.map-reading){padding-bottom:max(32px,env(safe-area-inset-bottom));scroll-padding-bottom:32px}
body .filters{padding-bottom:max(32px,env(safe-area-inset-bottom))}
body #reader-body{padding-bottom:max(40px,env(safe-area-inset-bottom))}

/* Decimal drums move inside fixed tiles, keeping the header still. */
.counter-digit{--digit-height:28px;padding:0;overflow:hidden}
.counter-wheel{position:absolute;inset:0;overflow:hidden}
.counter-track{display:block;will-change:transform}
.counter-track>span{display:grid;place-items:center;height:var(--digit-height);padding-bottom:1px}
.counter-digit:after{z-index:1}
body.mobile-layout .counter-digit{--digit-height:26px}
body>header .count-search{align-items:center}
body>header .culture-region{align-self:center}

.music-lane{padding-top:50px}
.music-lane-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
.music-lane-labels>span{position:absolute;left:12px;display:block;padding:0 8px;background:#fff;color:#666;line-height:1.6;white-space:nowrap}

/* Resting digits use normal text layout rather than a composited moving layer. */
.counter-digit:after{display:none}
.counter-digit[data-settled=true] .counter-track{transform:none!important;will-change:auto}
.counter-digit[data-settled=true] .counter-track>span{display:none}
.counter-digit[data-settled=true] .counter-track>span.current{display:grid}
.era-pages{display:flex;align-items:center;gap:8px;margin:8px 0 12px;color:#777;font-size:13px}
.era-pages button{display:grid;place-items:center;width:28px;height:28px;border:0;background:#f3f3f3;padding:0;font-size:18px}
.era-pages button:disabled{opacity:.3;cursor:default}
.era-pages-placeholder{height:28px;visibility:hidden}
.paged-map-count{display:flex;align-items:center;justify-content:space-between;min-height:28px}
.paged-map-count .era-pages{margin:0;gap:6px}
.paged-map-count .era-pages button{width:24px;height:24px;font-size:16px;pointer-events:auto;cursor:pointer}
.counter-digits{gap:4px}
#reader,#reader-body,#profile-panel{overflow-anchor:none}
/* A shared slot width for every regional label in the same historical period. */
body .period-track button[data-jump-period]{box-sizing:border-box;flex:0 0 calc(var(--era-label-width,8em) + 24px);width:calc(var(--era-label-width,8em) + 24px);padding-left:12px;padding-right:12px}
.counter-digit{flex:0 0 20px;width:20px;min-width:20px;max-width:20px}
body.mobile-layout .counter-digit{flex-basis:18px;width:18px;min-width:18px;max-width:18px}

.paged-map-count .reading-pages{margin:0;gap:6px}.map-column [data-list-page]{pointer-events:auto}
/* Two chronological rows, with horizontal access when the workspace narrows. */
body:not(.mobile-layout) .period-nav{height:calc(var(--era-track-height,132px) + 16px);min-height:calc(var(--era-track-height,132px) + 16px);max-height:calc(var(--era-track-height,132px) + 16px);padding:8px 0}
body:not(.mobile-layout) .period-track{height:var(--era-track-height,132px);max-height:var(--era-track-height,132px);flex-wrap:wrap;overflow-x:auto;overflow-y:auto;scrollbar-gutter:auto;align-items:flex-start}
body:not(.mobile-layout) .period-track:has([data-jump-period]){display:grid;grid-template-columns:repeat(var(--era-columns-count,7),192px);grid-auto-rows:55px;grid-auto-flow:row;gap:8px;justify-content:start;align-content:start;overflow-y:hidden}
body:not(.mobile-layout) .period-track button[data-jump-period]{width:100%;min-width:calc(var(--era-label-width,8em) + 24px)}
body .period-track{--scroll-ink:#aaa;scrollbar-width:thin;scrollbar-color:#aaa #f3f3f3;padding-bottom:8px}
body .period-track::-webkit-scrollbar{height:6px}
body .period-track::-webkit-scrollbar-track{background:#f3f3f3}
body .period-track::-webkit-scrollbar-thumb{background:#aaa;border-radius:3px}
body.mobile-layout .period-track{height:66px;max-height:66px}
body:not(.mobile-layout) .period-nav .back-to-top{height:50px;min-height:50px;max-height:50px;align-self:flex-start}
/* Remove the duplicated selection strip without leaving its reserved height. */
body:not(.mobile-layout) .workspace .selection-bar{display:none!important}
body .workspace .selection-bar #selection-summary{display:none!important}
.sidebar-all-domains{padding:0 0 10px;margin:0 0 8px;border-bottom:1px solid #eee}
.sidebar-all-domains .check{margin:0;gap:9px}
body.mobile-layout .workspace .selection-bar{height:36px;min-height:36px;max-height:36px;margin-bottom:0}
/* Align sidebar and workspace heading rows, then separate the first control. */
body:not(.mobile-layout) .filters{padding-top:10px}
body:not(.mobile-layout) .filters .filter-title{height:42px;min-height:42px;align-items:center;margin-bottom:14px}
/* Fade only the scrollbar paint; its space and the era positions stay fixed. */
body .period-track{scrollbar-color:transparent transparent}
body .period-track::-webkit-scrollbar-track,body .period-track::-webkit-scrollbar-thumb{background:transparent}
body .period-nav:hover .period-track,body .period-track:has(:focus-visible){scrollbar-color:#aaa #f3f3f3}
body .period-nav:hover .period-track::-webkit-scrollbar-track,body .period-track:has(:focus-visible)::-webkit-scrollbar-track{background:#f3f3f3}
body .period-nav:hover .period-track::-webkit-scrollbar-thumb,body .period-track:has(:focus-visible)::-webkit-scrollbar-thumb{background:#aaa}
body:not(.mobile-layout) .period-nav .back-to-top{height:55px;min-height:55px;max-height:55px;margin-top:0;align-self:flex-start}
body.mobile-layout .period-nav .back-to-top{height:54px;min-height:54px;max-height:54px;margin-top:0;align-self:flex-start}
