:root,
html.light {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f8f9fa;
  --panel-tint: #eaedfd;
  --text: #2c573e;
  --heading: #2c573e;
  --muted: rgba(0, 0, 0, 0.6);
  --line: #e0e0e0;
  --line-strong: #c9c9c9;
  --link: #007bff;
  --link-hover: #0056b3;
  --accent: #2c573e;
  --accent-strong: #1a3d2e;
  --shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.08);
  --header-line: rgba(0, 0, 0, 0.1);
  --focus-ring: rgba(0, 123, 255, 0.25);
  --quote-bg: rgba(211, 211, 211, 0.46);
  --btn-bg: #28a745;
  --btn-bg-hover: #218838;
  --btn-fg: #ffffff;
  --btn-secondary-bg: #f8f9fa;
  --btn-secondary-bg-hover: #e9ecef;
  /* aliases used by a few late rules */
  --border: var(--line);
  --bg-alt: var(--panel-soft);
}

html.dark {
  color-scheme: dark;
  --bg: #101815;
  --panel: #17241e;
  --panel-soft: #1d2c25;
  --panel-tint: #17241e;
  --text: #d6e3dc;
  --heading: #f0f7f3;
  --muted: #a8bbb0;
  --line: #2a3a32;
  --line-strong: #35463d;
  --link: #8ed8ad;
  --link-hover: #b9efce;
  --accent: #8ed8ad;
  --accent-strong: #b9efce;
  --shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.45);
  --header-line: #2a3a32;
  --focus-ring: rgba(142, 216, 173, 0.16);
  --quote-bg: #17241e;
  --btn-bg: #28a745;
  --btn-bg-hover: #218838;
  --btn-fg: #ffffff;
  --btn-secondary-bg: rgba(142, 216, 173, 0.1);
  --btn-secondary-bg-hover: rgba(142, 216, 173, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.55;
}

a {
  color: var(--link);
  font-weight: 400;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

body > .container > .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-start;
  margin-right: -15px;
  margin-left: -15px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body > .container > .row:hover,
body > .container > .row:focus {
  border-color: transparent;
  box-shadow: none;
  text-decoration: none;
}

body > .container > .row > .col {
  position: relative;
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.text-center {
  text-align: center !important;
}

.site-title-row .col {
  position: relative;
}

.site-title-row h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding: 0;
  border: 0;
  color: inherit;
  font-family: "Raleway", sans-serif;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.theme-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(44, 87, 62, 0.25);
  border-radius: 0.35rem;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  min-height: 0;
  padding: 0;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  font-weight: 400;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background-color: rgba(44, 87, 62, 0.08);
  border-color: rgba(44, 87, 62, 0.45);
  color: inherit;
  outline: none;
  text-decoration: none;
}

.theme-toggle-icon {
  display: block;
  fill: none;
  height: 1.25rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1.25rem;
}

.theme-toggle-icon-dark {
  display: none;
}

.dark .theme-toggle-icon-light {
  display: none;
}

.dark .theme-toggle-icon-dark {
  display: block;
}

html.dark .theme-toggle,
.dark .theme-toggle {
  border-color: rgba(214, 227, 220, 0.28);
}

html.dark .theme-toggle:hover,
html.dark .theme-toggle:focus,
.dark .theme-toggle:hover,
.dark .theme-toggle:focus {
  background-color: rgba(214, 227, 220, 0.08);
  border-color: rgba(214, 227, 220, 0.45);
}

.header {
  font-size: 1.2rem;
}

.header-gap {
  width: 1em;
  display: inline-block;
}

.podwiki-subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.2rem auto 0.8rem;
  font-family: "Raleway", "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
}

.podwiki-subnav a {
  padding: 0.25rem 0.45rem;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}

.podwiki-subnav a:hover,
.podwiki-subnav a:focus {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.page {
  width: min(100% - 2rem, 1040px);
  margin: 0 auto;
  padding: 2.75rem 0 4.5rem;
}

h1,
h2,
h3,
h4 {
  color: var(--heading);
  font-family: "Raleway", "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: 0;
}

h2 {
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.55rem, 3vw, 2rem);
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.35rem;
}

p,
ul,
ol {
  margin-top: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.home-search,
.search-panel {
  display: flex;
  gap: 0.65rem;
  width: min(100%, 760px);
  margin: 1.75rem auto 2rem;
}

.home-search input[type="search"] {
  min-width: 0;
  flex: 1 1 auto;
}

.home-search-button {
  flex: 0 0 auto;
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--heading);
}

.home-search-button:hover,
.home-search-button:focus {
  border-color: var(--accent);
  background: var(--panel);
  color: var(--accent-strong);
}

/* visually hidden but available to screen readers / document outline */
.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;
}

.home-more {
  margin: 2.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-actions,
.graph-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0 2.75rem;
}

input[type="search"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--panel);
  color: var(--heading);
  font: inherit;
}

input[type="search"]:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
  outline: none;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--btn-bg);
  border-radius: 0.35rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

button:hover,
button:focus,
.button:hover,
.button:focus {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-fg);
  text-decoration: none;
}

.button.secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--line-strong);
  color: var(--accent);
}

.button.secondary:hover,
.button.secondary:focus {
  background: var(--btn-secondary-bg-hover);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.card,
.result,
.row {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--panel);
}

.card:hover,
.card:focus,
.result:hover,
.result:focus,
.row:hover,
.row:focus {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card strong,
.row strong {
  color: var(--heading);
}

.card span,
.row span,
.muted,
.result-meta {
  color: var(--muted);
}

.card span {
  display: block;
  margin-top: 0.35rem;
}

.list {
  display: grid;
  gap: 0.55rem;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

body > .container > .row,
body > .container > .row:hover,
body > .container > .row:focus,
body > .container > .row:focus-within {
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body > .container > .row .header-item,
body > .container > .row .header-item:hover,
body > .container > .row .header-item:focus {
  transform: none;
}

body > .container > .row hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

html.dark body > .container > .row hr,
.dark body > .container > .row hr {
  border-top-color: #2a3a32;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.podcast-source {
  margin: 1rem 0;
  text-align: center;
}

.podcast-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
}

.podcast-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.podcast-list-item {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.podcast-list-item h2 {
  margin: 0.2rem 0 0.35rem;
  padding: 0;
  border: 0;
  font-size: 1.35rem;
}

.podcast-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 0;
}

.meta a {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  background: var(--panel);
  color: var(--link);
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
}

.meta a:hover,
.meta a:focus {
  border-color: var(--line-strong);
  color: var(--link-hover);
  text-decoration: underline;
}

.crosslink-panel {
  margin: 1.25rem 0 2rem;
  padding: 1rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-tint);
}

.crosslink-panel h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
  text-align: center;
}

.graph-connections {
  margin: 2.5rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
}

.graph-connections h2 {
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
  text-align: center;
}

.graph-open {
  margin: 0.9rem 0 0;
  text-align: center;
}

.graph-embed-intro {
  max-width: 680px;
  margin: 0 auto 0.85rem;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.graph-embed-types {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.graph-embed-types li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.graph-embed-types strong {
  color: var(--heading);
  font-size: 0.78rem;
}

.graph-embed-type-dot {
  display: inline-block;
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: var(--node-color, var(--accent));
  flex-shrink: 0;
}

.graph-embed {
  margin: 0.75rem 0 1rem;
}

.graph-embed-canvas {
  display: block;
  width: 100%;
  height: clamp(320px, 48vw, 460px);
  max-height: 460px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.graph-embed-related {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.graph-embed-related h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 1.05rem;
}

.graph-embed-related h3 span,
.graph-embed-related-count {
  min-width: 1.55rem;
  padding: 0.02rem 0.45rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.graph-embed-related-group {
  display: grid;
  gap: 0.35rem;
}

.graph-embed-related-group h4 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.25rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.graph-embed-related-list {
  display: grid;
  gap: 0.35rem;
}

.graph-embed-related-node {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.graph-embed-related-node[hidden] {
  display: none;
}

.graph-embed-related-node:hover,
.graph-embed-related-node:focus-within,
.graph-embed-related-node.is-active {
  border-color: var(--line-strong);
  background: var(--panel-tint);
}

.graph-embed-related-main {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.graph-embed-related-title {
  overflow-wrap: anywhere;
  color: var(--heading);
  font-weight: 700;
  line-height: 1.25;
}

.graph-embed-related-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.graph-embed-related-actions {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.graph-embed-related-open,
.graph-embed-related-explore,
.graph-embed-related-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.3rem;
  background: var(--panel-soft);
  color: var(--link);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.graph-embed-related-explore,
.graph-embed-related-more {
  appearance: none;
}

.graph-embed-related-open:hover,
.graph-embed-related-open:focus,
.graph-embed-related-explore:hover,
.graph-embed-related-explore:focus,
.graph-embed-related-more:hover,
.graph-embed-related-more:focus {
  border-color: var(--link-hover);
  background: var(--panel);
  color: var(--link-hover);
  text-decoration: none;
}

.graph-embed-related-open:focus-visible,
.graph-embed-related-explore:focus-visible,
.graph-embed-related-more:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.graph-embed-related-more {
  justify-self: start;
  margin-top: 0.1rem;
}

.knowledge-page p a,
.knowledge-page li a,
.knowledge-page table a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 80%, transparent);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

.knowledge-page p a:hover,
.knowledge-page li a:hover,
.knowledge-page table a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.results {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.result h2 {
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
}

.knowledge-page,
.episode,
.guest,
.topic {
  max-width: 780px;
  margin: 0 auto;
}

.knowledge-page > p:first-of-type:not(.eyebrow),
.page > p:first-of-type {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  font-size: 1.15rem;
  text-align: center;
}

.lede {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.45;
  text-align: center;
}

blockquote {
  margin: 1.25rem 0;
  padding: 1rem;
  border-left: 4px solid var(--accent);
  background: var(--quote-bg);
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--panel);
}

th,
td {
  padding: 0.55rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--heading);
}

code {
  color: var(--heading);
}

.graph-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 0.9rem;
  align-items: end;
  margin: 1.5rem 0 1.1rem;
}

.graph-search {
  position: relative;
}

.graph-search span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.graph-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}

.graph-search-results li {
  margin: 0;
}

.graph-search-results button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.graph-search-results button:hover,
.graph-search-results button:focus {
  background: var(--panel-soft);
  color: var(--accent-strong);
}

.graph-search-results button span {
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.graph-search-empty {
  padding: 0.5rem 0.6rem;
  color: var(--muted);
}

.graph-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
}

.graph-trail:empty {
  display: none;
}

.trail-back,
.trail-crumb {
  min-height: 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: var(--panel-soft);
  color: var(--link);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.trail-back:hover,
.trail-back:focus,
.trail-crumb:hover,
.trail-crumb:focus {
  border-color: var(--accent);
  color: var(--link-hover);
  background: var(--panel-soft);
  text-decoration: underline;
}

.trail-current {
  color: var(--heading);
  font-weight: 700;
}

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

.trail-hint {
  color: var(--muted);
  font-style: italic;
}

.graph-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  align-items: start;
}

.graph-stage,
.graph-panel {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
}

.graph-stage {
  min-height: 620px;
  overflow: hidden;
}

#podcast-graph-canvas {
  display: block;
  width: 100%;
  height: 620px;
}

/* Detail panel: a fixed-height twin card of the canvas, with a pinned
   identity header and an independently scrolling connections list. */
.graph-panel {
  position: sticky;
  top: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 620px;
  padding: 0;
  overflow: hidden;
}

.panel-head {
  flex-shrink: 0;
  padding: 1.15rem 1.15rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.graph-panel .eyebrow {
  margin: 0 0 0.3rem;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.graph-panel h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.28rem;
  line-height: 1.22;
  color: var(--heading);
}

.panel-summary {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.graph-panel .graph-actions {
  margin: 0.95rem 0 0;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: stretch;
}

.graph-panel .graph-actions .button {
  flex: 1;
  min-height: 2.4rem;
  padding: 0 0.6rem;
  font-size: 0.9rem;
}

.panel-conn-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.panel-conn-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--heading);
}

.conn-total {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1.1rem 1.1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.panel-body::-webkit-scrollbar {
  width: 9px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 5px;
  border: 3px solid var(--panel);
}

.graph-related {
  display: grid;
  gap: 0.9rem;
}

.related-group {
  display: grid;
  gap: 0.05rem;
}

.related-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.2rem;
  padding: 0.5rem 0 0.3rem;
  background: var(--panel);
  color: var(--muted);
  font-family: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.type-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.related-count {
  margin-left: auto;
  min-width: 1.5rem;
  padding: 0.02rem 0.4rem;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.related-list {
  display: grid;
  gap: 0.05rem;
}

.related-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 0;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--link);
  text-align: left;
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.3;
}

.related-node .rn-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.related-node .rn-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-node .rn-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.related-node::after {
  content: "\203A";
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.related-node:hover,
.related-node:focus {
  background: var(--panel-soft);
  color: var(--link-hover);
}

.related-node:hover::after,
.related-node:focus::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--link-hover);
}

.related-node:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.related-node.is-extra {
  display: none;
}

.related-group.expanded .related-node.is-extra {
  display: flex;
}

.related-more {
  justify-self: start;
  min-height: 0;
  margin-top: 0.2rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  background: transparent;
  color: var(--link);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.related-more:hover,
.related-more:focus {
  background: transparent;
  color: var(--link-hover);
  text-decoration: underline;
}

@media (max-width: 768px) {
  body {
    font-size: 1rem;
  }

  .theme-toggle {
    height: 2rem;
    right: 0;
    width: 2.25rem;
  }

  .header-gap {
    width: 0.2em;
  }

  .page {
    width: min(100% - 1.5rem, 1040px);
    padding-top: 0.75rem;
  }

  .home-search,
  .search-panel {
    margin-top: 0.75rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    margin-top: 2.25rem;
    font-size: 1.5rem;
  }

  .home-search,
  .search-panel,
  .graph-controls,
  .row {
    flex-direction: column;
    align-items: stretch;
  }

  body > .container > .row {
    flex-direction: row;
    align-items: initial;
  }

  .home-search,
  .search-panel {
    display: flex;
  }

  .home-search {
    flex-direction: row;
    align-items: stretch;
  }

  .quick-actions,
  .graph-actions,
  .meta,
  .summary-meta {
    justify-content: flex-start;
  }

  .graph-controls,
  .graph-shell {
    display: flex;
    flex-direction: column;
  }

  .graph-stage,
  .graph-panel {
    min-height: auto;
  }

  .graph-panel {
    position: static;
    height: auto;
    max-height: none;
  }

  .panel-body {
    overflow: visible;
  }

  #podcast-graph-canvas {
    height: 440px;
  }

  .graph-connections {
    padding: 0.85rem;
  }

  .graph-embed-canvas {
    height: 300px;
  }

  .graph-embed-related-node {
    align-items: stretch;
    flex-direction: column;
    gap: 0.45rem;
  }

  .graph-embed-related-actions {
    justify-content: flex-start;
  }

  .graph-embed-related-open,
  .graph-embed-related-explore {
    flex: 1 1 8rem;
  }
}

/* Special Pages filter */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.tag-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border, #d0d0d0);
  background: transparent;
  color: var(--muted, #666);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.tag-btn:hover {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

.tag-btn.active {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  color: #fff;
}

.special-card .card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.special-card .card-tags em {
  font-style: normal;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #888);
  background: var(--bg-alt, #f4f4f4);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
