:root {
  color-scheme: light;
  --ground: #ffffff;
  --paper: #ffffff;
  --ink: #111315;
  --muted: #3f4650;
  --line: #8c929b;
  --accent: #1638d4;
  --wash: #e3ff00;
  --signal: #ff5a1f;
  --electric: #e3ff00;
  --highlight: #f2f4f6;
  --font-text: "Literata", "Songti TC", "Noto Serif TC", "PMingLiU", Georgia, serif;
  --type-display: clamp(2.25rem,5vw,4rem);
  --type-section: 1.5rem;
  --type-subsection: 1.25rem;
  --type-body: 1.125rem;
  --type-detail: 1rem;
  --type-control: .9375rem;
  --type-small: .875rem;
  --type-reference: .8125rem;
  --panel-shadow: 4px 4px 0 #19181920;
  font-family: var(--font-text);
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body:not(.reader-page) { background: var(--ground); }
.reader-page { background: var(--paper); }
button, summary { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
a { color: var(--accent); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--electric); color: var(--ink); }
h1, h2, h3, h4, p { margin-top: 0; }
.skip { position: fixed; top: -10rem; left: 1rem; z-index: 100; background: var(--paper); padding: 1rem; }
.skip:focus { top: 1rem; }

/* Shared masthead and the small reading controls. */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 64px; padding: 1rem 3vw; border-bottom: 1px solid var(--ink); background: var(--electric); color: var(--ink); }
.wordmark { color: var(--ink); font: 600 1.125rem/1.4 var(--font-text); letter-spacing: -.02em; text-decoration: none; }
.brand-dot { color: var(--accent); }
.header-note, .back { color: var(--ink); font-size: var(--type-small); }
.reader-toolbar { position: sticky; top: 0; z-index: 25; padding-top: .5rem; padding-bottom: .5rem; }
.reader-identity { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.reader-identity .wordmark { flex-shrink: 0; }
.current-profile { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 1px solid var(--ink); padding-left: 1rem; font: 600 var(--type-detail)/1.4 var(--font-text); }
.reader-tools { display: flex; flex-shrink: 0; align-items: center; gap: .65rem; font-family: var(--font-text); }
.reader-tools button, .profile-switcher > summary { display: flex; align-items: center; justify-content: center; gap: .4rem; appearance: none; min-height: 44px; margin: 0; padding: .5rem .75rem; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font-size: var(--type-small); line-height: 1.4; white-space: nowrap; }
.reader-tools button:hover, .profile-switcher > summary:hover { background: var(--ink); color: var(--electric); }
.profile-switcher { position: relative; }
.profile-switcher > summary { list-style: none; }
.profile-switcher > summary::-webkit-details-marker { display: none; }
.profile-switcher > summary::after { content: ""; width: .45em; height: .45em; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-.15em) rotate(45deg); }
.profile-switcher[open] > summary::after { transform: translateY(.1em) rotate(225deg); }
.profile-panel { position: absolute; top: calc(100% + .5rem); right: 0; width: min(380px,calc(100vw - 24px)); max-height: 70vh; max-height: 70dvh; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--panel-shadow); }
.profile-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .35rem 0; }
.profile-list a { display: block; min-height: 44px; padding: .7rem 1rem; font: var(--type-detail)/1.5 var(--font-text); color: var(--ink); text-decoration: none; }
.profile-list a:hover, .profile-list a[aria-current="page"] { background: var(--wash); color: var(--accent); }
.profile-list a[aria-current="page"] { font-weight: 600; border-left: 2px solid var(--accent); }
.profile-name, .profile-subtitle, .profile-language { display: block; }
.profile-subtitle { margin-top: .2rem; color: var(--muted); font: 400 var(--type-small)/1.55 var(--font-text); }
.profile-language { margin-top: .35rem; color: var(--muted); font: 400 var(--type-reference)/1.5 var(--font-text); }
.profile-search { margin-top: 1.5rem; }
.search-label { display: block; margin-bottom: .5rem; color: var(--ink); font: 500 var(--type-control)/1.5 var(--font-text); }
[data-search-input] { width: 100%; min-height: 48px; padding: .7rem .8rem; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: var(--type-detail)/1.5 var(--font-text); }
[data-search-input]::placeholder { color: var(--muted); opacity: 1; }
[data-search-input]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-status { margin: .6rem 0 1rem; color: var(--muted); font: var(--type-small)/1.5 var(--font-text); }
.search-empty { margin: 1rem 0; color: var(--muted); font: var(--type-detail)/1.7 var(--font-text); }
.switcher-search { flex-shrink: 0; padding: .9rem 1rem .5rem; border-bottom: 1px solid var(--line); }
.switcher-search .search-status { margin-bottom: 0; }
.profile-panel > .search-empty { padding: 0 1rem; }

/* A ruled reading index, with fluorescent catalogue numbers. */
.shelf { max-width: 1180px; margin: 2.7rem auto 5rem; padding: 0 2rem; }
.shelf-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 1.6rem; margin-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.shelf-heading h1 { margin: 0; font: 600 var(--type-display)/1.25 var(--font-text); letter-spacing: -.025em; text-wrap: balance; }
.shelf-heading > span { padding: .45rem .65rem; border: 1px solid var(--ink); background: var(--signal); color: var(--ink); font-size: var(--type-small); font-weight: 600; white-space: nowrap; }
.entries { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 2.5rem; }
.entries > li { min-width: 0; }
.entry { display: grid; grid-template-columns: 2rem minmax(0,1fr) 2.2rem; align-items: center; gap: 1rem; min-height: 108px; height: 100%; padding: 1.2rem .25rem; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; }
.entry:hover { background: var(--wash); }
.entry:hover h2 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .22em; }
.entry h2 { margin: 0; font: 500 var(--type-section)/1.4 var(--font-text); }
.entry-subtitle { display: block; margin-top: .4rem; color: var(--muted); font: var(--type-small)/1.65 var(--font-text); }
.number, .language { font: var(--type-small)/1.5 var(--font-text); color: var(--muted); font-variant-numeric: tabular-nums; }
.number { display: grid; place-items: center; min-height: 1.85rem; border: 1px solid var(--ink); background: var(--signal); color: var(--ink); font-weight: 600; }
.language { text-align: right; color: var(--muted); }
.extras { margin-top: 3rem; }
.extras h2 { font-size: 1rem; }
.extras ul { list-style: none; padding: 0; }
.extras li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.site-footer { max-width: 1116px; margin: auto; padding: 1.5rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--type-small); }

/* Uploads use the same paper, type and controls as the reading library. */
.upload-link, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; font: 500 var(--type-control)/1.5 var(--font-text); }
.upload-link:hover { background: var(--ink); color: var(--electric); }
.upload-shelf { max-width: 760px; }
.upload-intro { margin: 1.5rem 0 2rem; color: var(--muted); line-height: 1.8; }
.upload-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1.5rem; }
.upload-form label { display: grid; gap: .6rem; min-width: 0; }
.field-label { font-weight: 600; line-height: 1.6; }
.field-hint { margin-left: .5rem; font-size: var(--type-small); color: var(--muted); font-weight: 400; }
.file-field { grid-column: 1 / -1; border: 1px dashed var(--ink); padding: 1.5rem; background: var(--paper); }
.file-field.dragging { background: var(--wash); border-color: var(--accent); }
.file-field input { max-width: 100%; font: var(--type-small)/1.6 var(--font-text); }
.file-field input::file-selector-button { padding: .6rem; margin-right: .75rem; border: 1px solid var(--ink); background: var(--electric); color: var(--ink); font: inherit; cursor: pointer; }
.text-field input, .text-field select { width: 100%; min-height: 48px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); padding: .65rem; font: var(--type-detail)/1.5 var(--font-text); }
.upload-form input:focus-visible, .upload-form select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.optional-file { border-style: solid; }
#file-caption { overflow-wrap: anywhere; line-height: 1.7; }
.upload-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; }
.primary-button { background: var(--electric); cursor: pointer; }
.primary-button:hover { background: var(--ink); color: var(--electric); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.text-button { border: 0; padding: .5rem 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
#upload-status, #upload-error { grid-column: 1 / -1; margin: 0; line-height: 1.7; }
#upload-error, .library-warning { color: var(--accent); }
.upload-success { padding: 2rem; border: 1px solid var(--ink); background: var(--paper); }
.upload-success h2 { font-size: var(--type-section); }
.outline-level-3 { padding-left: .7rem; }
.outline-level-4, .outline-level-5, .outline-level-6 { padding-left: 1.4rem; }
@media (max-width: 600px) {
  .upload-form { grid-template-columns: minmax(0,1fr); }
  .field-hint { display: block; margin-left: 0; }
  .file-field, .upload-success { padding: 1rem; }
}

/* Lectura's reading column and independent outline on the right. */
.reading-layout { display: grid; grid-template-columns: minmax(0,760px) minmax(190px,235px); justify-content: center; gap: clamp(2rem,4vw,4rem); padding: 3.5rem 4vw 6rem; }
.reading-layout.outline-collapsed { grid-template-columns: minmax(0,760px); }
.reading-main { min-width: 0; }
.article-header { padding-bottom: 1.5rem; border-bottom: 2px solid var(--ink); }
.article-header h1 { margin-bottom: 1rem; font: 600 var(--type-display)/1.25 var(--font-text); letter-spacing: -.025em; overflow-wrap: anywhere; text-wrap: balance; }
.article-subtitle { margin: .65rem 0 1.25rem; max-width: 48rem; color: var(--muted); font: 400 clamp(1rem,2.3vw,1.2rem)/1.65 var(--font-text); text-wrap: pretty; }
.article-tools { display: flex; gap: 1rem; font: var(--type-small)/1.5 var(--font-text); }
.article-tools a { color: var(--muted); }
.sidebar { position: sticky; top: 88px; align-self: start; min-width: 0; border-top: 3px solid var(--ink); font-family: var(--font-text); }
.outline-label { margin: 0; padding: .7rem .65rem; border-bottom: 1px solid var(--ink); background: var(--electric); color: var(--ink); font: 600 var(--type-small)/1.5 var(--font-text); }
.chapter-list { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 1rem; }
.chapter-list, .mobile-chapter-list { position: relative; overflow-anchor: none; }
.chapter-list ul, .mobile-chapter-list ul { list-style: none; margin: 0; padding: 0; }
.chapter-list ul ul { padding-left: .7rem; }
.chapter-list a { display: block; padding: .55rem .35rem .55rem .65rem; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; color: var(--muted); font: 400 var(--type-control)/1.5 var(--font-text); text-decoration: none; overflow-wrap: anywhere; }
.chapter-list a:hover { color: var(--accent); }
.chapter-list a[aria-current="location"] { border-left-color: var(--accent); background: var(--wash); color: var(--ink); font-weight: 600; }
.chapter-list ul ul a { font-size: var(--type-small); }

/* Quiet paper for long reading; citations act as highlighted annotations. */
.prose { padding-top: 2rem; color: var(--ink); font: 400 var(--type-body)/1.9 var(--font-text); overflow-wrap: anywhere; }
.prose:lang(en) { line-height: 1.8; }
.prose p { margin: 0 0 1.25em; }
.prose section, .prose :is(h2,h3,h4,h5,h6), .footnotes li { scroll-margin-top: 88px; }
.prose h2 { margin: 2.5em 0 .75em; padding-top: 1rem; border-top: 1px solid var(--line); font: 600 var(--type-section)/1.45 var(--font-text); text-wrap: pretty; }
.prose h3 { margin: 2em 0 .65em; font: 600 var(--type-subsection)/1.5 var(--font-text); text-wrap: pretty; }
.prose h4, .prose h5, .prose h6 { margin: 1.75em 0 .6em; font: 600 var(--type-body)/1.5 var(--font-text); }
.prose strong { font-weight: 700; }
/* A curated pilot: concrete facts, works and career turns, with fixed high-contrast ink. */
.prose.emphasis-pilot :is(.emphasis-key,.emphasis-method,.emphasis-turn,.emphasis-work) { color: #191819; padding: .04em .09em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.prose.emphasis-pilot :is(.emphasis-key,.emphasis-work) { background: #ffdf00; }
.prose.emphasis-pilot .emphasis-method { background: #ffdf00; }
.prose.emphasis-pilot .emphasis-turn { background: #ffdf00; }
.prose.emphasis-pilot .emphasis-work { font-weight: 700; }
.prose.emphasis-pilot .reading-annotation { margin: -.25em 0 1.5em; padding: .55rem .75rem; border-left: 4px solid #191819; background: #ffdf00; color: #191819; font: 400 var(--type-small)/1.65 var(--font-text); }
.prose.emphasis-pilot .reading-annotation strong { margin-right: .3em; }
.prose :is(h2,h3,h4,h5,h6) strong, .chapter-list strong, .mobile-chapter-list strong { font-weight: inherit; }
.prose ul, .prose ol { padding-left: 1.45em; margin: 0 0 1.55em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 2em 0; padding: .7rem 1.2rem; border-left: 3px solid var(--signal); color: var(--ink); background: var(--wash); }
.prose hr { margin: 3em 0; border: 0; border-top: 1px solid var(--line); }
.prose a:not(.citation):not(.footnote-ref):not(.footnote-back) { text-decoration-thickness: .07em; text-decoration-color: var(--accent); background-image: linear-gradient(to top,var(--wash) 0 30%,transparent 30%); }
.prose a:not(.citation):not(.footnote-ref):hover { text-decoration-color: var(--accent); }
.prose table { display: block; width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; margin: 2em 0; border-collapse: collapse; font: var(--type-detail)/1.65 var(--font-text); }
.prose td, .prose th { min-width: 7rem; padding: .65rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--highlight); font-weight: 600; }
.prose code { font: .85em/1.6 ui-monospace,monospace; background: var(--highlight); padding: .1em .25em; }
.prose pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--line); background: var(--highlight); }
.prose pre code { padding: 0; }
.prose img { max-width: 100%; height: auto; }
.prose .citation, .prose .footnote-ref { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; margin-inline: .13em; padding: .05em .3em; border: 1px solid var(--ink); background: var(--electric); color: var(--ink); font: 600 var(--type-reference)/1.4 var(--font-text); text-decoration: none; vertical-align: .05em; font-variant-numeric: tabular-nums; }
.prose .citation:hover, .prose .footnote-ref:hover, .prose .footnote-ref[aria-expanded="true"], .prose .citation[aria-expanded="true"] { color: var(--ink); background: var(--signal); border-color: var(--ink); }
.footnote-ref sup { font: inherit; vertical-align: baseline; }
.references > ol, .footnotes > ol { font-size: var(--type-detail); line-height: 1.75; }
.references > ol > li, .footnotes > ol > li { padding: .8rem .1rem .8rem .3rem; margin: 0; border-bottom: 1px solid var(--line); }
.references > ol p:last-child, .footnotes > ol p:last-child { margin-bottom: 0; }
.footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.footnotes li:target { background: var(--wash); }
.footnote-back { font: var(--type-small)/1.4 var(--font-text); text-decoration: none; }

/* Lectura-style note card: anchored at the corner without moving the passage. */
.inline-footnote { position: fixed; left: max(18px,env(safe-area-inset-left)); bottom: max(18px,env(safe-area-inset-bottom)); z-index: 55; width: min(440px,calc(100vw - 36px)); max-height: min(70dvh,600px); display: flex; flex-direction: column; overflow: hidden; margin: 0; padding: 1rem; border: 1px solid var(--ink); border-left: 4px solid var(--signal); background: var(--paper); box-shadow: var(--panel-shadow); color: var(--ink); font: var(--type-detail)/1.65 var(--font-text); }
.inline-footnote > header { display: flex; flex-wrap: wrap; flex-shrink: 0; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .6rem; margin-bottom: .7rem; border-bottom: 1px solid var(--line); }
.inline-footnote header strong { color: var(--accent); font: 600 var(--type-small)/1.4 var(--font-text); }
.inline-footnote-actions { display: flex; flex-shrink: 0; gap: .4rem; }
.inline-footnote-actions a, .inline-footnote-actions button { min-height: 40px; padding: .5rem .6rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: var(--type-small)/1.5 var(--font-text); text-decoration: none; }
.inline-footnote-actions a:hover, .inline-footnote-actions button:hover { background: var(--wash); border-color: var(--accent); }
.inline-footnote-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.inline-footnote-content p { margin: 0 0 1em; }
.inline-footnote-content p:last-child { margin-bottom: 0; }
.inline-footnote-content ul, .inline-footnote-content ol { padding-left: 1.4em; }
.note-destination { flex-shrink: 0; margin: .75rem 0 0; padding-top: .65rem; border-top: 1px solid var(--line); color: var(--muted); font: var(--type-small)/1.5 var(--font-text); overflow-wrap: anywhere; }

/* Lectura's compact contents overlay, opened from the toolbar. */
.mini-contents { position: fixed; right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); z-index: 30; min-height: 44px; min-width: 76px; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 0; background: #ffffffef; color: var(--ink); box-shadow: 3px 3px 0 var(--signal); backdrop-filter: blur(7px); font: 500 var(--type-control)/1.4 var(--font-text); font-variant-numeric: tabular-nums; }
.mini-contents::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--section-progress,0%); background: var(--accent); }
.mini-contents:hover { color: var(--ink); border-color: var(--ink); background: var(--electric); }
.contents-sheet { position: fixed; inset: max(74px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) auto auto; margin: 0; padding: 0; width: min(420px,calc(100vw - 24px)); max-height: min(68dvh,590px); overflow: hidden; border: 1px solid var(--ink); border-top: 5px solid var(--signal); background: var(--paper); color: var(--ink); box-shadow: var(--panel-shadow); }
.contents-sheet::backdrop { background: #19181938; backdrop-filter: blur(2px); }
.contents-sheet[open] { display: flex; flex-direction: column; }
.contents-sheet-header { background: var(--electric); display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.contents-sheet-header p { margin: 0 0 .4rem; color: var(--muted); font-size: var(--type-small); }
.contents-sheet-header h2 { margin: 0; font: 600 var(--type-detail)/1.5 var(--font-text); overflow-wrap: anywhere; }
.contents-close:hover { background: var(--electric); border-color: var(--ink); }
.contents-close { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 400 1.5rem/1 var(--font-text); }
.contents-progress { height: 3px; flex-shrink: 0; background: var(--highlight); }
.contents-progress span { display: block; height: 100%; background: var(--accent); transition: width 160ms ease-out; }
.mobile-chapter-list { overflow-y: auto; overscroll-behavior: contain; padding-bottom: .5rem; }
.mobile-chapter-list a { display: block; padding: .8rem 1rem; min-height: 44px; border-bottom: 1px solid var(--line); color: var(--ink); font: var(--type-detail)/1.5 var(--font-text); text-decoration: none; }
.mobile-chapter-list ul ul a { padding-left: 1.8rem; font-weight: 400; font-size: var(--type-small); color: var(--muted); }
.mobile-chapter-list a[aria-current="location"] { background: var(--wash); border-left: 3px solid var(--accent); color: var(--accent); font-weight: 600; }
.profile-pagination { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.profile-pagination a { display: flex; flex-direction: column; gap: .5rem; max-width: 48%; padding: .5rem 0; text-decoration: none; }
.profile-pagination span { font: var(--type-small)/1.5 var(--font-text); color: var(--muted); }
.profile-pagination strong { font: 500 var(--type-body)/1.5 var(--font-text); }
.profile-pagination .next { margin-left: auto; text-align: right; }
.article-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line); font-size: var(--type-small); }

@media (max-width:1180px) {
  .reading-layout { display: flex; flex-direction: column; max-width: 820px; margin: auto; padding: 2.5rem 2rem 5rem; gap: 2rem; }
  .sidebar { position: static; order: -1; width: 100%; }
  .reader-enhanced .sidebar { display: none; }
}
@media (max-width:700px) {
  .site-header { min-height: 64px; padding: .5rem 1rem; }
  .wordmark { font-size: 1rem; }
  .reader-toolbar.show-profile .wordmark { display: none; }
  .current-profile { border-left: 0; padding-left: 0; }
  .reader-tools { gap: .4rem; }
  .reader-tools button, .profile-switcher > summary { font-size: var(--type-small); padding: .55rem .65rem; min-height: 40px; }
  .profile-panel { position: fixed; top: 72px; right: 12px; width: min(380px,calc(100vw - 24px)); max-height: calc(100dvh - 96px); }
  .reading-layout { padding: 2rem 1.15rem 4rem; }
  .prose { padding-top: 1.75rem; }
  .prose section, .prose :is(h2,h3,h4,h5,h6), .footnotes li { scroll-margin-top: 80px; }
  .contents-sheet { top: max(72px,env(safe-area-inset-top)); }
  .inline-footnote { right: max(8px,env(safe-area-inset-right)); left: max(8px,env(safe-area-inset-left)); bottom: calc(max(12px,env(safe-area-inset-bottom)) + 60px); width: auto; max-height: min(62dvh,calc(100dvh - 160px),520px); }
  .inline-footnote-actions a, .inline-footnote-actions button { min-height: 40px; }
  .shelf { padding: 0 1.15rem; margin-top: 2rem; }
  .entries { grid-template-columns: 1fr; }
  .site-footer { margin: 0 1.15rem; }
}
@media (max-width:360px) {
  .reader-toolbar { gap: .4rem; padding-inline: .7rem; }.reader-tools { gap: .3rem; }
  .reader-tools button, .profile-switcher > summary { padding-inline: .45rem; }.wordmark { font-size: var(--type-control); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  body { background: white; }.site-header,.sidebar,.profile-pagination,.article-footer,.skip,.inline-footnote,.contents-sheet,.mini-contents { display: none !important; }
  .reading-layout { display: block; padding: 0; }.article-header h1 { font-size: 24pt; }.prose { font-size: 11pt; line-height: 1.6; }
  .prose table { display: table; font-size: 9pt; }.prose a { color: inherit; background: none !important; }
}

/* Crisp editorial grounds with decisive color reserved for navigation and emphasis. */
.prose th{background:var(--ink);color:var(--paper)}

/* Collection tabs share the reader's typography and remain ordinary links. */
.collection-tabs{display:flex;gap:1.8rem;align-items:center;margin:0 0 1.6rem;border-bottom:1px solid var(--ink)}
.collection-tabs a{display:flex;align-items:center;min-height:48px;padding:.4rem .15rem;color:var(--ink);text-decoration:none;font-size:1.05rem}
.collection-tabs a[aria-current="page"]{font-weight:650;box-shadow:0 3px var(--ink)}
.collection-tabs a:hover,.collection-tabs a:focus-visible{color:var(--accent)}
.collection-intro{max-width:48rem;font-size:1rem;line-height:1.8;margin:1.2rem 0 2rem}
.institution-affiliations{margin:3rem 0;padding-top:1.4rem;border-top:2px solid var(--ink)}
.institution-affiliations h2{font-size:1.4rem;margin:0 0 1rem}
.affiliation-list{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:1.5rem}
.affiliation-list li{padding:.5rem 0}
.affiliation-list h3{margin:0 0 .4rem;font-size:1.2rem}
.affiliation-list p{margin:.35rem 0;font-size:1rem;line-height:1.7}
.affiliation-list .affiliation-period{font-size:.875rem}

@media print{.article-tools,.related-profiles,.institution-affiliations{display:none!important;}@page{size:A4;margin:18mm;}h2,h3{break-after:avoid;}p,li{orphans:3;widows:3;}}

/* Creation order is optional: the original editorial/library order remains default. */
.library-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,240px);gap:1rem;align-items:end}
.library-query,.creation-sort{min-width:0}
.creation-sort label{display:block;margin-bottom:.5rem;font:500 var(--type-control)/1.5 var(--font-text)}
.creation-sort select{width:100%;max-width:100%;min-height:50px;padding:.65rem .8rem;border:1px solid var(--ink);border-radius:0;background:#fff;color:var(--ink);font:1rem/1.5 var(--font-text)}
.creation-sort select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.creation-note{font-size:.8125rem;line-height:1.7;color:var(--muted);margin:.7rem 0}
.creation-note summary{cursor:pointer;min-height:32px;display:list-item;width:fit-content}
.creation-note p{max-width:58rem;margin:.4rem 0 .8rem}
.entry-created{display:block;margin-top:.45rem;font-size:.75rem;line-height:1.6;color:var(--muted);font-variant-numeric:tabular-nums}
[data-sort="default"] .entry-created{display:none}
@media(max-width:650px){.library-controls{grid-template-columns:minmax(0,1fr)}.creation-sort select{min-height:48px}.creation-note summary{min-height:44px;padding:.4rem 0}}
