:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fffdfa;
  --ink: #242128;
  --muted: #605b65;
  --edge: #e2dcd5;
  --accent: #59458d;
  --accent-dark: #453269;
  --accent-soft: #eee8f5;
  --green: #366244;
  --green-soft: #e8f0e5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 19px;
  --shadow: 0 10px 35px #2c1b4110;
  --mast-height: 65px;
  --banner-offset: 0px;
  --chrome-height: calc(var(--chrome-full-height, 144px) - var(--banner-offset));
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
html { scroll-padding-top: calc(var(--chrome-height, 144px) + var(--tabs-height, 0px) + 12px); }
html.profile-open { overflow: hidden; }
.profile-open body { margin-inline-end: var(--locked-gutter, 0px); }
main { min-height: 50vh; }
main:focus, #chapter-content:focus { outline: none; }
#chapter-content { display: flow-root; overflow-anchor: none; }
body, button, input, select { font-family: var(--sans); }
button, input, select { font-size: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
svg { display: block; flex: none; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 12px; background: var(--surface); }
.wrap { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .69rem;
  font-weight: 760;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow .icon { width: 16px; height: 16px; }

.chrome {
  position: sticky;
  top: 0;
  transform: translateY(calc(-1 * var(--banner-offset)));
  z-index: 3;
  border-bottom: 1px solid var(--edge);
  background: var(--surface);
  box-shadow: 0 3px 12px #33274308;
}
.mast { height: var(--mast-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.6rem/1 var(--serif); letter-spacing: -.045em; }
.brand img { display: block; }
.brand-dot { color: var(--accent); }
.bookshelf { position: relative; }
.bookshelf summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--ink);
  list-style: none;
  font-size: .82rem;
  font-weight: 670;
}
.bookshelf summary::-webkit-details-marker { display: none; }
.bookshelf summary:hover, .bookshelf[open] summary { background: var(--accent-soft); }
.bookshelf summary svg, .select-wrap svg, .step svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bookshelf summary .chevron { margin-left: 3px; width: 12px; }
.bookshelf-menu {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 8px) 0 auto auto;
  width: min(330px, calc(100vw - 32px));
  max-height: min(400px, 60vh);
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.book-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  margin-top: 11px;
  border-radius: 9px;
  padding: 8px;
  line-height: 1.3;
}
.book-option[aria-current], .book-option:hover { background: var(--accent-soft); }
.book-option strong, .book-option small { display: block; }
.book-option small { margin-top: 3px; color: var(--muted); }
.book-option .tile-icon { width: 32px; height: 32px; }
.book-option > .icon { color: var(--accent); }

.timeline-wrap { border-top: 1px solid #e7e0ed; background: #f1edf5; }
.timeline {
  min-height: 77px;
  padding-block: 11px;
  display: grid;
  grid-template-columns: minmax(144px, .22fr) 35px minmax(0, 1fr) 35px minmax(129px, auto);
  align-items: center;
  column-gap: 12px;
}
.timeline-label { display: grid; min-width: 0; gap: 4px; align-content: center; line-height: 1.17; }
.timeline-book { color: var(--accent-dark); font-size: .82rem; font-weight: 720; overflow-wrap: anywhere; }
.timeline-label label { font-size: 1rem; font-weight: 720; overflow-wrap: anywhere; }
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid #d9cfe5;
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
}
.step { width: 35px; height: 35px; }
.step:disabled { opacity: .4; }
.step:not(:disabled):hover { background: #e2d8ee; }
.range-wrap { --progress: 0%; --thumb-radius: 9px; position: relative; min-width: 0; padding-top: 7px; }
.range-rail {
  position: absolute;
  top: 21px;
  inset-inline: var(--thumb-radius);
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--progress), #d6c9e5 var(--progress));
  pointer-events: none;
}
.range-ticks { position: absolute; inset: 20px var(--thumb-radius) auto; pointer-events: none; }
.range-ticks i { position: absolute; width: 1px; height: 7px; background: #9b89b6; }
.range-ticks .uncovered-tick { background: #b5a5c7; height: 5px; top: 1px; }
#chapter-range {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 100%;
  height: 32px;
  margin: 0;
  display: block;
  background: transparent;
  cursor: ew-resize;
  border-radius: 7px;
}
#chapter-range::-webkit-slider-runnable-track { height: 5px; background: transparent; }
#chapter-range::-moz-range-track { height: 5px; background: transparent; }
#chapter-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent), 0 3px 7px #59458d55;
}
#chapter-range::-moz-range-thumb {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent), 0 3px 7px #59458d55;
}
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .64rem; line-height: 1; margin-top: -1px; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap select { appearance: none; }
.select-wrap svg { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.jump select {
  width: 100%;
  min-height: 35px;
  padding: 4px 29px 4px 10px;
  border: 1px solid #d9cfe5;
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: .77rem;
  font-weight: 645;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 18px;
  padding-block: clamp(14px, 2.5vw, 28px);
  background:
    radial-gradient(ellipse at 80% 40%, #584b70 0, transparent 65%),
    radial-gradient(circle at 1px 1px, #b8a6d430 1px, transparent 1.2px) 0 0 / 16px 16px,
    #241d30;
  color: #fffbf5;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}
.hero-backdrop {
  position: absolute;
  z-index: -2;
  inset: -55% -4% auto;
  width: 108%;
  height: 169%;
  object-fit: cover;
  object-position: center 56%;
  filter: blur(6px) saturate(1.14);
  transform: translateY(var(--hero-offset, 0px));
  opacity: .88;
  pointer-events: none;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #181323fa 8%, #181323dd 48%, #1813233d 82%),
    linear-gradient(0deg, #181323bc, transparent 42%);
  content: "";
}
.hero h1, .profile-hero h2 {
  max-width: 18ch;
  margin-block: 10px 12px;
  font: 570 clamp(2.8rem, 6.15vw, 5rem)/.99 var(--serif);
  letter-spacing: -.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.byline { color: var(--accent-dark); font-weight: 640; font-size: .99rem; }
.byline span { margin-inline: 5px; color: #84778c; font-weight: 450; }
.hero .eyebrow, .hero .byline { color: #eadbf8; }
.hero .byline span { color: #cebde0; }
.hero-description { margin-top: 18px; color: #efe7f2; max-width: 42ch; font-size: .98rem; }
.hero-illustration { position: relative; min-width: 0; text-align: center; }
.hero-art { width: 100%; height: auto; border-radius: 16px; border: 1px solid #e0d4e9; box-shadow: 8px 16px 42px #110c1b66; }
.cover-stage {
  min-width: 0;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  transform: translateY(clamp(-32px, calc(var(--hero-offset, 0px) * -.16), 0px));
}
.cover-window { display: grid; place-items: center; }
.cover-window img {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(208px, 30vw, 335px);
  object-fit: contain;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 5px 6px 0 -2px #20182f, 12px 21px 36px #100d19b0;
}
.cover-stage figcaption { font-size: .69rem; text-align: center; color: #f3eaf9; }
.hero a:focus-visible { outline-color: #f3eaf9; }
.cover-stage figcaption a:hover { text-decoration: underline; text-underline-offset: 2px; }
.art-caption {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding-inline: 3px;
  color: var(--accent-dark);
  background: #f0e5f5;
  font: 680 .56rem/1.5 var(--sans);
  letter-spacing: .15em;
  white-space: nowrap;
}
#book-tabs {
  position: sticky;
  z-index: 2;
  top: var(--chrome-height, 144px);
}
#book-tabs.is-docked {
  background: var(--surface);
  box-shadow: inset 0 -1px var(--edge), 0 5px 12px #3327430c;
}
#book-tabs:not(:empty) + #chapter-content {
  min-height: calc(100dvh - var(--chrome-full-height, 144px) - var(--tabs-height, 0px));
}
.tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--surface);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 5px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .87rem;
  font-weight: 665;
  white-space: nowrap;
}
.tabs a[aria-current], .tabs a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.is-docked .tabs {
  padding-block: 0;
  border-color: transparent;
  border-radius: 0;
  background: none;
}
.is-docked .tabs a {
  position: relative;
  min-height: 51px;
  border-radius: 0;
  background: none;
}
.is-docked .tabs a:hover { color: var(--accent-dark); }
.is-docked .tabs a[aria-current]::after {
  position: absolute;
  inset: auto 12px 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  content: "";
}
.is-docked .tabs a:focus-visible { outline-offset: -4px; }
.tabs .safe-badge { margin-inline: auto 7px; }
.safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--green);
  background: var(--green-soft);
  font-size: .73rem;
  font-weight: 680;
  white-space: nowrap;
}
.safe-badge .icon { width: 15px; height: 15px; }

.overview-grid, .profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
}
.panel {
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}
.recap, .inset, .relations, .state-panel { padding: clamp(20px, 3.1vw, 36px); }
.recap { min-height: 225px; box-shadow: 0 5px 15px #2c1b4107; }
.recap h2, .inset h2, .section-heading h2, .state-panel h1, .state-panel h2 {
  font: 610 clamp(1.65rem, 3.5vw, 2.65rem)/1.09 var(--serif);
  letter-spacing: -.035em;
  margin-block: 9px 13px;
  overflow-wrap: anywhere;
}
.recap > p:not(.eyebrow), .inset > p:not(.eyebrow), .state-panel > p:not(.eyebrow) { color: var(--muted); }
.prose { max-width: 68ch; line-height: 1.65; }
.prose p + p { margin-top: 11px; }
.recap > .prose + h3 {
  margin-block: 1.5rem .65rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--edge);
  font: 650 1.3rem/1.2 var(--serif);
}
.inset {
  background: #f6f1fa;
  border-color: #e5ddeb;
}
.inset h2 { font-size: clamp(1.55rem, 2.9vw, 2.09rem); }
.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 37px;
  height: 37px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
}
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.feature { padding: 19px; border: 1px solid var(--edge); border-radius: 14px; background: #ffffff42; }
.feature h3 { margin: 9px 0 5px; font-size: .98rem; }
.feature p { color: var(--muted); font-size: .88rem; }
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 9px;
  border-bottom: 1px solid #e5ddeb;
  font-size: .85rem;
}
.stat span { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.stat .icon { width: 15px; height: 15px; color: var(--accent); }
.stat strong { font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.coverage-note { font-size: .77rem; margin-top: 14px; }
.coverage-note span { display: inline-block; width: 6px; height: 6px; margin: 0 6px 2px 0; border-radius: 50%; background: var(--accent); }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  margin-top: 18px;
  padding: 6px 13px;
  border: 1px solid #d6cbe1;
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 700;
}
.button:hover { background: var(--accent-soft); }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 700;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon, .button .icon { width: 16px; height: 16px; }
.section-block, .view-section { margin-top: 34px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { margin: 0 0 5px; }
.section-heading p { color: var(--muted); font-size: .91rem; }
.section-heading .text-link { flex-shrink: 0; padding-bottom: 3px; }
.state-panel { margin-top: 20px; }
.state-panel > .tile-icon { margin-bottom: 13px; }
.empty-note { color: var(--muted); font-size: .89rem; }
.loading-state { padding-block: 32px; color: var(--muted); }

.tone-violet { --tone-bg: #ede4f6; --tone-ink: #564077; }
.tone-teal { --tone-bg: #dceee8; --tone-ink: #286250; }
.tone-rose { --tone-bg: #f4e4e7; --tone-ink: #883d56; }
.tone-gold { --tone-bg: #f4ead6; --tone-ink: #765717; }
.tone-blue { --tone-bg: #e3ebf7; --tone-ink: #385b83; }
.tone-slate { --tone-bg: #ece8ee; --tone-ink: #5e5268; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: var(--tone-bg);
  color: var(--tone-ink);
  font: 650 1.15rem/1 var(--serif);
}
.avatar-small { width: 28px; height: 28px; border-radius: 7px; font-size: .75rem; }
.avatar-large { width: 98px; height: 98px; border-radius: 24px; font-size: 2.15rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.person-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--edge);
  border-radius: 15px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.person-card:hover, .person-card:focus-within { border-color: #aa98c4; box-shadow: var(--shadow); }
.person-card-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.person-card-header h3 { font: 660 1.35rem/1.06 var(--serif); overflow-wrap: anywhere; }
.person-card-header a::after { position: absolute; inset: 0; content: ""; border-radius: 15px; }
.person-card-header > .icon { width: 16px; height: 16px; color: var(--accent); }
.person-card-header p { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.person-overview { font-size: .89rem; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.group-pill, .status-pill { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 8px; font-size: .67rem; font-weight: 670; }
.group-pill { position: relative; z-index: 1; border: 0; color: var(--tone-ink); background: var(--tone-bg); }
.group-pill:hover { text-decoration: underline; }
.status-pill { color: var(--muted); border: 1px solid var(--edge); }
.card-activity { border-top: 1px solid var(--edge); padding-top: 10px; }
.activity-label { display: block; color: var(--accent); font-size: .61rem; font-weight: 760; text-transform: uppercase; letter-spacing: .11em; padding-bottom: 4px; }
.card-activity p { font-size: .79rem; line-height: 1.45; }
.card-activity p + p, .profile-activity p + p { margin-top: 6px; }
.card-activity strong, .profile-activity strong { color: var(--accent-dark); margin-right: 3px; }
.muted { color: var(--muted); }
.cast-controls, .connection-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.search-box { position: relative; display: flex; align-items: center; width: min(100%, 320px); }
.search-box svg { position: absolute; left: 11px; color: var(--accent); pointer-events: none; }
.search-box input, .cast-controls select, .connection-controls select {
  min-height: 41px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  font-size: .89rem;
}
.search-box input { padding-left: 36px; }
.group-control { display: flex; gap: 8px; align-items: center; min-width: 0; max-width: 100%; }
.cast-controls select, .connection-controls select { width: auto; max-width: 100%; padding-inline: 14px 34px; }
.group-control label, .connection-controls label { color: var(--muted); font-size: .84rem; font-weight: 660; }
.subheading { margin: 20px 0 10px; color: var(--muted); font-size: .83rem; font-weight: 690; }
.subheading span { color: var(--accent); }

.profile-layer {
  position: absolute;
  inset: var(--chrome-full-height, 144px) 0 auto;
  height: calc(100dvh - var(--chrome-height, 144px));
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.profile-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
}
.profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px clamp(12px, 2vw, 24px);
  border-bottom: 1px solid var(--edge);
  background: var(--surface);
}
.profile-close { width: 40px; height: 40px; }
.profile-close:hover { background: var(--accent-soft); }
.profile-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 0 clamp(12px, 2vw, 24px) max(20px, env(safe-area-inset-bottom));
}
.profile-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.profile-hero { display: flex; align-items: flex-start; gap: 21px; padding-block: 18px 6px; }
.profile-hero h2 { margin-block-end: 4px; font-size: clamp(2.35rem, 5.7vw, 4.5rem); }
.profile-hero .card-tags { margin-top: 10px; }
.profile-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.profile-overview { max-width: 68ch; margin-top: 9px; font-weight: 650; }
.profile-story h2 { margin-top: 0; font-size: clamp(1.85rem, 4vw, 3rem); }
.profile-activity { margin-bottom: 18px; padding: 14px; background: #f5f0f8; border-radius: 11px; }
.profile-activity h3 { margin-bottom: 7px; color: var(--accent-dark); font: 680 1.2rem/1.2 var(--serif); }
.profile-activity p, .alias-line { font-size: .88rem; }
.alias-line { margin-top: 8px; }
.alias-line strong { color: var(--accent-dark); margin-right: 4px; }
.relations { padding: clamp(16px, 2.3vw, 27px); }
.relation-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.relation-header h3 { font: 650 1.42rem/1.1 var(--serif); }
.view-toggle { display: flex; padding: 2px; border: 1px solid var(--edge); border-radius: 7px; }
.view-toggle button { padding: 3px 8px; border: 0; border-radius: 5px; color: var(--muted); background: none; font-size: .76rem; font-weight: 650; }
.view-toggle button[aria-pressed="true"], .view-toggle button:hover { color: var(--accent-dark); background: var(--accent-soft); }
.relation-tree { padding: 13px; background: #f9f6fa; border: 1px solid #efe8f2; border-radius: 12px; }
.tree-root { display: inline-flex; gap: 7px; align-items: center; padding: 4px 8px 4px 4px; border-radius: 8px; background: var(--accent-soft); }
.tree-root strong, .tree-node strong { font-size: .84rem; }
.tree-branch { position: relative; padding: 10px 0 0 17px; margin-left: 13px; border-left: 1px solid #c7bad9; }
.tree-branch h4 { color: var(--accent); text-transform: uppercase; letter-spacing: .11em; font-size: .63rem; margin-bottom: 7px; }
.tree-nodes, .relation-list { padding: 0; margin: 0; list-style: none; }
.tree-nodes li { position: relative; min-width: 0; margin-bottom: 8px; }
.tree-nodes li:last-child { margin-bottom: 0; }
.tree-nodes li::before { content: ""; position: absolute; top: 8px; right: calc(100% + 4px); width: 13px; border-top: 1px solid #c7bad9; }
.edge-label { display: block; font-size: .73rem; font-weight: 680; color: var(--muted); }
.tree-node { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 3px 7px 3px 3px; margin-block: 3px 0; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); }
.tree-node:hover { border-color: var(--accent); }
.tree-node .icon { width: 12px; height: 12px; color: var(--accent); }
.tree-nodes p, .relation-list p { color: var(--muted); font-size: .76rem; margin: 4px 0 0; }
.relation-list li { padding-block: 6px; border-bottom: 1px solid var(--edge); }
.relation-list li:last-child { border: 0; }
.relation-list a { color: var(--accent-dark); font-size: .9rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.relation-kind { color: var(--muted); margin-left: 4px; font-size: .74rem; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 11px;
  align-items: center;
  margin-top: 46px;
  padding-block: 16px 22px;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: .76rem;
  overflow-anchor: none;
}
.footer > span:first-child { color: var(--ink); font: 700 1.1rem/1 var(--serif); }

@media (max-width: 850px) {
  .timeline { grid-template-columns: minmax(110px, .32fr) 35px minmax(0, 1fr) 35px auto; column-gap: 8px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root { --mast-height: 51px; }
  .wrap { width: calc(100% - 30px); }
  .brand { font-size: 1.39rem; }
  .brand img { width: 29px; height: 29px; }
  .bookshelf summary { min-height: 34px; }
  .timeline {
    grid-template-columns: 37px minmax(0, 1fr) 37px;
    grid-template-areas: ". . ." "prev range next";
    min-height: 0;
    gap: 1px 9px;
    padding-block: 6px;
  }
  .timeline-label {
    grid-area: 1 / 1 / 2 / -1;
    gap: 2px;
    min-height: 32px;
    padding-inline-end: calc(min(44vw, 160px) + 9px);
  }
  .timeline-label label { font-size: .83rem; }
  .timeline-book { font-size: .72rem; }
  #previous { grid-area: prev; }
  #next { grid-area: next; }
  .step { width: 37px; height: 37px; }
  .range-wrap { grid-area: range; }
  .jump { grid-area: 1 / 2 / 2 / -1; justify-self: end; width: max-content; max-width: min(44vw, 160px); }
  .jump select { min-height: 31px; padding-block: 3px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero::before { background: linear-gradient(180deg, #181323f5 0%, #181323d9 45%, #18132360 74%, #181323dd 100%); }
  .hero .eyebrow { justify-content: center; }
  .hero h1 { font-size: clamp(2.25rem, 9vw, 3.6rem); margin: 8px auto; }
  .hero-description { margin: 10px auto 0; font-size: .89rem; }
  .art-caption { display: none; }
  .hero-art { width: min(260px, 100%); border-radius: 8px; }
  .cover-stage { gap: 7px; }
  .cover-window img { height: clamp(154px, 46vw, 224px); }
  .cover-stage figcaption { font-size: .64rem; }
  .eyebrow { font-size: .62rem; letter-spacing: .1em; }
  .tabs { gap: 2px; justify-content: space-around; }
  .tabs a { padding-inline: 7px; gap: 4px; min-height: 36px; font-size: .78rem; }
  .is-docked .tabs a { min-height: 48px; }
  .tabs a .icon { width: 15px; height: 15px; }
  .tabs .safe-badge { display: none; }
  .overview-grid, .profile-grid { grid-template-columns: 1fr; gap: 11px; margin-top: 13px; }
  .recap { min-height: 0; }
  .section-block, .view-section { margin-top: 24px; }
  .section-heading { flex-wrap: wrap; gap: 7px; }
  .feature-grid, .card-grid { gap: 10px; }
  .feature-grid { grid-template-columns: 1fr; margin-top: 13px; }
  .feature { padding: 13px; }
  .profile-hero { gap: 12px; padding-top: 14px; }
  .avatar-large { width: 59px; height: 59px; border-radius: 13px; font-size: 1.55rem; }
}

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

@media (max-width: 340px) {
  .tabs a .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-backdrop, .cover-stage { transform: none; }
  *, *::before, *::after { transition: none !important; }
}
