/* User-selected mechanical artwork; decoration never sits behind reading text. */
[data-theme="xuanqing"] {
  --canvas:#0b141d; --paper:#121f2b; --head-bg:#101d28; --rail:#0e1a24;
  --card:#192a37; --soft:#172733; --line:#354e5b; --rule:#708b98;
  --ink:#e7eff4; --navy:#e7eff4; --title:#e7eff4; --muted:#a6bbc5;
  --teal:#75d5e2; --blue:#a4dbe3; --selected:#223c4b;
  --pg-bg:#121f2b; --pg-label-bg:#172834; --pg-ink:#e7eff4;
  --pg-node-a:#7ccfd5; --pg-node-b:#d3b37d; --pg-node-c:#b7a9df; --pg-node-d:#d29eb3;
}
[data-theme="xuanqing"] body {
  background-image:radial-gradient(ellipse at 10% 0%,#17455824,transparent 35%);
  background-size:auto;
}
[data-theme="xuanqing"] .topbar {
  box-shadow:inset 0 1px #9adce522,0 4px 18px #0003;
  border-top-color:#668e9d;
}
[data-theme="xuanqing"] .topbar .site-modes a {
  background-color:#172733; border-color:#3c5664; color:#bfd0d9;
}
[data-theme="xuanqing"] .topbar .site-modes a[aria-current="page"] {
  background-color:#233e4d; border-color:#79bdc8; color:#f0f7fa;
}
[data-theme="xuanqing"] .topbar .site-modes a[aria-current="page"]::after {
  left:30%; right:30%; background:#7cdae4;
  box-shadow:0 0 6px #6ad1dd55;
}
[data-theme="xuanqing"] body[data-show-scene="true"] .xuanqing-scene {
  min-height:190px; padding:1.2rem 1.6rem; border:1px solid #486371;
  background:#0b171f; border-radius:5px; box-shadow:inset 0 1px #afcbd322;
}
[data-theme="xuanqing"] .xuanqing-scene::before {
  content:""; position:absolute; inset:0 0 0 30%; z-index:-1;
  background:#0b171f url('mecha-hero.webp') right center / auto 100% no-repeat;
  filter:saturate(.85) contrast(1.02);
}
[data-theme="xuanqing"] .xuanqing-scene::after {
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:linear-gradient(90deg,#0b171f 0%,#0b171feb 26%,#0b171f45 52%,transparent 66%);
}
[data-theme="xuanqing"] .scene-copy { max-width:53%; }
[data-theme="xuanqing"] .scene-title {
  font-size:clamp(1.5rem,2.15vw,2rem); letter-spacing:.065em; text-shadow:none;
}
[data-theme="xuanqing"] .scene-note { color:#b3c7d1; font-size:.86rem; }
[data-theme="xuanqing"] .scene-kicker { color:#afd8df; letter-spacing:.18em; }
[data-theme="xuanqing"] .scene-kicker span { background:#be9162; box-shadow:none; }
[data-theme="xuanqing"] .study-card {
  background:linear-gradient(115deg,#1b2d3a,#162631); border-color:#415d6a;
  border-radius:5px; box-shadow:inset 0 1px #96b9c418,0 3px 9px #0002;
}
[data-theme="xuanqing"] .study-card::before,
[data-theme="xuanqing"] .study-card::after {
  background:none; box-shadow:none; border-color:#81b8c4;
}
[data-theme="xuanqing"] body .pg-stage {
  background-color:#121f2b;
  background-image:linear-gradient(#678a9a07 1px,transparent 1px),linear-gradient(90deg,#678a9a07 1px,transparent 1px);
  background-size:42px 42px; border-color:#5a7a88;
  --pg-bg:#121f2b; --pg-label-bg:#172834; --pg-edge:#86c4d0;
  --pg-indirect:#aaa0ce; --pg-co:#7c99a4;
  box-shadow:inset 0 1px #b1ccd218,0 0 12px #51afc710;
}
[data-theme="xuanqing"] body .pg-stage::before,
[data-theme="xuanqing"] body .pg-stage::after {
  border-color:#90c4cd; filter:none; border-width:1px 0 0 1px;
  width:18px; height:18px;
}
[data-theme="xuanqing"] body .pg-stage::after { border-width:0 1px 1px 0; }
[data-theme="xuanqing"] body .pg-canvas-status {
  background:#182b37; border-color:#476372; box-shadow:none;
}
[data-theme="xuanqing"] body .pg-legend { background:#14242f; box-shadow:none; }
[data-theme="xuanqing"] .pg-evidence { background:#192a37; border-color:#425e6b; }
[data-theme="xuanqing"] body .pg-evidence { border-top-color:#78aebb; box-shadow:none; }
[data-theme="xuanqing"] .pg-evidence p,[data-theme="xuanqing"] .pg-guide,
[data-theme="xuanqing"] .pg-heading p { color:#b5c8d2; }
[data-theme="xuanqing"] .pg-source a,[data-theme="xuanqing"] .pg-evidence a { color:#b3e3ea; }

/* Light themes retain paper/pine and snow/plum, with quieter progress framing. */
[data-theme="ink"] .learning-progress {
  background:#f0f1e5; border:1px solid #bbc7b3; border-left:3px solid #6d8876;
  border-radius:7px; box-shadow:none;
}
[data-theme="paper"] .learning-progress {
  background:#f1f6f8; border:1px solid #c9d8df; border-left:3px solid #86a6b5;
  border-radius:7px; box-shadow:none;
}
:is([data-theme="ink"],[data-theme="paper"]) .question-row {
  border-radius:7px; box-shadow:none;
}
[data-theme="paper"] .question-row p,[data-theme="paper"] .record-small,
[data-theme="paper"] .catalog-meta,[data-theme="paper"] .attribution {
  color:#526e7c;
}
:is([data-theme="ink"],[data-theme="paper"]) {
  scrollbar-color:var(--rule) var(--rail); scrollbar-width:thin;
}
:is([data-theme="ink"],[data-theme="paper"]) ::-webkit-scrollbar { width:9px; height:9px; }
:is([data-theme="ink"],[data-theme="paper"]) ::-webkit-scrollbar-track { background:var(--rail); }
:is([data-theme="ink"],[data-theme="paper"]) ::-webkit-scrollbar-thumb {
  background:var(--rule); border:2px solid var(--rail); border-radius:8px;
}
@media(min-width:761px) {
  [data-theme] body[data-view="questions"] :is(.reading-scene-ink,.reading-scene-paper,.xuanqing-scene) {
    min-height:116px; padding:.6rem 1.25rem; margin-bottom:.6rem;
  }
  [data-theme] body[data-view="questions"] :is(.scene-title,.reading-scene-title) {
    font-size:1.5rem; line-height:1.45;
  }
  [data-theme] body[data-view="questions"] :is(.scene-kicker,.reading-scene-kicker) {
    margin-bottom:.25rem;
  }
  [data-theme] body[data-view="questions"] :is(.scene-note,.reading-scene-note) { margin-top:.2rem; }
}
@media(max-width:760px) {
  [data-theme="xuanqing"] body[data-show-scene="true"] .xuanqing-scene {
    min-height:94px; padding:.8rem; margin-bottom:.65rem;
  }
  [data-theme="xuanqing"] .xuanqing-scene::before {
    inset:0 0 0 24%; background-image:url('mecha-hero-small.webp');
  }
  [data-theme="xuanqing"] .xuanqing-scene::after {
    background:linear-gradient(90deg,#0b171ff7 0%,#0b171fdb 38%,#0b171f35 72%,transparent);
  }
  [data-theme="xuanqing"] .scene-copy { max-width:76%; }
  [data-theme="xuanqing"] .scene-title { font-size:1.18rem; letter-spacing:.035em; }
  [data-theme="xuanqing"] .scene-title {text-wrap:balance}
  [data-theme="xuanqing"] .scene-note,[data-theme="xuanqing"] .scene-kicker { display:none; }
}
@media(prefers-reduced-motion:reduce) {
  [data-theme="xuanqing"] :is(.xuanqing-scene,.pg-stage,.topbar,.study-card) { animation:none; transition:none; }
}
@media(forced-colors:active) {
  [data-theme="xuanqing"] .xuanqing-scene { background:Canvas; }
  [data-theme="xuanqing"] .xuanqing-scene::before,
  [data-theme="xuanqing"] .xuanqing-scene::after { display:none; }
}

/* Complete component states: avoid inherited light surfaces in dark mode. */
[data-theme] .more-study-card,[data-theme] .more-study-tab,[data-theme] .keyword-story-filter {
 background:var(--card);color:var(--ink);border-color:var(--line);box-shadow:none;
}
[data-theme] .more-study-card h3,[data-theme] .keyword-story-filter label {color:var(--title)}
[data-theme] .more-study-card p,[data-theme] .keyword-story-filter p,[data-theme] .study-supplements>p {color:var(--muted)}
[data-theme] .more-study-tab[aria-current=page] {background:var(--selected);color:var(--title);border-color:var(--rule)}
[data-theme] .more-study-tab:hover,[data-theme] .more-study-card:hover {background:var(--soft);color:var(--title);border-color:var(--rule)}
[data-theme] .keyword-story-filter :is(select,option) {background:var(--paper);color:var(--ink);border-color:var(--line)}
[data-theme] .study-supplements {box-shadow:none}
[data-theme] .study-supplements summary {color:var(--title);background:var(--supplement)}
[data-theme] {--focus-ring:var(--accent)}
[data-theme="xuanqing"] {--focus-ring:#f2bd80}
[data-theme] :is(a,button,summary,input,select,textarea,canvas):focus-visible {outline:3px solid var(--focus-ring);outline-offset:3px}
[data-theme] .study-selection-actions button:disabled {opacity:.5;cursor:not-allowed;background:var(--soft);color:var(--muted);border-color:var(--line);box-shadow:none}
[data-theme="paper"] .pg-evidence {border:1px solid #b2c5cf;box-shadow:none;background:#eef4f7}
[data-theme="paper"] .pg-evidence>h3 {border-color:#b2c5cf}
[data-theme] :is(.answer,.point-text) {max-inline-size:40em}
[data-theme="xuanqing"] .xuanqing-scene::before {mask-image:linear-gradient(90deg,transparent,black 23%);-webkit-mask-image:linear-gradient(90deg,transparent,black 23%)}
@media(max-width:760px), (pointer:coarse) {
 [data-theme] .appearance-control select,[data-theme] .text-size-control button {min-height:44px;height:44px}
 [data-theme] .source-tools>.source-locator-details>summary {min-height:44px;display:flex;align-items:center}
}

/* Large reading text need not enlarge the navigation chrome beyond the viewport. */
@media(max-width:760px) {
 [data-theme] .brand {font-size:18px;line-height:1.35;gap:8px}
 [data-theme] .brand strong {font-size:14px}
 [data-theme] .brand-divider {margin:0 3px}
 [data-theme] .header-tools {gap:5px}
 [data-theme] .appearance-control,[data-theme] .text-size-control {font-size:14px;height:50px;min-height:50px;padding:2px 4px}
 [data-theme] .appearance-control select,[data-theme] .text-size-control button {font-size:14px;padding:3px 7px;min-height:44px}
 [data-theme] .appearance-control select {max-width:128px}
 [data-theme] .attribution {font-size:16px;line-height:1.6;padding:10px 12px;margin-bottom:12px}
 [data-theme] .attribution p {margin:.25em 0}
 [data-theme] .about-shell h1 {font-size:min(1.75rem,38px);line-height:1.45}
 [data-theme] .pg-page-expanded .pg-route-actions {display:none}
 [data-theme] .pg-page-expanded .pg-heading {margin:0 0 4px;gap:4px}
 [data-theme] .pg-page-expanded .pg-heading h2 {font-size:18px;line-height:1.4;margin:0}
 [data-theme] .pg-page-expanded .pg-heading p {font-size:13px;line-height:1.5;margin:3px 0}
 [data-theme] .pg-page-expanded .pg-controls {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:4px 0}
 [data-theme] .pg-page-expanded .pg-controls>button {font-size:14px;padding:4px;min-height:44px}
 [data-theme] .pg-page-expanded :is([data-pg-fit],[data-pg-expand],[data-pg-fullscreen],.pg-depth,.pg-lines,.pg-expand-default) {grid-column:span 2}
 [data-theme] .pg-page-expanded .pg-controls>label {font-size:13px;line-height:1.4;min-height:44px;margin:0;padding:2px 4px}
 [data-theme] .pg-page-expanded .pg-depth {display:flex;gap:4px}
 [data-theme] .pg-page-expanded .pg-depth>button {font-size:13px;min-height:44px;flex:1;padding:3px}
 [data-theme] .pg-page-expanded .pg-guide {display:none}
 [data-theme] .pg-page-expanded .pg-scope-notice {font-size:13px;margin:4px 0}
 [data-theme] .pg-page-expanded .pg-scope-notice>summary {padding:4px;min-height:32px}
 [data-theme] .pg-page-expanded .pg-legend {font-size:13px;padding:5px 8px;line-height:1.5;gap:4px 12px}
}

/* MOBILE_GRAPH_LEGEND_SPACE: graph keys are compact, body reading size is retained. */
/* Secondary text and focus cues use the same theme contrast as the reading surface. */
[data-theme] .keyword-card p,[data-theme] .keyword-card .keyword-person-path {color:var(--muted)}
[data-theme] .keyword-card .keyword-open-hint {color:var(--blue)}
[data-theme] .series-related>summary {color:var(--title);min-height:44px}
[data-theme] .catalog-card.source-compact .source-title-row h2 a:focus-visible {outline:3px solid var(--focus-ring);outline-offset:3px}
[data-theme] button.category-link[data-record-export] {appearance:none;background:transparent;border:0;border-radius:var(--radius);width:100%;min-height:44px;text-align:left;color:var(--ink);font:inherit;padding:10px 12px;box-shadow:none}
[data-theme] button.category-link[data-record-export]:hover {background:var(--soft);color:var(--title)}
[data-theme] .source-detail {background:var(--card);color:var(--ink);border-color:var(--line);box-shadow:var(--shadow)}
[data-theme] .source-detail>h2,[data-theme] .source-location :is(h3,h4,.source-location-title),[data-theme] .source-alternatives h3 {color:var(--title)}
[data-theme] .source-location,[data-theme] .source-alternatives {background:var(--soft);color:var(--ink);border-color:var(--line);box-shadow:none}
[data-theme] .source-location :is(p,.source-location-path,.source-location-note,.catalog-locator) {color:var(--ink)}
[data-theme] .source-location a {color:var(--blue)}
[data-theme] .source-location button,[data-theme] .source-location-actions :is(a,button) {min-height:44px;background:var(--card);color:var(--blue);border-color:var(--line)}
[data-theme] .source-location button:hover,[data-theme] .source-location-actions :is(a,button):hover {background:var(--selected);color:var(--title);border-color:var(--rule)}
[data-theme] .copy-source-status {color:var(--muted)}
@media(max-width:760px){
 [data-theme] .pg-legend{font-size:13px;line-height:1.5;padding:6px 8px;gap:4px 12px}
 [data-theme] .pg-canvas-status{font-size:14px;line-height:1.5;padding:8px}
 [data-theme] .pg-stage{min-height:420px}
 [data-theme] .pg-page-expanded .pg-stage{min-height:300px}
}

/* Solo mecha refinement: a continuous chassis with four restrained metal corners. */
.armor-frame{display:none;pointer-events:none}
[data-theme="xuanqing"] body{padding-left:26px;padding-right:26px}
[data-theme="xuanqing"] .armor-frame{
 display:block;position:fixed;inset:7px 8px;z-index:6;pointer-events:none;
 border:44px solid transparent;border-image:url('armor-frame.svg?v=c7db3e4f2509') 48 / 44px / 0 stretch;
 filter:drop-shadow(0 1px 2px #0008);
}
[data-theme="xuanqing"] .topbar{
 border-top:0;border-bottom:1px solid #3d5969;
 background:linear-gradient(180deg,#172632,#101d28 78%);
 box-shadow:inset 0 1px #91b4c01c,0 5px 18px #0003;
}
[data-theme="xuanqing"] .topbar::before,[data-theme="xuanqing"] .topbar::after{display:none}
[data-theme="xuanqing"] .study-card::before,[data-theme="xuanqing"] .study-card::after{display:none}
[data-theme="xuanqing"] .study-card{border-color:#3d5968;box-shadow:inset 0 1px #a3c3cf12,0 3px 9px #0002}
@media(min-width:761px) and (max-width:1099px){
 [data-theme="xuanqing"] body{padding-left:20px;padding-right:20px}
 [data-theme="xuanqing"] .armor-frame{inset:5px 6px;border-width:34px;border-image-width:34px}
}
@media(max-width:760px){
 [data-theme="xuanqing"] body{padding-left:6px;padding-right:6px}
 [data-theme="xuanqing"] .armor-frame{inset:2px;border-width:19px;border-image-width:19px;filter:none}
}
@media print, (forced-colors:active){
 [data-theme="xuanqing"] .armor-frame{display:none}
 [data-theme="xuanqing"] body{padding-left:0;padding-right:0}
}

/* R13 shared reading density: preserve reading text and 44px controls. */
@media (min-width:1100px) {
  [data-theme] .study-card {padding:12px 16px;gap:8px}
  [data-theme] .study-card h2 {line-height:1.5;margin-bottom:3px}
  [data-theme] .study-card-main .study-count {line-height:1.55;margin:2px 0}
}
[data-theme] .feedback-header {gap:12px;padding:16px 20px;min-height:64px}
[data-theme] .feedback-brand {font-size:20px;line-height:1.35}
[data-theme] .feedback-header > a {font-size:16px;line-height:1.5;min-height:44px;display:inline-flex;align-items:center}
@media (max-width:760px) {
  [data-theme] .header-tools {gap:6px;flex-wrap:wrap}
  [data-theme] .header-tools :is(.appearance-control,.text-size-control) {height:50px;min-height:50px;padding:2px 4px;gap:3px;font-size:14px}
  [data-theme] .copyright-banner {margin-bottom:12px}
  [data-theme] .copyright-banner .copyright-meta, [data-theme] .copyright-banner .story-notice {font-size:16px;line-height:1.55;margin:0}
  [data-theme] .copyright-banner .copyright-links {font-size:16px;column-gap:12px;row-gap:0}
  [data-theme] .copyright-banner .copyright-links a {display:inline-flex;align-items:center;min-height:44px}
  [data-theme] .feedback-header {padding:12px 14px}
  [data-theme] .feedback-brand {font-size:18px}
}
@media (max-width:360px) {
  [data-theme] .header-tools .appearance-control select {min-width:92px;max-width:112px;font-size:14px}
}

/* R13 direct graph final integration */
/* Shared graph controls: reading type stays user-sized; secondary tools fold. */
[data-theme] .pg-extra-controls {position:relative;align-self:center;font-size:15px;line-height:1.5}
[data-theme] .pg-extra-controls>summary {cursor:pointer;min-height:44px;padding:10px 12px;box-sizing:border-box;border:1px solid var(--line);border-radius:4px;color:var(--ink);background:var(--card)}
[data-theme] .pg-extra-controls>summary:hover {background:var(--selected)}
[data-theme] .pg-extra-controls>summary:focus-visible {outline:3px solid var(--focus-ring);outline-offset:2px}
[data-theme] .pg-extra-controls .pg-extra-panel {display:flex;gap:8px;flex-wrap:wrap;padding:8px 0}
[data-theme] .pg-extra-controls:not([open]) .pg-extra-panel {display:none}
[data-theme] .pg-extra-controls .pg-expand-default {font-size:14px;min-height:44px;display:flex;align-items:center}
@media(max-width:760px){
 [data-theme] .person-graph .pg-heading h2 {font-size:21px;line-height:1.4;margin:0 0 4px}
 [data-theme] .person-graph .pg-heading p {font-size:14px;line-height:1.55;margin:4px 0 6px}
 [data-theme] .person-graph .pg-controls {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:8px 0}
 [data-theme] .person-graph .pg-controls>button {min-height:44px;font-size:14px;padding:4px}
 [data-theme] .person-graph .pg-controls :is([data-pg-fit],[data-pg-expand],.pg-depth,.pg-lines,.pg-extra-controls) {grid-column:span 2}
 [data-theme] .person-graph .pg-controls>.pg-depth {display:flex;gap:4px}
 [data-theme] .person-graph .pg-depth>button {min-height:44px;font-size:13px;flex:1;padding:3px}
 [data-theme] .person-graph .pg-controls>.pg-lines {min-height:44px;display:flex;align-items:center;margin:0;font-size:14px;line-height:1.4}
 [data-theme] .person-graph .pg-extra-controls {min-width:0;align-self:start;font-size:13px}
 [data-theme] .person-graph .pg-extra-controls>summary {padding:10px 5px;white-space:normal;line-height:1.5}
 [data-theme] .person-graph .pg-extra-controls[open] {grid-column:1/-1}
 [data-theme] .person-graph .pg-guide {font-size:14px;line-height:1.6;margin:6px 0 8px}
 [data-theme] .person-graph .pg-scope-notice {font-size:14px;line-height:1.5;margin:4px 0 8px}
 [data-theme] .person-graph .pg-scope-notice>summary {min-height:44px;padding:10px 8px;box-sizing:border-box}
 [data-theme] .pg-page-expanded .pg-heading h2 {font-size:18px}
 [data-theme] .pg-page-expanded .pg-heading p {font-size:13px}
 [data-theme] .pg-page-expanded .pg-guide {display:none}
 [data-theme] .pg-tooltip {max-width:calc(100% - 16px);font-size:14px;line-height:1.5;white-space:normal}
}

/* Put the actual source title before repeated navigation prose on phones. */
body[data-view="sourceDetail"] .content-heading .eyebrow {display:none}
body[data-view="sourceDetail"] #reading-note {font-size:16px;line-height:1.55;margin:6px 0 12px}
body[data-view="sourceDetail"] .content-heading {margin:0 0 8px;padding-bottom:6px}
body[data-view="sourceDetail"] .content-heading h1 {font-size:28px;line-height:1.4}
body[data-view="sourceDetail"] .source-detail {padding-top:14px}
body[data-view="sourceDetail"] .source-detail>.question-return {font-size:16px;min-height:44px;margin-bottom:8px}
[data-theme] .feedback-header>.feedback-brand {display:inline-flex;gap:10px;align-items:center;text-decoration:none;font-size:20px}
[data-theme] .feedback-brand .brand-mark {width:32px;height:32px;flex:none}
[data-theme] .feedback-brand .brand-mark svg {width:26px;height:26px}
@media(max-width:760px) {
 [data-theme] .feedback-header>.feedback-brand {font-size:18px}
 [data-theme] .header-tools .appearance-control>span {display:none}
 [data-theme] .header-tools .appearance-control select {min-width:96px;max-width:96px;font-size:14px;padding-left:4px;padding-right:4px}
 [data-theme] .header-tools .text-size-label {display:none}
 [data-theme] .header-tools .text-size-control button {width:44px;min-width:44px;padding:3px;font-size:14px}
 body[data-view="sourceDetail"] .copyright-banner {padding:12px 14px}
 body[data-view="sourceDetail"] .copyright-banner .copyright-owner strong {font-size:16px;line-height:1.55}
 body[data-view="sourceDetail"] .source-detail {padding:10px 14px 12px}
 body[data-view="sourceDetail"] .source-detail>.question-return {margin-bottom:4px}
}

/* Consistent note actions, including when only one version is available. */
[data-theme] .note-versions > .note-version {
  box-sizing:border-box;
  inline-size:10em;
  max-inline-size:100%;
  flex:0 0 auto;
  justify-content:center;
  text-align:center;
}
/* Keep the reading notice at the same visual level as the source description. */
[data-theme] .copyright-banner > .story-notice {
  grid-column:1 / -1;
  margin:.2em 0;
  font-weight:400;
}
[data-theme] footer .story-notice-footer {
  color:var(--muted);
  font-weight:400;
}

/* Card reading actions: title is a heading; equally sized buttons own the links. */
[data-theme] body .catalog-card.source-compact {
  --note-title:var(--title,var(--ink,#263d38));
  --note-action-bg:#edf5f0; --note-action-ink:#204f3d; --note-action-border:#719a83;
  --note-tencent-bg:#ecf3fa; --note-tencent-ink:#274d6e; --note-tencent-border:#7b9cb9;
  --note-video-bg:#f6f0e5; --note-video-ink:#705025; --note-video-border:#ae9367;
}
[data-theme="xuanqing"] body .catalog-card.source-compact {
  --note-title:#e3edf2;
  --note-action-bg:#203d3c; --note-action-ink:#d5f0e2; --note-action-border:#75aa95;
  --note-tencent-bg:#243a4d; --note-tencent-ink:#d5e7fa; --note-tencent-border:#83a6cc;
  --note-video-bg:#433a28; --note-video-ink:#f3e3bd; --note-video-border:#bca16c;
}
[data-theme] body .catalog-card.source-compact .source-title-row>h2 {
  color:var(--note-title); font-size:1.08rem; font-weight:650; line-height:1.6;
  letter-spacing:0; text-shadow:none; margin:.25rem 0 .55rem; cursor:default;
}
[data-theme] body .catalog-card.source-compact .note-versions {
  display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin:.1rem 0 .65rem;
}
[data-theme] body .catalog-card.source-compact .note-versions>a.note-version {
  display:inline-flex; box-sizing:border-box; inline-size:10em; max-inline-size:100%;
  flex:0 0 auto; min-block-size:44px; padding:.45rem .6rem; justify-content:center;
  align-items:center; text-align:center; white-space:normal; overflow-wrap:anywhere;
  color:var(--note-action-ink); background:var(--note-action-bg);
  border:1px solid var(--note-action-border); border-radius:5px;
  font-size:.94rem; font-weight:650; line-height:1.45; text-decoration:none;
  box-shadow:inset 0 1px 0 #ffffff12; cursor:pointer;
}
[data-theme] body .catalog-card.source-compact .note-versions>a[data-note-kind="tencent"] {
  color:var(--note-tencent-ink); background:var(--note-tencent-bg); border-color:var(--note-tencent-border);
}
[data-theme] body .catalog-card.source-compact .note-versions>a.replay-video-link {
  color:var(--note-video-ink); background:var(--note-video-bg); border-color:var(--note-video-border);
}
[data-theme] body .catalog-card.source-compact .note-versions>a.note-version:hover {
  text-decoration:underline; text-underline-offset:.2em; filter:brightness(1.08);
  box-shadow:0 2px 5px #00000018;
}
[data-theme] body .catalog-card.source-compact .note-versions>a.note-version:focus-visible {
  outline:3px solid var(--focus-ring,var(--note-action-border)); outline-offset:3px;
}
[data-theme] body .catalog-card.source-compact .source-tools {
  color:var(--muted,#586b63); gap:.1rem .85rem; padding-top:.35rem; margin-top:.25rem;
}
[data-theme] body .catalog-card.source-compact .source-tools :is(.record-quick,.record-toggle-feedback,.source-more,summary) {
  color:var(--muted,#586b63); font-size:.85rem; font-weight:450; text-shadow:none;
}
[data-theme] body .catalog-card.source-compact .source-tools :is(.record-quick,.source-more,summary):hover {
  color:var(--note-title); text-decoration:underline; text-underline-offset:.2em;
}
[data-theme] body .catalog-card.source-compact .replay-date-evidence {
  color:var(--muted,#586b63); font-size:.8rem; font-weight:400; line-height:1.5;
}
@media(max-width:520px) {
  [data-theme] body .catalog-card.source-compact .note-versions {gap:.4rem;}
  [data-theme] body .catalog-card.source-compact .note-versions>a.note-version {
    inline-size:min(10em,calc((100% - .4rem)/2)); font-size:.88rem; padding:.4rem .45rem;
  }
}
@media(forced-colors:active) {
  [data-theme] body .catalog-card.source-compact .note-versions>a.note-version {
    color:LinkText; background:Canvas; border-color:LinkText; box-shadow:none;
  }
}

/* 050: one-line source actions and plain result-group headings only. */
[data-theme] body #results .result-group-heading::before { content:none; display:none; }
[data-theme] body #results .result-group-heading { padding-left:0; }
[data-theme] body .catalog-card.source-compact .note-versions>a.note-version {
  white-space:nowrap; overflow-wrap:normal; word-break:normal;
}
[data-theme] body .catalog-card.source-compact .note-version>.note-version-label {
  display:block; min-inline-size:0; max-inline-size:100%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* 050: directory status controls only; progress remains browser-local. */
[data-theme] body .study-outline .study-status-filters {
  display:flex; flex-wrap:wrap; gap:.3rem; margin:.2rem 0 .45rem; flex:none;
}
[data-theme] body .study-outline .study-status-filters>button {
  flex:1 1 0; min-inline-size:0; min-block-size:40px;
  padding:.3rem .35rem; font-size:.86em; white-space:nowrap;
}

/* 053: only Huaxia/Weikong total overviews use the whole row. Focus views retain the original workspace. */
[data-theme] .pg-readable-overview .pg-workspace{grid-template-columns:minmax(0,1fr)}
[data-theme] .pg-readable-overview .pg-stage{height:var(--pg-workspace-height,900px);min-height:720px;max-height:960px}
[data-theme] .pg-readable-overview .pg-evidence{height:auto;min-height:120px;max-height:360px}
/* Expanded/fullscreen ID rules must not restore a side panel for these two overviews. */
#results.pg-page-expanded .pg-readable-overview .pg-workspace,#results:fullscreen .pg-readable-overview .pg-workspace{grid-template-columns:minmax(0,1fr)}
#results.pg-page-expanded .pg-readable-overview .pg-evidence,#results:fullscreen .pg-readable-overview .pg-evidence{height:auto;min-height:120px;max-height:360px}
@media(max-width:780px){
 #results.pg-page-expanded .pg-readable-overview .pg-evidence,#results:fullscreen .pg-readable-overview .pg-evidence{max-height:40dvh}
}
/* All graphs: toolbar occupies its own reserved band inside the frame. */
[data-theme] .pg-frame-tools{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding:8px 10px;background:var(--pg-bg,#12352f);border-bottom:1px solid var(--pg-ring,#a98b58)}
[data-theme] .pg-frame-tools .pg-canvas-status{position:static;flex:1 1 230px;padding:0;background:none;font-size:14px;line-height:1.5}
[data-theme] .pg-frame-actions{display:flex;gap:5px;margin-left:auto;flex-wrap:wrap}
[data-theme] .pg-frame-actions button{font-size:14px;min-height:44px;padding:5px 10px;white-space:nowrap}
[data-theme] .pg-frame-actions button[aria-pressed="true"]{background:var(--selected);border-color:var(--focus-ring)}
@media(max-width:780px){
 [data-theme] .pg-readable-overview .pg-stage{height:420px;min-height:320px;max-height:60dvh}
 [data-theme] .pg-readable-overview .pg-evidence{max-height:42dvh}
}

/* Candidate: explicit confirmed-component browsing; every name is attached to its node. */
[data-theme] .pg-component-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:8px 0 12px}
[data-theme] .pg-component-controls label{display:flex;align-items:center;gap:8px}
[data-theme] .pg-component-controls select,[data-theme] .pg-component-controls button{font:inherit;min-height:44px;max-width:100%;padding:6px 10px;border:1px solid var(--pg-ring,var(--line));border-radius:6px;color:var(--ink);background:var(--panel)}
[data-theme] .pg-component-status{flex:1 1 100%;font-size:.88em;color:var(--muted);line-height:1.5}
@media(max-width:780px){[data-theme] .pg-component-controls label{width:100%}[data-theme] .pg-component-controls select{flex:1;min-width:0}}

/* Two direct scope buttons; other small groups share one scrollable canvas. */
[data-theme] .pg-component-controls button[aria-pressed="true"]{background:var(--selected);border-color:var(--focus-ring)}
[data-theme] .pg-other-scope .pg-workspace{grid-template-columns:minmax(0,1fr)}
[data-theme] .pg-other-scope .pg-stage{height:var(--pg-small-groups-height,720px);min-height:360px;max-height:none}
[data-theme] .pg-other-scope .pg-evidence{height:auto;max-height:520px}
#results.pg-page-expanded .pg-other-scope .pg-workspace,#results:fullscreen .pg-other-scope .pg-workspace{grid-template-columns:minmax(0,1fr)}
#results.pg-page-expanded .pg-other-scope .pg-stage,#results:fullscreen .pg-other-scope .pg-stage{height:var(--pg-small-groups-height,720px);min-height:360px;max-height:none}
#results.pg-page-expanded .pg-other-scope .pg-evidence,#results:fullscreen .pg-other-scope .pg-evidence{height:auto;max-height:520px}
@media(max-width:780px){[data-theme] .pg-other-scope .pg-evidence,#results.pg-page-expanded .pg-other-scope .pg-evidence,#results:fullscreen .pg-other-scope .pg-evidence{max-height:42dvh}}

/* User-authorized one-screen graph candidate. Source semantics unchanged. */
body.pg-map-one-screen{overflow:hidden}
[data-theme] #results.pg-one-screen{position:fixed;inset:0;z-index:1200;width:100%;height:100dvh;max-width:none;margin:0;padding:8px;box-sizing:border-box;overflow:hidden;background:var(--paper,#f7f5ec)}
#results.pg-one-screen>:not(.person-graph){display:none}
#results.pg-one-screen .person-graph{max-width:none;margin:0;padding:0}
.pg-compact-toolbar{display:flex;align-items:center;gap:6px;min-height:48px;padding:0 0 8px;white-space:nowrap;position:relative;overflow-x:auto;scrollbar-width:thin}
.pg-compact-toolbar h2{font-size:1rem!important;line-height:1.3!important;white-space:nowrap!important;height:auto!important;max-height:2rem;max-width:15rem;min-width:0;overflow:hidden;text-overflow:ellipsis;margin:0;flex:1 1 12rem}
.pg-compact-toolbar .pg-route-actions,.pg-compact-toolbar .pg-component-controls,.pg-compact-toolbar .pg-frame-actions{display:flex;gap:5px;margin:0;padding:0;flex-shrink:0}
.pg-compact-toolbar .pg-component-controls{flex-wrap:nowrap}
[data-theme] #results.pg-one-screen .pg-compact-toolbar button,[data-theme] #results.pg-one-screen .pg-compact-toolbar a,[data-theme] #results.pg-one-screen .pg-compact-toolbar summary{font:inherit;font-size:13px;line-height:1.3;padding:6px 8px;min-height:34px;height:auto;white-space:nowrap;box-sizing:border-box;border:1px solid var(--line,#9aafaa);border-radius:4px;background:var(--card,#f7f5ec);color:var(--ink,#23443a);cursor:pointer;text-decoration:none}
.pg-compact-settings{margin-left:auto;flex-shrink:0}
.pg-compact-settings-panel{position:fixed;right:8px;top:var(--pg-toolbar-height,56px);width:min(540px,90vw);max-height:75dvh;overflow:auto;background:var(--paper,#f7f5ec);color:var(--ink,#23443a);padding:1rem;border:1px solid var(--line,#9aafaa);box-shadow:0 10px 30px #0003;z-index:20;white-space:normal;box-sizing:border-box}
.pg-compact-settings .pg-heading,.pg-compact-settings .pg-controls,.pg-compact-settings .pg-legend{position:static;display:block;height:auto;margin:.6rem 0}
.pg-compact-settings .pg-heading h2{display:none}
.pg-compact-toolbar [data-pg-expand],.pg-compact-toolbar .pg-expand-default{display:none}
[data-theme] #results.pg-one-screen .pg-workspace{grid-template-columns:minmax(0,1fr) 340px;gap:8px;margin:0}
@media(min-width:1100px) and (max-width:1450px){[data-theme] #results.pg-one-screen .pg-workspace{grid-template-columns:minmax(0,1fr) 300px}}
[data-theme] #results.pg-one-screen .pg-stage,[data-theme] #results.pg-one-screen .pg-evidence{height:var(--pg-workspace-height);min-height:0;max-height:none;box-sizing:border-box}
[data-theme] #results.pg-one-screen .pg-evidence{overflow:auto;overscroll-behavior:contain}
.pg-one-screen .pg-frame-tools{position:static;inset:auto;background:none!important;border:0;pointer-events:none;min-height:0;padding:0;margin:0;font-size:13px;opacity:1}
.pg-one-screen .pg-canvas-status{margin:0;font-size:11px}
.pg-gesture-hint{position:absolute;right:12px;bottom:10px;pointer-events:none;font-size:12px;padding:4px;background:var(--pg-bg,#f7f5ec);color:var(--pg-ink,#23443a);animation:pg-hint-out .3s 3s both}
@keyframes pg-hint-out{to{opacity:0}}
/* Small relation cards use the document's space and scrolling, never zoom to
   squeeze readable fixed-pixel names back into a single viewport. */
body.pg-other-map{overflow:auto}
body.pg-other-map .workspace{display:block;max-width:none;width:100%}
body.pg-other-map .sidebar,body.pg-other-map .topbar{display:none}
body.pg-other-map .content{padding:8px;width:100%;max-width:none}
[data-theme] #results.pg-one-screen.pg-other-scope{position:relative;inset:auto;height:auto;overflow:visible;width:100%;max-width:none}
.pg-other-scope .pg-compact-toolbar{position:sticky;top:0;z-index:20;background:var(--paper,#f7f5ec)}
[data-theme] #results.pg-other-scope .pg-workspace{grid-template-columns:minmax(0,1fr)}
[data-theme] #results.pg-other-scope .pg-evidence{height:auto;max-height:45dvh;min-height:120px;overflow:auto}
.pg-other-scope .pg-compact-toolbar [data-pg-zoom]{display:none}
.pg-other-scope .pg-canvas{cursor:pointer;touch-action:pan-y}
@media(min-width:1100px){
 [data-theme] #results.pg-other-scope .pg-workspace{grid-template-columns:minmax(0,1fr) 340px}
 [data-theme] #results.pg-other-scope .pg-evidence{position:sticky;top:58px;height:calc(100dvh - 70px);max-height:calc(100dvh - 70px)}
}
@media(min-width:1100px) and (max-width:1450px){[data-theme] #results.pg-other-scope .pg-workspace{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:1099px){
 [data-theme] #results.pg-one-screen .pg-workspace{grid-template-columns:minmax(0,1fr)}
 [data-theme] #results.pg-one-screen .pg-evidence{display:none;position:fixed;bottom:0;left:0;right:0;z-index:1250;height:auto;max-height:35dvh;min-height:0;overflow:auto;margin:0;border:2px solid var(--line);background:var(--paper);box-shadow:0 -6px 28px #0003}
 [data-theme] #results.pg-one-screen.pg-detail-open .pg-evidence{display:block}
 .pg-detail-close{display:block;position:sticky;top:0;margin-left:auto;background:var(--card);color:var(--ink);border:1px solid var(--line);padding:6px 10px}
}
@media(min-width:1100px){.pg-detail-close{display:none}}
@media(min-width:781px) and (max-width:1450px){.pg-compact-toolbar h2{max-width:10rem}.pg-compact-toolbar{gap:4px}}
@media(max-width:780px){
 body.pg-map-one-screen,body.pg-map-expanded{overflow:auto}
 [data-theme] #results.pg-one-screen{position:relative;inset:auto;height:auto;overflow:visible;padding:0;width:100%}
 .pg-compact-toolbar{overflow-x:auto;overscroll-behavior:contain;position:sticky;top:0;background:var(--paper,#f7f5ec);z-index:10;min-height:48px;max-width:100%;font-size:14px}
 .pg-compact-toolbar h2{min-width:7rem;max-width:7rem}.pg-compact-settings{margin-left:0}
 .pg-compact-settings-panel{position:fixed;top:56px;right:5px;width:calc(100vw - 10px);box-sizing:border-box}
 [data-theme] #results.pg-one-screen .pg-workspace{grid-template-columns:minmax(0,1fr)}
 [data-theme] #results.pg-one-screen .pg-stage{height:var(--pg-workspace-height);min-height:240px}
 [data-theme] #results.pg-one-screen .pg-evidence{height:auto;min-height:120px;max-height:45dvh;overflow:auto}
 .pg-gesture-hint{font-size:10px}
}
@media(prefers-reduced-motion:reduce){.pg-gesture-hint{animation:none;opacity:.55}}

/* Reading contrast corrections, scoped to the two reviewed themes. */
@media(max-width:1099px){[data-theme] #results.pg-one-screen.pg-detail-open .pg-evidence{max-height:var(--pg-sheet-max,35dvh)}}
[data-theme=xuanqing] .topbar .brand,[data-theme=xuanqing] .topbar .brand strong{color:#e3f2f5;opacity:1;text-shadow:none;-webkit-text-fill-color:currentColor}
[data-theme=xuanqing] .topbar .site-modes a{color:#d4e6ed;background:transparent;opacity:1}
[data-theme=xuanqing] .topbar .site-modes a[aria-current=page]{color:#fff;background:#284b5e;border-color:#8bb9ce}
[data-theme=xuanqing] .category-link,[data-theme=xuanqing] .index-link,[data-theme=xuanqing] .sidebar a,[data-theme=xuanqing] .category-link .nav-count{color:#d4e6ed;opacity:1}
[data-theme=xuanqing] .category-link[aria-current=page]{color:#fff;background:#284b5e}
[data-theme=paper] .topbar .brand,[data-theme=paper] .topbar .brand strong{color:#233d4d;opacity:1;text-shadow:none;-webkit-text-fill-color:currentColor}
[data-theme=paper] .topbar .site-modes a{color:#294353;background:transparent;box-shadow:none;opacity:1;border-color:transparent}
[data-theme=paper] .topbar .site-modes a[aria-current=page]{color:#fff;background:#294e65;border-color:#294e65}
[data-theme=paper] .category-link,[data-theme=paper] .index-link,[data-theme=paper] .sidebar a,[data-theme=paper] .category-link .nav-count{color:#294353;opacity:1}
[data-theme=paper] .category-link[aria-current=page]{background:#dbe8ef;color:#213d50}
[data-theme=paper] .text-size-control button[aria-pressed=true]{background:#294e65;color:#fff;border:2px solid #294e65;box-shadow:none}
[data-theme=xuanqing] .brand-mark,[data-theme=paper] .brand-mark{color:inherit;opacity:1}
[data-theme=xuanqing] .brand-mark path,[data-theme=paper] .brand-mark path{stroke:currentColor;fill:none;stroke-width:2;opacity:1}

/* 077: equal resource buttons and disclosure controls that stay in place. */
[data-theme] body .catalog-card.source-compact .source-links-row {
  --resource-width: 10rem;
  gap: 10px;
}
[data-theme] body .catalog-card.source-compact .source-links-row > .note-versions,
[data-theme] body .catalog-card.source-compact .source-links-row > .replay-link-group,
[data-theme] body .catalog-card.source-compact .source-links-row > .replay-link-group > .note-versions {
  display: contents;
}
[data-theme] body .catalog-card.source-compact .source-links-row .note-versions > a.note-version {
  flex: 0 0 var(--resource-width);
  width: var(--resource-width);
  min-width: 0;
  max-width: 100%;
  height: 4.6em;
  min-height: 4.6em;
  padding: .45em .55em;
  justify-content: center;
  align-items: center;
  text-align: center;
  white-space: normal;
}
[data-theme] body .catalog-card.source-compact .source-tools {
  overflow-anchor: none;
}
[data-theme] body .catalog-card.source-compact .source-tools > :is(.record-editor,.source-tag-details),
[data-theme] body .catalog-card.source-compact .source-tools > :is(.record-editor,.source-tag-details)::details-content {
  display: contents;
}
[data-theme] body .catalog-card.source-compact .source-tools > :is(.record-editor,.source-tag-details) > summary {
  flex: 0 0 auto;
  order: 0;
  min-height: 44px;
  margin: 0;
  padding: .4rem 0;
  border: 0;
  background: transparent;
}
[data-theme] body .catalog-card.source-compact .source-tools > details:not([open]) > :not(summary) {
  display: none;
}
[data-theme] body .catalog-card.source-compact .source-tools > details > :is(.source-disclosure-body,form) {
  flex: 1 0 100%;
  order: 10;
  min-width: 0;
  width: 100%;
  margin: .25rem 0 0;
  padding: .65rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: var(--soft);
}
[data-theme] body .catalog-card.source-compact .source-tools > .record-editor > form { order: 11; }
@media(max-width:600px) {
  [data-theme] body .catalog-card.source-compact .source-links-row { --resource-width: calc((100% - 10px) / 2); }
  [data-theme][data-text-size=xlarge] body .catalog-card.source-compact .source-links-row { --resource-width: 100%; }
}
@media(max-width:380px) {
  [data-theme] body .catalog-card.source-compact .source-links-row { --resource-width: 100%; }
}
@media(max-width:1279px) {
  [data-theme] body[data-study-outline=true] .study-outline-toggle { position: static; }
}
.pg-compact-toolbar .pg-tool-group {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  border-left: 1px solid var(--line); padding-left: 10px; margin-left: 4px;
}
[data-theme] #results.pg-one-screen .pg-compact-toolbar [data-pg-summary][aria-pressed=true] {
  background: var(--selected); border-color: var(--focus-ring); font-weight: 700;
}
.pg-compact-toolbar .pg-compact-settings { border-left: 1px solid var(--line); padding-left: 10px; }
.pg-relation-preview { display: none; }
@media(max-width:780px) {
  .pg-relation-preview:not([hidden]) { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
  .pg-relation-preview > button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; padding: 5px; }
  .pg-compact-toolbar { flex-wrap: wrap; white-space: normal; overflow-x: visible; }
  .pg-compact-toolbar h2 { flex: 1 1 calc(100% - 100px); max-width: none; }
  .pg-compact-toolbar .pg-tool-group { padding-left: 7px; margin-left: 0; }
  .pg-compact-toolbar .pg-compact-settings { margin-left: 0; }
}

/* 078: make topical collection entry as easy to find as the water collection. */
.topic-collection{border:2px solid var(--accent,#365f51);border-inline-start-width:6px;background:var(--panel,#faf9f2);padding:1.2rem 1.35rem;margin-block:1rem;}
.topic-collection .collection-kicker{font-size:.85rem;color:var(--accent,#365f51);font-weight:700;margin:0 0 .4rem;}
.topic-collection .video-library-title{font-size:1.35rem;margin:.25rem 0 .6rem;}
.topic-collection .collection-primary{display:inline-flex;align-items:center;justify-content:space-between;gap:1.25rem;min-height:3rem;padding:.7rem 1rem;margin-top:.35rem;border:1px solid var(--accent,#365f51);border-radius:5px;background:var(--accent,#365f51);color:var(--on-accent,#fff);text-decoration:none;font-weight:700;box-sizing:border-box;max-width:100%;}
.topic-collection .collection-primary:hover{filter:brightness(1.08);}
.topic-collection .collection-primary:focus-visible{outline:3px solid currentColor;outline-offset:3px;}
.topic-collection .collection-count{white-space:nowrap;border-inline-start:1px solid currentColor;padding-inline-start:1rem;}
@media(max-width:520px){.topic-collection{padding:1rem;}.topic-collection .collection-primary{width:100%;gap:.5rem;}.topic-collection .video-library-title{font-size:1.15rem;}}

/* Questions are a second way to browse the existing groupchat section. */
.groupchat-tabs{display:flex;flex-wrap:wrap;gap:.5rem;border-bottom:1px solid var(--line,#ccc8b5);padding:.4rem 0 .8rem;margin:.5rem 0 1rem;}
.groupchat-tabs a{display:inline-flex;align-items:center;justify-content:center;min-height:2.7rem;padding:.45rem 1rem;border:1px solid var(--line,#b9b49c);border-radius:4px;text-decoration:none;}
.groupchat-tabs a[aria-current="page"]{background:var(--accent,#365f51);color:var(--on-accent,#fff);font-weight:700;}
@media(max-width:520px){.groupchat-tabs a{flex:1;white-space:nowrap;padding:.45rem .55rem;}}
