/* A restrained editorial scale, shared by navigation and reading surfaces. */
:root{--ink:#202020;--rule:#d4d4d0;--wash:#f5f5f2;--serif:'Noto Serif TC',Georgia,serif;--sans:'Noto Sans TC',sans-serif;--scroll-ink:transparent}
body{color:var(--ink);font-family:var(--sans);font-size:16px}
button,input{font-family:var(--sans)}
body>header{padding:0 28px;border-color:var(--rule)}
body>header .brand{gap:14px;align-items:center;font:500 24px/1.25 var(--serif);letter-spacing:3px}
body>header .symbol{display:flex;align-items:center;padding:0;border:0;width:40px;height:44px}
.symbol svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body>header .brand small{font:11px/1.8 var(--sans);letter-spacing:2px;margin-top:5px}
body>header .search{width:340px;border-color:#aaa;gap:16px}
body>header .search input,body>header .search>span{font-size:15px}
body .workspace h2,body.graph-page .workspace h2{font:500 26px/1.4 var(--serif);letter-spacing:1px}
.filter-title h1{font-size:17px}.muted{font-size:15px}.check{font-size:16px}
.domain summary,.subdomains label{font-size:15px}.domain summary small,.check span,.subdomains small{font:13px/1.5 var(--sans);font-variant-numeric:tabular-nums}
body .workspace .selection-bar,body.graph-page .workspace .selection-bar{height:52px;min-height:52px;max-height:52px;padding:0;margin-bottom:12px;gap:14px;overflow:hidden}
body .selection-bar #selection-summary{height:50px;min-height:50px;max-height:50px;padding:7px 3px;align-items:center;box-sizing:border-box;overflow-y:hidden}
body .selection-bar .chip{height:34px;min-height:34px;margin:0;padding:4px 10px;line-height:24px;border:1px solid var(--rule);font-size:14px}
.selection-bar .layout-controls{gap:0;padding:0;border:1px solid var(--rule);height:34px;min-height:34px}
.selection-bar .layout-controls button{width:34px;height:32px;border:0;border-radius:0;padding:6px;color:var(--ink)}
.selection-bar .layout-controls button+button{border-left:1px solid var(--rule)}
.selection-bar .layout-controls svg{width:20px;height:20px;stroke-width:1.4;stroke-linecap:square;stroke-linejoin:miter}
.selection-bar .layout-controls button:hover{background:var(--wash)}
.selection-bar .layout-controls button[aria-expanded=false]{background:var(--ink);color:#fff}
body .workspace .views button{font-size:15px;padding:7px 15px}
body .period-nav{height:144px;min-height:144px;max-height:144px;padding:12px 0;gap:8px}
body .period-track{height:118px;max-height:118px;padding:0;gap:8px}
body .period-track button{height:55px;min-height:55px;max-height:55px;padding:6px 12px;font-size:15px;border-color:var(--rule)}
.period-track button small{font:12px/1.5 var(--sans);font-variant-numeric:tabular-nums;letter-spacing:.1px;margin-top:3px}
body .back-to-top{width:32px;flex-basis:32px;height:118px;margin:0;border-color:var(--rule);font-size:12px}
.graph-bar{gap:16px}.graph-switch button,.graph-expand{font-size:15px;border-color:var(--rule)}
.graph-switch button{padding:6px 13px}.graph-expand{padding:6px 12px}
.map-stage .map-column h3{font:500 22px/1.5 var(--serif)}
.era-date,.map-count,.map-stage .map-person small,.time-row>span,.event-row>span{font-family:var(--sans);font-variant-numeric:tabular-nums;letter-spacing:.1px}
.map-stage .map-school-title{font-size:14px}
.map-stage .map-person strong{font:500 16px/26px var(--serif)}
.map-stage .map-person small{font-size:13px;line-height:20px}
.map-stage.group-layout .map-person .graph-label{background:transparent}
.map-stage.group-layout .map-person:hover,.workspace .term-tile:hover,.workspace .person-card:hover{border-color:#555;background:var(--wash)}
.map-stage.group-layout .map-person.graph-current,.map-stage.group-layout .map-person.graph-current:hover{background:var(--ink);border-color:var(--ink);color:white}
.map-stage.group-layout .map-person.graph-current strong{font-size:16px}
/* Hover and selection share one enlargement; line boxes remain unchanged. */
.map-stage.node-layout .map-person.graph-current strong,.map-stage.node-layout .map-person:has(.graph-label:hover) strong{font-size:16px;line-height:26px;transform:none}
.map-stage.node-layout .map-person.graph-current small,.map-stage.node-layout .map-person:has(.graph-label:hover) small{font-size:13px;line-height:20px}
.map-stage.node-layout .map-person:hover{border-color:transparent;background:transparent}
.workspace .term-tile strong{font-size:20px}.workspace .term-tile span{font:15px/1.55 Georgia,var(--serif)}
.person-card h3{font-size:21px}.person-card .english{font-size:14px}.person-card .branch-text{font-size:14px}
.tag{font-size:13px}.english{font-family:Georgia,var(--serif)}
#reader-body{font-size:17px}#reader-body p{line-height:1.95}
#reader-body h2,#reader-body .profile-intro h2{font:500 32px/1.5 var(--serif)}
#reader-body .profile-quote{font-size:24px}#reader-body .profile-kicker{font-size:14px}
#reader-body .quote-citation,#reader-body .profile-photo figcaption{font-size:13px}
.profile-tabs button{font-size:15px}.profile-facts{font-size:15px}.profile-facts dd span{font-size:13px}
.reader-tools{height:64px;padding:12px 24px}.profile-tabs{top:64px}
.map-zoom{box-shadow:none;border-color:var(--rule)}
.map-zoom button{border-color:var(--rule)}
/* Transparent thumbs retain their gutter, so appearing scrollbars never shift text. */
html,.filters,.content-scroll,#reader,.period-track,.views,#selection-summary,.profile-tabs{scrollbar-width:thin;scrollbar-color:var(--scroll-ink) transparent}
.is-scrolling,.content-scroll:focus-visible,.period-track:focus-visible{--scroll-ink:#a4a4a0}
::-webkit-scrollbar{width:7px;height:7px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--scroll-ink);border-radius:0}
@media(prefers-reduced-motion:no-preference){button{transition:background-color .12s,border-color .12s,color .12s}}
@media(max-width:700px){body>header{padding:0 14px}body>header .brand{font-size:20px;gap:8px;letter-spacing:2px}body>header .symbol{width:30px}.symbol svg{width:28px;height:28px}body>header .brand small{font-size:9px;letter-spacing:1px}body>header .search{gap:8px}body>header .search input,body>header .search>span{font-size:13px}body .workspace h2,body.graph-page .workspace h2{font-size:23px}.graph-switch button,.graph-expand{font-size:13px;padding:6px 8px}.graph-bar{gap:8px}.workspace .term-tile strong{font-size:17px}.workspace .term-tile span{font-size:13px}#reader-body{font-size:16px}#reader-body .profile-intro h2{font-size:28px}}

/* Match the reader rule to workspace padding (10px) plus selection row (52px). */
.reader-tools{height:62px}.profile-tabs{top:62px}

/* A consistent reading scale, independent of quotation availability. */
#reader-body .profile-quote,#reader-body .profile-deck{font:400 22px/1.8 var(--serif);color:var(--ink);margin:20px 0 8px;padding:0;border:0}
#reader-body p .text-button,#reader-body li .text-button{font:inherit;line-height:inherit;margin:0 2px}
#reader-body .profile-quotation{float:none;width:auto;margin:0;padding:0}
#reader-body .quote-original{font:17px/1.8 Georgia,var(--serif);color:#555;margin:12px 0}
#reader-body .profile-quotation .quote-citation{font:13px/1.8 var(--sans);text-align:left;margin-top:16px}
#reader-body .profile-quotation .quote-citation a{display:block;width:fit-content;margin-top:8px}
#reader-body .quote-empty{color:#777}
@media(max-width:700px){#reader-body .profile-quote,#reader-body .profile-deck{font-size:20px}}

.profile-tabs .reader-top{border:1px solid var(--rule);align-self:stretch;min-width:30px;padding:8px 6px;font-size:12px;margin-right:6px;position:sticky;left:0;background:white;z-index:1}
.profile-tabs .reader-top:hover{background:var(--wash)}

/* Scale the composed label, preserving its original line breaks and anchor. */
.map-stage.node-layout .graph-label{background:transparent;transform-origin:left top;transform:scale(1);isolation:isolate;transition:none}
.map-stage.node-layout .map-person.graph-current .graph-label,.map-stage.node-layout .map-person:has(.graph-label:hover) .graph-label{transform:scale(1.18)}
.map-stage.node-layout .graph-label strong,.map-stage.node-layout .graph-label small{paint-order:stroke fill;-webkit-text-stroke:2px #fff;text-shadow:0 0 2px #fff}
/* Immediate emphasis avoids animated stretching while keeping line breaks fixed. */
/* Quiet overview lines; focused relationships retain their stronger treatment. */
.map-stage.node-layout:not(.graph-focused) .edge-ink{stroke:#949494;stroke-width:1;opacity:.35}
.map-stage.node-layout:not(.graph-focused) .graph-edge:hover .edge-ink,.map-stage.node-layout:not(.graph-focused) .graph-edge:focus-visible .edge-ink{stroke:#555;stroke-width:1.4;opacity:.75}

/* Direction belongs to each arrow, including both directions of mutual links. */
.map-lines .edge-ink.line-incoming{stroke-dasharray:6 5}
.map-lines .edge-ink.line-outgoing{stroke-dasharray:none}

.quote-translation-note{display:block;margin-top:4px}

/* Compact notebook navigation and orderly relationship reading. */
.profile-tabs button{padding:8px 8px}.profile-tabs{gap:0}
.profile-tabs .reader-top{width:24px;min-width:24px;padding:8px 3px;margin-right:5px;font-size:11px}
#reader-body .connection-group{margin-top:28px}
#reader-body .connection-group h4{font:500 15px/1.7 var(--sans);color:#666;margin:0 0 12px}
.connection-list{border-top:1px solid var(--rule)}
.connection-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;width:100%;padding:15px 0;text-align:left;border:0;border-bottom:1px solid var(--rule);background:transparent}
.connection-name{font:500 18px/1.7 var(--serif)}
.connection-type{font:13px/1.8 var(--sans);color:#777;align-self:center}
.connection-description{grid-column:1/-1;font:15px/1.85 var(--sans);color:#555}
.connection-row:hover{background:var(--wash)}
.connection-peers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;border-top:1px solid var(--rule)}
.connection-peers button{border:0;border-bottom:1px solid var(--rule);padding:12px 0;text-align:left;font:16px/1.7 var(--serif);overflow-wrap:anywhere}
#reader-body .connection-branch .text-button{margin:0;font:16px/1.8 var(--serif)}
#reader-body{container-type:inline-size}
@container(max-width:340px){.connection-peers{grid-template-columns:1fr}.connection-row{grid-template-columns:1fr}.connection-type{grid-row:2}.connection-description{grid-row:3}}

/* Source notes form a quiet, separate end matter block. */
#reader-body #profile-section-sources{margin-top:48px;padding-top:32px;border-top:1px solid #bcbcb8;font:14px/1.85 var(--sans);color:#666}
#reader-body #profile-section-sources>h3{font:500 17px/1.7 var(--sans);color:var(--ink);margin:0 0 24px}
.source-details{margin:0}.source-details>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px;margin:0 0 20px}
.source-details dt{font-weight:400;color:#777}.source-details dd{margin:0;min-width:0}
#reader-body .source-details a{display:block;width:fit-content;max-width:100%;font:inherit;line-height:1.85;margin:0 0 8px;overflow-wrap:anywhere;text-decoration-color:#bbb;text-decoration-thickness:1px;text-underline-offset:4px}
@container(max-width:340px){.source-details>div{grid-template-columns:1fr;gap:4px}}

/* One reading system: chapter / text / metadata, with distinct interaction styles. */
#reader.person-reader{--note-title:21px;--note-body:17px;--note-meta:14px}
#reader.person-reader .profile-tabs{gap:2px;padding:8px 0 10px;border-bottom:1px solid var(--ink);align-items:stretch}
#reader.person-reader .profile-tabs button{font:15px/24px var(--sans);padding:10px 10px;min-height:44px}
#reader.person-reader .profile-tabs .reader-top{width:24px;min-width:24px;font-size:11px;padding:10px 2px;margin-right:4px}
#reader.person-reader .profile-section{margin-top:48px;padding-top:28px;border-top:1px solid var(--rule)}
#reader.person-reader .profile-section:first-child{margin-top:0;border-top:0}
#reader.person-reader .profile-section>h3{font:500 var(--note-title)/1.5 var(--serif);color:var(--ink);letter-spacing:1px;margin:0 0 26px;padding-left:14px;border-left:3px solid var(--ink)}
#reader.person-reader #profile-panel p,#reader.person-reader .profile-questions{font:400 var(--note-body)/1.95 var(--sans);color:#333}
#reader.person-reader #profile-panel h4{font:500 var(--note-body)/1.7 var(--serif);color:var(--ink);margin:0 0 10px}
#reader.person-reader .profile-entry{display:block;border:0;padding:0;margin:0 0 32px}
#reader.person-reader .profile-entry p{margin:0}
#reader.person-reader .profile-book{padding:0 0 0 18px;border:0;border-left:1px solid var(--rule);margin:0 0 28px}
#reader.person-reader .profile-book p{margin:0}
#reader-body .profile-works{container-type:inline-size;margin:0}
#reader-body .profile-work{padding:18px 0;margin:0;border:0;border-bottom:1px solid var(--rule)}
#reader-body .profile-work:first-child{padding-top:4px}
#reader-body .profile-work .work-heading{display:grid;grid-template-columns:minmax(0,1fr) 7.5rem;align-items:baseline;gap:8px 20px}
#reader-body .profile-work h4{font-family:'Noto Serif TC',serif;font-size:18px;font-weight:500;line-height:1.8;margin:0;overflow-wrap:anywhere}
#reader-body .profile-work .work-date{font-family:'Noto Sans TC',sans-serif;font-size:14px;line-height:1.8;color:#737373;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
#reader-body .profile-work .work-description{font-size:16px;line-height:1.9;color:#555;margin:8px 0 0;overflow-wrap:anywhere}
@container(max-width:360px){#reader-body .profile-work .work-heading{grid-template-columns:minmax(0,1fr);gap:3px}#reader-body .profile-work .work-date{text-align:left}}
#reader.person-reader .profile-facts{display:grid;grid-template-columns:104px minmax(0,1fr);gap:14px 18px;font:var(--note-meta)/1.85 var(--sans);padding:22px 0 0;margin:28px 0 0}
#reader.person-reader .profile-facts dt,#reader.person-reader .profile-facts dd{margin:0}
#reader.person-reader .profile-facts dd span{font:inherit;color:#777}
#reader.person-reader .profile-facts .text-button{font:inherit;margin:0}
#reader.person-reader .profile-domains{margin:18px 0}.person-reader .profile-domains .chip{font-size:14px;margin:0 6px 6px 0}
#reader.person-reader .profile-aliases{font:var(--note-meta)/1.85 var(--sans);margin-top:18px}
#reader.person-reader .profile-questions{margin:0;padding-left:26px}
#reader.person-reader .profile-questions li{padding:0 0 22px 10px}
#reader.person-reader .profile-questions li::marker{font-family:Georgia,serif;color:#777}
#reader.person-reader #reader-body .profile-quotation{padding:22px 24px;margin:0;background:#f7f7f4;border-left:2px solid #aaa}
#reader.person-reader #reader-body .profile-quotation .profile-quote{font:400 22px/1.85 var(--serif);margin:0 0 14px}
#reader.person-reader #reader-body .profile-quotation .quote-original{font:17px/1.8 Georgia,var(--serif);color:#555;margin:0 0 20px}
#reader.person-reader #reader-body .profile-quotation .quote-citation{font:var(--note-meta)/1.85 var(--sans);padding-top:14px;border-top:1px solid var(--rule);margin:0;color:#777}
#reader.person-reader .connection-group{margin:28px 0 0}
#reader.person-reader .connection-group>h4{font:500 var(--note-meta)/1.8 var(--sans);color:#666;margin:0 0 14px}
#reader.person-reader .connection-list{border:0}
#reader.person-reader .connection-row{display:block;border:0;border-left:1px solid var(--rule);padding:0 0 0 18px;margin:0 0 24px;background:transparent}
#reader.person-reader .connection-heading{display:flex;align-items:baseline;gap:10px 16px;flex-wrap:wrap}
#reader.person-reader .connection-name{font:500 var(--note-body)/1.7 var(--serif);padding:0;border:0;border-bottom:1px solid #999;background:transparent;text-align:left}
#reader.person-reader .connection-name:hover,#reader.person-reader .connection-name:focus-visible{background:var(--ink);color:white;border-color:var(--ink)}
#reader.person-reader .connection-type{font:var(--note-meta)/1.7 var(--sans);color:#666}
#reader.person-reader #profile-panel .connection-description{font:var(--note-body)/1.85 var(--sans);margin:10px 0 0;color:#555}
#reader.person-reader .connection-context{padding:22px;background:#f7f7f4;margin-top:32px}
#reader.person-reader .connection-peers{border:0;gap:12px 22px}
#reader.person-reader .connection-peers button{font:var(--note-body)/1.8 var(--serif);border:0;padding:0;text-decoration:underline;text-decoration-color:#bbb;text-underline-offset:5px;background:transparent}
#reader.person-reader .connection-peers button:hover{color:#000;text-decoration-color:#000}
#reader.person-reader .connection-branch{padding-top:22px;border-top:1px solid var(--rule)}
#reader.person-reader #reader-body #profile-section-sources{margin-top:56px;padding-top:28px;border-color:#999;font:var(--note-meta)/1.85 var(--sans)}
#reader.person-reader #reader-body #profile-section-sources>h3{font:500 var(--note-body)/1.8 var(--sans);border:0;padding:0;letter-spacing:0;margin-bottom:24px;color:#666}
#reader.person-reader .source-details{font:var(--note-meta)/1.85 var(--sans)}
@container(max-width:420px){#reader.person-reader .profile-tabs{gap:0}#reader.person-reader .profile-tabs button{padding-left:8px;padding-right:8px}#reader.person-reader .profile-facts{grid-template-columns:88px minmax(0,1fr);gap:12px}#reader.person-reader #reader-body .profile-quotation{padding:18px}}
/* Neutral surfaces and a consistent, softer charcoal selection. */
:root{--selection-bg:#303030;--selection-fg:#fff;--reading-surface:#fafafa;--reading-border:#c8c8c8}
.period-track button[aria-current=location],.views button.active,.graph-switch button[aria-pressed=true],#reader.person-reader .profile-tabs button[aria-current=location],.map-stage.group-layout .map-person.graph-current{background:var(--selection-bg);border-color:var(--selection-bg);color:var(--selection-fg)}
.map-stage.group-layout .map-person.graph-current .graph-label{background:transparent;color:var(--selection-fg)}
.map-stage.group-layout .map-person.graph-current strong,.map-stage.group-layout .map-person.graph-current small{color:var(--selection-fg)}
body [data-term].reading-selected,body [data-event].reading-selected,#reader [data-term].reading-selected,#reader [data-event].reading-selected{background:var(--selection-bg);color:var(--selection-fg);border-color:var(--selection-bg)}
body .reading-selected strong,body .reading-selected small,body .reading-selected span{color:inherit}
#reader.person-reader .connection-context,#reader.person-reader #reader-body .profile-quotation{background:var(--reading-surface);border:1px solid var(--reading-border)}
.map-stage.group-layout .map-person.graph-current:hover{background:var(--selection-bg);border-color:var(--selection-bg)}
body .workspace [data-term].reading-selected,body .workspace [data-event].reading-selected,body .workspace [data-term].reading-selected:hover,body .workspace [data-event].reading-selected:hover{background:var(--selection-bg);color:var(--selection-fg);border-color:var(--selection-bg)}
body .workspace .reading-selected strong,body .workspace .reading-selected small,body .workspace .reading-selected span{color:var(--selection-fg)}
#reader.person-reader #reader-body .profile-quotation{padding:14px 16px}
#reader.person-reader #reader-body .profile-quotation+.profile-quotation{margin-top:12px}
#reader.person-reader #reader-body .profile-quotation .profile-quote{font-size:20px;line-height:1.7;margin:0}
#reader.person-reader #reader-body .profile-quotation .quote-original{font-size:16px;line-height:1.6;margin:6px 0 0}
#reader.person-reader #reader-body .profile-quotation .quote-citation{font-size:13px;line-height:1.6;border:0;padding:0;margin:8px 0 0}
#reader.person-reader #reader-body .profile-quotation .quote-context{font-size:15px;line-height:1.7;margin:8px 0 0}
/* Shared long-form hierarchy for every discipline's theory/style chapter. */
#reader.person-reader #profile-section-theory .profile-entry{margin:0 0 26px;padding:0;border:0}
#reader.person-reader #profile-section-theory .profile-entry h4{font:600 18px/1.65 var(--sans);margin:0 0 8px;letter-spacing:0}
#reader.person-reader #profile-section-theory p{font:400 17px/1.85 var(--sans);margin:0;color:#333}
#reader.person-reader #profile-section-theory .profile-entry p+p{margin-top:10px}
#reader.person-reader #profile-section-theory .learning-question{background:none;padding:0 0 22px;margin:0 0 26px;border:0;border-bottom:1px solid var(--rule)}
#reader.person-reader #profile-section-theory .learning-question h4{font:400 14px/1.6 var(--sans);color:#737373;margin:0 0 6px}
#reader.person-reader #profile-section-theory .learning-example{background:none;padding:20px 0 0;margin:4px 0 26px;border:0;border-top:1px solid var(--rule)}
#reader.person-reader #profile-section-theory .learning-example h4{font:500 16px/1.7 var(--sans);margin:0 0 8px}
#reader.person-reader #profile-section-theory .profile-disputes{padding-top:22px;margin-top:26px;border-top:1px solid var(--rule)}
#reader.person-reader #profile-section-theory .profile-disputes>h4{font:500 18px/1.7 var(--sans);margin:0 0 18px}
#reader-body .term-period-note{margin:22px 0 30px;padding:0;color:#767676;font-size:13px;line-height:1.85}
#reader-body .term-period-note p{margin:4px 0;font:inherit;color:inherit}

/* Direction remains distinct even when reciprocal paths sit close together. */
.map-lines .graph-primary .edge-ink.line-incoming{stroke:#858585;stroke-width:1.7;stroke-dasharray:6 5;opacity:1}
.map-lines .graph-primary .edge-ink.line-outgoing{stroke:#303030;stroke-width:2;stroke-dasharray:none;opacity:1}
.map-lines marker path.arrow-incoming{fill:#fff;stroke:#858585;stroke-width:1.2;stroke-linejoin:round}

/* Hover previews the card; only clicking selects it. */
.map-stage.group-layout .map-person:not(.graph-current):hover .graph-label{background:transparent;outline:none;color:var(--ink)}

/* Directory selection stays neutral, distinct from the genealogy. */
body .workspace .person-card.person-current,body .workspace .person-card.person-current:hover{background:#e7e7e7;border-color:#aaa;color:var(--ink)}

.event-row.person-event-current{background:#e7e7e7}.person-location-note{font-size:13px;color:#777;margin:0}

/* Keep the school context visible when locating a person in a long group. */
.people-group.person-location-group>summary{position:sticky;top:0;z-index:2;background:#fff}
.people-group.person-location-group>.branch-intro{position:sticky;top:var(--school-summary-height,29px);z-index:2;background:#fff}
