:root {
  color-scheme: light;
  --bg: #edf3f7;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.76);
  --glass-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.38));
  --glass-surface-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.48));
  --glass-border: rgba(255, 255, 255, 0.56);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --ink: #13243f;
  --muted: #51647d;
  --navy: #102d54;
  --navy-2: #0b1f3c;
  --sage: #668474;
  --gold: #b98a2e;
  --rust: #9b5740;
  --border: rgba(37, 57, 89, 0.13);
  --shadow: 0 26px 80px rgba(30, 48, 80, 0.16);
  --shadow-soft: 0 14px 44px rgba(30, 48, 80, 0.1);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(125deg, rgba(243, 230, 202, 0.58) 0%, rgba(230, 241, 248, 0.54) 34%, rgba(224, 235, 228, 0.5) 68%, rgba(250, 246, 238, 0.68) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.18)),
    url("assets/glass-landscape-bg.png") center / cover no-repeat fixed,
    linear-gradient(125deg, rgba(243, 230, 202, 0.94) 0%, rgba(230, 241, 248, 0.84) 34%, rgba(224, 235, 228, 0.78) 68%, rgba(250, 246, 238, 0.96) 100%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-width: 0;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(24px);
  box-shadow: 12px 0 52px rgba(30, 48, 80, 0.08);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.brand {
  display: grid;
  gap: 5px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 246, 225, 0.58)),
    rgba(255, 255, 255, 0.6);
  color: var(--gold);
  box-shadow: var(--glass-inset), 0 14px 28px rgba(185, 138, 46, 0.16);
  font-weight: 900;
}

.brand-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 900;
}

.nav-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 750;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--glass-inset), 0 12px 32px rgba(30, 48, 80, 0.08);
  backdrop-filter: blur(18px);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
}

.nav-link.active .nav-dot {
  opacity: 1;
}

.main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 24px clamp(18px, 3vw, 38px) 44px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.search {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(24px);
  box-shadow: var(--glass-inset), 0 16px 40px rgba(30, 48, 80, 0.09);
  color: var(--ink);
  outline: none;
}

.search:focus {
  border-color: rgba(102, 132, 116, 0.58);
  box-shadow: var(--glass-inset), 0 0 0 4px rgba(102, 132, 116, 0.18), 0 16px 40px rgba(30, 48, 80, 0.1);
}

.top-actions {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
  color: white;
  font-size: 0.93rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 28px rgba(16, 45, 84, 0.22);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.button.secondary {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.56);
  color: var(--navy);
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-inset), 0 12px 26px rgba(30, 48, 80, 0.07);
}

.button.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--navy);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 36px rgba(16, 45, 84, 0.24);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

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

.glass-card,
.card,
.panel,
.tip {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass-surface);
  backdrop-filter: blur(24px);
  box-shadow: var(--glass-inset), var(--shadow-soft);
}

.glass-card::before,
.card::before,
.panel::before,
.tip::before,
.scripture-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 38%);
}

.card,
.panel {
  padding: 22px;
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(2.15rem, 4vw, 3.55rem);
  line-height: 1.05;
  font-weight: 900;
}

h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  font-weight: 900;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.3;
  font-weight: 850;
}

p {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.62;
}

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

.micro {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-inset), 0 8px 20px rgba(30, 48, 80, 0.06);
}

.chip:hover {
  border-color: rgba(102, 132, 116, 0.55);
}

.chip.gold {
  border-color: rgba(185, 138, 46, 0.46);
  background: rgba(255, 247, 228, 0.58);
}

.reference-chip-grid {
  align-items: flex-start;
}

.reference-chip-grid .chip {
  justify-content: flex-start;
  min-width: 118px;
}

.profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reference-carousel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.reference-carousel-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--navy);
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-inset), 0 12px 26px rgba(30, 48, 80, 0.07);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(102, 132, 116, 0.58);
  box-shadow: var(--glass-inset), 0 0 0 4px rgba(102, 132, 116, 0.16), 0 14px 30px rgba(30, 48, 80, 0.1);
  outline: none;
}

.reference-carousel-track {
  display: flex;
  gap: 14px;
  min-width: 0;
  margin: 0 -2px;
  padding: 2px 2px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(16, 45, 84, 0.42) rgba(255, 255, 255, 0.2);
  scrollbar-width: thin;
}

.reference-carousel-track::-webkit-scrollbar {
  height: 10px;
}

.reference-carousel-track::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.reference-carousel-track::-webkit-scrollbar-thumb {
  border: 2px solid rgba(237, 243, 247, 0.72);
  border-radius: 999px;
  background: rgba(16, 45, 84, 0.42);
}

.reference-card {
  flex: 0 0 clamp(168px, 23vw, 224px);
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(236, 244, 240, 0.42)),
    rgba(255, 255, 255, 0.45);
  color: var(--navy);
  scroll-snap-align: start;
  text-align: left;
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-inset), 0 14px 32px rgba(30, 48, 80, 0.08);
}

.reference-card:hover,
.reference-card:focus-visible {
  border-color: rgba(185, 138, 46, 0.52);
  box-shadow: var(--glass-inset), 0 0 0 4px rgba(185, 138, 46, 0.14), 0 18px 38px rgba(30, 48, 80, 0.12);
  outline: none;
}

.reference-card-index {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.reference-card-book {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.15;
}

.reference-card-range {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.1;
}

.timeline-chart-shell {
  position: relative;
  min-height: clamp(680px, 82vh, 900px);
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.4)),
    rgba(238, 246, 245, 0.54);
  backdrop-filter: blur(24px);
  box-shadow: var(--glass-inset), var(--shadow-soft);
  overflow: hidden;
}

.timeline-chart-shell::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(19, 36, 63, 0.14);
  border-radius: 18px;
  pointer-events: none;
}

.timeline-chart-heading {
  position: absolute;
  top: clamp(26px, 4vw, 42px);
  right: clamp(28px, 4vw, 50px);
  z-index: 6;
  max-width: 260px;
  text-align: right;
}

.timeline-chart-heading h1 {
  margin: 0;
  color: rgba(19, 36, 63, 0.88);
  font-size: clamp(2.1rem, 4.2vw, 3.55rem);
  line-height: 0.96;
  text-transform: uppercase;
  letter-spacing: 0;
}

.timeline-chart-canvas {
  position: relative;
  min-height: clamp(620px, 76vh, 820px);
  isolation: isolate;
}

.timeline-orbit {
  position: absolute;
  left: 43%;
  top: 52%;
  width: min(700px, 82%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.timeline-ring,
.timeline-spoke,
.timeline-era-band,
.timeline-era-label,
.timeline-person-node,
.timeline-center {
  position: absolute;
}

.timeline-ring {
  left: 50%;
  top: 50%;
  width: var(--ring-size);
  aspect-ratio: 1;
  border: 1px solid rgba(35, 72, 82, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.timeline-spoke {
  left: 50%;
  top: 50%;
  width: 51%;
  height: 1px;
  transform: rotate(var(--spoke-angle));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(19, 36, 63, 0.2), rgba(19, 36, 63, 0.04));
}

.timeline-spoke::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(19, 36, 63, 0.42);
}

.timeline-era-band {
  left: 50%;
  top: 50%;
  width: var(--era-size);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from calc(var(--era-start) + 90deg),
    var(--era-color) 0deg var(--era-sweep),
    transparent var(--era-sweep) 360deg
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 18px), #000 calc(100% - 17px) calc(100% - 2px), transparent calc(100% - 1px));
  opacity: 0.5;
  filter: drop-shadow(0 8px 18px rgba(30, 48, 80, 0.08));
}

.timeline-era-label {
  z-index: 3;
  max-width: 118px;
  transform: translate(-50%, -50%) rotate(var(--label-angle));
  color: rgba(19, 36, 63, 0.58);
  font-size: clamp(0.54rem, 0.88vw, 0.68rem);
  font-weight: 850;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.timeline-person-node {
  z-index: 4;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--node-color);
  box-shadow: 0 7px 16px rgba(19, 36, 63, 0.14);
  transform: translate(-50%, -50%);
  text-decoration: none;
}

.timeline-person-node.tier-1 {
  width: 17px;
  height: 17px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.64), 0 12px 26px rgba(19, 36, 63, 0.2);
}

.timeline-person-node span {
  position: absolute;
  left: 50%;
  top: 15px;
  display: none;
  width: max-content;
  max-width: 96px;
  transform: translateX(-50%);
  color: rgba(19, 36, 63, 0.82);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.92);
}

.timeline-person-node.show-label span,
.timeline-person-node:hover span,
.timeline-person-node:focus-visible span {
  display: block;
}

.timeline-person-node:hover,
.timeline-person-node:focus-visible {
  z-index: 8;
  outline: none;
  box-shadow: 0 0 0 5px rgba(185, 138, 46, 0.2), 0 14px 26px rgba(19, 36, 63, 0.2);
}

.timeline-center {
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 90px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 8px solid rgba(220, 179, 83, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 32%),
    linear-gradient(145deg, rgba(111, 165, 143, 0.82), rgba(16, 45, 84, 0.9));
  color: white;
  font-weight: 950;
  letter-spacing: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 44px rgba(30, 48, 80, 0.22);
}

.timeline-center span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(19, 36, 63, 0.42);
}

.timeline-chart-legend {
  position: absolute;
  right: 24px;
  top: 168px;
  z-index: 7;
  width: min(250px, 30%);
  display: grid;
  gap: 7px;
}

.timeline-legend-item {
  min-height: 34px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.12;
  text-decoration: none;
  backdrop-filter: blur(14px);
  box-shadow: var(--glass-inset), 0 8px 18px rgba(30, 48, 80, 0.06);
}

.timeline-legend-item strong {
  color: var(--muted);
  font-size: 0.68rem;
}

.timeline-legend-swatch {
  width: 12px;
  height: 22px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.person-list {
  display: grid;
  gap: 10px;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-link {
  display: grid;
  gap: 3px;
  padding: 8px 0 10px;
  border-bottom: 1px solid rgba(37, 57, 89, 0.12);
  color: var(--ink);
  text-decoration: none;
}

.compact-link:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.person-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-inset), 0 10px 24px rgba(30, 48, 80, 0.06);
  text-decoration: none;
  min-width: 0;
}

.person-row:hover {
  border-color: rgba(102, 132, 116, 0.55);
}

.person-row-avatar {
  width: 54px;
  height: 68px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-inset), 0 10px 22px rgba(30, 48, 80, 0.14);
}

.person-row-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.person-name {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.profile-layout {
  width: 100%;
  min-width: 0;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.profile-heading {
  min-width: 0;
}

.person-portrait {
  width: min(220px, 34vw);
  margin: 0;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-inset), 0 20px 46px rgba(30, 48, 80, 0.18);
}

.person-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
}

.person-portrait figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.profile-section {
  display: grid;
  gap: 10px;
}

.profile-section h2 {
  margin-bottom: 0;
}

.study-guide {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.36);
  box-shadow: var(--glass-inset), 0 16px 36px rgba(30, 48, 80, 0.08);
}

.study-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.study-header h2 {
  margin-bottom: 4px;
}

.study-header p {
  margin-bottom: 0;
}

.study-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
  gap: 8px;
  max-width: 100%;
}

.study-tab {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--navy);
  text-align: left;
  box-shadow: var(--glass-inset), 0 10px 22px rgba(30, 48, 80, 0.06);
}

.study-tab span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.study-tab strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.study-tab.active {
  border-color: rgba(16, 45, 84, 0.38);
  background: linear-gradient(145deg, rgba(16, 45, 84, 0.96), rgba(11, 31, 60, 0.92));
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 30px rgba(16, 45, 84, 0.22);
}

.study-tab.active span {
  color: rgba(255, 255, 255, 0.72);
}

.study-part {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
}

.study-part p:last-child {
  margin-bottom: 0;
}

.study-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 20px;
}

.study-list li {
  color: var(--ink);
  line-height: 1.5;
}

.section-title {
  margin-bottom: 12px;
}

.tip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(255, 249, 236, 0.68), rgba(255, 255, 255, 0.38));
  border-color: rgba(255, 255, 255, 0.56);
}

.tip p {
  margin: 0;
  color: var(--navy);
  font-size: 0.94rem;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.radio-row {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.radio-row.selected {
  border-color: rgba(102, 132, 116, 0.58);
  background: rgba(237, 243, 237, 0.68);
}

.empty {
  padding: 24px;
  border: 1px dashed rgba(37, 57, 89, 0.18);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  background: rgba(15, 42, 74, 0.28);
  backdrop-filter: blur(8px);
  overflow: hidden;
  padding: 22px;
}

body:has(.modal-backdrop) {
  overflow: hidden;
}

.scripture-modal {
  width: min(900px, 100%);
  max-height: min(82vh, 760px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--glass-surface-strong);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(37, 57, 89, 0.12);
}

.modal-actions {
  border-top: 1px solid rgba(37, 57, 89, 0.12);
  border-bottom: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.modal-body {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.passage-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.scripture-text {
  max-height: clamp(220px, 36vh, 390px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(16, 45, 84, 0.44) rgba(255, 255, 255, 0.22);
  scrollbar-width: thin;
  padding: 18px;
  padding-right: 22px;
  padding-bottom: 24px;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  background: rgba(255, 248, 232, 0.66);
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.72;
  white-space: pre-line;
}

.scripture-text::-webkit-scrollbar {
  width: 10px;
}

.scripture-text::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.scripture-text::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 248, 232, 0.66);
  border-radius: 999px;
  background: rgba(16, 45, 84, 0.44);
}

.scripture-text::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 45, 84, 0.62);
}

.chapter-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(237, 243, 237, 0.68);
}

.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;
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  }

  .brand {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    margin-bottom: 14px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    white-space: nowrap;
  }

  .topbar,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .timeline-chart-shell {
    min-height: auto;
  }

  .timeline-chart-heading {
    position: relative;
    top: auto;
    right: auto;
    max-width: 100%;
    margin-bottom: 18px;
    text-align: left;
  }

  .timeline-chart-canvas {
    min-height: auto;
    display: grid;
    gap: 18px;
  }

  .timeline-orbit {
    position: relative;
    left: auto;
    top: auto;
    width: min(100%, 680px);
    margin: 0 auto;
    transform: none;
  }

  .timeline-chart-legend {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }
}

@media (max-width: 620px) {
  .main {
    padding: 14px 12px 28px;
  }

  .top-actions,
  .tip,
  .modal-header,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tip {
    display: flex;
  }

  .button,
  .button.secondary,
  .button.subtle {
    width: 100%;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .person-portrait {
    width: min(100%, 280px);
  }

  .study-guide {
    padding: 14px;
  }

  .person-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .person-row > .chip {
    grid-column: 2;
    justify-self: start;
  }

  .modal-backdrop {
    padding: 0;
  }

  .scripture-modal {
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .timeline-chart-shell {
    padding: 14px;
  }

  .timeline-chart-shell::before {
    inset: 9px;
    border-radius: 20px;
  }

  .timeline-chart-heading h1 {
    font-size: 2.1rem;
  }

  .timeline-era-label {
    display: none;
  }

  .timeline-person-node span {
    max-width: 72px;
    font-size: 0.58rem;
  }

  .timeline-center {
    width: 68px;
    border-width: 6px;
  }

  .timeline-center span {
    width: 42px;
    height: 42px;
  }
}
