/* GENERATED FILE — DO NOT EDIT.
 * Sources: apps/api/app/static/css/*.css
 * Regenerate: python apps/api/scripts/build_stylesheet.py
 * The section order below is the public cascade contract.
 */

/* --- source: css/tokens.css --- */
:root {
  --bg: #f3ede1;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: #fbf7ef;
  --text: #29261f;
  --muted: #6b6457;
  --border: #d8cebc;
  --accent: #6b4f1d;
  --accent-soft: rgba(107, 79, 29, 0.12);
  --page-glow: rgba(255, 255, 255, 0.35);
  --surface-overlay: rgba(255, 255, 255, 0.14);
  --accent-contrast: #fffaf0;
  color-scheme: light;
  --reader-max-width: 1180px;
  --reader-font-size: 20px;
  --shadow: 0 8px 24px rgba(20, 20, 20, 0.08);
  --left-drawer-width: 360px;
  --right-drawer-width: 360px;
  --font-ui: "Aptos", "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-reader-text: "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --profile-max-width: 70rem;
  --profile-measure: 70ch;
  --profile-radius: 10px;
  --profile-gap: 1.75rem;
}

body[data-theme="light"] {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #1d2430;
  --muted: #556173;
  --border: #dbe3ee;
  --accent: #1d5fd0;
  --accent-soft: rgba(29, 95, 208, 0.1);
}

body[data-theme="dark"] {
  --bg: #14161a;
  --panel: rgba(32, 35, 40, 0.92);
  --panel-strong: #1c2026;
  --text: #edf2fa;
  --muted: #a8b2c2;
  --border: #2f3742;
  --accent: #7db0ff;
  --accent-soft: rgba(125, 176, 255, 0.14);
  --page-glow: rgba(255, 255, 255, 0.025);
  --surface-overlay: rgba(255, 255, 255, 0.045);
  --accent-contrast: #111722;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* --- source: css/base.css --- */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top, var(--page-glow), transparent 28%),
    linear-gradient(180deg, var(--surface-overlay), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-reader-text);
}
button, input, select, summary, textarea { font: inherit; font-family: var(--font-ui); }
button, select, input {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 0.68rem 0.82rem;
}
textarea {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 0.68rem 0.82rem;
}
button {
  cursor: pointer;
  transition: transform 0.08s ease, background 0.18s ease, border-color 0.18s ease;
}
button:hover { background: var(--accent-soft); }
button:active { transform: translateY(1px); }
button:disabled {
  cursor: wait;
  opacity: 0.72;
}
.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 0.68rem 0.82rem;
  font: inherit;
  font-family: var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.button-like:hover { background: var(--accent-soft); }
.button-like:active { transform: translateY(1px); }
.button-like.is-disabled,
.button-like[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}
.subscribe-cta {
  background: var(--accent);
  color: var(--panel-strong);
  border-color: var(--accent);
}
.subscribe-cta:hover {
  background: var(--accent);
  opacity: 0.92;
}
label {
  display: grid;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.92rem;
}
h1, h2, h3, p, menu { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --- source: css/shell.css --- */
a { color: inherit; }

.app-shell { padding: 0.9rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin: 0 auto 0.85rem;
  max-width: 1840px;
}
.brand-block { display: grid; gap: 0.12rem; }
.topbar h1 { font-size: 1.2rem; line-height: 1.1; }
.topbar-subtitle { color: var(--muted); font-size: 0.92rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}
.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: flex-end;
}
.topbar-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.shell-auth-entry {
  white-space: nowrap;
}
.compact-controls label { min-width: 140px; }
.compact-controls select { min-width: 110px; }
.settings-menu {
  position: relative;
}
.settings-menu > summary {
  list-style: none;
}
.settings-menu > summary::-webkit-details-marker {
  display: none;
}
.settings-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  min-width: 290px;
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.settings-menu:not([open]) .settings-panel {
  display: none;
}
.settings-auth {
  display: grid;
  gap: 0.55rem;
}
.ghost-button {
  background: transparent;
  border: 1px solid transparent;
}
.ghost-button:hover {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}
.ghost-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.icon-button {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0;
}
.hidden { display: none !important; }
[hidden] { display: none !important; }

.reader-signin-invitation,
.site-feedback {
  width: min(100%, 1840px);
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
}
.reader-signin-invitation > div:first-child,
.site-feedback > div:first-child {
  display: grid;
  gap: 0.12rem;
}
.reader-signin-invitation strong { font-size: 0.92rem; }
.reader-signin-invitation-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.reader-signin-invitation .button-like,
.reader-signin-invitation .ghost-button,
.site-feedback .ghost-button { white-space: nowrap; }
.site-feedback { margin-top: 1rem; margin-bottom: 0; }
.site-feedback p { margin: 0; color: var(--muted); font-size: 0.86rem; }
@media (max-width: 640px) {
  .reader-signin-invitation,
  .site-feedback { align-items: flex-start; flex-direction: column; }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, var(--left-drawer-width)) minmax(0, 1fr) minmax(0, var(--right-drawer-width));
  gap: 1rem;
  max-width: 1840px;
  margin: 0 auto;
  align-items: start;
}
.layout.left-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) minmax(0, var(--right-drawer-width));
}
.layout.right-collapsed {
  grid-template-columns: minmax(0, var(--left-drawer-width)) minmax(0, 1fr) 0;
}
.layout.left-collapsed.right-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.sidebar, .reader-area { min-width: 0; }
.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
  position: sticky;
  top: 0.9rem;
  max-height: calc(100vh - 1.8rem);
  overflow: auto;
  padding-right: 0.1rem;
}
.left-panel.hidden-drawer,
.right-panel.hidden-drawer {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.reader-area { display: grid; gap: 1rem; }
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  padding: 0.2rem 0.2rem 0;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08)), var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 0.95rem;
  backdrop-filter: blur(8px);
}
.compact-card { padding: 0.85rem 0.95rem; }
.panel-card, .drawer-card { display: grid; gap: 0.75rem; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.panel-header h2 { font-size: 1.04rem; }
.panel-meta { font-size: 0.8rem; }
.stack { display: grid; }
.gap-sm { gap: 0.6rem; }
.results-list { display: grid; gap: 0.5rem; }
.scroll-results {
  max-height: 340px;
  overflow: auto;
  padding-right: 0.2rem;
}
.tall-scroll-results { max-height: 520px; }
.coverage-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.result-item, .search-hit, .author-card {
  width: 100%;
  text-align: left;
  background: var(--panel-strong);
}
.result-item .title, .search-hit .title, .author-title { display: block; font-weight: 600; }
.result-item .meta, .search-hit .meta, .muted { color: var(--muted); }
.author-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem;
  display: grid;
  gap: 0.6rem;
}
.author-works {
  display: grid;
  gap: 0.45rem;
  max-height: 200px;
  overflow: auto;
}
.group-block {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
}
.group-title { font-weight: 700; }
.inline-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.search-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}
.search-query-field { grid-column: 1 / 2; }
.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
}
.help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.help-tooltip-trigger {
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.help-tooltip-panel {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.45rem);
  transform: translate(-50%, 0.2rem);
  width: max-content;
  max-width: 280px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.help-tooltip:hover .help-tooltip-panel,
.help-tooltip:focus-within .help-tooltip-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.search-workspace-main { gap: 0.9rem; }
.search-workspace-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.search-mode-pill {
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.58rem 0.9rem;
}
.search-mode-pill.is-active {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.28);
  color: var(--accent);
}
.workspace-mode-summary {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
}
.workspace-mode-summary-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  color: var(--muted);
}
.workspace-mode-summary-text {
  font-size: 0.96rem;
}
.workspace-section {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.workspace-collapsible-section {
  padding-top: 0.35rem;
}
.workspace-section-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}
.workspace-section-summary::-webkit-details-marker {
  display: none;
}
.workspace-section-summary-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 0.98rem;
}
.workspace-collapsible-section .workspace-section-summary::after {
  content: '\25B8';
  color: var(--muted);
  font-size: 0.82rem;
  transition: transform 0.14s ease;
}
.workspace-collapsible-section[open] .workspace-section-summary::after {
  transform: rotate(90deg);
}
.workspace-section-body {
  display: grid;
  gap: 0.7rem;
}
.workspace-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.workspace-section-header h3 {
  margin: 0;
  font-size: 0.98rem;
}
.workspace-page-main {
  gap: 1rem;
}
.workspace-layout {
  display: grid;
  gap: 1.55rem;
}
.workspace-study,
.workspace-signin-card,
.workspace-dashboard-shell {
  display: grid;
  gap: 0.9rem;
}
.workspace-dashboard-shell {
  order: -1;
  padding: clamp(1rem, 2vw, 1.45rem);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, transparent), transparent 48%),
    var(--panel);
}
.workspace-saved-reading > .muted {
  max-width: 72ch;
}
.workspace-study-intro h2,
.workspace-study-section-header h3 {
  margin: 0;
}
.workspace-study-intro {
  display: grid;
  gap: 0.35rem;
  max-width: 68ch;
  padding-inline: 0.15rem;
}
.workspace-study-intro h2 {
  font-size: clamp(1.4rem, 2vw, 1.85rem);
}
.workspace-study-section {
  display: grid;
  gap: 0.9rem;
}
.workspace-study-section-header {
  display: grid;
  gap: 0.25rem;
  max-width: 70ch;
}
.workspace-study-section-header p {
  margin: 0;
}
.workspace-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
}
.workspace-study-card {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  min-height: 100%;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 5px 16px rgba(20, 20, 20, 0.04);
}
.workspace-curriculum-card {
  border-top: 3px solid color-mix(in srgb, var(--accent) 68%, var(--border));
}
.workspace-material-card {
  padding: 0.95rem 1rem;
}
.workspace-study-card h3 {
  margin: 0;
  font-size: 1.02rem;
}
.workspace-study-card p {
  margin: 0;
  color: var(--muted);
}
.workspace-study-steps,
.workspace-study-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.15rem;
}
.workspace-study-steps {
  counter-reset: study-step;
  list-style: none;
  padding-left: 0;
  gap: 0;
}
.workspace-study-steps li {
  counter-increment: study-step;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}
.workspace-study-steps li::before {
  content: counter(study-step);
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font: 0.72rem/1 var(--font-ui);
}
.workspace-study-link {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.62rem 0;
  color: inherit;
  text-decoration: none;
}
.workspace-study-card > .button-like,
.workspace-reading-list-card > .button-like {
  justify-self: start;
  margin-top: auto;
}
.workspace-study-link:hover,
.workspace-study-link:focus-visible {
  color: var(--accent);
}
.workspace-reading-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.75rem;
}
.workspace-reading-list-card {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent-soft));
}
.workspace-reading-list-card h3 {
  margin: 0;
  font-size: 0.98rem;
}
.workspace-reading-list-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.workspace-reading-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.workspace-reading-list-items li {
  min-width: 0;
}
.workspace-study-link-compact {
  display: inline-flex;
  padding: 0.35rem 0.52rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
  font: 0.82rem/1.2 var(--font-ui);
}
.workspace-reading-list-items .workspace-list-meta {
  display: none;
}
.workspace-reading-list-card > .button-like {
  padding: 0.52rem 0.68rem;
  font-size: 0.86rem;
}
.workspace-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}
.workspace-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
}
.workspace-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.workspace-card-header h3 {
  margin: 0;
  font-size: 1rem;
}
.workspace-card-body {
  display: grid;
  gap: 0.55rem;
}
.workspace-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
}
.workspace-list-item {
  display: grid;
  gap: 0.18rem;
  padding: 0.7rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.24);
  color: inherit;
  text-decoration: none;
}
.workspace-list-item-linked {
  min-width: 0;
}
.workspace-list-title {
  font-weight: 600;
}
.workspace-list-meta {
  color: var(--muted);
  font-size: 0.88rem;
}
.workspace-inline-remove {
  align-self: center;
  white-space: nowrap;
}
.error-text {
  color: #9f2c2c;
}
.span-2 { grid-column: span 2; }
.search-direct-matches {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.direct-match-section {
  display: grid;
  gap: 0.55rem;
}
.direct-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}
.direct-match-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
}
.direct-match-type {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.checkbox-label input[type="checkbox"] {
  margin: 0;
}
.multi-select {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
}
.multi-select > summary {
  list-style: none;
  padding: 0.7rem 0.82rem;
  cursor: pointer;
  color: var(--text);
}
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-select[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.multi-select-menu {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.82rem;
  max-height: 230px;
  overflow: auto;
}
.multi-option {
  display: flex;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.9rem;
  color: var(--text);
}
.multi-option input { margin-top: 0.15rem; }

.reader-toolbar {
  display: grid;
  gap: 0.85rem;
  position: relative;
  z-index: 20;
  overflow: visible;
}
.reader-toolbar-main {
  display: flex;
  align-items: end;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.reader-advanced-tools {
  width: 100%;
  border: 1px solid rgba(107, 79, 29, 0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.18);
}
.reader-advanced-tools > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-ui);
  color: var(--text);
}
.reader-advanced-tools > summary::-webkit-details-marker {
  display: none;
}
.reader-advanced-tools[open] > summary {
  border-bottom: 1px solid rgba(107, 79, 29, 0.12);
}
.reader-advanced-tools-body {
  padding: 0.85rem 0.9rem 0.9rem;
}
.toolbar-citation-field {
  flex: 1 1 320px;
  min-width: min(100%, 360px);
}
.toolbar-citation-field input {
  width: 100%;
}
.toolbar-omnibox-field {
  position: relative;
  flex: 1 1 420px;
  min-width: min(100%, 420px);
}
.toolbar-omnibox-field label {
  display: inline-flex;
  gap: 0.18rem;
  margin-bottom: 0.18rem;
}
.omnibox-control-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.omnibox-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.18rem;
}
.toolbar-omnibox-field input {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}
.omnibox-submit-button {
  flex: 0 0 auto;
  min-width: 5.5rem;
  white-space: nowrap;
}
.omnibox-status {
  min-height: 1rem;
  margin-top: 0;
  text-align: right;
}
.omnibox-results {
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  z-index: 280;
  display: grid;
  gap: 0.4rem;
  max-height: 340px;
  overflow: auto;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.omnibox-group {
  display: grid;
  gap: 0.35rem;
}
.omnibox-group-title {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.1rem 0.2rem;
}
.omnibox-item.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(107, 79, 29, 0.18);
}
.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto;
  gap: 0.75rem;
  align-items: start;
}
.toolbar-grid-action {
  display: grid;
  align-content: start;
  gap: 0.28rem;
}
.toolbar-grid-action-label {
  color: var(--muted);
  font-size: 0.92rem;
}
.toolbar-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar-export-menu {
  position: relative;
}
.toolbar-export-menu > summary {
  list-style: none;
}
.toolbar-export-menu > summary::-webkit-details-marker {
  display: none;
}
.toolbar-export-items {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 200;
  min-width: 10.75rem;
  display: grid;
  gap: 0.38rem;
  padding: 0.48rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.toolbar-export-menu:not([open]) .toolbar-export-items {
  display: none;
}
.toolbar-export-items button {
  width: 100%;
  text-align: left;
}
.toolbar-export-items > * {
  width: 100%;
}
.reader-stage { display: grid; gap: 1rem; min-height: 70vh; }
.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}
.reader-title { font-size: 1.45rem; font-weight: 700; }
.reader-pg-warning {
  min-height: 0;
}
.reader-pg-warning:empty {
  display: none;
}
.status-cluster { display: flex; align-items: center; gap: 0.7rem; }
.status-badge {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  white-space: nowrap;
}
.thinking-indicator {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
}
.thinking-indicator span {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.35;
  animation: thinking-bounce 1s infinite ease-in-out;
}
.thinking-indicator span:nth-child(2) { animation-delay: 0.12s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0.24s; }
@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.32; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.reader-content {
  width: 100%;
  max-width: none;
}
.small-link {
  font-size: 0.84rem;
}
.reader-debug-link {
  justify-self: end;
}

/* --- source: css/controls.css --- */

.pg-debug-shell {
  display: grid;
  gap: 1rem;
}
.pg-debug-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1rem;
}
.pg-debug-sidebar,
.pg-debug-main {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.pg-debug-filters {
  display: grid;
  gap: 0.75rem;
}
.pg-debug-work-list {
  max-height: 70vh;
  overflow: auto;
}
.pg-work-button {
  display: grid;
  gap: 0.35rem;
}
.pg-work-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.quality-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  color: var(--muted);
}
.quality-chip.green {
  background: rgba(65, 160, 90, 0.14);
  color: #3a8a52;
}
.quality-chip.orange {
  background: rgba(214, 141, 31, 0.14);
  color: #ad6d10;
}
.quality-chip.red {
  background: rgba(184, 67, 67, 0.16);
  color: #b44343;
}
.warning-banner {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(214, 141, 31, 0.12);
}
.warning-banner.red {
  background: rgba(184, 67, 67, 0.14);
}
.key-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.key-value-grid .label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.artifact-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.artifact-tab.active {
  border-color: var(--accent);
  color: var(--accent);
}
.artifact-viewer {
  min-height: 420px;
}
.artifact-viewer pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}
.reader-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}
.reader-jump-row label {
  min-width: 180px;
}

@media (max-width: 1100px) {
  .pg-debug-grid {
    grid-template-columns: 1fr;
  }
  .pg-debug-work-list {
    max-height: 320px;
  }
}
.reader-content.parallel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.reader-content.single { display: block; }
.reader-column {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  min-height: 300px;
}
.reader-column h3 {
  margin-bottom: 0.75rem;
  font-size: 0.98rem;
  color: var(--muted);
}
.cite-break {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(127,127,127,0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.cite-label {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}
.segment {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.35rem 0;
  font-size: var(--reader-font-size);
  line-height: 1.75;
  font-family: var(--font-reader-text);
}
.segment-number {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
  padding-top: 0.2rem;
}
.segment-text {
  white-space: pre-wrap;
  font-family: var(--font-reader-text);
}
.word-token {
  display: inline;
  border-radius: 8px;
  padding: 0.04rem 0.12rem;
  margin: 0 -0.04rem;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
  font-family: var(--font-reader-text);
}
.word-token:hover {
  background: var(--accent-soft);
}
.word-token.active-token {
  background: rgba(107, 79, 29, 0.18);
  box-shadow: 0 0 0 1px rgba(107, 79, 29, 0.34), inset 0 -0.22rem 0 rgba(107, 79, 29, 0.18);
  outline: 1px solid rgba(107, 79, 29, 0.22);
  outline-offset: 1px;
}
.word-token.highlight-preview {
  box-shadow: inset 0 -0.24rem 0 rgba(251, 191, 36, 0.45);
}
.word-token.highlight-amber {
  box-shadow: inset 0 -0.3rem 0 rgba(245, 158, 11, 0.45);
}
.word-token.highlight-mint {
  box-shadow: inset 0 -0.3rem 0 rgba(16, 185, 129, 0.4);
}
.word-token.highlight-sky {
  box-shadow: inset 0 -0.3rem 0 rgba(14, 165, 233, 0.4);
}
.word-token.highlight-rose {
  box-shadow: inset 0 -0.3rem 0 rgba(244, 63, 94, 0.35);
}
.notice {
  padding: 1rem;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--muted);
}
.loading-notice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.loading-notice .thinking-indicator {
  flex: 0 0 auto;
}
.empty-state { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.reader-empty-state {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 0;
}
.reader-empty-hero {
  display: grid;
  gap: 0.45rem;
}
.reader-empty-hero h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.08;
}
.reader-empty-copy {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}
.reader-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.reader-empty-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.reader-start-action {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid rgba(107, 79, 29, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(107, 79, 29, 0.08), rgba(255,255,255,0.24)),
    var(--panel-strong);
}
.reader-start-action-header {
  display: grid;
  gap: 0.2rem;
}
.reader-start-action h3 {
  font-size: 1.16rem;
  line-height: 1.1;
}
.reader-start-action p {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}
.reader-start-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.reader-start-examples a {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.42rem 0.66rem;
  border: 1px solid rgba(107, 79, 29, 0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.26);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  text-decoration: none;
}
.reader-start-examples a:hover {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.28);
}
.reader-empty-sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
}
.reader-empty-sample-card {
  display: grid;
  gap: 0.32rem;
  padding: 1rem;
  border: 1px solid rgba(107, 79, 29, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(107, 79, 29, 0.09), rgba(255,255,255,0.35)),
    var(--panel-strong);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.reader-empty-sample-card:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 79, 29, 0.28);
  box-shadow: 0 12px 24px rgba(20, 20, 20, 0.06);
}
.reader-empty-sample-card strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.reader-empty-sample-card span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}
.reader-empty-sample-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.reader-empty-notice {
  margin: 0;
}

.drawer-section-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 700;
}
.drawer-section-body {
  display: grid;
  gap: 0.8rem;
}
.reader-inline-disclosure {
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.16);
}
.reader-inline-disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 0.85rem;
  color: var(--muted);
}
.reader-inline-disclosure > summary::-webkit-details-marker {
  display: none;
}
.reader-inline-disclosure[open] > summary {
  border-bottom: 1px solid rgba(107, 79, 29, 0.12);
}
.reader-inline-disclosure-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem 0.85rem 0.85rem;
}
.drawer-section-body[hidden] { display: none; }
.study-tools-tabs { position: sticky; top: -0.9rem; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.3rem; padding: 0.35rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-strong); }
.study-tools-tab { border: 0; border-radius: 10px; padding: 0.5rem 0.35rem; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.study-tools-tab.active, .study-tools-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-contrast, #fff); }
.drawer-section-toggle {
  padding: 0.15rem 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.drawer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
}
.drawer-card-title {
  font-size: 1.15rem;
  line-height: 1.15;
}
.drawer-work-byline {
  font-size: 0.95rem;
}
.current-work-card,
.structure-drawer-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.08)),
    linear-gradient(135deg, rgba(107, 79, 29, 0.08), transparent 45%),
    var(--panel);
}
.work-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.work-fact {
  display: grid;
  gap: 0.2rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.18);
}
.work-fact-label {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.work-fact-value {
  font-size: 0.95rem;
  line-height: 1.35;
}
.statistics-table-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.85rem;
  margin-bottom: 0.7rem;
}
.statistics-table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.statistics-cell-stack {
  display: grid;
  gap: 0.32rem;
}
.statistics-inline-bar {
  width: 100%;
  max-width: 10rem;
  height: 0.36rem;
  border-radius: 999px;
  background: rgba(107, 79, 29, 0.12);
  overflow: hidden;
}
.statistics-inline-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(107, 79, 29, 0.36), rgba(107, 79, 29, 0.78));
}
.statistics-meter-card {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
}
.statistics-meter-card.is-missing {
  background: rgba(107, 79, 29, 0.08);
}
.statistics-meter-card.is-partial {
  background: linear-gradient(135deg, rgba(107, 79, 29, 0.12), rgba(255, 255, 255, 0.14));
}
.statistics-meter-card.is-complete {
  background: linear-gradient(135deg, rgba(107, 79, 29, 0.16), rgba(255, 255, 255, 0.14));
}
.statistics-meter-header,
.statistics-language-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.statistics-meter {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(107, 79, 29, 0.12);
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.statistics-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(107, 79, 29, 0.42), rgba(107, 79, 29, 0.9));
}
.statistics-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.statistics-language-card {
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
}
.secondary-drawer-card {
  gap: 0.55rem;
}
.compact-search-panel {
  gap: 0.65rem;
}
.search-filters {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
}
.search-filters > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.82rem;
  color: var(--muted);
}
.search-filters > summary::-webkit-details-marker {
  display: none;
}
.search-filters[open] > summary {
  border-bottom: 1px solid var(--border);
}
.search-filters > :not(summary) {
  padding: 0.75rem 0.82rem 0.82rem;
}
.compact-results {
  max-height: 260px;
}
.structure-range-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  background: rgba(107, 79, 29, 0.14);
  color: var(--accent);
  font-size: 0.82rem;
  font-family: var(--font-ui);
}
.structure-branch-summary {
  display: grid;
}
.structure-summary-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 18px;
  background: rgba(255,255,255,0.18);
}
.structure-summary-kicker {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.structure-summary-title {
  font-family: var(--font-display);
  font-size: 1.16rem;
}
.structure-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.structure-summary-span {
  color: var(--muted);
  font-size: 0.9rem;
}
.structure-subsection {
  display: grid;
  gap: 0.7rem;
}
.structure-subsection-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: end;
}
.structure-subsection-header h3 {
  font-size: 1.02rem;
}
.structure-node-list {
  display: grid;
  gap: 0.55rem;
}
.structure-node-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.14);
}
.structure-node-card.is-open {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(107, 79, 29, 0.18);
}
.structure-node-card.is-focused {
  background: rgba(107, 79, 29, 0.11);
}
.structure-node-card.is-boundary {
  border-style: dashed;
}
.structure-node-copy {
  display: grid;
  gap: 0.35rem;
}
.structure-node-link {
  justify-self: start;
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1.04rem;
  color: var(--text);
}
.structure-node-link:hover {
  background: transparent;
  color: var(--accent);
}
.structure-node-incipit {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.structure-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.structure-meta-separator {
  color: rgba(107, 79, 29, 0.45);
}
.structure-open-button {
  white-space: nowrap;
}
.structure-leaf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.1rem;
}
.structure-leaf-chip {
  display: grid;
  gap: 0.18rem;
  justify-items: start;
  min-width: 104px;
  padding: 0.55rem 0.72rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
}
.structure-leaf-chip.is-open {
  border-color: var(--accent);
  background: rgba(107, 79, 29, 0.12);
}
.structure-leaf-chip.is-focused {
  box-shadow: inset 0 0 0 1px rgba(107, 79, 29, 0.16);
}
.structure-leaf-chip.is-boundary {
  border-style: dashed;
}
.structure-leaf-label {
  font-family: var(--font-display);
  font-size: 0.96rem;
}
.structure-leaf-meta {
  color: var(--muted);
  font-size: 0.76rem;
}
.study-controls {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}
.compact-study-controls label { min-width: 180px; }
.small-note { font-size: 0.84rem; }
.structure-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.1rem;
}
.structure-breadcrumb[hidden] { display: none; }
.structure-current-path {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.14);
}
.structure-current-chip {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 0.92rem;
  font-family: var(--font-ui);
}
.structure-current-chip.is-current {
  color: var(--accent);
  font-weight: 700;
}
.breadcrumb-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.16);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.72rem;
  font-size: 0.82rem;
  font-family: var(--font-ui);
}
.breadcrumb-chip.is-current {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.breadcrumb-separator {
  color: var(--muted);
  font-size: 0.82rem;
}
.structure-spine-rail {
  display: grid;
  gap: 0.38rem;
}
.structure-spine-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.42rem 0.1rem;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.structure-spine-item:hover {
  background: rgba(107, 79, 29, 0.06);
}
.structure-spine-marker {
  position: relative;
  width: 0.92rem;
  min-height: 2.25rem;
  display: flex;
  justify-content: center;
}
.structure-spine-marker::before {
  content: "";
  position: absolute;
  inset: 0.08rem auto 0.08rem 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(107, 79, 29, 0.22);
}
.structure-spine-marker::after {
  content: "";
  position: relative;
  width: 0.52rem;
  height: 0.52rem;
  margin-top: 0.86rem;
  border-radius: 999px;
  background: rgba(107, 79, 29, 0.38);
  box-shadow: 0 0 0 1px rgba(107, 79, 29, 0.18);
}
.structure-spine-item.is-active .structure-spine-marker::before {
  background: linear-gradient(180deg, var(--accent), rgba(107, 79, 29, 0.28));
}
.structure-spine-item.is-active .structure-spine-marker::after {
  width: 0.62rem;
  height: 0.62rem;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(107, 79, 29, 0.12);
}
.structure-spine-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.structure-spine-label {
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.2;
}
.structure-spine-meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}
.structure-nearby-nav {
  display: grid;
  gap: 0.45rem;
}
.structure-nearby-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  padding: 0.62rem 0.74rem;
  border-radius: 14px;
  border: 1px solid rgba(107, 79, 29, 0.14);
  background: rgba(255,255,255,0.14);
  color: var(--text);
  text-align: left;
}
.structure-nearby-item.is-current {
  background: rgba(107, 79, 29, 0.1);
  border-color: rgba(107, 79, 29, 0.22);
}
.structure-nearby-prefix {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.structure-nearby-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}
.structure-nearby-label {
  font-size: 0.9rem;
  line-height: 1.2;
}
.structure-nearby-cite {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}
.structure-debug-panel {
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
}
.structure-debug-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.72rem 0.86rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.structure-debug-panel > summary::-webkit-details-marker {
  display: none;
}
.structure-debug-panel[open] > summary {
  border-bottom: 1px solid rgba(107, 79, 29, 0.12);
}
.structure-debug-panel > :not(summary) {
  padding: 0.2rem 0.72rem 0.78rem;
}
.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 180px;
  overflow: auto;
}
.token-chip {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  line-height: 1.2;
}
.token-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.token-detail {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem;
}
.token-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.detail-block { display: grid; gap: 0.18rem; }
.detail-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}
.detail-value { font-weight: 600; }
.feature-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.intertext-list {
  display: grid;
  gap: 0.8rem;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 0.15rem;
}
.intertext-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  display: grid;
  gap: 0.65rem;
  background: rgba(255,255,255,0.04);
}
.intertext-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.intertext-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.mini-citation-chip {
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: var(--panel-strong);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
}

.edge-dialog {
  border: none;
  padding: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  max-width: 680px;
  width: min(92vw, 680px);
}
.edge-dialog::backdrop { background: rgba(0,0,0,0.38); }
.edge-dialog-card {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}
.edge-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.edge-dialog-body {
  display: grid;
  gap: 0.8rem;
}
.edge-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}
.edge-dialog-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0;
}

.searchable-panel.is-loading,
.results-list.is-loading {
  position: relative;
}
.searchable-panel.is-loading::after,
.results-list.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: shimmer 1.1s infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1600px) {
  :root { --left-drawer-width: 330px; --right-drawer-width: 330px; }
  .toolbar-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; }
}

/* --- source: css/reader.css --- */
.reader-chapter-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.reader-chapter-controls[hidden] { display: none; }
.reader-chapter-controls label { display: flex; align-items: center; gap: .35rem; }
.reader-chapter-controls label[hidden] { display: none; }
.reader-chapter-controls select { width: auto; min-height: 2.5rem; max-width: 9rem; }
.reader-page .reader-view-controls { flex-wrap: wrap; }
.reader-page .reader-chapter-controls label { flex: 0 1 auto; }

@media (max-width: 1320px) {
  .layout {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }
  .right-panel {
    position: static;
    max-height: none;
    grid-column: 1 / -1;
  }
  .layout.right-collapsed {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }
  .layout.left-collapsed,
  .layout.left-collapsed.right-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell { padding: 0.7rem; }
  .topbar, .reader-header { flex-direction: column; align-items: stretch; }
  .content-page .topbar,
  .content-page .brand-block,
  .content-page .topbar-controls,
  .content-page .top-nav-links {
    width: 100%;
    min-width: 0;
  }
  .content-page .top-nav-main,
  .content-page .top-nav-secondary {
    flex-wrap: wrap;
  }
  .topbar-inline-actions,
  .reader-toolbar-main {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-panel {
    position: static;
    min-width: 0;
  }
  .layout,
  .layout.left-collapsed,
  .layout.right-collapsed,
  .layout.left-collapsed.right-collapsed {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .toolbar-grid,
  .reader-content.parallel,
  .search-hero-grid,
  .filter-grid,
  .statistics-table-controls,
  .statistics-scope-form,
  .statistics-compare-controls,
  .statistics-overview-grid,
  .statistics-vocab-grid,
  .statistics-grammar-grid,
  .work-facts-grid,
  .token-detail-grid,
  .edge-dialog-grid {
    grid-template-columns: 1fr;
  }
  .span-2 { grid-column: auto; }
}

/* A collapsed desktop drawer occupies a zero-width grid track.  Remove its
 * own panel box so padding cannot create a 34px overflow past that track. */
@media (min-width: 1200px) {
  .reader-page .layout > .sidebar.hidden-drawer {
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }
}

.top-nav-links {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.top-nav-main,
.top-nav-secondary,
.topbar-reader-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
}
.top-nav-secondary {
  background: rgba(255, 255, 255, 0.55);
}
.top-nav-main .nav-link {
  color: var(--text);
  font-weight: 600;
}
.top-nav-main[data-product-navigation] {
  flex-wrap: wrap;
  max-width: 100%;
  border-radius: 1rem;
}
.workspace-card pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.top-nav-main .reader-menu-action {
  font: inherit;
  cursor: pointer;
  background: transparent;
}
.top-nav-secondary .nav-link {
  font-size: 0.82rem;
}
.nav-link {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
}
.nav-link:hover {
  color: var(--ink);
  background: rgba(107, 79, 29, 0.08);
}
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.top-nav-links span.nav-link {
  cursor: default;
}

/* Keep rounded top navigation and settings trigger consistent across all compact page headers. */
.topbar.compact .top-nav-links,
.topbar.compact .topbar-inline-actions,
.topbar.compact .topbar-reader-tools {
  gap: 0.45rem;
}

.topbar.compact .nav-link,
.topbar.compact .topbar-reader-tools > .ghost-button,
.topbar.compact .settings-menu > summary {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  border-style: solid;
  font-size: 0.84rem;
  line-height: 1.2;
}

.topbar.compact .topbar-reader-tools > .ghost-button,
.topbar.compact .settings-menu > summary {
  background: var(--panel-strong);
  color: var(--text);
}

.topbar.compact .settings-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.article-link-list {
  display: grid;
  gap: 0.9rem;
}
.article-link-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08)), var(--panel);
  text-decoration: none;
  color: inherit;
}
.article-link-item:hover {
  border-color: rgba(107, 79, 29, 0.22);
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.06);
}
.article-link-title {
  font-weight: 700;
}
.article-link-copy {
  color: var(--muted);
}

.content-page {
  --content-max-width: 1240px;
  --content-prose-width: 72ch;
}

.content-page .app-shell {
  padding-bottom: 1.35rem;
}

.content-page .topbar {
  max-width: var(--content-max-width);
  margin-bottom: 0;
}

.content-page .topbar-controls {
  min-width: 0;
  justify-content: flex-end;
}

.content-page .top-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.content-page .topbar-inline-actions {
  justify-content: flex-end;
}

.content-page .topbar.compact .top-nav-links {
  align-items: center;
}

.content-page .content-shell {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.content-page .content-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.content-page .content-toc {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.8rem;
  align-self: start;
}

.content-page .content-toc-card,
.content-page .content-more-menu,
.content-page .guide-section,
.content-page .content-hero {
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
    var(--panel);
  box-shadow: var(--shadow);
}

.content-page .content-toc-card {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.content-page .content-toc-card h2,
.content-page .content-more-menu h2,
.content-page .guide-section h2,
.content-page .content-hero h1 {
  margin: 0;
}

.content-page .content-toc-card h2 {
  font-size: 1rem;
}

.content-page .content-toc-list {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.content-page .content-toc-list a {
  display: block;
  padding: 0.38rem 0.55rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
}

.content-page .content-toc-list a:hover,
.content-page .content-toc-list a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

.content-page .content-article {
  display: grid;
  gap: 1rem;
  max-width: var(--content-prose-width);
}

/* Recommended Reading uses the full shared guide canvas. Individual prose
 * blocks retain their own readable measures, while sections and card grids
 * can use the space left after the TOC column. */
.recommended-reading-page .content-article,
.bible-guide-page .content-article,
.classics-page .content-article {
  max-width: none;
  min-width: 0;
}

.content-page .content-hero {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem 1.25rem;
}

.content-page .content-hero-title {
  display: grid;
  gap: 0.2rem;
}

.content-page .content-hero h1 {
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.02;
}

.content-page .content-hero-subtitle {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.58;
}

.content-page .content-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.content-page .content-secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  align-items: center;
}

.content-page .content-more-menu {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-style: dashed;
}

.content-page .content-more-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.content-page .content-more-menu > summary::-webkit-details-marker {
  display: none;
}

.content-page .content-more-menu[open] > summary {
  margin-bottom: 0.2rem;
}

.content-page .content-more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.content-page .content-more-links a,
.content-page .content-more-links span,
.content-page .content-secondary-links a,
.content-page .content-secondary-links span {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  text-decoration: none;
}

.content-page .content-secondary-links a:hover,
.content-page .content-secondary-links a:focus-visible,
.content-page .content-more-links a:hover,
.content-page .content-more-links a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

.content-page .content-more-links span,
.content-page .content-secondary-links span {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.18);
  color: var(--accent);
  font-weight: 700;
}

.content-page .guide-section {
  display: grid;
  gap: 0.95rem;
  padding: 1.15rem 1.2rem;
}

.content-page .faq-section details {
  border-top: 1px solid rgba(107, 79, 29, 0.14);
  padding-top: 0.8rem;
}

.content-page .faq-section details:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.content-page .faq-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
  padding: 0.1rem 0;
}

.content-page .faq-section details > :not(summary) {
  margin-top: 0.65rem;
}


.content-page .guide-section-header {
  display: grid;
  gap: 0.28rem;
}

.content-page .guide-section-header h2 {
  font-size: clamp(1.22rem, 1.8vw, 1.6rem);
}

.content-page .guide-section-copy {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.58;
}

.content-page .guide-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}

.content-page .guide-card {
  display: grid;
  min-width: 0;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08)),
    var(--panel-strong);
}

.content-page .reading-card {
  min-height: 100%;
}

.content-page .guide-card h3,
.content-page .reading-card h3,
.content-page .example-code-card h3 {
  margin: 0;
  font-size: 1.03rem;
}

.content-page .guide-card p,
.content-page .reading-card p,
.content-page .example-code-card p,
.content-page .guide-section p,
.content-page .guide-section li {
  line-height: 1.58;
}

.content-page .guide-card ul,
.content-page .guide-card ol,
.content-page .reading-card ul,
.content-page .reading-card ol,
.content-page .guide-section ul,
.content-page .guide-section ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.28rem;
}

.content-page .badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.content-page .badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 1.8rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 79, 29, 0.16);
  background: rgba(107, 79, 29, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  text-align: center;
}

.content-page a.badge {
  text-decoration: none;
}

.content-page a.badge:hover,
.content-page a.badge:focus-visible {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.24);
  color: var(--accent);
}

.content-page .example-code-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08)),
    var(--panel-strong);
}

.content-page .example-code-card code {
  display: block;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.content-page .guide-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.52;
}

.content-page a:focus-visible,
.content-page button:focus-visible,
.content-page summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.content-page .content-hero a.button-like {
  white-space: nowrap;
}

.content-page .guide-card > a.button-like {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: auto;
  white-space: normal;
  text-align: center;
}

.church-fathers-page .content-hero-note {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.church-fathers-page .father-card {
  min-width: 0;
  grid-template-rows: auto auto auto 1fr auto auto;
}

.church-fathers-page .father-card h3,
.church-fathers-page .father-meta,
.church-fathers-page .father-description,
.church-fathers-page .father-start {
  overflow-wrap: anywhere;
}

.church-fathers-page .father-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.church-fathers-page .father-description,
.church-fathers-page .father-start {
  margin: 0;
}

.church-fathers-page .father-start {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.church-fathers-page .father-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  align-items: stretch;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.15rem;
}

.church-fathers-page .father-actions .button-like {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
}

.church-fathers-page .guide-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.classics-page .classics-feature-grid,
.classics-page .guide-card-grid {
  display: grid;
  gap: 1rem;
  align-items: stretch;
  grid-template-columns: 1fr;
}

.classics-page .classic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.classics-page .classic-card h3,
.classics-page .classic-meta,
.classics-page .classic-description,
.classics-page .classic-start {
  overflow-wrap: anywhere;
}

.classics-page .classic-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.classics-page .classic-description,
.classics-page .classic-start {
  margin: 0;
}

.classics-page .classic-start {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.classics-page .classic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.7rem;
}

.classics-page .classic-actions .button-like {
  min-width: 0;
  white-space: normal;
  text-align: center;
}

.classics-page .classic-primary {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.24);
  color: var(--accent);
  font-weight: 700;
}

.classics-page .classic-unavailable {
  color: var(--muted);
  font-size: 0.9rem;
}

.bible-guide-page .bible-book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.bible-guide-page .bible-book-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bible-guide-page .bible-book-heading {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
}

.bible-guide-page .bible-book-heading h3,
.bible-guide-page .bible-book-original,
.bible-guide-page .bible-book-description,
.bible-guide-page .bible-book-alias {
  overflow-wrap: anywhere;
}

.bible-guide-page .bible-book-order {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bible-guide-page .bible-book-original {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-reader-text);
}

.bible-guide-page .bible-book-description,
.bible-guide-page .bible-book-alias {
  margin: 0;
}

.bible-guide-page .bible-book-alias {
  color: var(--muted);
  font-size: 0.86rem;
}

.bible-guide-page .bible-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.7rem;
}

.bible-guide-page .bible-book-primary {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.24);
  color: var(--accent);
  font-weight: 700;
}

.bible-guide-page .bible-book-unavailable {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
}

.classics-page .classics-feature-grid .classic-card {
  border-color: var(--accent);
}

@media (min-width: 720px) {
  .bible-guide-page .bible-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .classics-page .classics-feature-grid,
  .classics-page .guide-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .bible-guide-page .bible-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .classics-page .classics-feature-grid,
  .classics-page .guide-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1560px) {
  .bible-guide-page .bible-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .classics-page .guide-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.church-fathers-page .father-primary {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.24);
  color: var(--accent);
  font-weight: 700;
}

.church-fathers-page .father-unavailable {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
}

@media (max-width: 620px) {
  .church-fathers-page .content-toc-list {
    grid-template-columns: 1fr;
  }

  .church-fathers-page .content-toc-list a {
    overflow-wrap: anywhere;
  }

  .church-fathers-page .guide-card-grid {
    grid-template-columns: 1fr;
  }

}

.side-tab {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  border-radius: 14px;
  padding: 0.75rem 0.65rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.side-tab-left { left: 0.2rem; }
.side-tab-right { right: 0.2rem; }

.reader-page .parallel-row.is-reader-focus {
  outline: 2px solid color-mix(in srgb, var(--accent, #9b6a32) 55%, transparent);
  outline-offset: 3px;
  background: color-mix(in srgb, var(--accent, #9b6a32) 8%, transparent);
}

.reader-stage {
  position: relative;
  overflow: visible;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: auto;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .reader-header-actions { display: none; }
}

.reader-float-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.view-float {
  position: sticky;
  top: 0.6rem;
  z-index: 8;
  width: auto;
  align-self: start;
}
.reader-view-controls {
  margin: 0;
  gap: 0.45rem;
  flex-wrap: nowrap;
}
.reader-reopen-context.is-dormant,
.reader-reopen-context[hidden] {
  display: none !important;
}
.reader-view-controls > * {
  flex: 0 1 auto;
}
.reader-passage-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.reader-export-menu {
  margin: 0;
}
.reader-view-controls label {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 18rem;
}
.reader-view-controls select {
  width: 100%;
  min-width: 0;
}

.reader-author-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.reader-menu-group-label {
  padding: 0.4rem 0.2rem 0.1rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.passage-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.reader-explore-all {
  display: inline-block;
  margin: 0.45rem 0 0.7rem;
  color: var(--accent);
}
#leftDrawerTab { display: none; }
.reader-page.reader-has-content .reader-stage-surface {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}
.reader-page.reader-has-content .reader-toolbar-surface {
  box-shadow: none;
}
.reader-chapter-intertexts-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}
.reader-chapter-intertexts {
  display: grid;
  gap: 0.55rem;
}
.reader-chapter-intertexts-block {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  border-top: none;
}
.reader-chapter-intertexts-block:first-child {
  padding-top: 0;
  border-top: none;
}
.reader-chapter-intertexts-body {
  display: grid;
  gap: 0.65rem;
}

.token-focus-word {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.token-detail-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.detail-block-wide { grid-column: 1 / -1; }
.lexicon-entry-stack {
  display: grid;
  gap: 0.6rem;
}
.lexicon-entry-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(107, 79, 29, 0.05);
  border: 1px solid rgba(107, 79, 29, 0.12);
}
.lexicon-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.lexicon-entry-headword {
  font-weight: 600;
}
.lexicon-entry-text {
  line-height: 1.5;
}

.reader-content.manuscript-reader {
  display: block;
  max-width: none;
  font-family: var(--font-reader-text);
}
.reader-columns-shell {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
}
.reader-main-pane {
  flex: 1 1 auto;
  min-width: 0;
}
.reader-main-frame {
  width: min(100%, var(--reader-max-width));
  margin: 0 auto;
}
.reader-single-column {
  display: grid;
  gap: 0.8rem;
}
.reader-single-version {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.reader-single-body {
  width: min(100%, 70ch);
  margin: 0 auto;
  font-size: var(--reader-font-size);
  line-height: 1.8;
}
.reader-prose-paragraph {
  margin: 0;
}
.reader-prose-paragraph + .reader-prose-paragraph {
  margin-top: 1.1rem;
}
.reader-inline-prose + .reader-inline-prose::before {
  content: " ";
}
.reader-note-marker,
.reader-note-marker-row {
  display: inline-flex;
  align-items: center;
}
.reader-note-marker {
  margin: 0 0.18rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.reader-note-marker:hover {
  background: transparent;
}
.reader-note-marker sup {
  font-size: 0.94em;
  font-weight: 700;
}
.reader-note-popup-body {
  display: grid;
  gap: 0.55rem;
}
.reader-note-popup-body-paratext {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(107, 79, 29, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(107, 79, 29, 0.07), rgba(107, 79, 29, 0.02));
}
.reader-note-popup-prose {
  line-height: 1.65;
}
.reader-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.reader-inline-number {
  color: var(--accent);
  font-size: 0.72em;
  line-height: 0;
  margin-right: 0.18rem;
  vertical-align: super;
}
.reader-dialogue-fragment,
.reader-inline-dialogue {
  padding-left: 5.5rem;
}
.reader-speaker-block {
  margin: 0.6rem 0 0.2rem;
}
.reader-speaker-label {
  margin-left: -4.6rem;
  width: 4.2rem;
  text-align: right;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
}
.reader-stage-block {
  margin: 0.35rem 0;
  padding-left: 5.5rem;
}
.reader-stage-text {
  font-style: italic;
  color: var(--muted);
}
.reader-explicit-break {
  height: 0.85rem;
}
.reader-explicit-break.break-speech {
  height: 1.1rem;
}
.reader-explicit-break.break-para,
.reader-explicit-break.break-stanza {
  height: 1.35rem;
}
.reader-scholium-cite {
  font-family: var(--font-display);
  font-size: 0.98rem;
}
.parallel-grid,
.parallel-grid-header {
  display: grid;
  gap: 0.9rem;
  align-items: start;
}
.parallel-grid-two {
  grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr);
}
.parallel-grid-single {
  grid-template-columns: 78px minmax(0, 1fr);
}
.parallel-grid-header {
  margin-bottom: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 0.45rem;
  background: linear-gradient(to bottom, var(--panel) 72%, rgba(0,0,0,0));
}
.parallel-header-cell {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.15rem 0.2rem;
}
.parallel-row {
  --row-height: auto;
  display: grid;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(107, 79, 29, 0.08);
}
.parallel-cell {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.35rem 0.15rem 0.35rem 0.2rem;
}
.parallel-cell-header {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.text-cell .parallel-cell-content {
  min-height: var(--row-height);
  font-size: var(--reader-font-size);
  line-height: 1.72;
  font-family: var(--font-reader-text);
}
.scholia-cell .parallel-cell-content {
  height: var(--row-height);
  max-height: var(--row-height);
  overflow: auto;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.cite-gutter {
  background: transparent;
  border: none;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 0.55rem 0.35rem;
}
.cite-gutter-target {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  cursor: pointer;
}
.cite-gutter-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.cite-gutter-scholarly,
.reader-scholarly-badge,
.reader-meter-chip,
.reader-citation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  font-size: 0.72rem;
  color: var(--muted);
}
.reader-citation-badge.is-static {
  cursor: default;
}
.cite-gutter-scholarly {
  margin-top: 0.35rem;
  text-align: center;
}
.cite-gutter-inline-chips {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
  justify-items: center;
}
.verse-fragment + .verse-fragment {
  margin-top: 0.22rem;
}
.verse-fragment,
.verse-fragment.segment-type-line,
.verse-fragment.block-kind-verse,
.verse-fragment.block-kind-line {
  display: block;
  white-space: normal;
}
.verse-fragment.is-embedded,
.segment-type-line.is-embedded {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}
.verse-fragment-heading {
  margin: 0.2rem 0 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: 0;
}
.verse-fragment-heading.is-centered {
  text-align: center;
}
.verse-fragment-heading.is-bold {
  font-weight: 700;
}
.reader-paratext-fragment {
  color: #5f5030;
}
.reader-paratext-fragment.reader-inline-prose,
.reader-paratext-fragment.verse-fragment {
  background: linear-gradient(180deg, rgba(107, 79, 29, 0.07), rgba(107, 79, 29, 0.02));
  border-left: 3px solid rgba(107, 79, 29, 0.26);
  border-radius: 10px;
  padding: 0.2rem 0.55rem;
}
.reader-paratext-fragment.verse-fragment-heading {
  background: linear-gradient(180deg, rgba(107, 79, 29, 0.12), rgba(107, 79, 29, 0.04));
  border-left-color: rgba(107, 79, 29, 0.38);
}
.verse-fragment-empty {
  min-height: 1.8rem;
}
.segment-type-line {
  padding-left: 1.6rem;
  text-indent: -1.6rem;
  text-indent: 1.6rem hanging each-line;
  margin-top: 0.12rem;
  margin-bottom: 0.12rem;
}
.reader-citation-badge-row {
  margin: 0.2rem 0 0.5rem;
}
.reader-meter-chip {
  margin-left: 0.45rem;
}
.parallel-grid .segment-type-prose.continues-before {
  margin-top: 0;
}
.parallel-grid .segment-type-prose.continues-after {
  margin-bottom: 0;
}
.parallel-alignment-notice {
  margin-bottom: 0.35rem;
}
.scholium-stack,
.scholia-overview-card {
  display: grid;
  gap: 0.6rem;
}
.scholia-section {
  display: grid;
  gap: 0.35rem;
}
.scholia-section-label {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--muted);
}
.scholia-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.intertext-row-badge,
.chapter-intertext-cite-button,
.chapter-intertext-item-button {
  text-align: left;
}
.inline-intertext-chip,
.scholium-author-chip {
  max-width: 100%;
}
.intertext-preview-card,
.intertext-focus-card {
  display: grid;
  gap: 0.55rem;
}
.intertext-preview-card-body,
.intertext-focus-body,
.intertext-preview-groups,
.intertext-preview-snippets {
  display: grid;
  gap: 0.5rem;
}
.intertext-preview-author,
.intertext-preview-work {
  display: grid;
  gap: 0.3rem;
}
.intertext-preview-author {
  padding-top: 0.35rem;
  border-top: 1px solid rgba(107, 79, 29, 0.1);
}
.intertext-preview-author:first-child {
  padding-top: 0;
  border-top: none;
}
.intertext-preview-author-header,
.intertext-preview-work-header,
.intertext-preview-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.intertext-preview-item-list {
  display: grid;
  gap: 0.35rem;
}
.intertext-preview-item-button {
  display: grid;
  gap: 0.18rem;
  padding: 0.7rem 0.8rem;
}
.intertext-preview-snippet {
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
}
.intertext-preview-cite-strip {
  margin-top: 0.1rem;
}
.chapter-intertext-cite-button.is-active {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.28);
  color: var(--accent);
}
.intertext-overview-card {
  margin-top: 0.65rem;
}
.parallel-row.is-hover-linked,
.reader-note-marker.is-hover-linked {
  background: rgba(199, 166, 91, 0.08);
}
.reader-note-marker.is-hover-linked {
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(199, 166, 91, 0.42);
}
.scholia-empty {
  color: var(--muted);
  align-self: start;
}
.compact-overview {
  max-height: none;
}

.collection-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.3rem;
}
.collection-card.active,
.author-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.work-card {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 0.85rem;
}
.work-card-actions {
  display: flex;
  align-items: center;
}
.ghost-link {
  text-decoration: none;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}
.library-shell {
  max-width: 1840px;
  margin: 0 auto;
}
.library-browser-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 1rem;
  align-items: start;
}
.library-browser-card {
  max-width: 1080px;
  min-height: 72vh;
  justify-self: center;
  width: 100%;
  display: grid;
  gap: 1.1rem;
  padding: 1.35rem;
}
.library-browser-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}
.library-browser-topline h2 {
  font-size: clamp(1.7rem, 2vw, 2.3rem);
}
.library-utility-cluster {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
}
.library-browser-controls {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(107, 79, 29, 0.12);
}
.library-breadcrumb-controls {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.library-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  min-height: 2rem;
}
.library-crumb {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 0;
}
.library-crumb:not(.current) {
  cursor: pointer;
}
.library-crumb.current {
  color: var(--text);
  font-weight: 600;
}
.library-crumb:hover:not(.current) {
  color: var(--accent);
  background: transparent;
}
.library-crumb-separator {
  color: var(--muted);
}
.library-browser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-content: start;
}
.library-node-card {
  width: 100%;
  min-height: 150px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 0.9rem 0.95rem 1rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06)),
    var(--panel-strong);
}
.library-node-card:hover {
  border-color: rgba(107, 79, 29, 0.28);
}
.library-node-card-compact {
  min-height: 0;
}
.library-node-rule {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(107, 79, 29, 0.15));
}
.library-node-card .title,
.library-work-copy .title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.2;
}
.library-node-card .meta,
.library-work-copy .meta {
  color: var(--muted);
  font-size: 0.88rem;
}
.library-browse-controls {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px solid rgba(107, 79, 29, 0.12);
}
.library-search-field,
.library-filter {
  display: grid;
  gap: 0.35rem;
}
.library-search-field input,
.library-filter select {
  width: 100%;
}
.library-mode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.library-mode-controls .ghost-button.active {
  background: var(--accent-soft);
  border-color: rgba(107, 79, 29, 0.32);
  color: var(--text);
}
.library-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}
.library-browser-results {
  display: grid;
  gap: 1rem;
}
.library-group-section,
.library-bible-section {
  display: grid;
  gap: 0.7rem;
}
.library-group-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(107, 79, 29, 0.14);
}
.library-author-list,
.library-book-list,
.library-author-works {
  display: grid;
  gap: 0.65rem;
}
.library-author-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  overflow: hidden;
}
.library-author-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
}
.library-author-toggle:hover {
  background: rgba(107, 79, 29, 0.04);
}
.library-author-copy {
  display: grid;
  gap: 0.22rem;
}
.library-author-count {
  color: var(--muted);
  white-space: nowrap;
}
.library-author-works {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid rgba(107, 79, 29, 0.12);
}
.library-inline-work-card {
  padding: 0.8rem 0.85rem;
}
.library-sidecar {
  position: sticky;
  top: 0.9rem;
  align-self: start;
}
.library-side-panel {
  padding: 0.95rem;
}
.library-side-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
}
.library-side-summary::-webkit-details-marker {
  display: none;
}
.library-side-panel[open] .library-side-summary {
  margin-bottom: 0.8rem;
}
.library-recent-link {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
  text-decoration: none;
  background: var(--panel-strong);
}
.library-work-card {
  min-height: 0;
  align-items: center;
}
.library-work-copy {
  display: grid;
  gap: 0.35rem;
}
.library-work-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.library-admin-tree-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1.4fr) minmax(280px, 0.8fr);
  gap: 1rem;
}
.catalog-tree-container {
  --tree-scale: 1;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  min-height: 440px;
  max-height: 68vh;
  overflow: auto;
  padding: 0.8rem;
}
.catalog-tree-root {
  transform: scale(var(--tree-scale));
  transform-origin: top left;
  display: grid;
  gap: 0.35rem;
}
.catalog-tree-empty {
  color: var(--muted);
}
.catalog-tree-branch {
  border-left: 1px dashed var(--border);
  margin-left: 0.35rem;
  padding-left: 0.6rem;
  display: grid;
  gap: 0.25rem;
}
.catalog-tree-node {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 0.26rem 0.62rem;
  cursor: pointer;
}
.catalog-tree-node.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.catalog-tree-node small {
  color: var(--muted);
}
.catalog-tree-inspector {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 0.8rem;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.catalog-tree-summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}
.catalog-tree-summary.active {
  color: var(--accent);
}
.library-column {
  min-height: 68vh;
}
.library-collection-list {
  display: grid;
  gap: 0.7rem;
}
.panel-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  align-items: end;
}
.edit-form-grid {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.edit-form-grid input,
.inline-controls input,
.inline-controls select {
  width: 100%;
}
.editorial-tools-layout {
  display: grid;
  gap: 1rem;
}
.editorial-tools-card {
  display: grid;
  gap: 0.85rem;
}
.editorial-tools-card .panel-header {
  margin-bottom: 0;
}
.editorial-tools-card textarea,
.editorial-tools-card input,
.editorial-tools-card select {
  width: 100%;
}
.editorial-tools-card .study-controls,
.editorial-tools-card .graph-filter-grid {
  margin-bottom: 0;
}
.review-expanded {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.review-expanded-body {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.review-evidence-row,
.feature-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.validation-summary {
  color: var(--muted);
  font-size: 0.92rem;
}


.reader-page .reader-author-link,
.reader-page .reader-more-by-link,
.reader-page .current-work-author-link,
.reader-page .current-work-more-by-link,
.reader-page .mobile-reader-author {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
.reader-page .reader-subtitle,
.reader-page #readerSubtitle { overflow-wrap: anywhere; }
.reader-page .reader-metadata-separator { color: var(--muted); }
.reader-page .reader-entity-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.15rem 0 0.65rem;
  color: var(--muted);
  font: 0.78rem var(--font-ui);
}
.reader-page .reader-entity-breadcrumb a { color: var(--accent); }
.reader-page .reader-entity-breadcrumb .is-current { color: var(--text); }
.reader-page .reader-author-shelf {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.8rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
}
.reader-page .reader-author-shelf h2 { margin: 0; font-size: 1.1rem; }
.reader-page .reader-bottom-navigation {
  max-width: var(--reader-content-width, 78ch); margin: 2.4rem auto 0; padding: 1.15rem 0 0.35rem; border-top: 1px solid var(--border);
}
.reader-page .reader-bottom-navigation-links { display: flex; justify-content: space-between; gap: 1rem; }
.reader-page .reader-bottom-navigation-link { display: flex; flex: 1 1 0; min-width: 0; min-height: 3.25rem; align-items: center; gap: 0.35rem; padding: 0.55rem 0.25rem; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.reader-page .reader-bottom-navigation-link:hover { color: var(--accent); }
.reader-page .reader-bottom-navigation-link:focus-visible, .reader-page .reader-bottom-work-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.reader-page .reader-bottom-navigation-prev { justify-content: flex-start; text-align: left; }
.reader-page .reader-bottom-navigation-next { justify-content: flex-end; text-align: right; color: var(--text); font-weight: 650; }
.reader-page .reader-bottom-navigation-direction { flex: 0 0 auto; font: 0.78rem var(--font-ui); white-space: nowrap; }
.reader-page .reader-bottom-navigation-label { min-width: 0; }
.reader-page .reader-bottom-end-state { display: grid; gap: 0.65rem; text-align: center; }
.reader-page .reader-bottom-end-message { margin: 0; color: var(--text); font: 1rem var(--font-ui); }
.reader-page .reader-bottom-work-link { width: fit-content; margin: 0 auto; color: var(--accent); font: 0.88rem var(--font-ui); }
.reader-page .reader-bottom-navigation[hidden], .reader-page .reader-bottom-navigation-link[hidden], .reader-page .reader-bottom-end-state[hidden], .reader-page .reader-bottom-work-link[hidden] { display: none !important; }
.reader-page .reader-author-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0.55rem;
}
.reader-page .reader-author-recommendation-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.reader-page .reader-author-recommendation-card a {
  overflow-wrap: anywhere;
  font-weight: 700;
}
.reader-page .reader-author-recommendation-meta { color: var(--muted); font-size: 0.78rem; }
.reader-page .reader-author-profile-link { width: fit-content; font: 0.86rem var(--font-ui); }
.reader-page .reader-entity-breadcrumb[hidden],
.reader-page .reader-author-shelf[hidden],
.reader-page .mobile-reader-author[hidden] { display: none !important; }
.reader-page .reader-entity-breadcrumb a:focus-visible,
.reader-page .reader-author-shelf a:focus-visible,
.reader-page .mobile-reader-author:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---- Witness comparison mode ---- */
.reader-page #witnessCompareToggle.is-active {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-color: var(--accent);
}
.reader-page .witness-compare-panel {
  display: grid;
  gap: 1rem;
  margin: 0.75rem 0 1.5rem;
  padding: 0.9rem 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.reader-page .witness-compare-panel[hidden] { display: none !important; }
.reader-page .witness-compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: end;
}
.reader-page .witness-compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 840px) {
  .reader-page .witness-compare-columns { grid-template-columns: 1fr; }
}
.reader-page .witness-compare-column {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, var(--panel));
}
.reader-page .witness-meta { display: grid; gap: 0.25rem; margin-bottom: 0.75rem; }
.reader-page .witness-card { gap: 0.2rem; }
.reader-page .witness-siglum {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.reader-page .witness-name { color: var(--muted); font-size: 0.92rem; }
.reader-page .witness-card-meta { font-size: 0.78rem; line-height: 1.35; }
.reader-page .witness-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.82rem;
}
.reader-page .coverage-pill {
  display: inline-block;
  width: fit-content;
  margin-top: 0.25rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
}
.reader-page .coverage-represented { background: color-mix(in srgb, #2f7d4a 18%, transparent); color: #1f5a34; }
.reader-page .coverage-lacuna { background: color-mix(in srgb, #b45309 18%, transparent); color: #7c3d05; }
.reader-page .coverage-no-transcription { background: color-mix(in srgb, #6b7280 18%, transparent); color: #374151; }
.reader-page .coverage-omission { background: color-mix(in srgb, #7c3aed 16%, transparent); color: #5b21b6; }
.reader-page .coverage-unavailable,
.reader-page .coverage-not-extant { background: color-mix(in srgb, #b91c1c 14%, transparent); color: #7f1d1d; }
.reader-page .witness-token-line {
  font-family: var(--font-greek, var(--font-body));
  font-size: 1.12rem;
  line-height: 1.7;
  margin: 0;
}
.reader-page .witness-token {
  display: inline;
  border-radius: 4px;
  padding: 0 0.05em;
}
.reader-page .witness-token[data-attestation] {
  background: color-mix(in srgb, #b45309 22%, transparent);
}
.reader-page .witness-empty-state {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.reader-page .witness-inventory-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
}
.reader-page .witness-inventory-group {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.reader-page .witness-inventory-group h4 { margin: 0 0 0.4rem; font-size: 0.92rem; }
.reader-page .witness-inventory-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
}
.reader-page .witness-inventory-group .siglum {
  font-weight: 700;
  margin-right: 0.25rem;
}
.reader-page .witness-variation-cards {
  display: grid;
  gap: 0.65rem;
}
.reader-page .variation-card {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, var(--panel));
}
.reader-page .variation-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.reader-page .variation-kind { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.reader-page .origin-pill {
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
}
.reader-page .origin-reviewed { background: color-mix(in srgb, #2563eb 16%, transparent); }
.reader-page .origin-automatic { background: color-mix(in srgb, #6b7280 14%, transparent); }
.reader-page .variation-readings {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.reader-page .variation-reading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: baseline;
  font-size: 0.9rem;
}
.reader-page .reading-text { font-family: var(--font-greek, var(--font-body)); font-weight: 600; }
.reader-page .reading-support { color: var(--muted); font-size: 0.82rem; }
.reader-page .reading-source-link { font-size: 0.78rem; }
.reader-page .reader-dual-reference {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.reader-page .reader-dual-reference[hidden] { display: none !important; }
.reader-page .reader-dual-reference .dual-ref-label {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: baseline;
}
.reader-page .reader-dual-reference .dual-ref-connector {
  opacity: 0.75;
  font-weight: 600;
}
.reader-page .reader-dual-reference .dual-ref-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  opacity: 0.85;
}
.reader-page .witness-order-map-section { margin-top: 0.25rem; }
.reader-page .witness-order-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.reader-page .order-map-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.reader-page .order-map-list li {
  display: grid;
  gap: 0.15rem 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--border, #ccc) 70%, transparent);
}
.reader-page .order-map-list li .order-map-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
}
.reader-page .order-map-list button.order-map-jump {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.reader-page .order-map-list button.order-map-jump:hover .order-label {
  text-decoration: underline;
}
.reader-page .order-seq { font-weight: 700; min-width: 1.5rem; }
.reader-page .order-dual-ref { font-size: 0.8rem; color: var(--muted); }
body.witness-compare-mode.reader-page #readerContent,
body.witness-compare-mode #readerContent { display: none; }

.reader-attribution-footer {
  width: min(100%, var(--reader-max-width));
  margin: 1.5rem auto 0;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.84rem;
}

/* Reader 2.0: drawers float over the canvas on desktop.  The layout owns one
 * reading surface; opening context or navigation must not resize the text. */
@media (min-width: 981px) {
  .reader-page .layout,
  .reader-page .layout.left-collapsed,
  .reader-page .layout.right-collapsed,
  .reader-page .layout.left-collapsed.right-collapsed {
    display: block;
    grid-template-columns: none;
    max-width: none;
  }
  .reader-page .reader-area { width: 100%; }
  .reader-page .sidebar {
    position: fixed;
    z-index: 100;
    inset-block: 5.5rem 1rem;
    width: min(24rem, 38vw);
    max-height: none;
    overflow: auto;
  }
  .reader-page .left-panel { inset-inline-start: 0; transform: translateX(-104%); }
  .reader-page .right-panel {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform: translateX(104%);
  }
  .reader-page .sidebar:not(.hidden-drawer) { transform: translateX(0); }
}
@media (min-width: 1200px) {
  .reader-page .layout,
  .reader-page .layout.left-collapsed,
  .reader-page .layout.right-collapsed,
  .reader-page .layout.left-collapsed.right-collapsed {
    display: block;
    max-width: none;
  }
  .reader-page .sidebar {
    position: fixed;
    z-index: 100;
    inset-block: 5.5rem 1rem;
    width: min(24rem, 38vw);
    max-height: none;
    padding: 1rem;
    overflow: auto;
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 0 18px 18px 0;
    box-shadow: var(--shadow);
    transition: transform 180ms ease, opacity 180ms ease, visibility 0s linear 180ms;
  }
  .reader-page .left-panel { inset-inline-start: 0; transform: translateX(-104%); }
  .reader-page .right-panel {
    inset-inline-start: auto;
    inset-inline-end: 0;
    border-radius: 18px;
    transform: translateX(104%);
  }
  .reader-page .sidebar:not(.hidden-drawer) {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .reader-page .reader-area { width: 100%; }
  .reader-page .reader-stage-surface { max-width: 1160px; margin-inline: auto; width: 100%; }
  .reader-page .reader-content.manuscript-single { max-width: 78ch; margin-inline: auto; }
}

.reader-page .right-panel[data-context-object] .study-tools-tabs { display: none; }
.reader-page [data-context-section] { min-width: 0; }

.reader-page .context-inspector-overview {
  display: grid;
  gap: .8rem;
  padding: 0 .15rem .8rem;
  border-bottom: 1px solid var(--border);
}
.reader-page .context-inspector-object-label {
  max-width: 34ch;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-reader-text);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-page .context-inspector-body { display: grid; gap: .8rem; min-width: 0; }
.reader-page .context-inspector-body .token-detail { padding: 0; border: 0; background: transparent; }
.reader-page .context-inspector-body .token-detail-grid { grid-template-columns: 1fr; }
.reader-page .context-inspector-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.reader-page .context-inspector-actions button { min-height: 2.5rem; padding: .48rem .68rem; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); cursor: pointer; }
.reader-page .context-inspector-actions button:hover,
.reader-page .context-inspector-actions button:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.reader-page .context-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.reader-page .context-summary-grid > div { display: grid; gap: .12rem; padding: .5rem .35rem; border-bottom: 1px solid var(--border); text-align: center; }
.reader-page .context-summary-grid strong { font-size: 1.15rem; }
.reader-page .context-summary-grid span { color: var(--muted); font-size: .7rem; }
.reader-page .context-inspector-section { display: grid; gap: .45rem; }
.reader-page .context-inspector-section h3 { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.reader-page .context-inspector-section h3 span { color: var(--accent); }
.reader-page .context-connections { display: grid; gap: .6rem; min-width: 0; }
.reader-page .context-connections .reader-chapter-intertexts-card { border: 0; padding: 0; background: transparent; box-shadow: none; }
.reader-page .context-connections .intertext-preview-cite-strip { display: none; }
.reader-page .context-selected-text { margin: 0; padding: .65rem .7rem; border-inline-start: 3px solid var(--accent); color: var(--text); font-family: var(--font-reader-text); line-height: 1.5; }
.reader-page .context-provenance { color: var(--muted); font-size: .8rem; }
.reader-page .context-provenance summary { cursor: pointer; }
.reader-page .cite-connection-indicator { margin-inline-start: .25rem; color: var(--accent); font-family: var(--font-ui); font-size: .7rem; white-space: nowrap; }

@media (max-width: 720px) {
  .reader-page .context-inspector-overview { padding-bottom: 1rem; }
  .reader-page .context-inspector-object-label { font-size: 1.05rem; }
  .reader-page .context-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-page .context-inspector-actions button { flex: 1 1 8rem; }
}

/* Pass 1 reading surface: location and contents are publication chrome, not
 * another metadata card. */
.reader-page .reader-location-control {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.5rem;
  padding: .45rem .7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.reader-page .reader-location-control:hover,
.reader-page .reader-location-control:focus-visible { color: var(--accent); }
.reader-page .reader-location-control span:last-child { max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-page .reader-contents-drawer { gap: .9rem; }
.reader-page .reader-contents-heading { padding: 0 .15rem; }
.reader-page .reader-contents-heading h3 { margin: 0; font-size: 1.2rem; }
.reader-page .reader-contents-heading p { margin: .2rem 0 0; font-size: .84rem; }
.reader-page .reader-contents-search input { width: 100%; border-radius: 9px; }
.reader-page .reader-contents-outline { display: grid; gap: .55rem; }
.reader-page .reader-contents-outline-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.reader-page .reader-contents-outline-heading h3 { margin: 0; font-size: .95rem; }
.reader-page .reader-contents-outline-body { display: grid; gap: .55rem; }
.reader-page .reader-contents-info { margin-top: auto; color: var(--muted); font-size: .82rem; text-decoration: none; }
.reader-page .reader-contents-info:hover { color: var(--accent); }
.reader-page .reader-version-heading {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: .35rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.reader-page .reader-version-heading:hover,
.reader-page .reader-version-heading:focus-visible { color: var(--accent); background: var(--accent-soft); border-radius: .4rem; outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.reader-page .reader-version-name { grid-column: 1; }
.reader-version-dialog {
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}
.reader-version-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.reader-version-dialog h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.reader-version-dialog label { display: grid; gap: .4rem; margin-bottom: .8rem; }
.reader-version-dialog select { width: 100%; min-width: 0; min-height: 2.75rem; }
.reader-version-dialog > button { min-height: 2.75rem; margin: .3rem .3rem 0 0; }
.reader-page .reader-add-version { display: block; margin-top: .5rem; font-size: .8rem; }
.reader-featured-pairs { grid-column: 1 / -1; }
.reader-featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .85rem; }
.reader-featured-pair { display: flex; flex-direction: column; gap: .65rem; padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--panel-strong); min-width: 0; }
.reader-featured-pair h4 { margin: 0; font: 1.15rem var(--font-display, Georgia, serif); }
.reader-featured-pair p { margin: 0; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.reader-featured-pair details { font-size: .85rem; color: var(--muted); }
.reader-featured-pair > a { margin-top: auto; align-self: flex-start; }
.intertext-public-controls { display: grid; gap: .6rem; margin-block: .6rem; }
.intertext-public-controls [role="group"] { display: flex; flex-wrap: wrap; gap: .35rem; }
.intertext-public-controls button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.intertext-evidence-label { display: inline-block; font-size: .78rem; color: var(--muted); margin: .2rem .35rem; }
.intertext-evidence-assessment { border-inline-start: 3px solid var(--accent); padding-inline-start: .8rem; }
.reader-page .reader-version-caret { grid-column: 2; color: var(--muted); font-size: .8em; }
.reader-page .reader-version-kind { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .04em; }
.reader-page .parallel-header-cell.cite-gutter { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.reader-page .cite-gutter-target { color: var(--muted); font: inherit; font-size: .78rem; }
.reader-page .cite-gutter-target:hover { color: var(--accent); }

@media (min-width: 981px) {
  .reader-page.reader-has-content .reader-toolbar { position: sticky; top: .4rem; z-index: 25; background: color-mix(in srgb, var(--panel-strong) 94%, transparent); }
}

@media (min-width: 900px) {
  .reader-page.reader-landing .reader-empty-state { grid-template-columns: minmax(0, 1.35fr) minmax(260px, .8fr); align-items: center; column-gap: clamp(2rem, 6vw, 6rem); }
  .reader-page.reader-landing .reader-content.manuscript-single { width: 100%; max-width: none; margin-inline: 0; }
  .reader-page.reader-landing .reader-empty-hero { grid-column: 1; max-width: 42rem; }
  .reader-page.reader-landing .reader-continue-action { grid-column: 2; width: 100%; max-width: 24rem; margin: 0; justify-self: end; align-self: center; }
  .reader-page.reader-landing .reader-empty-action-grid { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  .reader-page .reader-float-row,
  .reader-page .view-float,
  .reader-page .reader-view-controls { width: 100%; }
  .reader-page .reader-content.mobile-parallel-stacked .parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-stacked .parallel-grid-header.parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-stacked .parallel-row { grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr); }
  .reader-page .reader-content.mobile-parallel-stacked .parallel-cell[data-reading-role="secondary"] { border-top: 0; padding-top: .2rem; }
  .reader-page.reader-landing .reader-content { max-width: none; }
}

body[data-theme="dark"] .reader-page .parallel-grid-header,
body[data-theme="dark"] .reader-page .reader-continue-action {
  background: linear-gradient(to bottom, var(--panel) 76%, transparent);
}
body[data-theme="dark"] .reader-page .reader-start-action,
body[data-theme="dark"] .reader-page .reader-continue-action,
body[data-theme="dark"] .reader-page .reader-advanced-tools,
body[data-theme="dark"] .reader-page .reader-toolbar-surface,
body[data-theme="dark"] .reader-page .reader-stage-surface {
  border-color: var(--border);
}

.reader-attribution-heading {
  color: var(--text);
  font-weight: 700;
}

.reader-attribution-intro {
  margin: 0.25rem 0 0.75rem;
}

.reader-attribution-items {
  display: grid;
  gap: 0.65rem;
}

.reader-attribution-item {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.reader-attribution-item h3 {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.reader-attribution-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.reader-attribution-term {
  color: var(--text);
  font-weight: 700;
}

.reader-attribution-footer a {
  color: var(--accent);
}

.reader-attribution-empty {
  font-style: italic;
}

/* Pass 3.1: one command surface, with location first and equal interaction feedback. */
.reader-page .reader-view-controls {
  width: min(100%, var(--reader-max-width));
  min-height: 2.8rem;
  align-items: center;
  justify-content: space-between;
  padding: .2rem .35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-strong) 94%, transparent);
}
.reader-page .reader-command-action,
.reader-page .reader-view-controls > .reader-passage-nav button,
.reader-page .reader-view-controls > .toolbar-export-menu > summary {
  min-height: 2.35rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  transition: background .16s ease, box-shadow .16s ease, border-color .16s ease, color .16s ease;
}
.reader-page .reader-command-action:hover,
.reader-page .reader-command-action:focus-visible,
.reader-page .reader-view-controls > .reader-passage-nav button:hover,
.reader-page .reader-view-controls > .reader-passage-nav button:focus-visible,
.reader-page .reader-view-controls > .toolbar-export-menu > summary:hover,
.reader-page .reader-view-controls > .toolbar-export-menu[open] > summary {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--accent);
}
.reader-page .reader-location-control { border-color: transparent; background: transparent; }
.reader-page .reader-location-control span:last-child { max-width: 34ch; }
.reader-page .parallel-row { margin-bottom: .28rem; padding-bottom: .28rem; }
.reader-page .parallel-cell { padding-block: .2rem; }
.reader-page .text-cell .parallel-cell-content { line-height: 1.58; }
.reader-page .context-loading-state { display: grid; gap: .35rem; padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-overlay); }
.reader-page #readerContent.reader-version-loading { position: relative; }
.reader-page #readerContent.reader-version-loading::before { content: 'Loading version…'; position: absolute; inset: .35rem .5rem auto auto; z-index: 2; padding: .25rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: .78rem; }

@media (min-width: 900px) {
  .reader-page.reader-landing .layout {
    grid-template-columns: 0 minmax(0, 1220px) 0;
    justify-content: center;
    max-width: 1220px;
  }
  .reader-page.reader-landing .reader-area,
  .reader-page.reader-landing .reader-stage-surface { max-width: 1220px; }
  .reader-page.reader-landing .reader-stage-surface { padding-inline: clamp(1.5rem, 3vw, 3rem); }
}

.reader-edition-research { margin: 0.75rem 0; font-size: 0.9rem; }
.reader-edition-research summary { cursor: pointer; }
.reader-edition-research #readerEditionSummary { margin-top: 0.5rem; }
.reader-edition-research button { margin: 0.25rem 0.35rem 0.25rem 0; }

/* --- source: css/reader-intertexts.css --- */
@media (max-width: 1200px) {
  .library-browser-layout,
  .library-admin-tree-layout,
  .parallel-grid-two,
  .parallel-grid-single,
  .parallel-grid-header.parallel-grid-two,
  .parallel-grid-header.parallel-grid-single {
    grid-template-columns: 1fr;
  }
  .parse-float {
    width: 100%;
  }
  .view-float {
    width: 100%;
  }
  .reader-float-row {
    flex-direction: column;
    align-items: stretch;
  }
  .reader-columns-shell {
    flex-direction: column;
    gap: 1rem;
  }
  .reader-main-frame {
    width: 100%;
  }
  .text-cell .parallel-cell-content {
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .reader-dialogue-fragment,
  .reader-inline-dialogue,
  .reader-stage-block {
    padding-left: 2.6rem;
  }
  .reader-speaker-label {
    margin-left: -2.2rem;
    width: 1.9rem;
    font-size: 0.75rem;
  }
  .library-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .library-browser-topline {
    flex-direction: column;
  }
  .top-nav-links {
    order: -1;
  }
  .content-page .topbar {
    gap: 0.8rem;
  }
  .content-page .topbar-controls {
    width: 100%;
  }
  .content-page .top-nav-links {
    width: 100%;
  }
  .content-page .content-layout {
    grid-template-columns: 1fr;
  }
  .content-page .content-toc {
    position: static;
    order: -1;
  }
  .content-page .content-toc-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .content-page .content-article {
    max-width: 100%;
  }
  .content-page .content-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .content-page .content-hero-actions a,
  .content-page .content-hero-actions button,
  .content-page .content-more-menu {
    width: 100%;
  }
  .content-page .content-secondary-links,
  .content-page .content-more-links {
    width: 100%;
  }
  .side-tab {
    top: auto;
    bottom: 0.8rem;
    transform: none;
    writing-mode: horizontal-tb;
  }
  .side-tab-left { left: 0.8rem; }
  .side-tab-right { right: 0.8rem; }
}

@media (max-width: 900px) {
  .library-browser-grid {
    grid-template-columns: 1fr;
  }

  .library-filter-grid {
    grid-template-columns: 1fr;
  }

  .library-work-card {
    flex-direction: column;
    align-items: stretch;
  }

  .library-work-actions {
    justify-content: flex-start;
  }

  .library-author-toggle {
    align-items: start;
    flex-direction: column;
  }
}

.edge-decision-panel {
  border-top: 1px solid var(--line, rgba(0,0,0,0.12));
  margin-top: 1rem;
  padding-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.grow-field {
  flex: 1 1 auto;
}

.review-card {
  padding: 0.75rem;
}

.graph-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
}

.review-expanded {
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
  display: grid;
  gap: 0.55rem;
}

.review-expanded details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  background: var(--panel-strong);
}

.review-expanded summary {
  cursor: pointer;
  font-weight: 600;
}

.review-expanded-body {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.review-evidence-row {
  display: grid;
  gap: 0.25rem;
}

.graph-edge-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
}

.annotation-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.annotation-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.45rem;
  background: var(--panel-strong);
}

.annotation-meta {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.validation-summary {
  font-size: 0.82rem;
  color: var(--muted);
}

.validation-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.45rem;
  background: var(--panel-strong);
}

.danger-text {
  color: #b42318;
}

@media (max-width: 980px) {
  .graph-filter-grid {
    grid-template-columns: 1fr;
  }
}

.master-data-toolbar {
  display: grid;
  gap: 0.8rem;
}

.wrap-controls {
  flex-wrap: wrap;
  align-items: end;
}

.alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.alphabet-button {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: inherit;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

.alphabet-button.active {
  background: var(--accent);
  color: #fff;
}

.master-data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 380px);
  gap: 0.85rem;
  align-items: start;
}

.master-data-tree-card,
.master-data-drawer {
  min-height: 68vh;
}

.master-data-tree-card {
  min-width: 0;
  overflow-x: auto;
}

.master-tree-columns,
.master-tree-row {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    minmax(180px, 0.95fr)
    minmax(170px, 0.95fr)
    minmax(190px, 1.05fr)
    minmax(150px, 0.9fr)
    minmax(120px, 0.8fr)
    minmax(160px, 0.9fr);
  gap: 0.75rem;
  align-items: center;
}

.treegrid-head {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.master-tree {
  display: grid;
  gap: 0.25rem;
  padding-top: 0.5rem;
}

.master-tree-row {
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: var(--panel-strong);
}

.master-tree-row.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(141, 111, 63, 0.12);
}

.work-row {
  margin-left: 0.85rem;
}

.version-row {
  margin-left: 1.7rem;
  opacity: 0.95;
}

.tree-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

.primary-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.indent-1 {
  padding-left: 1rem;
}

.indent-2 {
  padding-left: 2rem;
}

.expander-button {
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.row-select-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.tree-loading-row {
  margin-left: 1rem;
  color: var(--muted);
  padding: 0.25rem 0.75rem 0.55rem;
}

.version-marker {
  color: var(--accent);
}

.master-data-drawer {
  position: sticky;
  top: 0.75rem;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 0.8rem;
  width: 100%;
  max-width: 380px;
  min-width: 0;
  justify-self: end;
  align-self: start;
  max-height: calc(100vh - 1.5rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.master-drawer-tabs {
  display: flex;
  gap: 0.4rem;
}

.drawer-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.drawer-tab.active {
  background: var(--accent);
  color: #fff;
}

.master-drawer-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-height: 0;
  padding-bottom: 0.25rem;
}

.form-actions-wide {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.master-form-actions {
  margin-top: 0.35rem;
}

.detail-section {
  display: grid;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--panel-strong);
}

.detail-section h3,
.detail-section h4 {
  margin: 0;
}

.relationship-list,
.detail-stack,
.history-stack {
  display: grid;
  gap: 0.7rem;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.card-subtle {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.2);
}

.authority-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.detail-table {
  display: grid;
  gap: 0.45rem;
}

.detail-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.16);
}

.history-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.2);
}

.history-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-diffs {
  display: grid;
  gap: 0.35rem;
}

.history-diff-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.4rem;
  font-size: 0.92rem;
}

.master-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.master-data-secondary {
  margin-top: 1rem;
}

.reader-page .topbar {
  align-items: center;
  margin-bottom: 0.7rem;
}

.reader-page .brand-block {
  gap: 0.02rem;
}

.reader-page .topbar h1 {
  font-size: 1.08rem;
}

.reader-page .topbar-subtitle {
  font-size: 0.88rem;
}

.reader-page .top-nav-links,
.reader-page .topbar-inline-actions {
  gap: 0.45rem;
}

.reader-page .top-nav-secondary {
  opacity: 0.9;
}

.reader-page .nav-link,
.reader-page .topbar-reader-tools > .ghost-button,
.reader-page .settings-menu > summary {
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  border-style: solid;
  font-size: 0.84rem;
}

.reader-page .topbar-reader-tools > .ghost-button,
.reader-page .settings-menu > summary {
  min-height: 2.45rem;
}

.reader-page #toggleLeftDrawerButton,
.reader-page #toggleRightDrawerButton {
  padding: 0.52rem 0.94rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.reader-page .sidebar {
  gap: 0.35rem;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
    var(--panel);
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.05);
  scrollbar-gutter: stable;
}

.reader-page .drawer-header {
  padding: 0 0 0.65rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(107, 79, 29, 0.12);
}

.reader-page .drawer-header h2 {
  font-size: 1.14rem;
}

.reader-page .reader-sidebar-section {
  gap: 0.7rem;
}

.reader-page .reader-sidebar-section-priority {
  padding: 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(107, 79, 29, 0.12);
  box-shadow: none;
  backdrop-filter: none;
}

.reader-page .reader-sidebar-section-secondary,
.reader-page .reader-sidebar-section-utility {
  padding: 0.85rem 0 0;
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(107, 79, 29, 0.12);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.reader-page .current-work-card,
.reader-page .structure-drawer-card,
.reader-page .right-panel .reader-sidebar-section-priority {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08)),
    linear-gradient(135deg, rgba(107, 79, 29, 0.06), transparent 52%);
}

.reader-page .drawer-card-title {
  font-size: 1.08rem;
}

.reader-page .drawer-work-byline,
.reader-page .panel-meta,
.reader-page .muted.small-note {
  color: var(--muted);
}

.reader-page .work-facts-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.reader-page .work-fact {
  gap: 0.18rem;
  padding: 0.42rem 0;
  border: none;
  border-top: 1px solid rgba(107, 79, 29, 0.1);
  border-radius: 0;
  background: transparent;
}

.reader-page .work-fact:first-child {
  border-top: none;
  padding-top: 0;
}

.reader-page .work-fact-label {
  font-size: 0.68rem;
  letter-spacing: 0.11em;
}

.reader-page .work-fact-value {
  font-size: 0.92rem;
}

.reader-page .inline-chip {
  border-color: rgba(107, 79, 29, 0.16);
  background: rgba(107, 79, 29, 0.06);
  padding: 0.1rem 0.48rem;
}

.reader-page .drawer-section-toggle {
  padding: 0;
  font-size: 0.98rem;
}

.reader-page .search-filters,
.reader-page .multi-select,
.reader-page .author-card,
.reader-page .work-card,
.reader-page .result-item,
.reader-page .search-hit {
  border-color: rgba(107, 79, 29, 0.12);
  box-shadow: none;
}

.reader-page .search-filters,
.reader-page .multi-select,
.reader-page .work-card,
.reader-page .author-card {
  background: rgba(255,255,255,0.12);
}

.reader-page .compact-results {
  max-height: 240px;
}

.reader-page .reader-toolbar-surface {
  padding: 0.32rem 0.68rem;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(20, 20, 20, 0.04);
  background:
    linear-gradient(180deg, var(--surface-overlay), transparent),
    var(--panel);
}

.reader-page .reader-toolbar-main {
  align-items: start;
  gap: 0.4rem;
}

.reader-page .reader-advanced-tools {
  background: var(--surface-overlay);
}

.reader-page .reader-advanced-tools > summary {
  padding: 0.58rem 0.8rem;
  font-size: 0.9rem;
}

.reader-page .reader-advanced-tools-body {
  padding: 0.75rem 0.8rem 0.8rem;
}

.reader-page .omnibox-control-row {
  gap: 0.42rem;
}

.reader-page .toolbar-omnibox-field {
  flex: 1 1 100%;
}

.reader-page .toolbar-omnibox-field label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reader-page .omnibox-meta-row {
  font-size: 0.78rem;
}

.reader-page .omnibox-submit-button {
  border-color: rgba(107, 79, 29, 0.2);
  background: rgba(107, 79, 29, 0.1);
}

.reader-page.reader-landing .topbar-reader-tools,
.reader-page.reader-landing .side-tab,
.reader-page.reader-landing .reader-toolbar-surface,
.reader-page.reader-landing .reader-header,
.reader-page.reader-landing .mobile-reading-header,
.reader-page.reader-landing .reader-pg-warning,
.reader-page.reader-landing .reader-float-row {
  display: none !important;
}

.reader-page.reader-landing .reader-area {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.reader-page.reader-landing .reader-stage-surface {
  padding: 1.45rem;
}

.reader-page.reader-landing .reader-content {
  margin: 0;
}

.reader-page.reader-landing .reader-empty-state {
  min-height: min(62vh, 680px);
  align-content: center;
  gap: 1.35rem;
}

.reader-page.reader-landing .reader-empty-hero {
  max-width: 42rem;
}

.reader-page.reader-landing .reader-empty-hero h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  max-width: 12.5em;
}

.reader-page.reader-landing .reader-empty-copy {
  max-width: 74ch;
  font-size: 1.06rem;
}

/* --- source: css/reader-mobile.css --- */
@media (max-width: 640px) {
  .reader-empty-action-grid {
    grid-template-columns: 1fr;
  }

  .reader-start-action {
    padding: 0.9rem;
  }

  .omnibox-submit-button {
    width: 100%;
  }
}

/* Bilingual reader: keep columns together on tablets; switch by row on phones. */
@media (min-width: 721px) and (max-width: 1199px) {
  .reader-page .parallel-grid-two,
  .reader-page .parallel-grid-header.parallel-grid-two {
    grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.7rem;
  }

  .reader-page .parallel-grid-single,
  .reader-page .parallel-grid-header.parallel-grid-single {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 0.7rem;
  }

  .reader-page .parallel-cell + .parallel-cell {
    padding-top: 0.15rem;
    border-top: 0;
  }

  .mobile-reading-header {
    display: none;
  }
}


.share-dialog {
  width: min(37rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: min(46rem, calc(100dvh - 2rem));
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: var(--text, var(--ink));
  background: var(--panel-strong);
  box-shadow: 0 1.4rem 4rem rgba(38, 26, 12, 0.28);
}

.share-dialog::backdrop { background: rgba(28, 21, 13, 0.48); }

.share-dialog-card { display: flex; flex-direction: column; gap: 1rem; max-height: inherit; overflow-y: auto; padding: 1.25rem; }
.share-dialog-header, .share-preview-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.share-dialog-kicker { margin: 0 0 .15rem; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.share-dialog h3, .share-dialog h4 { margin: 0; }
.share-dialog-header h3 { font-size: 1.25rem; }
.share-preview { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.share-preview h4, .share-more-options h4 { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.share-preview-mode { color: var(--accent); font-size: .78rem; font-weight: 650; }
.share-preview blockquote { display: -webkit-box; margin: .7rem 0 .65rem; overflow: hidden; color: var(--text, var(--ink)); font-family: var(--reader-font, inherit); font-size: 1rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.share-preview-reference { margin: 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.share-status { min-height: 1.3rem; margin: -.25rem 0 0; color: var(--muted); }
.share-status[data-state="error"] { color: var(--danger, #a43d31); }
.share-status[data-state="success"] { color: var(--success, #2f6d48); }
.share-primary-actions, .share-secondary-actions { display: grid; gap: .6rem; }
.share-primary-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.share-action { min-width: 0; min-height: 44px; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text, var(--ink)); background: var(--panel); text-align: left; overflow-wrap: anywhere; }
.share-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.share-action:active { transform: translateY(1px); }
.share-action:focus-visible, .share-more-options > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.share-action-primary { display: flex; align-items: center; justify-content: center; gap: .45rem; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); font-weight: 700; text-align: center; }
.share-action-primary svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.share-action:disabled { cursor: not-allowed; opacity: .52; text-decoration: line-through; }
.share-more-options { border-top: 1px solid var(--border); }
.share-more-options > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; color: var(--accent); font-weight: 700; list-style-position: inside; }
.share-more-options > summary::marker { color: var(--muted); }
.share-more-chevron { font-size: 1.25rem; transition: transform .15s ease; }
.share-more-options[open] .share-more-chevron { transform: rotate(180deg); }
.share-more-options-body { display: grid; gap: 1rem; padding: .25rem 0 .25rem 1rem; }
.share-secondary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .55rem; }

@media (max-width: 640px) {
  .reader-page .reader-bottom-navigation { margin-top: 2rem; padding-top: 1rem; }
  .reader-page .reader-bottom-navigation-links { flex-direction: column; gap: 0.35rem; }
  .reader-page .reader-bottom-navigation-link { flex-basis: auto; width: 100%; min-height: 3.5rem; }
  .reader-page .reader-bottom-navigation-next { justify-content: flex-start; text-align: left; }
  .reader-page .reader-view-menu > summary { font-size: 0; }
  .reader-page .reader-view-menu > summary::after { content: 'Aa'; font-size: 1rem; }
  .share-dialog { width: 100%; max-width: none; max-height: min(88dvh, 46rem); margin: 0; border-radius: 16px 16px 0 0; }
  .share-dialog-card { padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
  .share-primary-actions { grid-template-columns: 1fr; }
  .share-more-options-body { padding-left: 0; }
}

@media (max-width: 360px) {
  .share-secondary-actions { grid-template-columns: 1fr; }
  .share-dialog-card { padding-left: .75rem; padding-right: .75rem; }
}

@media (prefers-reduced-motion: reduce) { .share-more-chevron { transition: none; } }

.reader-page .reader-toolbar button,
.reader-page .reader-toolbar select,
.reader-page .reader-toolbar input,
.reader-page .toolbar-export-menu > summary {
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
}

.reader-page #prevPassageButton,
.reader-page #nextPassageButton,
.reader-page .toolbar-secondary-actions .ghost-button {
  background: transparent;
}

.reader-page .toolbar-export-menu > summary {
  border-color: rgba(107, 79, 29, 0.2);
  background: rgba(107, 79, 29, 0.1);
}

@media (min-width: 721px) and (max-width: 1199px) {
  .reader-page .reader-view-controls { flex-wrap: wrap; }
}

.reader-page .reader-stage-surface {
  padding: 1rem 1.35rem 1.35rem;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(20, 20, 20, 0.05);
}
.reader-page.reader-has-content .reader-stage-surface {
  padding: 0.35rem 0.15rem 1.1rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reader-page .reader-header {
  margin-bottom: 0.05rem;
  gap: 0.7rem;
}

.reader-page .reader-title {
  font-size: clamp(1.52rem, 2.2vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.reader-page #readerSubtitle {
  max-width: 78ch;
  font-size: 0.92rem;
  line-height: 1.35;
}

.reader-page .reader-empty-state {
  gap: 1.1rem;
  padding-top: 0.35rem;
}

.reader-page .reader-empty-copy {
  font-size: 0.98rem;
}

.reader-page .reader-continue-action {
  margin: 0.9rem 0 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(107, 79, 29, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(107, 79, 29, 0.1), rgba(255, 255, 255, 0.4)),
    var(--panel-strong);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
}

.reader-page .reader-continue-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reader-page .reader-continue-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.reader-page .reader-continue-meta {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.reader-page .status-badge {
  padding: 0.3rem 0.68rem;
  font-size: 0.78rem;
}

.reader-page .reader-float-row {
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.reader-page .view-float,
.reader-page .parse-float,

.reader-page .reader-view-controls {
  gap: 0.45rem 0.55rem;
  align-items: end;
}

.reader-page .reader-view-controls label {
  min-width: 0;
  font-size: 0.82rem;
}

.reader-page .reader-view-controls label > span,
.reader-page .reader-view-controls label {
  color: var(--muted);
}

.reader-page .reader-passage-nav {
  gap: 0.35rem;
}

.reader-page .reader-export-menu .toolbar-export-items {
  min-width: 13rem;
}

.reader-page .reader-inline-toggle-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  color: var(--text);
  padding: 0.2rem 0.1rem;
}

.reader-page .parse-float-card {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.08);
}


.reader-page .ghost-link {
  border-color: rgba(107, 79, 29, 0.16);
  background: rgba(107, 79, 29, 0.04);
}

.reader-page .side-tab {
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 12px;
  padding: 0.62rem 0.58rem;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: rgba(251, 247, 239, 0.94);
  box-shadow: 0 10px 22px rgba(20, 20, 20, 0.1);
  opacity: 0.98;
}

.reader-page .side-tab-left {
  left: 0.32rem;
}

.reader-page .side-tab-right {
  right: 0.32rem;
}

.reader-page .structure-subsection {
  gap: 0.58rem;
}

.reader-page .structure-subsection + .structure-subsection {
  padding-top: 0.12rem;
}

.reader-page .structure-range-pill {
  background: rgba(107, 79, 29, 0.09);
}

.reader-page .structure-breadcrumb {
  gap: 0.32rem;
}

.reader-page .breadcrumb-chip {
  border-color: rgba(107, 79, 29, 0.12);
  background: rgba(107, 79, 29, 0.05);
}

.reader-page .structure-spine-rail {
  gap: 0.12rem;
  padding-left: 0.1rem;
}

.reader-page .structure-spine-item {
  grid-template-columns: 0.72rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.22rem 0;
  border-radius: 10px;
}

.reader-page .structure-spine-item:hover {
  background: linear-gradient(90deg, rgba(107, 79, 29, 0.06), transparent 78%);
}

.reader-page .structure-spine-item.is-active {
  background: linear-gradient(90deg, rgba(107, 79, 29, 0.1), transparent 80%);
}

.reader-page .structure-spine-marker {
  width: 0.72rem;
  min-height: 1.95rem;
}

.reader-page .structure-spine-marker::before {
  width: 1px;
  background: rgba(107, 79, 29, 0.18);
}

.reader-page .structure-spine-marker::after {
  width: 0.42rem;
  height: 0.42rem;
  margin-top: 0.75rem;
  background: rgba(107, 79, 29, 0.32);
  box-shadow: none;
}

.reader-page .structure-spine-item.is-active .structure-spine-marker::after {
  width: 0.56rem;
  height: 0.56rem;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(107, 79, 29, 0.1);
}

.reader-page .structure-spine-copy {
  gap: 0;
}

.reader-page .structure-spine-label {
  font-size: 0.92rem;
  line-height: 1.18;
}

.reader-page .structure-spine-meta {
  display: none;
}

.reader-page .structure-nearby-item {
  padding: 0.52rem 0;
  border: none;
  border-top: 1px solid rgba(107, 79, 29, 0.1);
  border-radius: 0;
  background: transparent;
}

.reader-page .structure-nearby-item:first-child {
  border-top: none;
  padding-top: 0;
}

.reader-page .structure-nearby-item.is-current {
  background: transparent;
}

.reader-page .structure-debug-panel > summary {
  padding: 0.55rem 0 0;
}

.reader-page .reader-main-frame {
  width: min(100%, calc(var(--reader-max-width) - 40px));
  padding-top: 0.15rem;
}

.reader-legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  margin: 0.8rem 0 0;
  padding: 0.9rem 1rem 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.reader-legal-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.reader-legal-footer a:hover,
.reader-legal-footer a:focus-visible {
  color: var(--text);
  border-bottom-color: currentColor;
}

.reader-legal-label {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.policy-main {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.policy-card {
  display: grid;
  gap: 0.95rem;
}

.policy-card h2 {
  font-size: 1.42rem;
}

.policy-stack {
  display: grid;
  gap: 0.8rem;
}

.policy-stack section {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.policy-stack h3 {
  margin: 0;
  font-size: 1rem;
}

.policy-stack p,
.policy-stack li {
  color: var(--muted);
  line-height: 1.5;
}

.policy-stack ul {
  margin: 0;
  padding-left: 1.1rem;
}

.policy-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.policy-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.reader-page .parallel-grid-header {
  padding-bottom: 0.3rem;
  background: linear-gradient(to bottom, rgba(251, 247, 239, 0.92) 76%, rgba(251, 247, 239, 0));
}

.reader-page .reader-single-version,
.reader-page .parallel-header-cell,
.reader-page .parallel-cell-header {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.reader-page .reader-single-body,
.reader-page .text-cell .parallel-cell-content {
  line-height: 1.84;
}

.reader-page .parallel-grid,
.reader-page .parallel-grid-header {
  gap: 1rem;
}

.reader-page .parallel-grid-two,
.reader-page .parallel-grid-single {
  grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr);
}

.reader-page .parallel-grid-single {
  grid-template-columns: 62px minmax(0, 1fr);
}

.reader-page .parallel-row {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(107, 79, 29, 0.05);
}

.reader-page .parallel-cell {
  padding: 0.15rem 0.05rem 0.35rem;
}

.reader-page .parallel-alignment-notice {
  font-size: 0.8rem;
}

.reader-page .cite-gutter {
  padding: 0.38rem 0.12rem;
}

.reader-page .cite-gutter-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.reader-page .cite-gutter-scholarly,
.reader-page .reader-scholarly-badge,
.reader-page .reader-meter-chip,
.reader-page .reader-citation-badge {
  padding: 0.08rem 0.38rem;
  border: none;
  background: rgba(107, 79, 29, 0.08);
  color: var(--muted);
  font-size: 0.67rem;
}

.reader-page .cite-gutter-inline-chips {
  gap: 0.2rem;
  margin-top: 0.35rem;
}

.reader-page .reader-citation-badge-row {
  margin: 0.08rem 0 0.35rem;
}

.reader-page .reader-chapter-intertexts-card {
  padding: 0.6rem 0;
  border-top: 1px solid rgba(107, 79, 29, 0.1);
}

.reader-page .reader-chapter-intertexts-card:first-child {
  padding-top: 0;
  border-top: none;
}

.reader-page .reader-chapter-intertexts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.reader-page .reader-chapter-intertexts-body {
  display: grid;
  gap: 0.35rem;
}

.reader-page .right-panel .reader-sidebar-section-utility .drawer-section-toggle {
  color: var(--muted);
}

.reader-page .right-panel .notice,
.reader-page .left-panel .notice,
.reader-page #tokenDetail.notice,
.reader-page #legacyTokenDetail.notice {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(107, 79, 29, 0.08);
}

.morphology-attention {
  box-shadow: 0 0 0 2px rgba(107, 79, 29, 0.18);
  border-radius: 14px;
}



/*
 * Reader responsive authority.
 *
 * The phone reading predicate is shared with reader-mobile-mode.js:
 * narrow screens, plus coarse-pointer short landscape screens up to 980px.
 * Keep this block last in the Reader CSS family so library/admin source order
 * cannot silently decide how the Reader is laid out.
 */
.reader-page .mobile-reading-header {
  display: none;
}

@media (max-width: 1199px) {
  body.reader-page {
    overflow-x: clip;
  }

  .reader-page .layout,
  .reader-page .layout.left-collapsed,
  .reader-page .layout.right-collapsed,
  .reader-page .layout.left-collapsed.right-collapsed {
    display: block;
    grid-template-columns: minmax(0, 1fr);
  }

  .reader-page .reader-main-frame {
    width: 100%;
  }

  .reader-page .sidebar {
    position: fixed;
    z-index: 200;
    inset-block: 0;
    width: min(27rem, 92vw);
    max-height: 100dvh;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease, visibility 0s linear 180ms;
  }

  .reader-page .left-panel {
    inset-inline-start: 0;
    transform: translateX(-104%);
  }

  .reader-page .right-panel {
    inset-inline-end: 0;
    inset-inline-start: auto;
    grid-column: auto;
    transform: translateX(104%);
  }

  .reader-page .sidebar.mobile-drawer-open {
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .reader-page .side-tab {
    display: none !important;
  }

  .reader-drawer-backdrop {
    position: fixed;
    z-index: 190;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(31, 27, 20, 0.34);
    cursor: default;
  }

  .reader-drawer-backdrop[hidden] {
    display: none;
  }

  body.reader-drawer-active {
    overflow: hidden;
    background: var(--surface, #f5efe3);
    opacity: 1;
  }

  body.reader-drawer-active .reader-area,
  body.reader-drawer-active .reader-page .topbar {
    pointer-events: none;
  }

  .reader-page .drawer-header {
    flex: 0 0 auto;
    padding-top: max(0.35rem, env(safe-area-inset-top));
  }

  .reader-page .study-tools-tabs {
    position: sticky;
    top: 0;
    flex: 0 0 auto;
    z-index: 3;
    padding-block: 0.35rem;
  }

  .reader-page .reader-sidebar-section {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }
}

/* Pass 3 final cascade: intentional parallel overflow belongs to the canvas. */
@media (max-width: 720px), (pointer: coarse) and (max-width: 980px) and (max-height: 560px) {
  .reader-page .reader-content.mobile-parallel-side-by-side { overflow-x: auto !important; overflow-y: visible; }
  .reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-header.parallel-grid-two { grid-template-columns: 64px 330px 330px !important; min-width: 724px; }
  .reader-page .reader-content.mobile-parallel-stacked .parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-stacked .parallel-grid-header.parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-stacked .parallel-row { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 1199px) {
  .reader-page .right-panel.intertext-detail-active > .reader-sidebar-section:not([data-context-section="passage"]),
  .reader-page .right-panel.intertext-detail-active > .reader-sidebar-section-utility,
  .reader-page .right-panel.intertext-detail-active .reader-sidebar-section-priority > .drawer-section-toggle,
  .reader-page .right-panel.intertext-detail-active #exploreAllConnections,
  .reader-page .right-panel.intertext-detail-active .reader-specialist-disclosure {
    display: none !important;
  }

  .reader-page .right-panel.intertext-detail-active .reader-sidebar-section-priority {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .reader-page .right-panel.mobile-drawer-open,
  .reader-page .right-panel.intertext-detail-active {
    background: var(--panel, #fff);
    background-color: var(--panel, #fff);
    opacity: 1;
  }

  .reader-page .right-panel.intertext-detail-active .reader-sidebar-section-priority > .drawer-section-body:not([hidden]) {
    display: block;
    overflow: auto;
    padding: 0.25rem 0.15rem 1rem;
  }
}

/* Reader 3: the edition canvas is a page, while the command surface stays compact. */
.reader-page {
  --reader-line-height: 1.6;
  --reader-measure: 72ch;
}
.reader-page.reader-has-content .topbar {
  margin-bottom: .25rem;
  min-height: 3.1rem;
}
.reader-page.reader-has-content .topbar h1 { font-size: 1.05rem; }
.reader-page.reader-has-content .topbar-subtitle,
.reader-page.reader-has-content .top-nav-secondary { display: none; }

.reader-page .reader-toolbar-surface { display: none; }
.reader-page .reader-toolbar-surface:has(.reader-advanced-tools[open]) { display: block; margin: 0 0 .5rem; border: 0; box-shadow: none; background: transparent; }
.reader-page .reader-toolbar-surface:has(.reader-advanced-tools[open]) .reader-advanced-tools-body { padding: .5rem 0; }
.reader-page .reader-stage-surface {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: .25rem 0 1.5rem;
}
@media (max-width: 720px), (pointer: coarse) and (max-width: 980px) and (max-height: 560px) {
  html, body.reader-page { overflow-x: clip; }
  .reader-page .reader-toolbar-surface:has(.reader-advanced-tools[open]) { display: block !important; padding: .35rem .55rem; }
  .reader-page #mobileSearchToggle::before { content: '\2315'; font-size: 1.2rem; }
}
.reader-page .mobile-reading-context strong,
.reader-page .mobile-reading-context span,
.reader-page .mobile-reading-context a { display: block; max-width: 100%; min-width: 0; }
.reader-page .reader-header { display: none; }
.reader-page .reader-float-row { position: sticky; top: 0; z-index: 30; margin: 0 0 1.2rem; }
.reader-page .reader-view-controls {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .55rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
}
.reader-page .reader-passage-nav { margin-right: auto; }
.reader-page .reader-passage-nav button,
.reader-page .reader-view-controls summary { border: 0; background: transparent; box-shadow: none; }
.reader-page .reader-content { --reader-text-width: var(--reader-measure); font-family: var(--font-reader-text); font-size: var(--reader-font-size); line-height: var(--reader-line-height); }
.reader-page .reader-content.manuscript-single { max-width: var(--reader-text-width); margin-inline: auto; }
.reader-page .reader-content.manuscript-single .reader-single-body { max-width: none; }
.reader-page .parallel-grid-header,
.reader-page .parallel-grid-two,
.reader-page .parallel-grid-single { column-gap: 1.4rem; }
.reader-page .parallel-grid-two,
.reader-page .parallel-grid-header.parallel-grid-two { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr); }
.reader-page .reader-content.mobile-parallel-side-by-side { overflow-x: auto; }
.reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-two,
.reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-header.parallel-grid-two { min-width: 760px; }
.reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-two { grid-template-columns: 64px minmax(330px, 1fr) minmax(330px, 1fr); }
.reader-page .reader-content.mobile-parallel-stacked .parallel-grid-two,
.reader-page .reader-content.mobile-parallel-stacked .parallel-grid-header.parallel-grid-two,
.reader-page .reader-content.mobile-parallel-stacked .parallel-row { grid-template-columns: minmax(0, 1fr); }
.reader-page .reader-content.mobile-parallel-stacked .cite-gutter { grid-column: 1; }
.reader-page .reader-content.mobile-parallel-stacked .parallel-cell[data-reading-role="secondary"] { border-top: 1px solid var(--border); padding-top: .85rem; }
.reader-page .reader-appearance-group { display: grid; gap: .3rem; border: 0; margin: 0; padding: 0; }
.reader-page .reader-appearance-group legend { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.reader-page .reader-view-menu .toolbar-export-items { min-width: 16rem; }
html[data-reader-spacing="compact"] .reader-page .reader-content { --reader-line-height: 1.45; }
html[data-reader-spacing="comfortable"] .reader-page .reader-content { --reader-line-height: 1.6; }
html[data-reader-spacing="relaxed"] .reader-page .reader-content { --reader-line-height: 1.8; }
html[data-reader-width="narrow"] .reader-page .reader-content { --reader-measure: 64ch; }
html[data-reader-width="comfortable"] .reader-page .reader-content { --reader-measure: 72ch; }
html[data-reader-width="wide"] .reader-page .reader-content { --reader-measure: 88ch; }
html[data-reader-layout="single"] .reader-page .reader-content .parallel-header-cell[data-reading-role="secondary"],
html[data-reader-layout="single"] .reader-page .reader-content .parallel-cell[data-reading-role="secondary"] { display: none; }
html[data-reader-layout="single"] .reader-page .reader-content .parallel-grid-two { grid-template-columns: 58px minmax(0, 1fr); }

@media (max-width: 720px) {
  .reader-page #readerViewPanel:has(#readerChapterControls:not([hidden])) { display: block; }
  .reader-page #readerViewControls:has(#readerChapterControls:not([hidden])) > :not(#readerChapterControls) { display: none; }
  .reader-page.reader-has-content .app-shell { padding-inline: .55rem; }
  .reader-page .reader-view-controls { top: 0; padding: .25rem; }
  .reader-page .reader-passage-nav button { font-size: 0; min-width: 2.5rem; }
  .reader-page .reader-passage-nav button::first-letter { font-size: 1.15rem; }
  .reader-page .reader-content { font-size: clamp(18px, var(--reader-font-size), 25px); }
  .reader-page .reader-content.mobile-parallel-side-by-side { width: 100%; overscroll-behavior-x: contain; }
  .reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-two,
  .reader-page .reader-content.mobile-parallel-side-by-side .parallel-grid-header.parallel-grid-two { min-width: 760px; }
}

@media (max-width: 720px), (pointer: coarse) and (max-width: 980px) and (max-height: 560px) {
  .reader-page .app-shell {
    padding-inline: 0.45rem;
  }

  .reader-page .topbar {
    min-height: 2.8rem;
    margin-bottom: 0.35rem;
    padding: 0.42rem 0.2rem;
  }

  .reader-page .topbar h1 {
    font-size: 0.98rem;
  }

  .reader-page .topbar-subtitle,
  .reader-page .topbar .eyebrow,
  .reader-page .top-nav-links,
  .reader-page .topbar-reader-tools,
  .reader-page .subscribe-cta {
    display: none;
  }

  .reader-page .reader-toolbar-surface {
    display: none;
  }

  .reader-page .reader-stage-surface {
    padding: 0.45rem 0.6rem 0.8rem;
    border-radius: 14px;
    box-shadow: none;
  }

  .reader-page .reader-header,
  .reader-page #readerEntityBreadcrumb,
  .reader-page #readerViewPanel {
    display: none;
  }

  .reader-page .reader-float-row {
    min-height: 0;
    margin: 0;
  }

  .reader-page .reader-pg-warning {
    margin: 0 0 0.25rem;
    font-size: 0.76rem;
  }

  .reader-page .mobile-reading-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "nav context more"
      "actions actions actions";
    position: sticky;
    z-index: 20;
    top: 0.2rem;
    gap: 0.2rem 0.35rem;
    margin: 0 0 0.45rem;
    padding: 0.32rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-strong) 96%, transparent);
    box-shadow: 0 3px 10px rgba(20, 20, 20, 0.05);
  }
  .reader-page #mobileNavigatorButton,
  .reader-page #mobileReaderMore,
  .reader-page .mobile-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    font-size: 0;
    line-height: 1;
    border-radius: 10px;
  }
  .reader-page #mobileNavigatorButton { grid-area: nav; }
  .reader-page #mobileReaderMore { grid-area: more; }
  .reader-page #mobilePrevPassageButton,
  .reader-page #mobileNextPassageButton {
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 0;
  }
  .reader-page #mobileNavigatorButton::before,
  .reader-page #mobilePrevPassageButton::before,
  .reader-page #mobileNextPassageButton::before,
  .reader-page #mobileReaderMore::before {
    font-size: 1.2rem;
    line-height: 1;
  }
  .reader-page .mobile-reading-context { grid-area: context; }
  .reader-page .mobile-reading-actions { grid-area: actions; justify-content: space-between; width: 100%; }
  .reader-page #mobileReaderMoreMenu { grid-area: more; }
  .reader-page .mobile-more-group-label {
    padding: 0.35rem 0.45rem 0.1rem;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .reader-page .mobile-reading-context {
    min-width: 0;
  }

  .reader-page .mobile-reading-context strong,
  .reader-page .mobile-reading-context span,
  .reader-page .mobile-reading-context a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reader-page .mobile-reading-context strong {
    font-size: 0.84rem;
  }

  .reader-page .mobile-reading-context span,
  .reader-page .mobile-reader-author {
    font-size: 0.72rem;
  }

  .reader-page .mobile-reading-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem;
  }

  .reader-page .mobile-reading-actions button,
  .reader-page .mobile-reading-actions summary {
    min-width: 2.75rem;
    min-height: 2.75rem;
    width: auto;
    padding: 0.32rem 0.46rem;
    font-size: 0;
    line-height: 1;
  }

  .reader-page .mobile-reading-actions button::before,
  .reader-page .mobile-reading-actions summary::before {
    font-size: 1.2rem;
  }

  #mobileNavigatorButton::before { content: '\2630'; }
  #mobilePrevPassageButton::before { content: '\2039'; }
  #mobileNextPassageButton::before { content: '\203a'; }
  #mobileReaderMore::before { content: '\22ef'; }
  #mobileStudyToolsButton { display: none; }

  .reader-page .mobile-reading-more,
  .reader-page .mobile-reading-versions-tools {
    position: relative;
  }

  .reader-page .mobile-reading-more > summary,
  .reader-page .mobile-reading-versions-tools > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    list-style: none;
    cursor: pointer;
  }

  .reader-page .mobile-reading-more > summary::-webkit-details-marker,
  .reader-page .mobile-reading-versions-tools > summary::-webkit-details-marker {
    display: none;
  }

  .reader-page .mobile-reading-more-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.3rem);
    right: 0;
    display: grid;
    width: min(18rem, calc(100vw - 1rem));
    max-height: min(70dvh, 30rem);
    overflow: auto;
    gap: 0.2rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
  }

  .reader-page .mobile-reading-more:not([open]) > .mobile-reading-more-menu {
    display: none;
  }

  .reader-page .mobile-reading-more-menu button,
  .reader-page .mobile-reading-more-menu .mobile-reading-versions-tools > summary {
    width: 100%;
    min-height: 2.75rem;
    justify-content: flex-start;
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
  }

  .reader-page .mobile-reading-more-menu button::before {
    content: none;
  }

  .reader-page .mobile-reading-versions-tools-body {
    display: grid;
    gap: 0.35rem;
    padding: 0.4rem;
  }

  .reader-page .mobile-reading-versions-tools-body label {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
  }

  .reader-page .mobile-reading-versions-tools-body select {
    width: 100%;
    min-height: 2.75rem;
  }

  .reader-page #mobileReaderVersionsMenu > summary {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    list-style: none;
    cursor: pointer;
  }

  .reader-page #mobileReaderVersionsMenu > summary::-webkit-details-marker {
    display: none;
  }

  .reader-page #mobileReaderVersionsPanel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    max-height: 60dvh;
    overflow: auto;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
  }

  .reader-page #mobileReaderVersionsMenu:not([open]) > #mobileReaderVersionsPanel {
    display: none;
  }

  .reader-page .mobile-reading-mode-controls {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.18rem;
    width: 100%;
    padding: 0.16rem;
    border-radius: 10px;
  }

  .reader-page .mobile-reading-mode-controls[hidden] {
    display: none;
  }

  .reader-page .mobile-reading-mode-controls button {
    min-width: 0;
    min-height: 2.75rem;
    overflow: hidden;
    padding: 0.32rem 0.2rem;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reader-page #readerContent {
    max-width: 100%;
    margin-top: 0.1rem;
    overflow-x: clip;
  }

  .reader-page .reader-content,
  .reader-page .reader-content * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .reader-page .parallel-grid-two,
  .reader-page .parallel-grid-single,
  .reader-page .parallel-grid-header.parallel-grid-two,
  .reader-page .parallel-grid-header.parallel-grid-single,
  .reader-page .parallel-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.42rem;
  }

  .reader-page .parallel-grid-header {
    position: sticky;
    top: 0;
    margin-bottom: 0.35rem;
    padding: 0.2rem 0 0.3rem;
  }

  .reader-page .parallel-header-cell[data-reading-role="primary"],
  .reader-page .parallel-header-cell[data-reading-role="secondary"],
  .reader-page .parallel-cell[data-reading-role="primary"],
  .reader-page .parallel-cell[data-reading-role="secondary"] {
    min-width: 0;
  }

  .reader-page .cite-gutter {
    grid-column: 1;
    justify-items: start;
    min-height: 1.45rem;
    padding: 0.1rem 0;
  }

  .reader-page .cite-gutter-target {
    justify-items: start;
  }

  .reader-page .parallel-cell[data-reading-role="secondary"] {
    padding-top: 0.62rem;
    border-top: 1px solid rgba(107, 79, 29, 0.1);
  }

  .reader-page .reader-content.mobile-reading-primary [data-reading-role="secondary"],
  .reader-page .reader-content.mobile-reading-secondary [data-reading-role="primary"] {
    display: none;
  }

  .reader-page .reader-content.mobile-reading-primary .parallel-header-cell[data-reading-role="primary"],
  .reader-page .reader-content.mobile-reading-secondary .parallel-header-cell[data-reading-role="secondary"] {
    display: block;
  }

  .reader-page .parallel-row {
    margin-bottom: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .reader-page .text-cell .parallel-cell-content {
    line-height: 1.72;
  }

  .reader-page .reader-sidebar-section {
    padding: 0.6rem 0.7rem;
    border-radius: 14px;
  }

  .reader-page .right-panel {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    padding: max(0.6rem, env(safe-area-inset-top)) max(0.7rem, env(safe-area-inset-right)) max(0.7rem, env(safe-area-inset-bottom)) max(0.7rem, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    transform: translateY(104%);
    overflow: hidden;
  }

  /* Context is the primary mobile sheet. Keep the legacy persistence targets
   * in normal document flow so notes/highlight actions remain reachable while
   * the sheet itself owns scrolling. */
  .reader-page .right-panel {
    overflow-y: auto;
  }
  .reader-page .context-inspector-overview {
    flex: 0 0 auto;
  }
  .reader-page .right-panel .reader-sidebar-section.is-active-tool-section {
    flex: 0 0 auto;
    overflow: visible;
  }
  .reader-page .right-panel .reader-sidebar-section.is-active-tool-section > .drawer-section-body:not([hidden]) {
    flex: 0 0 auto;
    overflow: visible;
  }

  .reader-page .right-panel.mobile-drawer-open {
    transform: translateY(0);
  }

  .reader-page .right-panel .drawer-header {
    min-height: 3rem;
  }

  .reader-page .right-panel .drawer-header .icon-button,
  .reader-page .right-panel .study-tools-tab {
    min-height: 2.75rem;
  }

  .reader-page .right-panel .study-tools-tabs {
    margin-bottom: 0.35rem;
  }

  .reader-page .right-panel .reader-sidebar-section {
    display: none;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
  }

  .reader-page .right-panel .reader-sidebar-section.is-active-tool-section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .reader-page .right-panel .reader-sidebar-section.is-active-tool-section > .drawer-section-toggle {
    flex: 0 0 auto;
  }

.reader-page .right-panel .reader-sidebar-section.is-active-tool-section > .drawer-section-body:not([hidden]) {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

  .reader-page .right-panel .reader-sidebar-section-priority,
  .reader-page .right-panel .reader-sidebar-section-utility {
    box-shadow: none;
  }

  .reader-page .intertext-list,
  .reader-page .compact-overview {
    gap: 0.35rem;
  }

  .reader-page .intertext-preview-card,
  .reader-page .intertext-focus-card,
  .reader-page .intertext-preview-snippet,
  .reader-page .intertext-preview-item-button {
    gap: 0.3rem;
    padding: 0.5rem 0.55rem;
  }

  .reader-page .intertext-preview-author,
  .reader-page .intertext-preview-work {
    gap: 0.2rem;
  }

  .reader-page .reader-chapter-intertexts-card {
    padding-block: 0.45rem;
  }

  .reader-page .reader-chapter-intertexts-body,
  .reader-page .scholia-section {
    gap: 0.25rem;
  }

  .reader-page .reader-author-shelf {
    margin-top: 1.25rem;
  }
}

@media (pointer: coarse) and (max-width: 980px) and (max-height: 560px) {
  .reader-page .topbar {
    display: none;
  }

  .reader-page .app-shell {
    padding-block-start: 0.25rem;
  }

  .reader-page .reader-stage-surface {
    padding-top: 0.25rem;
  }

  .reader-page .mobile-reading-header {
    margin-bottom: 0.25rem;
  }

  .reader-page .mobile-reading-mode-controls button,
  .reader-page .mobile-reading-actions button,
  .reader-page .mobile-reading-actions summary {
    min-height: 2.65rem;
  }

  .reader-page .right-panel .reader-sidebar-section {
    padding-block: 0.45rem;
  }

  .reader-page .intertext-preview-card,
  .reader-page .intertext-focus-card {
    font-size: 0.88rem;
  }
}

/* Universal Context owns the sheet scroll; compatibility sections must not
 * flex over one another when passage context exposes notes and connections. */
@media (max-width: 1199px) {
  .reader-page .right-panel.mobile-drawer-open {
    overflow-y: auto;
  }
  .reader-page .right-panel.mobile-drawer-open .context-inspector-overview,
  .reader-page .right-panel.mobile-drawer-open .reader-sidebar-section.is-active-tool-section {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }
  .reader-page .right-panel.mobile-drawer-open .reader-sidebar-section.is-active-tool-section > .drawer-section-body:not([hidden]) {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }
}

/* --- source: css/library.css --- */
@media (prefers-reduced-motion: no-preference) {
  .morphology-attention {
    animation: morphology-attention-pulse 0.95s ease-out;
  }
}

@keyframes morphology-attention-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(107, 79, 29, 0.3);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(107, 79, 29, 0);
  }
}

.token-mini-card {
  position: fixed;
  z-index: 320;
  width: min(20rem, calc(100vw - 24px));
  max-width: min(20rem, calc(100vw - 24px));
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(107, 79, 29, 0.18);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.97);
  box-shadow: 0 12px 30px rgba(20, 20, 20, 0.14);
  pointer-events: auto;
}

.token-mini-card-surface {
  font-family: var(--font-reader-text);
  font-size: 0.98rem;
  font-weight: 600;
}

.token-mini-card-meta {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.token-mini-card-lemma { margin-top: 0.08rem; color: var(--muted); font-weight: 500; }
.token-mini-card-gloss { margin-top: 0.28rem; color: var(--text); font-style: italic; }
.token-mini-card-alternatives { margin-top: 0.28rem; color: var(--muted); font-size: 0.76rem; }
.token-mini-card { transition: opacity .12s ease, transform .12s ease; }
@media (prefers-reduced-motion: reduce) {
  .token-mini-card { transition: none; }
}
.intertext-open-alongside { margin-top: 0.8rem; }
@media (max-width: 720px), (pointer: coarse) and (max-width: 980px) and (max-height: 560px) {
  .token-mini-card { inset-inline: 0.75rem !important; top: auto !important; bottom: max(0.75rem, env(safe-area-inset-bottom)) !important; max-width: none; border-radius: 16px; }
}

@media (max-width: 1100px) {
  .master-data-layout {
    grid-template-columns: 1fr;
  }

  .master-data-drawer {
    position: static;
  }
}

@media (max-width: 900px) {
  .master-tree-columns,
  .master-tree-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr);
  }

  .master-tree-columns > :nth-child(n + 5),
  .master-tree-row > :nth-child(n + 5) {
    display: none;
  }

  .authority-link-grid {
    grid-template-columns: 1fr;
  }

  .detail-table-row {
    grid-template-columns: 1fr;
  }

  .history-diff-row {
    grid-template-columns: 1fr;
  }
}

.account-page-main {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.auth-card {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.account-tabs .button-like.active {
  background: var(--accent);
  color: var(--panel-strong);
  border-color: var(--accent);
}

.account-form {
  display: grid;
  gap: 0.9rem;
}

.account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-form label,
.account-form .checkbox-row {
  display: grid;
  gap: 0.3rem;
}

.account-form input,
.account-form select,
.account-form textarea {
  width: 100%;
  border: 1px solid rgba(107, 79, 29, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.status-banner {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(107, 79, 29, 0.14);
  background: rgba(255, 255, 255, 0.2);
}

.status-banner[data-kind="success"] {
  border-color: rgba(56, 116, 51, 0.24);
  background: rgba(129, 181, 105, 0.14);
}

.status-banner[data-kind="error"] {
  border-color: rgba(154, 76, 76, 0.24);
  background: rgba(171, 88, 88, 0.12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.activation-checklist-banner .checklist-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.activation-checklist-banner .checklist-item {
  align-items: baseline;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1.1rem 1fr;
}

.activation-checklist-banner .checklist-item.is-complete {
  color: var(--muted);
  text-decoration: line-through;
}

.activation-checklist-banner .checklist-marker {
  font-weight: 700;
}

.activation-checklist-banner .activation-success {
  color: var(--success, #39733a);
  font-weight: 600;
  margin-top: 0.75rem;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.data-list {
  display: grid;
  gap: 0.7rem;
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(107, 79, 29, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.summary-box {
  display: grid;
  gap: 0.2rem;
}

@media (max-width: 680px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .data-row {
    display: grid;
    align-items: start;
  }
}

.author-work-picker {
  display: grid;
  gap: 0.75rem;
}

.picker-field {
  display: grid;
  gap: 0.4rem;
}

.author-work-picker-field {
  display: grid;
  gap: 0.4rem;
}

.author-work-picker-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.author-work-picker-input {
  width: 100%;
}

.author-work-picker-clear {
  flex: 0 0 auto;
}

.author-work-picker-menu {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 252, 246, 0.98);
}

body[data-theme="dark"] .author-work-picker-menu {
  background: rgba(27, 25, 23, 0.98);
  border-color: rgba(255, 255, 255, 0.12);
}

.author-work-picker-option {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid transparent;
  background: transparent;
}

.author-work-picker-option:hover,
.author-work-picker-option.is-active {
  border-color: rgba(126, 88, 48, 0.28);
  background: rgba(126, 88, 48, 0.08);
}

.author-work-picker-option-title {
  font-weight: 600;
}

.author-work-picker-option-meta,
.author-work-picker-empty {
  font-size: 0.92rem;
  color: var(--muted-text, #6c645d);
}

/* Shared keyboard access stays visible across the sepia, light, and dark surfaces. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--panel-strong);
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: 0.6rem;
  left: 0.6rem;
  transform: translateY(-160%);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.mobile-menu-panel {
  display: contents;
}

.mobile-menu-trigger {
  display: none;
}

/* --- source: css/admin.css --- */
@media (max-width: 980px) {
  .topbar.compact {
    position: relative;
    flex-direction: row;
    align-items: center;
  }

  .topbar.compact .brand-block {
    min-width: 0;
  }

  .topbar.compact .topbar-subtitle,
  .topbar.compact .eyebrow {
    display: none;
  }

  .topbar.compact .topbar-controls {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .mobile-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    font-size: 0.84rem;
  }

  .mobile-menu-panel {
    position: absolute;
    z-index: 180;
    top: calc(100% + 0.45rem);
    right: 0;
    display: grid;
    width: min(23rem, calc(100vw - 1.4rem));
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
  }

  .mobile-menu-panel[hidden] {
    display: none;
  }

  .mobile-menu-panel .top-nav-links,
  .mobile-menu-panel .top-nav-main,
  .mobile-menu-panel .top-nav-secondary,
  .mobile-menu-panel .topbar-inline-actions,
  .mobile-menu-panel .topbar-reader-tools {
    display: grid;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .mobile-menu-panel .top-nav-links,
  .mobile-menu-panel .topbar-inline-actions {
    gap: 0.45rem;
  }

  .mobile-menu-panel .top-nav-main,
  .mobile-menu-panel .top-nav-secondary,
  .mobile-menu-panel .topbar-reader-tools {
    gap: 0.18rem;
  }

  .mobile-menu-panel .nav-link,
  .mobile-menu-panel .topbar-reader-tools > .ghost-button,
  .mobile-menu-panel .settings-menu > summary,
  .mobile-menu-panel .subscribe-cta {
    justify-content: flex-start;
    width: 100%;
    border-radius: 12px;
  }

  .mobile-menu-panel .settings-panel {
    position: static;
    min-width: 0;
    margin-top: 0.35rem;
  }

}

/* Compact admin navigation is intentionally a single row, but public guide
 * pages share the compact header and still need the normal stacked mobile
 * layout. Keep this correction scoped to content pages. */
@media (max-width: 980px) {
  .content-page .topbar.compact {
    flex-direction: column;
    align-items: stretch;
  }

  .content-page .topbar.compact .topbar-controls {
    width: 100%;
    margin-left: 0;
    flex: 0 1 auto;
  }

  .content-page .topbar.compact .top-nav-links {
    width: 100%;
  }

  .content-page .top-nav-main,
  .content-page .top-nav-secondary {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.library-catalog-picker {
  margin: 0.15rem 0 0.95rem;
}

.catalog-picker {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
  border: 1px solid rgba(107, 79, 29, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
}

.catalog-picker-field {
  display: grid;
  gap: 0.35rem;
}

.catalog-picker-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.catalog-picker-input-row input {
  width: 100%;
}

.catalog-picker-results {
  display: grid;
  gap: 0.65rem;
  max-height: min(30rem, 55vh);
  overflow-y: auto;
  padding: 0.65rem;
  border: 1px solid rgba(107, 79, 29, 0.16);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.catalog-picker-group {
  display: grid;
  gap: 0.3rem;
}

.catalog-picker-group-title {
  color: var(--muted);
  font-size: 0.74rem;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-picker-option {
  display: grid;
  gap: 0.16rem;
  width: 100%;
  padding: 0.62rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
}

.catalog-picker-option:hover,
.catalog-picker-option.is-active {
  border-color: rgba(107, 79, 29, 0.28);
  background: var(--accent-soft);
}

.catalog-picker-option-title {
  font-weight: 700;
}

.catalog-picker-option-meta,
.catalog-picker-option-alias,
.catalog-picker-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.library-alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.library-alphabet-bar .ghost-button {
  min-width: 2.1rem;
  padding: 0.38rem 0.52rem;
}

@media (max-width: 720px) {
  .library-alphabet-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 0.18rem;
  }

  .library-alphabet-bar .ghost-button {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .catalog-picker-input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-picker-input-row .ghost-button {
    width: 100%;
  }
}

/* --- source: css/public-pages.css --- */
/* Scoped presentation for server-rendered public catalog pages. */
.public-page-shell .public-page-content {
  width: min(100%, var(--profile-max-width, 70rem));
  margin: 0 auto;
}
.public-page-shell .public-topbar { align-items: center; }
.public-page-shell .public-brand { text-decoration: none; }
.public-page-shell .public-top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-ui);
}
.public-page-shell .public-author,
.public-page-shell .public-work,
.public-page-shell .entity-profile {
  display: grid;
  gap: var(--profile-gap, 1.75rem);
  padding-bottom: 3rem;
}
.public-page-shell .public-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font: 0.82rem var(--font-ui);
}
.public-page-shell .public-breadcrumbs a { color: var(--muted); text-decoration: none; }
.public-page-shell .public-breadcrumbs a:hover,
.public-page-shell .public-breadcrumbs a:focus-visible { color: var(--accent); }
.public-page-shell .public-kicker {
  color: var(--muted);
  font: 0.72rem/1.2 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.public-page-shell .author-hero,
.public-page-shell .work-hero {
  display: grid;
  gap: 0.85rem;
  padding: 0.35rem 0 1.6rem;
  border-bottom: 1px solid var(--border);
}
.public-page-shell .author-hero h1,
.public-page-shell .work-hero h1 {
  max-width: 22ch;
  font-size: clamp(2.15rem, 4.6vw, 3.35rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.public-page-shell .profile-subtitle,
.public-page-shell .work-hero-author {
  margin: 0;
  color: var(--muted);
  font: 1.05rem/1.45 var(--font-body);
}
.public-page-shell .work-hero-author a {
  color: var(--text);
  font-weight: 600;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
.public-page-shell .entity-aliases {
  margin: 0;
  max-width: var(--profile-measure, 70ch);
  color: var(--muted);
  font: 0.92rem/1.5 var(--font-ui);
  overflow-wrap: anywhere;
}
.public-page-shell .author-alias-disclosure { display: inline; margin-left: .35rem; }
.public-page-shell .author-alias-disclosure summary { display: inline; cursor: pointer; color: var(--accent); }
.public-page-shell .author-alias-more { display: block; margin-top: .3rem; }
.public-page-shell .profile-intro { display: grid; gap: 0.45rem; }
.public-page-shell .profile-intro h2 {
  color: var(--muted);
  font: 0.72rem/1.2 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.public-page-shell .entity-description,
.public-page-shell .author-metadata.entity-description {
  max-width: var(--profile-measure, 70ch);
  color: var(--text);
  font: 1.05rem/1.65 var(--font-body);
}
.public-page-shell .profile-actions,
.public-page-shell .work-actions,
.public-page-shell .entity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
  margin-top: 0.35rem;
}
.public-page-shell .work-primary-action {
  background: var(--accent);
  color: var(--panel-strong);
  border-color: var(--accent);
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
}
.public-page-shell .work-primary-action:hover { background: var(--accent); opacity: 0.92; }
.public-page-shell .profile-secondary-action {
  color: var(--muted);
  font: 0.95rem var(--font-ui);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
.public-page-shell .profile-secondary-action:hover,
.public-page-shell .profile-secondary-action:focus-visible { color: var(--accent); }
.public-page-shell .entity-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18.5rem);
  gap: 2.25rem 3rem;
  align-items: start;
}
.public-page-shell .entity-profile-main,
.public-page-shell .entity-profile-aside,
.public-page-shell .author-works-section,
.public-page-shell .work-outline,
.public-page-shell .work-key-lemmas,
.public-page-shell .work-metadata,
.public-page-shell .entity-metadata,
.public-page-shell .entity-secondary {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}
.public-page-shell .entity-profile h2,
.public-page-shell .author-works-section h2,
.public-page-shell .work-outline h2,
.public-page-shell .work-key-lemmas h2,
.public-page-shell .work-metadata h2,
.public-page-shell .entity-metadata h2,
.public-page-shell .entity-secondary h2,
.public-page-shell .author-statistics h2,
.public-page-shell .work-statistics h2 {
  font-size: 1.28rem;
  line-height: 1.25;
}
.public-page-shell .entity-facts {
  display: grid;
  gap: 0.85rem 1.25rem;
  margin: 0;
}
.public-page-shell .entity-facts div { display: grid; gap: 0.15rem; }
.public-page-shell .entity-facts dt {
  color: var(--muted);
  font: 0.75rem/1.3 var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.public-page-shell .entity-facts dd { margin: 0; overflow-wrap: anywhere; }
.public-page-shell .entity-work-group,
.public-page-shell .work-version-group { display: grid; gap: 0.55rem; }
.public-page-shell .entity-group-label,
.public-page-shell .citation-group-label,
.public-page-shell .work-version-group h3 {
  margin: 0;
  color: var(--muted);
  font: 0.78rem/1.3 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.public-page-shell .author-entity-work-list,
.public-page-shell .entity-version-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.public-page-shell .author-work-card,
.public-page-shell .work-version-card {
  display: block;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.public-page-shell .entity-work-row,
.public-page-shell .entity-version-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 3.15rem;
  padding: 0.85rem 0.15rem;
  color: inherit;
  text-decoration: none;
}
.public-page-shell .entity-work-row:hover,
.public-page-shell .entity-version-row:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.public-page-shell .entity-work-copy,
.public-page-shell .entity-version-copy { display: grid; gap: 0.2rem; min-width: 0; }
.public-page-shell .author-work-card h3,
.public-page-shell .entity-version-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.public-page-shell .author-work-meta,
.public-page-shell .work-version-meta {
  margin: 0;
  color: var(--muted);
  font: 0.86rem/1.4 var(--font-ui);
}
.public-page-shell .entity-work-action {
  flex: 0 0 auto;
  color: var(--muted);
  font: 0.86rem var(--font-ui);
  font-size: 1.35rem;
  line-height: 1;
}
.public-page-shell .author-start-with,
.public-page-shell .author-corpus-snapshot,
.public-page-shell .author-other-works {
  display: grid;
  gap: .7rem;
  min-width: 0;
}
.public-page-shell .author-start-with h2,
.public-page-shell .author-corpus-snapshot h2 { margin: 0; }
.public-page-shell .author-corpus-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin: 0;
}
.public-page-shell .author-corpus-facts div { padding-right: .65rem; border-right: 1px solid var(--border); }
.public-page-shell .author-corpus-facts div:last-child { border-right: 0; }
.public-page-shell .author-corpus-facts dt { color: var(--muted); font: .75rem var(--font-ui); text-transform: uppercase; letter-spacing: .06em; }
.public-page-shell .author-corpus-facts dd { margin: .2rem 0 0; font: 1.25rem var(--font-ui); color: var(--text); }
.public-page-shell .author-corpus-snapshot h3 { margin: .4rem 0 0; font: .8rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.public-page-shell .author-keyness-list { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.public-page-shell .author-keyness-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); padding: .35rem 0; }
.public-page-shell .author-keyness-term { font-family: var(--font-body); font-size: 1.05rem; }
.public-page-shell .author-keyness-term a { color: var(--text); }
.public-page-shell .author-other-works summary { cursor: pointer; font: 1.05rem var(--font-ui); color: var(--muted); }
.public-page-shell .author-other-works .author-entity-work-list { margin-top: .7rem; }
.public-page-shell .entity-version-row.is-primary .entity-version-title { font-weight: 700; }
.public-page-shell .author-empty-state,
.public-page-shell .entity-sparse-state,
.public-page-shell .work-empty-state {
  margin: 0;
  color: var(--muted);
  font: 0.95rem/1.5 var(--font-ui);
}
.public-page-shell .entity-reference-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.1rem;
}
.public-page-shell .entity-reference-list a { overflow-wrap: anywhere; }
.public-page-shell .citation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.35rem, 1fr));
  gap: 0.22rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.public-page-shell .citation-grid a {
  display: grid;
  place-items: center;
  min-height: 2.4rem;
  padding: 0.25rem;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 4px;
  text-decoration: none;
  font: 0.84rem var(--font-ui);
}
.public-page-shell .citation-grid a:hover,
.public-page-shell .citation-grid a:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.public-page-shell .entity-outline-named {
  display: grid;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.public-page-shell .entity-outline-named a {
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.public-page-shell .citation-tree { display: grid; gap: 1rem; }
.public-page-shell .citation-group { display: grid; gap: 0.45rem; }
.public-page-shell .work-outline-more { margin-top: 0.55rem; }
.public-page-shell .work-outline-more summary {
  cursor: pointer;
  color: var(--accent);
  font: 0.9rem var(--font-ui);
}
.public-page-shell .entity-disclosure summary {
  cursor: pointer;
  color: var(--text);
  font: 0.95rem var(--font-ui);
}
.public-page-shell .work-key-lemma-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.public-page-shell .work-key-lemma { display: grid; gap: 0.2rem; }
.public-page-shell .work-key-lemma a { font-weight: 700; overflow-wrap: anywhere; }
.public-page-shell .work-key-lemma-meta,
.public-page-shell .entity-secondary-copy { color: var(--muted); font: 0.82rem var(--font-ui); }
.public-page-shell .entity-secondary-copy { margin: 0; }
.public-page-shell .author-statistics,
.public-page-shell .work-statistics { color: var(--muted); font: 0.92rem/1.5 var(--font-ui); }
.public-page-shell .public-not-found {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem 0;
}
.public-page-shell a:focus-visible,
.public-page-shell summary:focus-visible,
.public-page-shell button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.public-page-shell .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.public-page-shell .document-language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font: 0.86rem var(--font-ui);
}
.public-page-shell .entity-secondary h2,
.public-page-shell .author-statistics h2,
.public-page-shell .work-statistics h2 {
  font-size: 1.05rem;
}
@media (max-width: 860px) {
  .public-page-shell .entity-profile-layout { grid-template-columns: 1fr; gap: 1.75rem; }
}
@media (max-width: 640px) {
  .public-page-shell .public-topbar { align-items: flex-start; flex-direction: column; }
  .public-page-shell .author-hero h1,
  .public-page-shell .work-hero h1 { max-width: none; }
  .public-page-shell .work-actions,
  .public-page-shell .profile-actions,
  .public-page-shell .entity-actions { display: grid; grid-template-columns: 1fr; }
  .public-page-shell .work-actions .button-like,
  .public-page-shell .profile-actions .button-like { width: 100%; text-align: center; }
  .public-page-shell .entity-work-row,
  .public-page-shell .entity-version-row { align-items: flex-start; }
  .public-page-shell .entity-work-row { min-height: 3.5rem; padding: .8rem .15rem; }
  .public-page-shell .author-keyness-list li { display: grid; gap: .15rem; }
  .public-page-shell .author-corpus-facts { gap: .35rem; }
  .public-page-shell .author-corpus-facts dd { font-size: 1.1rem; }
  .public-page-shell .author-other-works { margin-top: .25rem; }
}

.public-page-shell [hidden] { display: none !important; }
.public-page-shell .author-discovery-page { display: grid; gap: 1.25rem; }
.public-page-shell .author-discovery-page .author-hero { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--border); border-radius: 20px; background: var(--panel-strong); }
.public-page-shell .author-discovery-page .author-hero h1 { margin: 0; max-width: 18ch; }
.public-page-shell .author-hero-facts { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0; color: var(--muted); font: .88rem var(--font-ui); }
.public-page-shell .author-hero-fact { padding: .25rem .55rem; border: 1px solid var(--border); border-radius: 999px; }
.public-page-shell .author-hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.public-page-shell .author-start-section,
.public-page-shell .author-spanish-section,
.public-page-shell .author-all-works,
.public-page-shell .author-statistics-secondary,
.public-page-shell .author-categories { padding: 1rem 0; }
.public-page-shell .author-discovery-grid,
.public-page-shell .author-all-work-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0; }
.public-page-shell .author-discovery-page .author-work-card { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; gap: .85rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.public-page-shell .author-work-card-copy { min-width: 0; }
.public-page-shell .author-discovery-page .author-work-card h3 { margin: 0; overflow-wrap: anywhere; }
.public-page-shell .author-work-title { color: var(--text); }
.public-page-shell .author-work-original { margin: .25rem 0 0; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.public-page-shell .author-discovery-page .author-work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .7rem 0 0; color: var(--muted); font: .78rem var(--font-ui); }
.public-page-shell .author-work-category { padding-right: .25rem; }
.public-page-shell .language-badge { padding: .2rem .45rem; border: 1px solid var(--border); border-radius: 999px; }
.public-page-shell .language-badge-spanish { color: var(--accent); border-color: var(--accent); }
.public-page-shell .author-read-link { align-self: flex-start; }
.public-page-shell .author-work-filters { display: grid; grid-template-columns: minmax(12rem, 2fr) repeat(3, minmax(8rem, 1fr)); gap: .65rem; align-items: end; margin: .9rem 0 1rem; }
.public-page-shell .author-work-filters label { display: grid; gap: .3rem; color: var(--muted); font: .82rem var(--font-ui); }
.public-page-shell .author-work-filters input,
.public-page-shell .author-work-filters select { width: 100%; min-width: 0; }
.public-page-shell .author-result-count { color: var(--muted); font: .85rem var(--font-ui); }
.public-page-shell .author-discovery-page .author-empty-state { padding: 1rem; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); list-style: none; }
@media (max-width: 760px) {
  .public-page-shell .author-work-filters { grid-template-columns: 1fr 1fr; }
  .public-page-shell .author-work-filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
  .public-page-shell .author-hero-actions { display: grid; grid-template-columns: 1fr; }
  .public-page-shell .author-hero-actions > * { width: 100%; text-align: center; }
  .public-page-shell .author-work-filters { grid-template-columns: 1fr; }
}

/* Shared public-page affordances. */
.page-locale-fallback { margin: 0 0 1rem; }
.faq-filter {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
}
.faq-filter label { font: 0.86rem var(--font-ui); font-weight: 700; }
.faq-filter input { width: 100%; }
.public-footer {
  width: min(100% - 2rem, 1180px);
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--border);
}
.public-footer nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; justify-content: center; font: 0.86rem var(--font-ui); }
.public-footer a, .public-footer span { color: var(--muted); }
.public-footer a:hover, .public-footer a:focus-visible { color: var(--accent); }
.public-footer [aria-current="page"] { color: var(--text); font-weight: 700; }
details:focus-visible, summary:focus-visible, .faq-filter input:focus-visible, .public-footer a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .public-footer { width: min(100% - 1rem, 1180px); }
  .public-footer nav { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

/* --- source: css/statistics.css --- */
/* Statistics is a reading surface: rules, rhythm and type carry hierarchy. */

.statistics-workspace .page-shell.statistics-page {
  width: min(100%, 1480px);
  max-width: none;
  margin-inline: auto;
  display: grid;
  gap: clamp(1.8rem, 3vw, 3rem);
  padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.statistics-page,
.statistics-page * { min-width: 0; }
.statistics-num { font-variant-numeric: tabular-nums lining-nums; }
.statistics-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.statistics-page button:disabled { cursor: not-allowed; }
.statistics-view-tab:disabled { opacity: .52; }
.statistics-language-context { margin: .65rem 0 0; color: var(--muted); font: .82rem var(--font-ui); }
.statistics-capability-notice { margin: 1rem 0; }
/* Work-level keyness is not a supported product surface. The profile is
   injected on <body> by the server so these controls never flash before JS. */
body[data-statistics-profile="work"] #viewTabCompare,
body[data-statistics-profile="work"] #openCompareView,
body[data-statistics-profile="work"] #viewCompare { display: none !important; }
.statistics-term-help { position: relative; display: inline-flex; align-items: center; gap: .28rem; }
.statistics-term-button { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: var(--muted); font: .68rem var(--font-ui); line-height: 1; cursor: help; }
.statistics-term-button:hover, .statistics-term-button:focus-visible { color: var(--accent); }
.statistics-term-tooltip { position: absolute; z-index: 30; top: calc(100% + .45rem); left: 0; width: min(22rem, 72vw); padding: .65rem .75rem; border: 1px solid var(--border); background: var(--panel-strong); color: var(--text); box-shadow: 0 8px 24px rgba(20, 16, 10, .14); font: .78rem/1.45 var(--font-ui); font-weight: 400; text-align: left; }
.statistics-term-tooltip[hidden] { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Corpus context and hero */
.statistics-hero {
  display: grid;
  gap: 0;
  padding: clamp(1.25rem, 3vw, 2.5rem) 0 0;
  border-bottom: 1px solid var(--border);
}
.statistics-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  color: var(--muted);
  font: .76rem var(--font-ui);
}
.statistics-scope-object,
.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .18em;
  cursor: pointer;
}
.statistics-scope-object:hover,
.text-link:hover { color: var(--text); }
.statistics-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-top: clamp(1.4rem, 3vw, 2.4rem);
  padding-bottom: 1.5rem;
}
.statistics-hero-identity { max-width: 68ch; }
.statistics-hero h2,
.statistics-view-heading h2 {
  margin: 0;
  font: clamp(2.15rem, 4.2vw, 4.25rem)/1.02 var(--font-display, Georgia, serif);
  font-weight: 500;
  letter-spacing: -.035em;
}
.statistics-hero h2 { max-width: 24ch; font-size: clamp(1.8rem, 3.2vw, 3rem); }
.statistics-hero-meta {
  max-width: 70ch;
  margin: .65rem 0 0;
  color: var(--muted);
  font: .98rem/1.5 var(--font-ui);
}
.statistics-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem 1rem;
  padding-bottom: .15rem;
}
.statistics-hero-actions .ghost-button {
  color: var(--muted);
  font-size: .86rem;
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .2em;
}
.statistics-hero-actions .ghost-button:first-child {
  color: var(--accent);
  font-weight: 650;
}
.statistics-hero-actions .ghost-button:hover { color: var(--text); }

.statistics-metric-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 1.25rem 0 1.15rem;
  border-top: 1px solid var(--border);
}
.statistics-metric {
  display: grid;
  gap: .3rem;
  padding: .1rem 1.15rem .1rem 1.15rem;
  border-left: 1px solid var(--border);
  background: none;
}
.statistics-metric:first-child { padding-left: 0; border-left: 0; }
.statistics-metric .work-fact-label {
  display: block;
  color: var(--muted);
  font: .67rem var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.statistics-metric .work-fact-value {
  display: block;
  color: var(--text);
  font: clamp(1.25rem, 2vw, 1.7rem) var(--font-display, Georgia, serif);
  line-height: 1.1;
}
.statistics-trust-line {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding: .8rem 0 1rem;
  color: var(--muted);
  font: .8rem var(--font-ui);
}
.statistics-trust-mark { color: var(--accent); font-size: 1.1rem; }
.statistics-method {
  padding: 0 0 1.1rem;
  border-bottom: 1px solid var(--border);
}
.statistics-method summary,
.statistics-advanced summary {
  width: fit-content;
  color: var(--accent);
  font: .78rem var(--font-ui);
  cursor: pointer;
}
.statistics-method summary:hover,
.statistics-advanced summary:hover { color: var(--text); }
.statistics-method-content { margin-top: .75rem; }
.statistics-method[open] { padding-top: .9rem; }
.statistics-method[open] > summary { margin-bottom: .35rem; }
.statistics-method > .statistics-method-content:first-of-type { margin-top: .7rem; }
.statistics-method #coverageCards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}
.statistics-method #coverageCards .statistics-metric { padding: .7rem 1rem .7rem 0; }
.statistics-method #coverageCards .statistics-metric + .statistics-metric { padding-left: 1rem; }

.statistics-scope-form {
  display: grid;
  grid-template-columns: auto minmax(11rem, 1fr) minmax(12rem, 1.6fr) auto;
  gap: .7rem;
  align-items: end;
  margin-top: 0;
  padding: 1rem 0 1.2rem;
  border-top: 1px solid var(--border);
}
.statistics-scope-form label,
.statistics-table-controls label,
.statistics-compare-controls label,
.statistics-table-toolbar > label {
  display: grid;
  gap: .3rem;
  color: var(--muted);
  font: .74rem var(--font-ui);
}
.statistics-scope-form select,
.statistics-scope-form input { min-width: 0; }
.statistics-scope-form [hidden],
.statistics-scope-picker[hidden] { display: none !important; }
.statistics-scope-picker { grid-column: 2 / 4; }
.statistics-change-scope { margin: .05rem 0 1rem; font-size: .8rem; }
.statistics-change-scope.is-active { font-weight: 650; }
.statistics-warnings { margin-top: .25rem; }

/* Local analysis navigation */
.statistics-view-nav {
  display: flex;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.statistics-view-nav::-webkit-scrollbar { display: none; }
.statistics-view-tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: .3rem 0 .9rem;
  background: none;
  color: var(--muted);
  font: .86rem var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
}
.statistics-view-tab:hover,
.statistics-view-tab[aria-selected="true"] { color: var(--text); }
.statistics-view-tab[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 650; }
.statistics-quality-compat { margin-left: auto; opacity: .7; }

/* View rhythm and overview */
.statistics-view { display: grid; gap: clamp(1.8rem, 3vw, 2.8rem); min-width: 0; }
.statistics-profile-intro,
.statistics-view-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
}
.statistics-profile-intro { padding: .2rem 0 1.6rem; border-bottom: 1px solid var(--border); }
.statistics-profile-intro > div { max-width: 70ch; }
.statistics-profile-intro h2,
.statistics-section-heading h3 {
  margin: 0;
  font: clamp(1.35rem, 2vw, 1.75rem) var(--font-display, Georgia, serif);
  font-weight: 500;
}
.statistics-profile-intro p:not(.eyebrow),
.statistics-view-heading p:not(.eyebrow) { max-width: 68ch; margin: .5rem 0 0; color: var(--muted); line-height: 1.55; }
.statistics-profile-intro .button-like { flex: 0 0 auto; }
.eyebrow { margin: 0 0 .45rem; color: var(--muted); font: .68rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }
.statistics-section { min-width: 0; padding-top: .2rem; }
.statistics-section + .statistics-section { border-top: 1px solid var(--border); padding-top: 1.45rem; }
.statistics-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.statistics-section-heading p { margin: 0; color: var(--muted); font: .76rem var(--font-ui); }
.statistics-overview-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(17rem, .85fr); gap: clamp(2rem, 5vw, 5rem); }

/* Language composition: a bar/list, not a large empty card */
.statistics-language-grid { display: grid; gap: .05rem; }
.statistics-language-card {
  display: grid;
  grid-template-columns: 6.5rem minmax(8rem, 1fr) minmax(7rem, 9rem);
  gap: 1rem;
  align-items: center;
  padding: .8rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.statistics-language-card-header { display: contents; }
.statistics-language-card-header .work-fact-label { color: var(--text); font: 1.05rem var(--font-display, Georgia, serif); text-transform: uppercase; }
.statistics-language-card-header strong { text-align: right; font: 1.1rem var(--font-display, Georgia, serif); }
.statistics-inline-bar { height: 6px; overflow: hidden; background: var(--accent-soft); }
.statistics-inline-bar span { display: block; height: 100%; background: var(--accent); }
.statistics-language-card .small-note { grid-column: 3; text-align: right; }

/* Tables and compact controls */
.statistics-preview-table,
.statistics-table-section { min-width: 0; }
.statistics-preview-table table,
.statistics-table-section table,
.statistics-keyness-workspace table { width: 100%; border-collapse: collapse; }
.statistics-page table th { color: var(--muted); font: .67rem var(--font-ui); font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.statistics-page table th,
.statistics-page table td { padding: .62rem .45rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.statistics-page table th:first-child,
.statistics-page table td:first-child { padding-left: 0; }
.statistics-page table th:last-child,
.statistics-page table td:last-child { padding-right: 0; }
.statistics-lemma,
.statistics-lemma-link { font: 1.02rem var(--font-display, Georgia, serif); }
.statistics-lemma-link { border: 0; padding: 0; background: none; color: var(--accent); cursor: pointer; }
.statistics-cell-stack { display: grid; gap: .25rem; }
.statistics-pos-profile,
.statistics-morphology-list { display: grid; gap: .55rem; }
.statistics-pos-row,
.statistics-morphology-row { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(6rem, 1fr) 4.5rem; gap: .8rem; align-items: center; font: .85rem var(--font-ui); }
.statistics-pos-label { font-weight: 600; }
.statistics-pos-bar { height: 7px; overflow: hidden; background: var(--accent-soft); }
.statistics-pos-bar span { display: block; height: 100%; background: var(--accent); }
.statistics-pos-row strong,
.statistics-morphology-row > span:last-child { text-align: right; font-weight: 500; }
.statistics-morphology-group { padding-top: 1rem; border-top: 1px solid var(--border); }
.statistics-morphology-group h3 { margin: 0 0 .65rem; font: 1.05rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-pos-link { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; }
.statistics-segmented { display: inline-flex; gap: .15rem; padding: .15rem; border: 1px solid var(--border); border-radius: .35rem; }
.statistics-segmented button,
.statistics-lang-tab { border: 0; padding: .4rem .7rem; background: transparent; color: var(--muted); font: .76rem var(--font-ui); cursor: pointer; }
.statistics-segmented button.is-active,
.statistics-segmented button[aria-selected="true"],
.statistics-lang-tab.is-active { background: var(--accent-soft); color: var(--text); font-weight: 650; }
.statistics-mode-row,
.statistics-chart-toolbar,
.statistics-table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.statistics-advanced { margin-left: auto; }
.statistics-advanced-body { margin-top: .8rem; padding: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.statistics-table-controls,
.statistics-compare-controls { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.statistics-table-controls input,
.statistics-table-controls select { min-width: 8rem; }
.statistics-export-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font: .76rem var(--font-ui); }

/* Comparison builder */
.statistics-keyness-workspace { display: grid; gap: 1.5rem; }
.statistics-keyness-workspace > .statistics-view-heading { align-items: start; }
.statistics-keyness-workspace > .statistics-view-heading h2 { max-width: 20ch; font-size: clamp(2rem, 3.5vw, 3.35rem); }
.statistics-research-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1fr);
  grid-template-areas: "focus vs reference" "mode mode mode" "swap . submit";
  gap: 1rem 1.35rem;
  align-items: center;
  padding: 1.35rem 0 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.statistics-question-side { display: grid; gap: .45rem; }
.statistics-focus-side { grid-area: focus; }
.statistics-reference-side { grid-area: reference; }
.question-label { display: block; margin-bottom: .05rem; color: var(--muted); font: .68rem var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.question-vs { grid-area: vs; justify-self: center; color: var(--accent); font: 1.15rem var(--font-display, Georgia, serif); font-style: italic; }
.statistics-author-picker { min-height: 3.1rem; }
.statistics-author-picker .author-work-picker,
.statistics-author-picker .author-work-picker-field { gap: .35rem; }
.statistics-author-picker input,
.statistics-author-picker select { width: 100%; }
.statistics-reference-side .small-note { margin: .1rem 0 0; }
.statistics-compare-mode { grid-area: mode; display: flex; flex-wrap: wrap; gap: .9rem 1.25rem; width: 100%; border: 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); padding: 1rem 0 0; margin: .2rem 0 0; color: var(--muted); font: .78rem var(--font-ui); }
.statistics-compare-mode legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.statistics-compare-mode label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.statistics-research-question > #keynessSwapAuthors { grid-area: swap; justify-self: start; }
.statistics-research-question > button[type="submit"] { grid-area: submit; justify-self: end; }
.statistics-compare-controls { grid-column: 1 / -1; }

/* Results context and coverage */
.statistics-result-context { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding: .15rem 0 1.1rem; border-bottom: 1px solid var(--border); }
.statistics-result-context h3 { margin: 0; font: clamp(1.3rem, 2vw, 1.7rem) var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-result-context h3 span { padding: 0 .35em; color: var(--muted); font-size: .8em; font-style: italic; }
.statistics-result-measure { margin: .4rem 0 0; color: var(--muted); font: .82rem var(--font-ui); }
.statistics-result-scope { max-width: 35rem; color: var(--muted); font: .76rem/1.5 var(--font-ui); }
.statistics-result-scope summary { color: var(--accent); cursor: pointer; }
.statistics-result-scope p { margin: .4rem 0 0; }
#keynessWarnings { display: grid; gap: .5rem; }
#keynessWarnings .notice,
#keynessNotice > .notice { padding: .55rem 0; border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: none; color: var(--muted); }
.statistics-compare-coverage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.statistics-coverage-side { display: grid; gap: .25rem; }
.statistics-coverage-side h4 { margin: 0 0 .1rem; font: .98rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-coverage-side.is-unequal h4::after { content: " · uneven coverage"; color: var(--muted); font: .7rem var(--font-ui); }

/* Charts: responsive SVG with a quiet, two-sided scholarly palette */
.statistics-chart-toolbar { margin: .1rem 0 0; }
.statistics-chart-toolbar .small-note { max-width: 60ch; text-align: right; }
.statistics-chart-frame { min-height: 20rem; padding: 1.15rem 0 .75rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.statistics-scatter { display: block; width: 100%; height: auto; }
.statistics-chart-legend { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .5rem; color: var(--muted); font: .72rem var(--font-ui); }
.legend-focus::before,
.legend-reference::before { content: ""; display: inline-block; width: .65rem; height: .65rem; margin-right: .35rem; background: var(--accent); vertical-align: -.03em; }
.legend-reference::before { background: color-mix(in srgb, var(--accent) 42%, var(--muted)); }
.statistics-scatter .axis,
.statistics-scatter .tick { stroke: var(--muted); stroke-width: 1; }
.statistics-scatter .grid-line { stroke: var(--border); stroke-width: 1; }
.statistics-scatter-heading { max-width: 64ch; margin: .35rem 0 1rem; }
.statistics-scatter-heading h3 { margin: 0; font: clamp(1.25rem, 2.2vw, 1.7rem) var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-scatter-heading p { margin: .35rem 0 0; color: var(--muted); font: .84rem/1.5 var(--font-ui); }
.statistics-scatter-shell { width: min(100%, 58rem); margin-inline: auto; }
.statistics-scatter { aspect-ratio: 1 / 1; }
.statistics-scatter .tick-label { fill: var(--muted); font: 16px var(--font-ui); }
.statistics-scatter .equality-line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 10 8; opacity: .8; }
.statistics-scatter .equality-label { fill: var(--muted); font: italic 16px var(--font-display, Georgia, serif); }
.statistics-scatter .point-label { font-size: 15px; }
.statistics-scatter .scatter-axis-label-compact { display: none; }
.statistics-scatter .point-overused { fill: var(--accent); }
.statistics-scatter .point-underused { fill: var(--panel-strong); stroke: var(--accent); stroke-width: 2; }
.statistics-scatter-hit-target { fill: transparent; pointer-events: all; }
.statistics-scatter-hit:hover .point-overused,
.statistics-scatter-hit:focus .point-overused,
.statistics-scatter-hit.is-selected .point-overused { stroke: var(--text); stroke-width: 3; }
.statistics-scatter-hit:hover .point-underused,
.statistics-scatter-hit:focus .point-underused,
.statistics-scatter-hit.is-selected .point-underused { fill: var(--accent-soft); stroke: var(--text); stroke-width: 3; }
.statistics-scatter-inspector { display: grid; gap: .6rem; margin: 0 0 .75rem; padding: .8rem 1rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--panel); font: .8rem/1.45 var(--font-ui); }
.statistics-scatter-inspector[hidden] { display: none; }
.statistics-scatter-inspector-heading { display: flex; align-items: baseline; gap: .65rem; }
.statistics-scatter-inspector-heading strong { font: 1.2rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-scatter-inspector-values { display: grid; gap: .15rem; }
.statistics-scatter-inspector-values b { color: var(--text); font-weight: 600; }
.statistics-scatter-inspector-actions { display: flex; flex-wrap: wrap; gap: .45rem .8rem; align-items: center; }
.statistics-keyness-inspector { display: grid; gap: .6rem; margin: 0 0 .85rem; padding: .8rem 1rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--panel); font: .8rem/1.45 var(--font-ui); }
.statistics-keyness-inspector[hidden] { display: none; }
.statistics-keyness-inspector .statistics-scatter-inspector-heading { display: flex; align-items: baseline; gap: .65rem; }
.statistics-keyness-inspector .statistics-scatter-inspector-heading strong { font: 1.2rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-keyness-inspector .statistics-scatter-inspector-values { display: grid; gap: .15rem; }
.statistics-keyness-inspector .statistics-scatter-inspector-values b { color: var(--text); font-weight: 600; }
.statistics-keyness-inspector .statistics-scatter-inspector-actions { display: flex; flex-wrap: wrap; gap: .45rem .8rem; align-items: center; }
.statistics-diverging { display: grid; gap: .9rem; width: 100%; color: var(--text); }
.statistics-diverging-heading { max-width: 65ch; }
.statistics-diverging-heading h3 { margin: 0; font: clamp(1.25rem, 2.2vw, 1.7rem) var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-diverging-heading p { margin: .35rem 0 0; color: var(--muted); font: .84rem/1.5 var(--font-ui); }
.statistics-diverging-directions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; align-items: center; color: var(--muted); font: .78rem var(--font-ui); }
.statistics-diverging-directions > :first-child { text-align: right; }
.statistics-diverging-directions > :last-child { text-align: left; }
.statistics-diverging-directions strong { color: var(--text); font-weight: 600; }
.statistics-diverging-equality { color: var(--accent); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.statistics-diverging-scale { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; color: var(--muted); font: .7rem var(--font-ui); font-variant-numeric: tabular-nums; }
.statistics-diverging-scale > :first-child { text-align: left; }
.statistics-diverging-scale > :last-child { text-align: right; }
.statistics-diverging-scale strong { color: var(--accent); font-weight: 600; }
.statistics-diverging-desktop { display: grid; gap: .35rem; }
.statistics-diverging-row { display: grid; grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr); gap: .75rem; min-height: 2.05rem; align-items: stretch; }
.statistics-diverging-center-line { display: block; width: 2px; background: var(--accent); opacity: .75; }
.statistics-diverging-cell { min-width: 0; display: flex; align-items: stretch; }
.statistics-diverging-hit { min-width: 0; width: 100%; display: grid; align-items: center; gap: .55rem; padding: .22rem .35rem; border: 1px solid transparent; border-radius: .25rem; background: transparent; color: inherit; font: .82rem var(--font-ui); text-align: inherit; cursor: pointer; }
.statistics-diverging-cell:first-child .statistics-diverging-hit { grid-template-columns: minmax(5rem, .8fr) minmax(3rem, 1.5fr) auto; }
.statistics-diverging-cell:last-child .statistics-diverging-hit { grid-template-columns: auto minmax(3rem, 1.5fr) minmax(5rem, .8fr); }
.statistics-diverging-term { min-width: 0; overflow: hidden; color: var(--text); font: 1rem var(--font-display, Georgia, serif); text-overflow: ellipsis; white-space: nowrap; }
.statistics-diverging-cell:first-child .statistics-diverging-term { text-align: right; }
.statistics-diverging-cell:last-child .statistics-diverging-term { text-align: left; }
.statistics-diverging-bar-track { display: flex; width: 100%; height: 1.15rem; background: var(--accent-soft); }
.statistics-diverging-cell:first-child .statistics-diverging-bar-track { justify-content: flex-end; }
.statistics-diverging-cell:last-child .statistics-diverging-bar-track { justify-content: flex-start; }
.statistics-diverging-bar { display: block; width: var(--diverging-bar-width); background: var(--accent); opacity: .82; transition: opacity .15s ease, filter .15s ease; }
.statistics-diverging-hit.is-reference .statistics-diverging-bar { background: color-mix(in srgb, var(--accent) 48%, var(--muted)); }
.statistics-diverging-value { min-width: 3.2rem; color: var(--muted); font-size: .72rem; text-align: center; }
.statistics-diverging-hit:hover,
.statistics-diverging-hit:focus,
.statistics-diverging-hit.is-selected { border-color: var(--accent); background: var(--panel-strong); }
.statistics-diverging-hit:hover .statistics-diverging-bar,
.statistics-diverging-hit:focus .statistics-diverging-bar,
.statistics-diverging-hit.is-selected .statistics-diverging-bar { opacity: 1; filter: saturate(1.15); }
.statistics-diverging-hit:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.statistics-diverging-mobile { display: none; }
.statistics-diverging-note { margin: 0; color: var(--muted); font: .78rem/1.5 var(--font-ui); }
.statistics-chart-hit { cursor: pointer; }
.statistics-chart-hit:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.statistics-chart-empty { display: grid; place-items: center; min-height: 18rem; color: var(--muted); font: .86rem var(--font-ui); }
.statistics-chart-a11y-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.statistics-keyness-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.statistics-result-cards { display: none; }
.statistics-meter-card { padding: .7rem 0; border-top: 1px solid var(--border); }
.statistics-meter-header { display: flex; justify-content: space-between; gap: 1rem; font: .78rem var(--font-ui); }
.statistics-meter { height: 6px; margin: .55rem 0; background: var(--accent-soft); }
.statistics-meter span { display: block; height: 100%; background: var(--accent); }

/* Evidence drawer: inspector, not a stack of cards */
.statistics-drawer[hidden] { display: none !important; }
.statistics-drawer:not([hidden]) { position: fixed; inset: 0; z-index: 80; }
.statistics-drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 16, 10, .24); }
.statistics-drawer-panel { position: absolute; top: 0; right: 0; width: min(38rem, 94vw); height: 100%; overflow: auto; padding: clamp(1.35rem, 3vw, 2.5rem); background: var(--panel-strong); border-left: 1px solid var(--border); box-shadow: -12px 0 30px rgba(20, 16, 10, .12); }
.statistics-drawer-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.statistics-drawer-header h2 { margin: 0; font: clamp(1.8rem, 4vw, 2.5rem) var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-drawer-header .small-note { margin-top: .35rem; }
.statistics-drawer-body { padding-top: .25rem; }
.statistics-drawer-section { padding: 1.3rem 0; }
.statistics-drawer-section + .statistics-drawer-section { border-top: 1px solid var(--border); }
.statistics-drawer-section h3 { margin: 0 0 .8rem; font: 1.05rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-drawer-finding { margin: 0; color: var(--muted); font: 1rem var(--font-ui); }
.statistics-drawer-finding strong { color: var(--text); }
.statistics-drawer-strength { margin: .35rem 0 1.1rem; color: var(--accent); font: 1rem var(--font-display, Georgia, serif); }
.statistics-drawer-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.statistics-drawer-side { padding-top: .75rem; border-top: 2px solid var(--accent); }
.statistics-drawer-side + .statistics-drawer-side { border-top-color: color-mix(in srgb, var(--accent) 42%, var(--muted)); }
.statistics-drawer-side .eyebrow { margin-bottom: .55rem; color: var(--text); letter-spacing: .08em; }
.statistics-drawer-side dl { display: grid; gap: .55rem; margin: 0; }
.statistics-drawer-side dl div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.statistics-drawer-side dt { color: var(--muted); font: .75rem var(--font-ui); }
.statistics-drawer-side dd { margin: 0; font: 1.05rem var(--font-display, Georgia, serif); }
.statistics-drawer-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.25rem; }
.statistics-drawer-metrics .statistics-metric { padding: .55rem 0; border-left: 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.statistics-drawer-metrics .statistics-metric:first-child { padding-left: 0; }
.statistics-drawer-actions { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; align-items: center; margin-top: 1rem; }
.statistics-evidence-link { color: var(--accent); font: .78rem var(--font-ui); text-decoration: underline; text-underline-offset: .18em; }
.statistics-evidence-link:hover { color: var(--text); }
.statistics-drawer-section code { color: var(--text); font-size: .85em; }
.statistics-drawer-section .small-note { max-width: 62ch; margin-top: .8rem; line-height: 1.5; }

/* Shared local states */
.notice { padding: .6rem .75rem; border-left: 3px solid var(--accent); background: var(--accent-soft); font: .82rem/1.45 var(--font-ui); }
.statistics-pro-badge { display: inline-block; margin-left: .35rem; padding: .1rem .4rem; border: 1px solid var(--border); border-radius: .25rem; color: var(--muted); font: .68rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.statistics-pro-lock .button-like,
.statistics-error-state .button-like { display: inline-block; margin-top: .55rem; }
.statistics-error-state { display: grid; gap: .55rem; padding: 1rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--panel); }
.statistics-error-state h3 { margin: 0; font: 1.2rem var(--font-display, Georgia, serif); font-weight: 500; }
.statistics-error-state p { margin: 0; color: var(--muted); }
.statistics-error-state details { display: grid; gap: .35rem; color: var(--muted); font: .76rem var(--font-ui); }
.statistics-error-state summary { color: var(--text); cursor: pointer; }
.statistics-error-state code { display: block; overflow: auto; padding: .55rem; background: var(--panel-strong); color: var(--text); font: .78rem ui-monospace, SFMono-Regular, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.statistics-error-meta { display: block; }

@media (max-width: 1040px) {
  .statistics-metric-line { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1rem; }
  .statistics-metric:nth-child(4) { padding-left: 0; border-left: 0; }
  .statistics-overview-columns { grid-template-columns: 1fr; gap: 1.7rem; }
  .statistics-scope-form { grid-template-columns: 1fr 1fr; }
  .statistics-scope-picker { grid-column: 1 / -1; }
  .statistics-method #coverageCards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistics-method #coverageCards .statistics-metric:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 820px) {
  .statistics-hero-row,
  .statistics-profile-intro,
  .statistics-view-heading,
  .statistics-result-context { display: block; }
  .statistics-hero-actions { justify-content: flex-start; margin-top: 1.1rem; }
  .statistics-profile-intro .button-like { margin-top: 1rem; }
  .statistics-view-heading .statistics-advanced { margin-top: 1rem; }
  .statistics-research-question { grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr); gap: .8rem; }
  .statistics-chart-toolbar { align-items: start; flex-direction: column; }
  .statistics-chart-toolbar .small-note { text-align: left; }
}
@media (max-width: 640px) {
  .statistics-workspace .page-shell.statistics-page { padding-inline: 1rem; }
  .statistics-hero h2 { max-width: 18ch; }
  .statistics-metric-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistics-metric,
  .statistics-metric:nth-child(4) { padding-left: .8rem; border-left: 1px solid var(--border); }
  .statistics-metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .statistics-scope-form { grid-template-columns: 1fr; }
  .statistics-scope-picker { grid-column: 1; }
  .statistics-quality-compat { margin-left: 0; }
  .statistics-language-card { grid-template-columns: 4.7rem minmax(4rem, 1fr) 5.2rem; gap: .65rem; }
  .statistics-language-card .small-note { display: none; }
  .statistics-table-section table th:nth-child(n + 4),
  .statistics-table-section table td:nth-child(n + 4) { display: none; }
  .statistics-research-question { grid-template-columns: 1fr; grid-template-areas: "focus" "vs" "reference" "mode" "swap" "submit"; align-items: stretch; }
  .question-vs { justify-self: start; padding: .05rem 0; }
  .statistics-research-question > #keynessSwapAuthors,
  .statistics-research-question > button[type="submit"] { justify-self: start; }
  .statistics-compare-coverage { grid-template-columns: 1fr; }
  .statistics-drawer-panel { width: 100%; padding: 1rem; }
  .statistics-drawer-comparison { gap: .8rem; }
  .statistics-drawer-metrics { grid-template-columns: 1fr 1fr; }
  .statistics-method #coverageCards { grid-template-columns: 1fr 1fr; }
  .statistics-method #coverageCards .statistics-metric,
  .statistics-method #coverageCards .statistics-metric + .statistics-metric { padding-left: 0; border-left: 0; }
  .statistics-scatter .tick-label { font-size: 30px; }
  .statistics-scatter .axis-label { font-size: 30px; }
  .statistics-scatter .point-label { font-size: 27px; }
  .statistics-scatter .equality-label { font-size: 28px; }
  .statistics-scatter .scatter-axis-label-wide { display: none; }
  .statistics-scatter .scatter-axis-label-compact { display: inline; }
  .statistics-scatter .point-label[data-scatter-label-priority="secondary"] { display: none; }
  #keynessCards.statistics-result-cards { display: grid; gap: .7rem; }
}
@media (max-width: 640px) {
  .statistics-diverging { gap: .75rem; }
  .statistics-diverging-directions { grid-template-columns: 1fr; gap: .2rem; }
  .statistics-diverging-directions > :first-child,
  .statistics-diverging-directions > :last-child { text-align: left; }
  .statistics-diverging-equality { order: 3; justify-self: start; }
  .statistics-diverging-scale { grid-template-columns: 1fr auto 1fr; gap: .5rem; }
  .statistics-diverging-desktop { display: none; }
  .statistics-diverging-mobile { display: grid; gap: .75rem; }
  .statistics-diverging-mobile section { display: grid; gap: .45rem; }
  .statistics-diverging-mobile h4 { margin: 0; color: var(--muted); font: .82rem var(--font-ui); }
  .statistics-diverging-mobile-list { display: grid; gap: .35rem; }
  .statistics-diverging-mobile .statistics-diverging-hit { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .7rem; padding: .35rem .25rem; }
  .statistics-diverging-mobile .statistics-diverging-term { grid-column: 1; grid-row: 1; text-align: left; }
  .statistics-diverging-mobile .statistics-diverging-bar-track { grid-column: 1; grid-row: 2; height: .9rem; }
  .statistics-diverging-mobile .statistics-diverging-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .statistics-diverging-mobile .is-reference .statistics-diverging-term { grid-column: 1; }
  .statistics-diverging-mobile .is-reference .statistics-diverging-bar-track { grid-column: 1; }
  .statistics-diverging-mobile-divider { display: flex; align-items: center; gap: .6rem; color: var(--accent); font: .68rem var(--font-ui); }
  .statistics-diverging-mobile-divider::before { content: ""; flex: 1; height: 2px; background: var(--accent); opacity: .7; }
  .statistics-diverging-mobile-divider::after { content: ""; flex: 1; height: 2px; background: var(--accent); opacity: .7; }
  .statistics-diverging-mobile-divider span { white-space: nowrap; }
  .statistics-diverging-note { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* --- source: css/manuscript.css --- */
.manuscript-page { max-width: 1180px; }
.manuscript-breadcrumbs { display: flex; gap: .55rem; color: var(--muted-text, #6c645d); font-size: .9rem; margin-bottom: 1.5rem; }
.manuscript-hero { border-bottom: 1px solid var(--border, #d9d1c4); padding-bottom: 1.7rem; margin-bottom: 1.8rem; }
.manuscript-kicker { color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.manuscript-hero h1 { font-family: var(--display-font, Georgia, serif); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin: .35rem 0 .75rem; }
.manuscript-dek { color: var(--muted-text, #6c645d); font-size: 1.05rem; }
.manuscript-id { color: var(--muted-text, #6c645d); font-size: .86rem; }
.manuscript-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .32fr); gap: 2rem; align-items: start; }
.manuscript-section { border-top: 1px solid var(--border, #d9d1c4); padding-top: 1.25rem; margin-top: 1.5rem; }
.manuscript-section h2 { font-family: var(--display-font, Georgia, serif); margin: 0 0 .7rem; }
.manuscript-section-intro, .manuscript-source-line { color: var(--muted-text, #6c645d); font-size: .92rem; }
.manuscript-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.4rem; }
.manuscript-fact dt { color: var(--muted-text, #6c645d); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.manuscript-fact dd { margin: .2rem 0 0; }
.manuscript-coverage-list { padding-left: 1.2rem; }
.manuscript-coverage-list li { margin: .45rem 0; }
.manuscript-read-button { display: inline-block; margin-top: .35rem; }
.manuscript-external ul { list-style: none; padding: 0; margin: 0; }
.manuscript-external li { margin: .45rem 0; }
.manuscript-source-note { color: var(--muted-text, #6c645d); font-size: .9rem; }
.manuscript-witness-chip-host { display: inline-flex; position: relative; }
.manuscript-witness-chip { border: 1px solid var(--border, #d9d1c4); border-radius: 999px; background: var(--surface, #fff); color: inherit; cursor: pointer; padding: .2rem .55rem; }
.manuscript-witness-popover { background: var(--surface, #fff); border: 1px solid var(--border, #d9d1c4); border-radius: .55rem; box-shadow: 0 8px 24px rgba(0,0,0,.16); display: grid; gap: .25rem; left: 0; min-width: 190px; padding: .7rem; position: absolute; top: calc(100% + .35rem); z-index: 20; }
.manuscript-witness-popover a { margin-top: .25rem; }
@media (max-width: 760px) {
  .manuscript-columns, .manuscript-facts { grid-template-columns: 1fr; }
  .manuscript-side-column { order: -1; }
}

/* --- source: css/scholar-mode.css --- */
/* Scholar Mode workspace. Ordinary reader styles stay untouched unless body.scholar-mode. */

.reader-page #scholarModeToggle.is-active {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-color: var(--accent);
}

.reader-page #scholarModeBar[hidden],
.reader-page #scholarTraditionPanel[hidden] { display: none !important; }

.reader-page #scholarModeBar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: end;
  margin: 0.35rem 0 0.75rem;
}

.reader-page .scholar-mode-bar {
  position: relative;
  z-index: 1;
}

.reader-page .scholar-mode-tabs,
.reader-page .scholar-tradition-tabs,
.reader-page .scholar-tray-tabs,
.reader-page .scholar-witness-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

body.scholar-mode #readerIntertextsButton,
body.scholar-mode #chapterIntertextsSectionBody,
body.scholar-mode .reader-intertexts-entry {
  display: none;
}

body.scholar-mode .scholar-locus-mark {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  cursor: pointer;
}

body.scholar-mode .scholar-locus-chip,
body.scholar-mode .scholar-variant-open {
  border: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0 0.1rem;
}

body.scholar-mode .is-active-locus {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.scholar-study-tray {
  grid-column: 1 / -1;
  margin: 0.35rem 0 1rem;
  padding: 0.9rem 1rem 1.1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.scholar-study-tray-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-height: 72vh;
  overflow: auto;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
}

.scholar-study-tray-mobile .scholar-study-tray {
  margin: 0;
  border-radius: 16px 16px 0 0;
}

.scholar-tray-header,
.scholar-reading-head,
.scholar-variant header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.scholar-tray-header h3,
.scholar-variant-open {
  margin: 0.15rem 0 0;
  font-size: 1.02rem;
}

.scholar-tray-tabs button,
.scholar-mode-tabs button,
.scholar-tradition-tabs button {
  border: 1px solid var(--border);
  background: var(--surface, var(--panel));
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.scholar-tray-tabs button.is-active,
.scholar-mode-tabs button.is-active,
.scholar-tradition-tabs button.is-active {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-color: var(--accent);
}

.scholar-readings,
.scholar-reception-bucket ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  gap: 0.85rem;
}

.scholar-reading-label {
  display: inline-flex;
  min-width: 1.4rem;
  font-weight: 700;
}

.scholar-reading-text { font-size: 1.15rem; }

.scholar-reading-witnesses,
.scholar-variant-reading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}

.scholar-witness-table,
.scholar-matrix,
.scholar-relationships,
.scholar-details {
  width: 100%;
  border-collapse: collapse;
}

.scholar-witness-table th,
.scholar-witness-table td,
.scholar-matrix th,
.scholar-matrix td,
.scholar-relationships th,
.scholar-relationships td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.scholar-matrix-wrap { overflow: auto; max-width: 100%; }

.scholar-cell-unavailable { color: var(--muted); }
.scholar-cell-uncertain { font-style: italic; }
.scholar-cell-omission { color: #5b21b6; }

.scholar-details { display: grid; gap: 0.45rem; }
.scholar-details div { display: grid; grid-template-columns: minmax(8rem, 16rem) 1fr; gap: 0.6rem; }
.scholar-details dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.scholar-details dd { margin: 0; }

.scholar-variant {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

#scholarTraditionPanel {
  margin: 0.5rem 0 1.5rem;
}

@media (max-width: 760px) {
  .scholar-details div { grid-template-columns: 1fr; }
}

/* --- source: css/reader-alongside.css --- */
/* Alongside comparison workspace. Ordinary Reader geometry stays unchanged
 * unless body.reader-alongside-mode is set. */

.reader-page #readerAlongsideCanvas[hidden] {
  display: none !important;
}

.reader-page .reader-alongside-canvas {
  width: min(100%, var(--reader-max-width, 72rem));
  margin: 0.35rem auto 1.25rem;
  font-family: var(--font-ui);
}

.reader-page .alongside-workspace-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.reader-page .alongside-heading-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.reader-page .alongside-relation {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.reader-page .alongside-workspace-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.reader-page .alongside-copy-link { color: var(--muted); }
.reader-page .alongside-copy-link span { font-size: 0.82rem; }

.reader-page .alongside-jump {
  display: none;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.reader-page .alongside-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.reader-page .alongside-divider {
  width: 1px;
  background: var(--border);
  margin: 0 0.85rem;
}

.reader-page .alongside-pane {
  min-width: 0;
  max-width: 62ch;
}

.reader-page .alongside-pane-related {
  justify-self: end;
  width: 100%;
}

.reader-page .alongside-pane-header {
  margin-bottom: 0.5rem;
}

.reader-page .alongside-role {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.reader-page .alongside-author {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.25;
}

.reader-page .alongside-work-line,
.reader-page .alongside-meta-line {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.reader-page .alongside-sep {
  margin: 0 0.3rem;
}

.reader-page .alongside-version-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.reader-page .alongside-version-label select,
.reader-page #alongsideTargetVersionSelect {
  max-width: 14rem;
  font: inherit;
}

.reader-page .alongside-open-related {
  margin-top: 0.55rem;
  display: inline-flex;
}

.reader-page .alongside-pane-body {
  font-family: var(--font-reading, var(--font-body, Georgia, serif));
  font-size: 1.08rem;
  line-height: 1.58;
  color: var(--text);
}
.reader-page mark.alongside-evidence-mark {
  background: color-mix(in srgb, var(--accent, #9b7b4f) 22%, transparent);
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent, #9b7b4f) 65%, currentColor);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}
@media (forced-colors: active) {
  .reader-page mark.alongside-evidence-mark { outline: 1px solid CanvasText; background: Highlight; color: HighlightText; }
}

.reader-page .intertext-context-detail { display: grid; gap: 0.55rem; padding: 0.2rem 0.15rem; }
.reader-page .intertext-context-detail h3 { margin: 0.15rem 0 0; }
.reader-page .intertext-context-detail .reader-scholium-cite { margin: 0; }
.reader-page .intertext-detail-relation { margin: 0; color: var(--muted); font-size: 0.9rem; }
.reader-page .intertext-evidence-stack { display: grid; gap: 0.85rem; margin: 0.3rem 0; }
.reader-page .intertext-evidence-stack > div { border-top: 1px solid var(--border); padding-top: 0.55rem; }
.reader-page .intertext-evidence-cite { margin: 0.1rem 0; color: var(--muted); font-size: 0.9rem; }
.reader-page .intertext-evidence-text { margin: 0.2rem 0 0; font-family: var(--font-reading, Georgia, serif); font-size: 1.05rem; }
.reader-page .intertext-detail-actions { display: grid; gap: 0.4rem; margin-top: 0.25rem; }
.reader-page .intertext-detail-actions .intertext-open-alongside { width: 100%; justify-content: center; }
.reader-page .intertext-explore-link { margin-top: 0.1rem; }
.reader-page .intertext-detail-details { border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: 0.3rem; }

.reader-page .alongside-prose,
.reader-page .alongside-fragment,
.reader-page .alongside-line,
.reader-page .alongside-heading {
  margin: 0 0 0.85rem;
}

.reader-page .alongside-heading {
  font-weight: 650;
}

.reader-page .alongside-speaker {
  margin: 0.75rem 0 0.25rem;
  font-weight: 650;
  font-variant: small-caps;
}

.reader-page .alongside-stage {
  margin: 0.35rem 0 0.75rem;
  font-style: italic;
  color: var(--muted);
}

.reader-page .alongside-cite-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.reader-page .alongside-break {
  height: 0.75rem;
}

.reader-page .alongside-error {
  padding: 0.75rem 0;
}

.reader-page .alongside-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.reader-page .alongside-copy-status {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
}

/* Suspend ordinary Reader-local chrome while Alongside owns the canvas. */
body.reader-alongside-mode.reader-page #readerContent {
  display: none !important;
}

body.reader-alongside-mode.reader-page #toggleLeftDrawerButton,
body.reader-alongside-mode.reader-page #mobileReaderMoreMenu,
body.reader-alongside-mode.reader-page #copyScholarlyReferenceButton,
body.reader-alongside-mode.reader-page #readerViewMenu,
body.reader-alongside-mode.reader-page #readerActionsMenu,
body.reader-alongside-mode.reader-page #readerViewPanel,
body.reader-alongside-mode.reader-page #readerPassageNav,
body.reader-alongside-mode.reader-page #readerIntertextsButton,
body.reader-alongside-mode.reader-page #scholarModeToggle,
body.reader-alongside-mode.reader-page #witnessCompareToggle,
body.reader-alongside-mode.reader-page #mobileReaderMore,
body.reader-alongside-mode.reader-page #readerAttributionFooter,
body.reader-alongside-mode #readerAttributionFooter,
body.reader-alongside-mode.reader-page .reader-reopen-context,
body.reader-alongside-mode .reader-reopen-context,
body.reader-alongside-mode.reader-page [data-reader-view-control],
body.reader-alongside-mode.reader-page [data-reader-more-control],
body.reader-alongside-mode.reader-page [data-reader-context-control],
body.reader-alongside-mode.reader-page .reader-local-contents,
body.reader-alongside-mode.reader-page [data-reader-action-proxy],
body.reader-alongside-mode.reader-page [data-reader-nav-proxy] {
  display: none !important;
  pointer-events: none !important;
}

body.reader-alongside-mode.reader-page #prevPassageButton,
body.reader-alongside-mode.reader-page #nextPassageButton,
body.reader-alongside-mode.reader-page #mobilePrevPassageButton,
body.reader-alongside-mode.reader-page #mobileNextPassageButton,
body.reader-alongside-mode.reader-page #mobileNavigatorButton,
body.reader-alongside-mode.reader-page #toggleLeftDrawerInlineButton,
body.reader-alongside-mode.reader-page #readerIntertextsButton,
body.reader-alongside-mode.reader-page .reader-intertexts-entry,
body.reader-alongside-mode.reader-page #versionOneSelect,
body.reader-alongside-mode.reader-page #versionTwoSelect,
body.reader-alongside-mode.reader-page #swapVersionsButton,
body.reader-alongside-mode.reader-page #syncScrollToggle,
body.reader-alongside-mode.reader-page #scholarModeToggle,
body.reader-alongside-mode.reader-page #witnessCompareToggle,
body.reader-alongside-mode.reader-page #scholarModeBar,
body.reader-alongside-mode.reader-page #witnessComparePanel,
body.reader-alongside-mode.reader-page #mobileReadingModeControls,
body.reader-alongside-mode.reader-page #mobilePrimaryVersionSelect,
body.reader-alongside-mode.reader-page #mobileSecondaryVersionSelect {
  display: none !important;
}

body.reader-alongside-mode.reader-page .left-panel:not(.mobile-drawer-open) {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 920px) {
  .reader-page .alongside-panes {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }

  .reader-page .alongside-divider {
    width: auto;
    height: 1px;
    margin: 0;
  }

  .reader-page .alongside-pane,
  .reader-page .alongside-pane-related {
    max-width: none;
    justify-self: stretch;
  }

  .reader-page .alongside-jump {
    display: flex;
  }
}

@media (min-width: 921px) and (max-width: 1100px) {
  .reader-page .alongside-pane {
    max-width: none;
  }
}

@media (min-width: 1400px) {
  .reader-page .alongside-pane-body {
    max-width: 58ch;
  }
}

/* --- source: css/search.css --- */
/* Search keeps the query primary and occasional controls behind one disclosure. */
.search-workspace-main { max-width: 1100px; margin-inline: auto; gap: 1.8rem; }
.search-shell-card, .search-results-card { border: 0; background: transparent; box-shadow: none; padding-inline: 0; }
.search-shell-card > .browser-header { margin-bottom: .6rem; }
.search-shell-card > .browser-header p { margin: 0; font: 1.15rem/1.5 var(--font-display, Georgia, serif); }
.search-form-shell { gap: .85rem; }
.search-workspace-mode-row { display: inline-flex; width: fit-content; gap: .2rem; padding: .25rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--panel); }
.search-mode-pill { border: 0; border-radius: .45rem; padding: .55rem .9rem; color: var(--muted); background: transparent; }
.search-mode-pill.is-active { background: var(--panel-strong); color: var(--accent); box-shadow: 0 1px 3px #00000012; font-weight: 600; }
.search-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: end; padding-top: .4rem; }
.search-query-field { min-width: 0; gap: .4rem; }
.search-query-field > span { font: .8rem var(--font-ui); color: var(--muted); }
.search-query-field input { width: 100%; min-height: 3.5rem; padding: .8rem 1rem; border-radius: .65rem; background: var(--panel-strong); font: 1.2rem var(--font-display, Georgia, serif); }
#searchPageSubmit { min-height: 3.5rem; padding: .8rem 1.8rem; border-radius: .65rem; background: var(--accent); color: var(--accent-contrast); border: 1px solid var(--accent); font-weight: 600; }
#searchPageSubmit:disabled { opacity: .65; }
.search-query-options { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.3rem; }
.search-query-options > label { display: flex; flex-direction: row; align-items: center; gap: .55rem; }
.search-query-options .label-with-info { font: .8rem var(--font-ui); color: var(--muted); }
.search-query-options select { width: auto; min-height: 2.35rem; padding-block: .35rem; font-size: .85rem; }
.search-query-options p { margin: 0; }
.search-active-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.search-active-filters:empty, #searchPageSaveFeedback:empty, #searchPageWarnings:empty, .search-direct-matches:empty { display: none; }
.search-filter-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; overflow-wrap: anywhere; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: 999px; padding: .4rem .65rem; background: var(--accent-soft); color: var(--text); font: .78rem var(--font-ui); cursor: pointer; }
.search-filter-chip span[aria-hidden="true"] { color: var(--accent); font-size: 1rem; line-height: .8; }
.search-refinements { border-block: 1px solid var(--border); }
.search-refinements > summary { display: flex; align-items: center; gap: .65rem; padding: .85rem 0; cursor: pointer; list-style: none; font: .9rem var(--font-ui); }
.search-refinements > summary::-webkit-details-marker { display: none; }
.search-refinements > summary::before { content: '+'; width: 1rem; color: var(--accent); font-size: 1.15rem; }
.search-refinements[open] > summary::before { content: '\2212'; }
.search-filter-count { border-radius: 999px; background: var(--accent-soft); color: var(--accent); min-width: 1.5rem; text-align: center; padding: .15rem .35rem; font-size: .75rem; }
.search-refinements-body { padding: 0 1.1rem 1.1rem; border-radius: .65rem; background: var(--panel); margin-bottom: 1rem; }
.search-shell-card .workspace-section { padding: .85rem 0; }
.search-shell-card .workspace-section-body { padding: .9rem 0 0; }
.search-shell-card .workspace-section-summary-title { font-size: .9rem; }
.search-save-row { display: flex; justify-content: flex-end; margin-top: -.45rem; }
.search-save-row button { font-size: .8rem; padding: .4rem .65rem; }
#searchPageIntertextSection { padding: 1rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--panel); }
.search-century-field { position: relative; display: grid; gap: .4rem; }
.search-picker-toggle { width: 100%; min-height: 2.45rem; padding: .55rem .7rem; text-align: left; border: 1px solid var(--border); border-radius: .35rem; background: var(--panel-strong); color: var(--text); }
.search-picker-menu { position: absolute; z-index: 70; top: calc(100% + .35rem); left: 0; right: 0; max-height: 22rem; overflow: auto; padding: .35rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--panel-strong); box-shadow: var(--shadow); }
.search-picker-option { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .6rem; border: 0; border-radius: .25rem; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.search-picker-option:hover, .search-picker-option.is-selected { background: var(--accent-soft); }
.search-picker-check { width: 1rem; color: var(--accent); font-weight: 700; }
.search-results-card { margin-top: .2rem; }
.search-results-card > .browser-header { position: sticky; top: 0; z-index: 20; padding: .75rem 0; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 95%, transparent); backdrop-filter: blur(8px); }
.search-results-card > .browser-header h3 { font: 1.35rem var(--font-display, Georgia, serif); font-weight: 500; }
.search-results-card .results-list { display: grid; gap: .8rem; padding-top: .9rem; }
.search-results-card .result-item, .search-results-card .search-hit { border-radius: .35rem; border-inline: 0; border-top: 1px solid var(--border); background: transparent; padding-inline: 0; }
.search-results-card .result-item .title, .search-results-card .search-hit .title { font: 1.05rem var(--font-display, Georgia, serif); }
.search-results-card mark { background: var(--search-match-background, #ffe69a); color: #292212; padding: 0 .08em; border-radius: .12em; box-decoration-break: clone; }
.author-work-picker-field { position: relative; }
.author-work-picker-input-row { position: relative; }
.author-work-picker-input { min-width: 0; }
.author-work-picker-clear { padding: .35rem .5rem; font-size: .76rem; }
.author-work-picker-menu { position: absolute; z-index: 80; top: calc(100% + .35rem); left: 0; right: 0; max-width: 38rem; max-height: 22rem; overflow-y: auto; overflow-x: hidden; padding: .35rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--panel-strong); box-shadow: var(--shadow); }
.author-work-picker-option { border-radius: .25rem; padding: .65rem .7rem; }
.author-work-picker-option-title { font: 1rem var(--font-display, Georgia, serif); font-weight: 600; }
.author-work-picker-option-meta { font: .76rem var(--font-ui); }
.author-work-picker.has-selected-author .author-work-picker-input { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); font-weight: 600; }
.search-form-shell .compact-study-controls { justify-content: flex-start; padding-top: .25rem; }
.search-direct-matches { display: grid; gap: .9rem; padding-top: .9rem; }
.refinement-heading { color: var(--muted); font: .72rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.direct-best-match { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.direct-match-eyebrow, .direct-related-label { color: var(--muted); font: .7rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.direct-match-card { display: grid; gap: .35rem; padding: .85rem 0; }
.direct-best-match .direct-match-card { padding-top: .35rem; }
.direct-match-type { color: var(--muted); font: .72rem var(--font-ui); text-transform: uppercase; }
.direct-match-card .title { font: 1.35rem var(--font-display, Georgia, serif); }
.direct-related-works { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; padding-top: .15rem; }
.direct-related-work { color: var(--accent); font: .9rem var(--font-display, Georgia, serif); }
.direct-match-section { display: grid; gap: .45rem; }
.direct-match-grid { display: flex; flex-wrap: wrap; gap: .4rem .55rem; }
.direct-match-grid .direct-match-card { min-width: min(18rem, 100%); flex: 1 1 18rem; border-top: 1px solid var(--border); }
.search-direct-matches + .search-direct-matches { border-top: 1px solid var(--border); }
.search-direct-matches:last-of-type { padding-bottom: .2rem; }
@media (min-width: 920px) {
  .search-shell-card { padding-bottom: .25rem; }
  .search-form-shell { display: grid; grid-template-columns: minmax(0, 1fr); }
  .search-shell-card .workspace-section-body { max-width: 62rem; }
  .search-results-card { padding-top: .15rem; }
}
@media (max-width: 680px) {
  .search-workspace-main { padding-inline: 1rem; }
  .search-query-row { gap: .5rem; }
  #searchPageSubmit { padding-inline: 1rem; }
  .search-query-options { align-items: flex-start; }
  .search-query-options > label { flex-wrap: wrap; }
  .search-query-options p { font-size: .78rem; }
  .search-refinements > summary > .small-note { display: none; }
  .search-refinements-body { padding-inline: .75rem; }
  .search-shell-card > .browser-header p { font-size: 1.05rem; }
  .search-query-field { grid-column: auto; }
  .search-mode-pill { flex: 1; }
  .search-workspace-mode-row { width: 100%; }
  .search-shell-card .filter-grid { grid-template-columns: 1fr; }
  .search-shell-card .span-2 { grid-column: auto; }
  .search-results-card > .browser-header { top: 0; }
  .direct-match-grid { display: grid; grid-template-columns: 1fr; }
  .direct-match-grid .direct-match-card { min-width: 0; }
  .direct-related-works { gap: .35rem .55rem; }
  .author-work-picker-menu { max-width: calc(100vw - 2rem); max-height: min(22rem, 50vh); }
  .search-picker-menu { max-height: 50vh; }
}
@media (prefers-reduced-motion: reduce) { .search-results-card > .browser-header { backdrop-filter: none; } }
/* The last desktop field sits at the viewport edge; keep its help on screen. */
@media (min-width: 681px) {
  #searchNormalizationHelp { left: auto; right: 0; transform: translateY(.2rem); }
  .help-tooltip:hover #searchNormalizationHelp,
  .help-tooltip:focus-within #searchNormalizationHelp { transform: translateY(0); }
}

@media (max-width: 380px) { .search-query-row { grid-template-columns: 1fr; } #searchPageSubmit { width: 100%; } }

.search-evidence-filters { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.search-evidence-filters > summary { cursor: pointer; font: .85rem var(--font-ui); color: var(--muted); }
.search-evidence-filters[open] > .filter-grid { margin-top: .85rem; }
.search-results-card .result-item { display: grid; gap: .45rem; padding-block: 1rem; }
.search-results-card .result-item .meta { font: .8rem/1.5 var(--font-ui); }
.search-results-card .search-result-excerpt { font: 1.12rem/1.65 var(--font-display, Georgia, serif); }
.search-results-card .result-item .study-controls { margin-top: .25rem; }

/* Guided discovery remains a small, optional layer around the existing query. */
.search-examples { display: flex; flex-wrap: wrap; gap: .3rem .55rem; align-items: center; }
.search-examples-label { color: var(--muted); font: .75rem var(--font-ui); margin-right: .2rem; }
.search-examples button { padding: .3rem .55rem; font: .78rem var(--font-ui); border: 1px solid var(--border); border-radius: 999px; }
.search-scope-summary { margin: 0; padding: .65rem .8rem; border-left: 2px solid var(--accent); background: var(--accent-soft); font: .84rem/1.6 var(--font-ui); overflow-wrap: anywhere; }
.search-mode-guide { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.search-mode-guide:empty { display: none; }
.search-mode-guide p { margin: .4rem 0 0; color: var(--muted); font: .85rem/1.5 var(--font-ui); }
.search-mode-guide button { font: .8rem var(--font-ui); }
.search-experience:has(> .search-scope-summary[hidden]):has(> .search-mode-guide:empty):not(:has(> details)) { display: none; }
.search-experience > .workspace-section { border: 1px solid var(--border); border-radius: .65rem; background: var(--panel); padding: 1rem; margin-top: .65rem; }
.search-experience .workspace-section-body > p[data-i18n="search.note.morphology_entities"] { display: none; }
.search-edition-choice { max-width: 34rem; margin: 1rem 0; }
.search-edition-choice select { max-width: 100%; }
.search-apply-filters { background: var(--accent); color: var(--accent-contrast); margin-top: .85rem; }
.search-research-actions, .search-recovery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font: .82rem var(--font-ui); }
.search-research-actions { justify-content: flex-end; }
.search-recovery { padding: 1rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--panel); }
.search-recovery p { margin: 0 0 .65rem; font: .9rem/1.5 var(--font-ui); }
.search-recovery-actions button { border: 1px solid var(--border); }
.search-recovery p:last-child { margin-bottom: 0; }
.search-loaded-details { border-block: 1px solid var(--border); padding: .8rem 0; }
.search-loaded-details > summary { cursor: pointer; font: .85rem var(--font-ui); }
.search-refinement-group { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-top: .5rem; }
.search-refinement-group h4 { margin: 0; font: 600 .8rem var(--font-ui); }
.search-refinement-group button { border: 1px solid var(--border); padding: .35rem .55rem; font: .78rem var(--font-ui); }
.search-result-reference { color: var(--muted); font: .8rem/1.5 var(--font-ui); overflow-wrap: anywhere; }
.search-results-card .result-item .title { font-size: 1.2rem; }
.search-results-card .result-item details code { overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .search-examples-label { flex-basis: 100%; }
  .search-examples button { min-height: 2.3rem; }
  .search-scope-summary { font-size: .8rem; }
  .search-research-actions { justify-content: flex-start; }
}

/* --- source: css/reference.css --- */
.nav-more-menu { position: relative; }
.nav-more-menu > summary { list-style: none; cursor: pointer; }
.nav-more-menu > summary::-webkit-details-marker { display: none; }
.nav-more-panel { position: absolute; z-index: 70; top: calc(100% + 0.35rem); right: 0; min-width: 12rem; display: grid; gap: 0.15rem; padding: 0.42rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-strong); box-shadow: var(--shadow); }
.nav-more-menu:not([open]) .nav-more-panel { display: none; }
.nav-more-panel .nav-link { display: block; white-space: nowrap; }
.reference-subnav {
  width: 100%;
  margin: 0 auto 1.1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}
.reference-subnav-inner {
  width: min(100%, 1180px);
  min-width: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0;
}
.reference-subnav-home,
.reference-subnav-link,
.reference-language-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
}
.reference-subnav-home {
  flex: 0 0 auto;
  padding: 0 0.8rem 0 0;
  border-right: 1px solid var(--border);
  color: var(--text);
  font: 700 0.76rem/1.2 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.reference-subnav-home:hover,
.reference-subnav-home.is-active,
.reference-subnav-link:hover,
.reference-subnav-link[aria-current="page"] {
  color: var(--accent);
}
.reference-subnav-home.is-active { font-weight: 800; }
.reference-subnav-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.reference-subnav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 2.75rem;
  padding: 0 0.2rem;
  border-radius: 10px;
}
.reference-subnav-item.is-active { background: var(--accent-soft); }
.reference-subnav-link {
  padding: 0.45rem 0.65rem;
  font: 600 0.92rem/1.2 var(--font-ui);
  white-space: nowrap;
}
.reference-subnav-item.is-active .reference-subnav-link { color: var(--accent); }
.reference-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding-right: 0.35rem;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font: 0.76rem/1.2 var(--font-ui);
  white-space: nowrap;
}
.reference-language-link {
  min-width: 2.55rem;
  justify-content: center;
  padding: 0.35rem 0.35rem;
  border-radius: 7px;
}
.reference-language-link:hover,
.reference-language-link.is-current,
.reference-language-link[aria-current="page"] {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  color: var(--accent);
}
.reference-language-divider { color: var(--border-strong, var(--border)); }
.reference-page, .reference-hero { display: grid; gap: 1rem; max-width: 1180px; margin: 0 auto; }
.reference-hero { padding: 1.2rem 0 1.6rem; }
.reference-hero h1, .reference-page h1 { max-width: 24ch; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.1; }
.reference-lede { max-width: 72ch; color: var(--muted); font-size: 1.04rem; line-height: 1.6; }
.reference-kicker { color: var(--muted); font: 0.72rem/1.2 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; }
.reference-status { font: 0.9rem var(--font-ui); }
.reference-breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.45rem; color: var(--muted); font: 0.84rem var(--font-ui); }
.reference-breadcrumbs a { color: inherit; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.85rem; }
.reference-card { position: relative; display: grid; gap: 0.65rem; min-height: 10.5rem; padding: 1rem; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.reference-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.reference-card h2 { font-size: 1.3rem; }
.reference-card p { color: var(--muted); line-height: 1.45; }
.reference-card-arrow { position: absolute; right: 1rem; bottom: 0.9rem; color: var(--accent); font-size: 1.2rem; }
.reference-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: auto; }
.reference-card-link { min-height: 2.75rem; }
.reference-note { max-width: 78ch; line-height: 1.55; }
.reference-note p { color: var(--muted); }
.reference-search { display: grid; gap: 0.35rem; max-width: 38rem; }
.reference-search > div { display: flex; gap: 0.45rem; }
.reference-search input { flex: 1; min-width: 0; }
.reference-alphabet { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.reference-letter { display: inline-grid; place-items: center; min-width: 2rem; min-height: 2rem; padding: 0.25rem 0.42rem; border: 1px solid var(--border); border-radius: 9px; color: inherit; text-decoration: none; font: 0.9rem var(--font-ui); }
.reference-letter:hover, .reference-letter.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.reference-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.reference-table { min-width: 42rem; }
.reference-table th[scope="row"] { font-size: 1rem; }
.reference-lemma { font-weight: 700; }
.reference-pagination { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.reference-pattern-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.65rem; }
.reference-pattern { display: grid; gap: 0.25rem; padding: 0.85rem 0.95rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: inherit; text-decoration: none; }
.reference-pattern:hover { border-color: var(--accent); background: var(--accent-soft); }
.reference-paradigm-list { display: grid; gap: 1rem; }
.reference-paradigm { display: grid; gap: 0.75rem; }
.reference-paradigm-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.reference-paradigm-heading h2 { font-size: 1.5rem; }
.reference-source { color: var(--muted); font: 0.82rem/1.45 var(--font-ui); }
.reference-link-list { display: grid; gap: 0.6rem; margin: 0; padding-left: 1.2rem; }
@media (max-width: 700px) {
  .reference-subnav { margin-bottom: 0.85rem; overflow: hidden; }
  .reference-subnav-inner { display: grid; gap: 0.2rem; padding: 0.35rem 0.2rem 0.25rem; }
  .reference-subnav-home { border-right: 0; padding: 0 0.45rem; min-height: 2.75rem; }
  .reference-subnav-tools { width: 100%; padding: 0 0.15rem 0.15rem; }
  .reference-subnav-item { min-height: 2.75rem; }
  .reference-page, .reference-hero { padding-left: 0.2rem; padding-right: 0.2rem; }
  .reference-search > div { align-items: stretch; flex-direction: column; }
  .nav-more-panel { position: static; min-width: 0; box-shadow: none; margin-top: 0.2rem; }
}

/* Jerome grammar surfaces: canonical models first, source evidence second. */
.grammar-landing { gap: 2rem; }
.grammar-hero { display: grid; gap: .8rem; max-width: 58rem; padding: 1.25rem 0 1rem; }
.grammar-hero h1, .grammar-pattern-header h1 { max-width: 19ch; font-size: clamp(2.35rem, 6vw, 4.35rem); letter-spacing: -.035em; }
.grammar-lookup { display: grid; gap: .4rem; max-width: 38rem; margin-top: .45rem; }
.grammar-lookup > div { display: flex; gap: .5rem; }
.grammar-lookup input { flex: 1; min-width: 0; }
.grammar-jump-nav { display: flex; flex-wrap: wrap; gap: .35rem .75rem; max-width: 62rem; padding-top: .35rem; font: 600 .82rem var(--font-ui); }
.grammar-jump-nav a { color: var(--accent); text-decoration: none; }
.grammar-jump-nav a:hover, .grammar-jump-nav a:focus-visible { text-decoration: underline; text-underline-offset: .18em; }
.grammar-discovery-sections { display: grid; gap: 2rem; }
.grammar-discovery-section { display: grid; gap: .7rem; scroll-margin-top: 1.25rem; }
.grammar-discovery-section h2 { margin: 0; font-size: 1.35rem; }
.grammar-discovery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .7rem; }
.grammar-discovery-card { display: grid; grid-template-columns: auto 1fr; gap: .35rem .65rem; align-content: start; min-height: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--panel) 88%, var(--accent-soft)); color: inherit; text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.grammar-discovery-card:hover, .grammar-discovery-card:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.grammar-discovery-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.grammar-card-sequence { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent); color: var(--panel); font: 700 .86rem var(--font-ui); }
.grammar-card-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem; min-width: 0; }
.grammar-discovery-card h3 { margin: 0; font-size: 1.15rem; }
.grammar-card-stage { color: var(--muted); font: 700 .68rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.grammar-card-form, .grammar-card-hint, .grammar-card-count { grid-column: 1 / -1; }
.grammar-card-form { font-family: var(--font-display, Georgia, serif); font-size: 1.25rem; font-weight: 600; }
.grammar-card-hint { color: var(--muted); line-height: 1.45; }
.grammar-card-count { color: var(--muted); font: .76rem var(--font-ui); }
.grammar-method-note, .grammar-provenance, .grammar-evidence, .grammar-advanced { max-width: 62rem; padding: 1.15rem; border-top: 1px solid var(--border); }
.grammar-method-note h2, .grammar-provenance h2, .grammar-evidence h2, .grammar-advanced summary { margin: 0 0 .45rem; font-size: 1.1rem; }
.grammar-pattern-page { gap: 1.25rem; }
.grammar-pattern-header { display: grid; gap: .55rem; padding: 1.2rem 0 .5rem; }
.grammar-pattern-header h1 { margin: 0; }
.grammar-recognition { max-width: 55rem; padding: .8rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-soft); line-height: 1.5; }
.grammar-register { color: var(--muted); font: .8rem/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .08em; }
.grammar-pattern-choices { display: flex; gap: .55rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: thin; scroll-snap-type: x proximity; }
.grammar-pattern-choice { display: grid; flex: 0 0 11rem; min-height: 4.7rem; gap: .25rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; scroll-snap-align: start; }
.grammar-pattern-choice span { color: var(--muted); font: .78rem/1.3 var(--font-ui); }
.grammar-pattern-choice:hover, .grammar-pattern-choice:focus-visible, .grammar-pattern-choice.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.canonical-paradigm { display: grid; gap: 1.1rem; max-width: 62rem; padding: 1.4rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.canonical-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.canonical-heading h2 { margin: 0; font-family: var(--font-display, Georgia, serif); font-size: clamp(1.65rem, 4vw, 2.55rem); }
.canonical-heading h2 a { color: inherit; }
.canonical-badge { color: var(--accent); font: .72rem/1.2 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }
.grammar-principal-parts { margin: 0; color: var(--muted); font-family: var(--font-display, Georgia, serif); font-size: 1.02rem; }
.grammar-principal-parts strong { color: var(--text); font: 600 .78rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.grammar-view-toggle { display: flex; gap: .35rem; }
.grammar-view-toggle button { min-height: 2.3rem; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: inherit; cursor: pointer; font: 600 .8rem var(--font-ui); }
.grammar-view-toggle button:hover, .grammar-view-toggle button:focus-visible, .grammar-view-toggle button.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.grammar-grid-wrap { overflow-x: auto; }
.grammar-grid { width: min(100%, 48rem); border-collapse: collapse; font-family: var(--font-display, Georgia, serif); }
.grammar-grid th, .grammar-grid td { padding: .62rem .7rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent); text-align: start; }
.grammar-grid thead th { color: var(--muted); font: 600 .76rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.grammar-grid tbody th { width: 8rem; color: var(--muted); font: 600 .8rem var(--font-ui); }
.grammar-grid td { font-size: 1.12rem; }
.grammar-grid td[data-form-cell] { color: var(--text); font-weight: 600; }
.grammar-form-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.grammar-form { padding: .45rem .65rem; border-bottom: 2px solid var(--accent); font-family: var(--font-display, Georgia, serif); font-size: 1.15rem; }
.grammar-verb-matrices { display: grid; gap: .65rem; }
.grammar-verb-mobile { display: none; }
.grammar-verb-card { border-top: 1px solid var(--border); }
.grammar-verb-card summary, .grammar-verb-mobile-mood summary { padding: .75rem 0; color: var(--accent); cursor: pointer; font: 700 .85rem var(--font-ui); }
.grammar-verb-mobile-mood summary { list-style: none; gap: .55rem; }
.grammar-verb-mobile-mood summary::-webkit-details-marker { display: none; }
.grammar-mobile-mood-label { display: flex; align-items: center; gap: .55rem; width: 100%; }
.grammar-mobile-mood-label::before { content: '›'; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 1px solid var(--border); border-radius: 50%; font-size: 1.15rem; line-height: 1; transition: transform .15s ease; }
.grammar-verb-mobile-mood[open] .grammar-mobile-mood-label::before { transform: rotate(90deg); }
.grammar-mobile-mood-label::after { content: attr(data-form-count) ' forms'; margin-inline-start: auto; color: var(--muted); font-weight: 600; font-size: .75rem; }
.grammar-verb-card summary:focus-visible, .grammar-verb-mobile-mood summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.grammar-verb-grid { width: 100%; }
.grammar-verb-grid td { white-space: nowrap; }
.grammar-verb-nonfinite { display: grid; gap: .45rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.grammar-verb-nonfinite h3 { margin: 0; color: var(--accent); font: 700 .85rem var(--font-ui); }
.grammar-verb-nonfinite dl { display: grid; gap: .45rem; margin: 0; }
.grammar-verb-nonfinite dl > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .7rem; align-items: baseline; }
.grammar-verb-nonfinite dt { color: var(--muted); font: 600 .8rem var(--font-ui); }
.grammar-verb-nonfinite dd { margin: 0; font-family: var(--font-display, Georgia, serif); font-size: 1.12rem; }
.grammar-evidence { display: grid; gap: .45rem; }
.grammar-evidence-count { margin: 0; color: var(--muted); font: .8rem var(--font-ui); }
.grammar-example-list { display: grid; gap: .5rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.grammar-example-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
.grammar-example-list a { font-family: var(--font-display, Georgia, serif); font-size: 1.1rem; font-weight: 600; }
.grammar-advanced { margin-top: .25rem; }
.grammar-advanced summary { cursor: pointer; color: var(--accent); }
.grammar-provenance { color: var(--muted); line-height: 1.55; }
.grammar-provenance h2 { color: var(--text); }
.grammar-glossary { display: grid; gap: .6rem; max-width: 62rem; padding-top: .5rem; }
.grammar-glossary h2 { margin: 0; font-size: 1.05rem; }
.grammar-glossary-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.grammar-help { min-width: 9rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.grammar-help summary { color: var(--accent); cursor: pointer; font: 600 .8rem var(--font-ui); }
.grammar-help span { display: block; padding-top: .35rem; color: var(--muted); font-size: .84rem; line-height: 1.4; }
@media (max-width: 700px) {
  .grammar-hero h1, .grammar-pattern-header h1 { font-size: clamp(2.2rem, 13vw, 3.4rem); }
  .grammar-lookup > div { flex-direction: column; }
  .grammar-jump-nav { flex-wrap: nowrap; overflow-x: auto; padding: .35rem 0 .55rem; scrollbar-width: thin; white-space: nowrap; }
  .grammar-discovery-grid { grid-template-columns: 1fr; }
  .grammar-discovery-card { padding: .85rem; }
  .grammar-pattern-choice { flex-basis: min(11rem, 78vw); }
  .canonical-paradigm { padding: 1rem .75rem; border-radius: 15px; }
  .canonical-heading { display: grid; gap: .5rem; }
  .grammar-grid { width: 100%; table-layout: fixed; }
  .grammar-grid th, .grammar-grid td { padding: .48rem .35rem; }
  .grammar-grid tbody th { width: 4.4rem; }
  .grammar-grid td { font-size: 1rem; overflow-wrap: anywhere; }
  .grammar-verb-desktop { display: none; }
  .grammar-verb-mobile { display: grid; gap: 1rem; min-width: 0; }
  .grammar-verb-mobile-group { min-width: 0; border-top: 1px solid var(--border); padding-top: .8rem; }
  .grammar-verb-mobile-group h3 { margin: 0 0 .45rem; color: var(--text); font: 700 1rem var(--font-ui); }
  .grammar-verb-mobile-mood { min-width: 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
  .grammar-verb-mobile-mood summary { min-height: 2.75rem; display: flex; align-items: center; padding: .65rem 0; }
  .grammar-verb-mobile-rows { display: grid; gap: 0; margin: 0 0 .45rem; min-width: 0; }
  .grammar-verb-mobile-row { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: .65rem; align-items: baseline; padding: .28rem 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
  .grammar-verb-mobile-row dt { color: var(--muted); font: 600 .78rem var(--font-ui); }
  .grammar-verb-mobile-row dd { min-width: 0; margin: 0; color: var(--text); font-family: var(--font-display, Georgia, serif); font-size: 1.12rem; font-weight: 600; overflow-wrap: anywhere; }
  .grammar-verb-nonfinite dl > div { grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr); }
  .grammar-example-list li { align-items: baseline; }
}
.grammar-lookup-results { margin: 1.5rem 0 2rem; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
.grammar-lookup-results ul { display: grid; gap: .65rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.grammar-lookup-results li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.grammar-lookup-form { min-width: 5rem; font-weight: 700; }
