:root {
  --paper: #ece6d8;
  --paper-strong: #f8f3e8;
  --paper-panel: #eee7d8;
  --ink: #171918;
  --muted: #665f54;
  --line: #c9bda8;
  --line-strong: #9f927d;
  --rail: #101513;
  --rail-soft: #151b18;
  --rail-ink: #eee7d8;
  --olive: #374d35;
  --rust: #8f2f1d;
  --rust-bright: #b6472a;
  --green: #314a33;
  --steel: #58666f;
  --link: #8f2f1d;
  --shadow: 0 16px 36px rgba(18, 20, 18, 0.16);
  --radius: 2px;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-width: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 25% 10%, rgba(143, 47, 29, 0.05), transparent 35%),
    linear-gradient(90deg, rgba(43, 32, 20, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(43, 32, 20, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px, 36px 36px, auto;
}

a {
  color: var(--rust);
  text-decoration: none;
}

a:hover {
  color: var(--rust);
}

button,
input,
textarea {
  font: inherit;
}

button,
input,
textarea,
.top-actions,
.nav-section,
.infobox,
.tabs,
.kicker,
.metadata,
.stat,
.tag,
.term,
.status,
.wiki-table,
.mini-stats {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 320px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  min-height: 70px;
  border-bottom: 1px solid rgba(238, 231, 216, 0.15);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03), transparent),
    #101412;
  color: var(--rail-ink);
  box-shadow: 0 7px 24px rgba(11, 13, 12, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--rail-ink);
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(238, 231, 216, 0.22);
  border-radius: 4px;
  background: #05090b;
  box-shadow: 0 0 0 1px rgba(255, 79, 18, 0.08);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: block;
  min-width: 0;
}

.brand strong,
.brand em {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 29px;
  font-stretch: condensed;
  letter-spacing: 1px;
}

.brand em {
  max-width: 238px;
  margin-top: 0;
  color: #f5ecde;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
  text-transform: none;
}

@supports not (text-wrap: balance) {
  .brand em {
    text-wrap: normal;
  }
}

.search {
  position: relative;
  display: block;
  align-items: center;
  min-width: 0;
}

.search span {
  display: none;
  color: #cbd1c8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(238, 231, 216, 0.22);
  border-radius: 7px;
  padding: 0 42px 0 16px;
  color: #fffdf8;
  background: rgba(7, 9, 8, 0.62);
  outline: none;
}

.search input:focus {
  border-color: #d2c5a1;
  box-shadow: 0 0 0 3px rgba(210, 197, 161, 0.17);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  align-self: stretch;
}

.top-actions a,
.button {
  display: inline-flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid rgba(238, 231, 216, 0.11);
  border-radius: 0;
  padding: 0 17px;
  color: var(--rail-ink);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions a:hover {
  color: #fff;
  background: rgba(143, 47, 29, 0.24);
}

.button {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--paper-strong);
}

.workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 388px;
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 70px);
  overflow: visible;
}

.workspace:has(.membership-matrix-section) {
  grid-template-columns: 272px minmax(0, 1fr);
}

.workspace:has(.membership-matrix-section) .right-rail {
  display: none;
}

.workspace:has(.membership-matrix-section) .article {
  padding-right: 32px;
  padding-left: 32px;
}

.workspace:has(.character-network-page) {
  grid-template-columns: 272px minmax(0, 1fr);
}

.workspace:has(.character-network-page) .right-rail {
  display: none;
}

.workspace:has(.character-network-page) .article {
  padding-right: clamp(24px, 3vw, 44px);
  padding-left: clamp(24px, 3vw, 44px);
}

.workspace:has(.visual-page) {
  grid-template-columns: 272px minmax(0, 1fr);
}

.workspace:has(.visual-page) .right-rail {
  display: none;
}

.workspace:has(.visual-page) .article {
  padding-right: clamp(24px, 3vw, 44px);
  padding-left: clamp(24px, 3vw, 44px);
}

.left-rail {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  overflow-y: auto;
  border-right: 1px solid rgba(238, 231, 216, 0.12);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.08)),
    #111816;
  color: var(--rail-ink);
  padding: 16px 0 28px;
}

.right-rail {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02)),
    rgba(231, 224, 209, 0.82);
  padding: 0;
}

.nav-section {
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(238, 231, 216, 0.12);
}

.nav-section h2,
.infobox h2 {
  margin: 0 0 12px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-section h2 {
  padding: 0 18px;
  color: #a79f90;
}

.nav-section a {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-left: 4px solid transparent;
  padding: 6px 18px;
  color: #e1dacb;
  font-size: 14px;
  line-height: 1.25;
}

.nav-section a:hover {
  border-color: var(--rust-bright);
  color: #ffffff;
  background: rgba(143, 47, 29, 0.28);
}

.nav-section a.nav-primary {
  border-color: var(--rust-bright);
  background: #9b351f;
  color: #fff8eb;
  font-weight: 800;
}

.article {
  min-width: 0;
  min-height: calc(100vh - 70px);
  overflow: visible;
  padding: 28px clamp(30px, 4vw, 60px) 72px;
  background:
    radial-gradient(circle at 15% 0, rgba(143, 47, 29, 0.035), transparent 30%),
    linear-gradient(180deg, rgba(248, 243, 232, 0.96), rgba(239, 232, 218, 0.96)),
    var(--paper-strong);
}

.article-header {
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--olive);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: clamp(44px, 5.6vw, 72px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  color: var(--rust);
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

p {
  line-height: 1.55;
}

.lede {
  max-width: 920px;
  margin: 13px 0 0;
  color: #383631;
  font-size: 17px;
  font-style: italic;
}

.lede.small {
  max-width: 940px;
  margin: 0 0 18px;
  font-size: 15px;
}

.notice {
  border: 1px solid #d2b59a;
  border-left: 5px solid var(--rust);
  border-radius: var(--radius);
  margin: 0 0 22px;
  padding: 13px 15px;
  background: rgba(253, 245, 230, 0.78);
  color: #3e342d;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(18, 24, 27, 0.78);
  border-radius: 8px;
  margin: 0 0 22px;
  background: #03080c;
  box-shadow: 0 18px 42px rgba(7, 9, 10, 0.28);
}

.home-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.home-hero-hotspot {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 6px;
  outline: 0;
}

.home-hero-hotspot:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 79, 18, 0.58);
}

.home-hero-hotspot:hover {
  background: rgba(255, 79, 18, 0.08);
}

.home-hero-books {
  left: 6.5%;
  top: 71%;
  width: 15.8%;
  height: 12.4%;
}

.home-hero-characters {
  left: 23.7%;
  top: 71%;
  width: 20.4%;
  height: 12.4%;
}

.home-hero-timeline {
  left: 45.4%;
  top: 71%;
  width: 17.7%;
  height: 12.4%;
}

.wiki-section {
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.wiki-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading a {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.stat {
  min-width: 0;
  border: 0;
  border-top: 1px solid rgba(159, 146, 125, 0.5);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
}

.stat span,
.stat strong {
  display: block;
}

.stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: rgba(249, 244, 232, 0.68);
  box-shadow: none;
}

.wiki-table th,
.wiki-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(159, 146, 125, 0.42);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.3;
}

.wiki-table th {
  color: #242724;
  background: rgba(218, 209, 191, 0.9);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wiki-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.wiki-table tr.is-focused td {
  background: #f7edd9;
  box-shadow: inset 4px 0 0 var(--accent);
}

.wiki-table code {
  font-size: 12px;
  word-break: break-all;
}

.tag,
.term {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #cfc5b1;
  border-radius: 999px;
  margin: 0 5px 6px 0;
  padding: 3px 8px;
  color: #33413b;
  background: rgba(255, 253, 248, 0.78);
  font-size: 12px;
  font-weight: 650;
}

.term {
  border-color: #c5d1ca;
  color: #345b55;
  background: #edf4f0;
}

.link-tag:hover {
  border-color: var(--rust);
  color: var(--rust);
}

.character-tag {
  border-color: #b9c7d0;
  color: #284f63;
  background: #eef5f7;
}

.entity-cloud {
  max-width: 980px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.character-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.82);
}

.character-card h3 {
  margin: 0 0 7px;
  font-size: 17px;
}

.character-card p {
  margin: 0 0 11px;
  color: #4e5c56;
  font-size: 13px;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-stats span {
  border: 1px solid #d2c8b7;
  border-radius: 999px;
  padding: 4px 8px;
  color: #48564f;
  background: #f8f4ea;
  font-size: 12px;
  font-weight: 750;
}

.arc-list {
  display: grid;
  gap: 14px;
}

.arc-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: rgba(255, 253, 248, 0.82);
}

.arc-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.arc-card p {
  margin: 0;
  color: #4e5c56;
}

.curated-arc-list {
  display: grid;
  gap: 16px;
}

.story-arc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 253, 248, 0.9);
}

.story-arc-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.story-arc-card p {
  margin: 0;
  color: #3f4d47;
  line-height: 1.62;
}

.story-arc-card p + p {
  margin-top: 11px;
}

.turning-point-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #33413b;
  line-height: 1.5;
}

.turning-point-list li + li {
  margin-top: 6px;
}

.metadata.compact {
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 7px 12px;
}

.overview-profile {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.overview-profile dt,
.overview-profile dd {
  border-top: 1px solid rgba(203, 194, 179, 0.72);
  margin: 0;
  padding: 9px 10px;
  line-height: 1.45;
}

.overview-profile dt:nth-of-type(1),
.overview-profile dd:nth-of-type(1) {
  border-top: 0;
}

.overview-profile dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-profile dd {
  color: #29352f;
}

.overview-section-list {
  display: grid;
  gap: 24px;
}

.overview-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.overview-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.overview-section h2 {
  margin-bottom: 10px;
}

.overview-section p {
  margin: 0;
  color: #2e302c;
}

.overview-section p + p {
  margin-top: 11px;
}

.relationship-list {
  display: grid;
  gap: 18px;
}

.relationship-card {
  display: block;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 16px 0 0;
  background: transparent;
}

.relationship-card h3 {
  margin: 0 0 9px;
  color: var(--rust);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 25px;
  line-height: 1.1;
}

.relationship-card h4 {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.relationship-card p {
  margin: 0;
  color: #2e302c;
}

.relationship-card p + p {
  margin-top: 12px;
}

.fact-list {
  margin: 13px 0 0;
  padding-left: 20px;
  color: #33413b;
  line-height: 1.5;
}

.fact-list li + li {
  margin-top: 6px;
}

.source-chip {
  display: block;
  border: 1px solid #d4cab7;
  border-radius: 2px;
  margin-bottom: 8px;
  padding: 8px 9px;
  background: #f8f4ea;
  color: #31413b;
  font-size: 12px;
}

.source-chip span,
.source-chip em {
  display: block;
}

.source-chip em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
}

.review-candidates {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.7);
}

.review-candidates summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #3f4b46;
  font-weight: 800;
}

.review-candidates .wiki-table {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: none;
}

.dossier {
  display: grid;
  gap: 18px;
}

.dossier-grid,
.web-edge-list {
  display: grid;
  gap: 16px;
}

.source-gap-list {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.dossier-section,
.source-gap,
.web-edge-card {
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 16px 0 0;
  background: transparent;
}

.dossier-section,
.source-gap {
  display: block;
}

.web-edge-card {
  display: block;
}

.dossier-grid.compact .dossier-section {
  display: block;
}

.dossier-section h3,
.source-gap h3,
.web-edge-card h3 {
  margin: 0 0 9px;
  color: var(--rust);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 24px;
  line-height: 1.1;
}

.dossier-section p,
.source-gap p,
.web-edge-card p {
  margin: 0;
  color: #2e302c;
}

.dossier-section p + p {
  margin-top: 10px;
}

.source-gap {
  border-color: #b38769;
  background: transparent;
}

.source-note-marker {
  color: var(--rust);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.dossier-footnotes {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.dossier-footnotes h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.dossier-footnotes ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.dossier-footnotes li {
  color: #43514b;
}

.dossier-footnotes li strong,
.dossier-footnotes li span {
  display: block;
}

.dossier-footnotes li span {
  margin: 2px 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.source-note-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.source-note-links .source-chip {
  margin-bottom: 0;
}

.relationship-web {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.web-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.web-node {
  display: grid;
  gap: 4px;
  min-height: 78px;
  border: 1px solid #cfc5b0;
  border-radius: 6px;
  padding: 11px 12px;
  background: #f5f0e5;
  color: var(--ink);
}

.web-node span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.web-edge-card h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.network-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.character-network-page .section-heading {
  align-items: end;
}

.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d2c8b7;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 253, 248, 0.82);
  color: #3f4d47;
  font-size: 12px;
  font-weight: 750;
}

.legend-item i {
  display: block;
  width: 28px;
  height: 4px;
  border-radius: 999px;
}

.legend-family i,
.edge-family {
  background: #b55335;
  stroke: #b55335;
}

.legend-team i,
.edge-team {
  background: #477067;
  stroke: #477067;
}

.legend-command i,
.edge-command {
  background: #58666f;
  stroke: #58666f;
}

.legend-science i,
.edge-science {
  background: #2f6f89;
  stroke: #2f6f89;
}

.legend-enemy i,
.edge-enemy {
  background: #7b3430;
  stroke: #7b3430;
}

.legend-story i,
.edge-story {
  background: #7a6f44;
  stroke: #7a6f44;
}

.network-board-scroll {
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
  border: 1px solid #cfc5b1;
  border-radius: var(--radius);
  padding: 8px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.88)),
    linear-gradient(90deg, rgba(94, 87, 72, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(94, 87, 72, 0.08) 1px, transparent 1px),
    #ece5d8;
  background-size: auto, 52px 52px, 52px 52px, auto;
  box-shadow: 0 14px 34px rgba(31, 36, 34, 0.12);
}

.network-board {
  position: relative;
  min-width: 980px;
  isolation: isolate;
}

.network-board::before {
  position: absolute;
  inset: 58px 12px 20px;
  border: 1px dashed rgba(94, 87, 72, 0.24);
  border-radius: 6px;
  content: "";
  pointer-events: none;
}

.network-lane-label {
  position: absolute;
  z-index: 3;
  border-bottom: 2px solid var(--lane-color);
  padding-bottom: 7px;
  color: #31413b;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.network-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
}

.network-edge-link {
  cursor: pointer;
  outline: none;
}

.network-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-width: 18px;
  pointer-events: stroke;
}

.network-edge {
  fill: none;
  opacity: 0.42;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.network-edge-link:hover .network-edge,
.network-edge-link:focus .network-edge,
.network-edge-link:focus-visible .network-edge {
  opacity: 0.86;
}

.network-node {
  position: absolute;
  z-index: 2;
  height: 112px;
  border: 1px solid #cfc5b0;
  border-left: 5px solid var(--lane-color);
  border-radius: 7px;
  padding: 9px 10px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.84)),
    var(--lane-bg);
  box-shadow: 0 8px 18px rgba(31, 36, 34, 0.11);
}

.network-node-title {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #21302b;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.18;
}

.network-node-title span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--lane-color);
  color: #fffdf8;
  font-size: 11px;
}

.network-node p {
  display: -webkit-box;
  margin: 7px 0 8px;
  overflow: hidden;
  color: #4d5a54;
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.network-node-books,
.network-detail-row span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.network-node-books {
  flex-wrap: nowrap;
  overflow: hidden;
}

.network-node-books .book-chip {
  flex: 0 0 auto;
  max-width: 56px;
}

.book-chip {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 22px;
  border: 1px solid #cfc5b0;
  border-radius: 999px;
  padding: 3px 7px;
  overflow: hidden;
  background: #f5f0e5;
  color: #34504b;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-chip.more {
  color: #5d5548;
  background: #e8dfcf;
}

.network-character-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
}

.network-character-detail {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--lane-color);
  border-radius: var(--radius);
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.82)),
    var(--lane-bg);
}

.network-character-rank {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--lane-color);
  color: #fffdf8;
  font-weight: 900;
}

.network-character-copy h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.network-character-copy p {
  margin: 0 0 11px;
  color: #4d5a54;
  font-size: 13px;
}

.network-detail-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 8px;
}

.network-detail-row strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.network-inline-link {
  font-weight: 750;
}

.network-edge-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.network-edge-detail {
  --relation-color: #7a6f44;
  display: block;
  scroll-margin-top: 90px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--relation-color);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 6px 16px rgba(31, 36, 34, 0.08);
}

.network-edge-detail:target,
.network-edge-detail.is-active {
  border-color: var(--relation-color);
  box-shadow: 0 0 0 3px rgba(181, 83, 53, 0.16), 0 10px 24px rgba(31, 36, 34, 0.14);
}

.network-edge-detail h3 {
  margin: 0 0 9px;
  color: var(--rust);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 23px;
  line-height: 1.12;
}

.network-edge-detail h3 span {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.network-edge-detail p {
  margin: 0;
}

.network-edge-detail .fact-list {
  margin-top: 11px;
}

.network-edge-works {
  margin-top: 12px;
}

.relation-family {
  --relation-color: #b55335;
}

.relation-team {
  --relation-color: #477067;
}

.relation-command {
  --relation-color: #58666f;
}

.relation-science {
  --relation-color: #2f6f89;
}

.relation-enemy {
  --relation-color: #7b3430;
}

.relation-story {
  --relation-color: #7a6f44;
}

.lane-core {
  --lane-color: #b55335;
  --lane-bg: #fff0ea;
}

.lane-field {
  --lane-color: #477067;
  --lane-bg: #edf4f0;
}

.lane-command {
  --lane-color: #58666f;
  --lane-bg: #eef1f2;
}

.lane-science {
  --lane-color: #2f6f89;
  --lane-bg: #edf5f7;
}

.lane-survivor {
  --lane-color: #7a6f44;
  --lane-bg: #f4f0df;
}

.lane-mission {
  --lane-color: #805c91;
  --lane-bg: #f3edf6;
}

.lane-threat {
  --lane-color: #7b3430;
  --lane-bg: #f8ece9;
}

.network-lane-guide li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.network-lane-guide li strong,
.network-lane-guide li span:last-child {
  grid-column: 2;
}

.lane-dot {
  grid-row: 1 / span 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--lane-color);
}

.group-card-grid,
.group-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.group-card,
.group-roster-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 1px 0 rgba(32, 38, 34, 0.04);
}

.group-card {
  min-height: 190px;
}

.group-card h3,
.group-roster-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.group-card p,
.group-roster-card p {
  margin: 0 0 12px;
  color: #4e5c56;
  font-size: 13px;
}

.group-overview {
  border-top: 3px solid #d7c7aa;
  padding-top: 4px;
}

.group-section-list {
  display: grid;
  gap: 20px;
}

.membership-matrix-section {
  border-top: 3px solid #d7c7aa;
  padding-top: 8px;
}

.membership-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.membership-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d2c8b7;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 253, 248, 0.84);
  color: #3f4d47;
  font-size: 12px;
  font-weight: 760;
}

.matrix-swatch {
  display: block;
  width: 22px;
  height: 14px;
  border: 1px solid rgba(33, 42, 37, 0.18);
  border-radius: 4px;
}

.matrix-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #cfc5b1;
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
  box-shadow: 0 10px 26px rgba(31, 36, 34, 0.09);
  padding-bottom: 4px;
}

.team-membership-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.team-membership-matrix th,
.team-membership-matrix td {
  border-right: 1px solid #d7cebb;
  border-bottom: 1px solid #d7cebb;
}

.team-membership-matrix thead th {
  min-width: 76px;
  padding: 12px 10px;
  background: #e5dccb;
  color: #34413c;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  vertical-align: bottom;
  white-space: normal;
}

.team-membership-matrix thead th a {
  color: #245f73;
}

.team-membership-matrix .matrix-member-head,
.team-membership-matrix .matrix-member {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 220px;
  max-width: 220px;
  text-align: left;
}

.team-membership-matrix .matrix-member-head {
  background: #d9cfbc;
}

.team-membership-matrix .matrix-member {
  padding: 10px 12px;
  background: #fbf7ef;
  color: #26312d;
  vertical-align: middle;
}

.team-membership-matrix .matrix-member a {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.team-membership-matrix .matrix-member span {
  display: block;
  margin-top: 3px;
  color: #65716b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.matrix-cohort-row th {
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 8px 12px;
  background: #332f2b;
  color: #fff7ec;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.matrix-cell {
  position: relative;
  width: 76px;
  min-width: 76px;
  height: 56px;
  padding: 4px;
  overflow: visible;
  background: #f7f2e8;
  text-align: center;
  vertical-align: middle;
}

.matrix-cell span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fffdf8;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.matrix-cell em {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.state-lead {
  background: #8f3f2c;
}

.state-lead span {
  background: #5e2418;
}

.state-active {
  background: #477067;
}

.state-active span {
  background: #2f554f;
}

.state-attached {
  background:
    repeating-linear-gradient(135deg, rgba(47, 111, 137, 0.88) 0 8px, rgba(47, 111, 137, 0.62) 8px 16px);
}

.state-attached span {
  background: #1f556a;
}

.state-legacy {
  background:
    linear-gradient(rgba(255, 253, 248, 0.28), rgba(255, 253, 248, 0.28)),
    #7a6f44;
}

.state-legacy span {
  background: #5f5635;
}

.state-fallen {
  background:
    linear-gradient(135deg, rgba(123, 52, 48, 0.92), rgba(123, 52, 48, 0.72));
}

.state-fallen span {
  background: #4d211f;
}

.state-empty {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.025) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.025) 50%, rgba(0, 0, 0, 0.025) 75%, transparent 75%),
    #f8f4ea;
  background-size: 12px 12px;
}

.state-empty span {
  display: none;
}

.infobox {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 18px 18px 20px;
  background: transparent;
  box-shadow: none;
}

.infobox.texture,
.infobox.page-card {
  overflow: hidden;
  color: #f8f4eb;
  background:
    linear-gradient(rgba(18, 22, 20, 0.82), rgba(18, 22, 20, 0.86)),
    url("./images/archive-texture.png") center / cover;
}

.infobox.texture h2,
.infobox.page-card h2,
.infobox.texture .stat span,
.infobox.texture .stat strong,
.infobox.page-card .stat span,
.infobox.page-card .stat strong {
  color: #f8f4eb;
}

.infobox.texture .stat,
.infobox.page-card .stat {
  border-color: rgba(255, 253, 248, 0.24);
}

.infobox p {
  margin: 8px 0 0;
  color: #423d35;
  font-size: 13px;
}

.infobox.texture p,
.infobox.page-card p {
  color: #d5d8cf;
}

.character-profile-card {
  padding-top: 0;
}

.character-portrait {
  margin: 0 0 16px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 253, 248, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.08), rgba(255, 253, 248, 0)),
    #0f1311;
}

.character-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  object-position: 50% 0;
}

.character-portrait-rail img {
  aspect-ratio: 9 / 16;
  object-fit: contain;
  object-position: 50% 0;
}

.character-portrait figcaption {
  margin: 0;
  padding: 9px 12px 11px;
  color: rgba(248, 244, 235, 0.76);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.character-portrait-inline {
  display: none;
}
.lore-rendering {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.16);
  background: #101411;
}

.lore-rendering img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 50%;
}

.lore-rendering figcaption {
  margin: 0;
  padding: 9px 12px 11px;
  color: rgba(248, 244, 235, 0.76);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.lore-rendering-inline {
  display: none;
}

.lore-story-visual {
  margin: 24px 0 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101411;
  box-shadow: var(--shadow);
}

.lore-story-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.lore-story-visual figcaption {
  margin: 0;
  border-top: 1px solid rgba(238, 231, 216, 0.16);
  padding: 10px 12px;
  color: rgba(248, 244, 235, 0.78);
  background: #101411;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.coverage-box h2,
.verification-box h2 {
  color: #2c302b;
}

.coverage-meter {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.coverage-meter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #38342e;
  font-size: 13px;
}

.coverage-meter-row span {
  min-width: 0;
}

.coverage-meter-row strong {
  color: #38342e;
  font-size: 13px;
  font-weight: 750;
}

.coverage-track {
  height: 8px;
  border: 1px solid rgba(159, 146, 125, 0.58);
  background: rgba(248, 243, 232, 0.8);
}

.coverage-track span {
  display: block;
  height: 100%;
  background: #314a33;
}

.coverage-meter.overall .coverage-track span {
  background: var(--rust);
}

.verification-box p strong {
  color: #314a33;
}

.aside-link-list {
  display: grid;
  gap: 0;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.aside-link-list li {
  border-top: 1px solid rgba(203, 193, 173, 0.72);
  padding: 7px 0;
}

.aside-link-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.aside-link-list a {
  display: inline-block;
  color: var(--rust);
  font-weight: 850;
  text-decoration: none;
}

.aside-link-list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lore-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.lore-card {
  display: grid;
  align-content: start;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(249, 244, 234, 0.88)),
    repeating-linear-gradient(135deg, rgba(48, 58, 52, 0.035) 0 1px, transparent 1px 8px);
}

.lore-card h3 {
  margin: 0 0 9px;
  font-size: 20px;
}

.lore-card p {
  margin: 0 0 14px;
  color: #46544e;
}

.lore-card .mini-stats a {
  border: 1px solid #c8bda8;
  border-radius: 999px;
  padding: 4px 8px;
  color: #245a6a;
  background: #eef5f5;
  font-size: 12px;
  font-weight: 800;
}

.lore-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.lore-related-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.78);
}

.lore-related-grid h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lore-article {
  border-top: 3px solid #d7c7aa;
  padding-top: 8px;
}

.lore-section-list {
  display: grid;
  gap: 20px;
}

.lore-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.lore-section:last-child {
  border-bottom: 0;
}

.lore-section h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.lore-section p {
  margin: 0;
  color: #3f4d47;
}

.lore-section p + p {
  margin-top: 12px;
}

.lore-subtopic-list {
  display: grid;
  gap: 16px;
}

.lore-subtopic {
  border-left: 3px solid #b55335;
  padding-left: 13px;
}

.lore-subtopic h3 {
  display: inline;
  margin: 0;
  border-bottom: 2px solid rgba(181, 83, 53, 0.35);
  color: #26352f;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.lore-subtopic p {
  margin-top: 8px;
}

.lore-expansion {
  border: 1px dashed #c8bda8;
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(248, 244, 234, 0.7);
}

.lore-expansion h2 {
  margin-top: 0;
  font-size: 20px;
}

.rail-link {
  margin-top: 12px;
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.tabs a {
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  padding: 8px 12px;
  color: #43514b;
  background: #ede7d9;
  font-size: 13px;
  font-weight: 750;
}

.tabs a.active {
  border-color: var(--line-strong);
  border-bottom-color: var(--paper-strong);
  color: var(--ink);
  background: var(--paper-strong);
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.source-ref {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 2fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  font-size: 13px;
}

.metadata {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 16px;
}

.metadata dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metadata dd {
  margin: 0;
  word-break: break-word;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  color: #214b3d;
  background: #dbeae2;
}

.status.hold {
  color: #6d3b26;
  background: #f2decf;
}

.submission-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.submission-form label {
  display: grid;
  gap: 6px;
  color: #3f4b46;
  font-size: 13px;
  font-weight: 800;
}

.submission-form input,
.submission-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fffdf8;
}

.submission-form button {
  justify-self: start;
  border: 1px solid #8d402d;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fffaf3;
  background: var(--rust);
  font-weight: 800;
  cursor: pointer;
}

.timeline-hero {
  border-bottom: 3px solid #b55335;
}

.timeline-jump {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.timeline-jump a {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdf8;
}

.timeline-jump a:hover {
  border-color: #b55335;
  box-shadow: 0 8px 20px rgba(31, 36, 34, 0.1);
}

.timeline-jump strong {
  color: #8d402d;
  font-size: 12px;
  text-transform: uppercase;
}

.timeline-jump span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.timeline-roadmap {
  position: relative;
  display: grid;
  gap: 28px;
}

.timeline-roadmap::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 72px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(#b55335, #477067 45%, #58666f);
}

.timeline-era {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
}

.timeline-marker {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.timeline-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #8d402d;
  border-radius: 8px;
  padding: 8px 10px;
  color: #fffdf8;
  background: #8d402d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.timeline-marker em {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin: 0 auto;
  border: 2px solid #fffdf8;
  border-radius: 50%;
  color: #fffdf8;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--paper);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.timeline-era-body {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 12px 30px rgba(31, 36, 34, 0.08);
}

.timeline-era-body > header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.timeline-era-body h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.timeline-era-body header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.timeline-major-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline-event {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
}

.timeline-event.major {
  border-top: 4px solid var(--rust);
}

.event-label {
  margin: 0;
  color: var(--olive);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-event h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.timeline-event p {
  margin: 0;
  color: #34413d;
  font-size: 14px;
  line-height: 1.55;
}

.timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  border: 1px solid #b9d1cf;
  border-radius: 999px;
  padding: 4px 8px;
  color: #20586a;
  background: #eef8f7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.timeline-secondary {
  margin-top: 14px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f3f7f1;
}

.timeline-secondary h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.timeline-secondary ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 19px;
}

.timeline-secondary li {
  color: #35423e;
  line-height: 1.5;
}

.search-results {
  position: absolute;
  top: 62px;
  left: 360px;
  right: 300px;
  z-index: 40;
  max-height: min(70vh, 620px);
  overflow: auto;
  border: 1px solid #2a211a;
  border-radius: 2px;
  padding: 8px;
  background: #f7f1e5;
  box-shadow: var(--shadow);
}

.search-results a {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  color: var(--ink);
}

.search-results a:last-child {
  border-bottom: 0;
}

.search-results span {
  color: var(--rust);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-results strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results a.search-result-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.search-results .search-result-meta {
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-results em {
  display: block;
  color: #4a564f;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.45;
}

.topic-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
}

.topic-badges span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(16, 21, 19, 0.18);
  border-radius: 4px;
  color: #26302c;
  background: rgba(248, 243, 232, 0.9);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.topic-infobox .stat + .stat {
  margin-top: 8px;
}

.source-map-footnotes {
  margin-top: 24px;
}

.source-map-footnotes ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.source-map-footnotes li {
  line-height: 1.52;
}

.story-link-section {
  margin-top: 24px;
}

.story-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.story-link-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 243, 232, 0.72);
}

.story-link-grid h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1380px) {
  .workspace {
    grid-template-columns: 246px minmax(0, 1fr) 330px;
  }

  .topbar {
    grid-template-columns: 280px minmax(240px, 1fr) auto;
  }

  .top-actions a {
    padding: 0 12px;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }

  .character-portrait-inline,
  .lore-rendering-inline {
    display: block;
    max-width: 420px;
    margin: 16px 0 20px;
    border: 1px solid var(--line);
  }

  .topbar {
    grid-template-columns: 250px minmax(220px, 1fr);
  }

  .top-actions {
    grid-column: 1 / -1;
    min-height: 44px;
    border-top: 1px solid rgba(238, 231, 216, 0.11);
  }

  .top-actions a {
    min-height: 44px;
  }

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

@media (max-width: 820px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    min-height: 100dvh;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 14px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    min-height: 42px;
    align-self: stretch;
    white-space: normal;
  }

  .top-actions a {
    min-width: 0;
    min-height: 38px;
    border-top: 1px solid rgba(238, 231, 216, 0.11);
    padding: 0 10px;
    text-align: center;
  }

  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    overflow: visible;
  }

  .character-portrait-inline,
  .lore-rendering-inline {
    max-width: none;
  }

  .left-rail {
    order: 2;
    position: static;
    top: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(238, 231, 216, 0.15);
  }

  .right-rail {
    position: static;
    top: auto;
    max-height: none;
    min-height: 0;
  }

  .nav-section {
    margin-bottom: 16px;
  }

  .nav-section a {
    display: inline-flex;
    margin: 0 6px 6px 0;
    border-left: 0;
    border: 1px solid rgba(238, 231, 216, 0.18);
    border-radius: 3px;
    color: #eee7d8;
    background: rgba(255, 255, 255, 0.06);
  }

  .article {
    order: 1;
    min-height: auto;
    overflow: visible;
    padding: 24px 16px 48px;
  }

  .home-hero {
    margin-right: -4px;
    margin-left: -4px;
    border-radius: 6px;
  }

  .home-hero-hotspot {
    display: none;
  }

  h1 {
    font-size: clamp(36px, 13vw, 52px);
  }

  .lede {
    font-size: 15px;
  }

  .panel-grid,
  .split-list,
  .network-summary-grid,
  .lore-related-grid,
  .timeline-jump,
  .timeline-major-grid {
    grid-template-columns: 1fr;
  }

  .wiki-table {
    display: block;
    overflow-x: auto;
  }

  .source-ref,
  .metadata,
  .overview-profile,
  .arc-card,
  .relationship-card,
  .dossier-grid.compact,
  .dossier-section,
  .source-gap,
  .web-edge-card,
  .timeline-row,
  .timeline-era {
    grid-template-columns: 1fr;
  }

  .timeline-roadmap::before {
    display: none;
  }

  .timeline-marker {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .timeline-marker span {
    justify-content: flex-start;
  }

  .timeline-marker em {
    margin: 0;
    flex: 0 0 auto;
  }

  .timeline-era-body {
    padding: 14px;
  }

  .search-results {
    left: 12px;
    right: 12px;
    top: 150px;
  }

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

  .network-character-list {
    grid-template-columns: 1fr;
  }

  .network-character-detail,
  .network-detail-row {
    grid-template-columns: 1fr;
  }

  .network-character-rank {
    width: 38px;
    height: 38px;
  }

  .visual-page .nss-vis .toolbar,
  .visual-page .nss-vis > h2 {
    top: 0;
  }

  .visual-page .nss-vis .legend,
  .visual-page .nss-vis .grid,
  .visual-page .nss-vis .wide-grid,
  .visual-table-cards,
  .visual-page .nss-vis .org-row {
    grid-template-columns: 1fr;
  }
}

.visual-page,
.chronology-page {
  overflow: visible;
}

.visual-page .nss-vis {
  display: grid;
  gap: 18px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.visual-page .nss-vis > p {
  max-width: 78ch;
  margin: 0;
  color: #2d3934;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

.visual-page .nss-vis style,
.visual-page .table-wrap.visual-table-enhanced {
  display: none;
}

.visual-page .nss-vis .table-wrap,
.chronology-page .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.visual-page .nss-vis a,
.chronology-page a.wiki-internal,
a.wiki-internal {
  color: var(--link);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.visual-page .nss-vis .toolbar button {
  cursor: pointer;
}

.visual-page .nss-vis .toolbar {
  position: sticky;
  top: 76px;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(248, 243, 232, 0.96);
  box-shadow: 0 8px 18px rgba(31, 36, 34, 0.08);
}

.visual-page .nss-vis .toolbar button,
.visual-page .nss-vis select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 6px 10px;
  color: #24362f;
  background: #fffdf8;
  font-weight: 800;
}

.visual-page .nss-vis .toolbar button[aria-pressed="true"] {
  color: #fffdf8;
  background: var(--rust);
}

.visual-page .nss-vis .toolbar button:focus-visible,
.visual-page .nss-vis select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.visual-page .nss-vis .scan-note {
  border: 1px solid #d1c6b4;
  border-left: 5px solid var(--rust);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: #f4ecdc;
  color: #293631;
}

.visual-page .nss-vis > h2 {
  position: sticky;
  top: 76px;
  z-index: 8;
  margin: 20px 0 0;
  border-bottom: 2px solid var(--line-strong);
  padding: 10px 0 8px;
  color: #1f2f29;
  background: linear-gradient(180deg, rgba(248, 243, 232, 0.98), rgba(248, 243, 232, 0.92));
  font-size: 26px;
}

.visual-page .nss-vis .legend,
.visual-page .nss-vis .grid,
.visual-page .nss-vis .wide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.visual-page .nss-vis .legend {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.visual-page .nss-vis .card,
.visual-page .nss-vis .rel-card,
.visual-page .nss-vis .marker-card,
.visual-page .nss-vis .org-card,
.visual-page .nss-vis .tree-card {
  border: 1px solid var(--line);
  border-left: 5px solid #477067;
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 7px 17px rgba(31, 36, 34, 0.08);
}

.visual-page .nss-vis .marker-card {
  border-left-color: #b55335;
}

.visual-page .nss-vis .org-card {
  border-left-color: #58666f;
}

.visual-page .nss-vis .tree-card {
  border-left-color: #7a6f44;
}

.visual-page .nss-vis .card h3,
.visual-page .nss-vis .rel-card h3,
.visual-page .nss-vis .marker-card h3,
.visual-page .nss-vis .org-card h3,
.visual-page .nss-vis .tree-card h3,
.visual-table-card h3 {
  margin: 0 0 10px;
  color: var(--rust);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: 22px;
  line-height: 1.12;
}

.visual-page .nss-vis .card p,
.visual-page .nss-vis .rel-card p,
.visual-page .nss-vis .marker-card p,
.visual-page .nss-vis .org-card p,
.visual-page .nss-vis .tree-card p {
  margin: 8px 0 0;
  color: #33413b;
}

.visual-page .nss-vis .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.visual-page .nss-vis .tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9bda8;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1eadb;
  color: #354840;
  font-size: 12px;
  font-weight: 800;
}

.visual-table-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.visual-table-card {
  border: 1px solid var(--line);
  border-left: 5px solid #2f6f89;
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 7px 17px rgba(31, 36, 34, 0.08);
}

.visual-table-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.visual-table-card div {
  border-top: 1px solid rgba(201, 189, 168, 0.75);
  padding-top: 9px;
}

.visual-table-card dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.visual-table-card dd {
  margin: 0;
  color: #2f3d37;
}

.visual-table-card dd p,
.visual-table-card dd ul {
  margin-top: 6px;
  margin-bottom: 0;
}

.visual-page .nss-vis .org-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.visual-page .nss-vis .org-label,
.visual-page .nss-vis .org-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 253, 248, 0.9);
}

.visual-page .nss-vis .org-label {
  display: flex;
  align-items: center;
  color: #fffdf8;
  background: #394842;
  font-weight: 900;
}

.visual-page .nss-vis .tree {
  margin: 0;
  padding-left: 22px;
}

.visual-page .nss-vis .tree li + li {
  margin-top: 8px;
}

.chronology-page blockquote {
  border-left: 4px solid var(--rust);
  margin: 0 0 18px;
  padding: 10px 14px;
  background: rgba(181, 83, 53, 0.08);
}

.chronology-page h2 {
  margin: 34px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line-strong);
}

.chronology-page h3,
.chronology-page h4 {
  margin-top: 22px;
}

.chronology-page h3 {
  position: sticky;
  top: 82px;
  z-index: 8;
  margin: 28px -6px 14px;
  padding: 10px 6px 9px;
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(236, 230, 216, 0.98), rgba(236, 230, 216, 0.94));
}

.chronology-page .table-wrap {
  overflow-x: visible;
}

.chronology-page .markdown-table table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  border: 1px solid var(--line-strong);
}

.chronology-page .markdown-table th,
.chronology-page .markdown-table td {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
}

.chronology-page .markdown-table th {
  background: rgba(16, 21, 19, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chronology-event-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 16px 0 32px;
}

.chronology-event-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--rust);
  border-radius: 8px;
  background: rgba(248, 243, 232, 0.88);
  box-shadow: 0 10px 24px rgba(18, 20, 18, 0.08);
}

.chronology-event-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.chronology-date {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(16, 21, 19, 0.18);
  border-radius: 4px;
  color: var(--rail-ink);
  background: var(--rail);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chronology-event-card h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.chronology-impact {
  margin: 0;
  max-width: 78ch;
  line-height: 1.62;
}

.chronology-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.chronology-detail {
  min-width: 0;
  padding: 10px 12px;
  background: rgba(238, 231, 216, 0.92);
}

.chronology-detail.full {
  grid-column: 1 / -1;
}

.chronology-detail dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chronology-detail dd {
  margin: 0;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .chronology-page h3 {
    top: 118px;
    margin-right: 0;
    margin-left: 0;
  }

  .chronology-event-card {
    padding: 13px;
  }

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