/* Fogline Geary Subway Guide, shared styles */

:root {
  --bg: #f7f4ee;
  --bg-elev: #fdfaf2;
  --ink: #222222;
  --muted: #666666;
  --rule: #d6cfbf;
  --accent: #9e1f0c;

  /* Status / category colors */
  --done: #7d7d7d;
  --current: #cd853f;
  --pending: #9e1f0c;
  --future: #b8b3a4;
  --rail: #9e1f0c;
  --brt: #fdae61;
  --downgrade: #cd853f;
  --delivered: #7d7d7d;

  /* Funding segment colors */
  --federal: #4a6fa0;
  --local-tax: #9e1f0c;
  --state: #6b8e4a;
  --value-cap: #fdae61;
  --other: #b8b3a4;
  --tbd: #cccccc;

  --serif: Charter, "Iowan Old Style", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
}

/* SITE HEADER (every page) */
.site-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule);
}
.site-header-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-section {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-left: 4px;
}
.brand:hover .brand-name { color: var(--accent); }
.site-nav {
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}
.site-nav a.nav-subscribe {
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 3px 10px;
  border-radius: 3px;
}
.site-nav a.nav-subscribe:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown > a::after {
  content: "";
  display: inline-block;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  margin-left: 6px;
  vertical-align: 2px;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 6px 0;
  margin-top: 0;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* Invisible bridge so the cursor can cross from parent to menu without losing hover */
.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
  display: none;
}
.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
  display: block;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block !important;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}
.nav-dropdown-menu a:hover {
  background: rgba(214, 207, 191, 0.4);
  color: var(--accent);
}
.nav-dropdown-divider {
  display: block;
  height: 1px;
  background: rgba(126, 116, 96, 0.25);
  margin: 6px 12px;
}

/* Overlay variant: same light header, but positioned over a full-viewport
   element below it (used on the explore map page). */
.site-header.site-header-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
}
.footer-subscribe {
  font-weight: 500;
}
.footer-subscribe a {
  font-weight: 700;
  color: var(--accent);
}

/* HERO MAP (landing page only) - full viewport width */
.hero {
  background: var(--bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0;
}

/* Page intro block (title block above the hero) */
.page-intro {
  background: var(--bg);
}
.page-intro-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}
.page-intro-wrap .page-kicker,
.page-intro-wrap .page-title,
.page-intro-wrap .page-subtitle,
.page-intro-wrap .page-byline {
  margin-top: 0;
}
.hero-map {
  width: 100%;
  margin: 0;
  display: block;
}
.hero-map img,
.hero-map svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Map legend (sits below the full-width map, content-width) */
.hero-legend {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
}
.hero-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-legend .swatch-line {
  display: inline-block;
  width: 32px;
  height: 5px;
  border-radius: 2px;
  vertical-align: middle;
}
.hero-legend .swatch-dashed {
  background: repeating-linear-gradient(
    to right,
    #3a7d7d 0,
    #3a7d7d 8px,
    transparent 8px,
    transparent 14px
  );
  border-radius: 0;
}
.hero-legend .swatch-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  vertical-align: middle;
}
.hero-legend .legend-label {
  color: var(--ink);
}
.hero-legend .legend-detail {
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

.hero-explore-link {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 18px;
  font-family: var(--sans);
  font-size: 14px;
}
.hero-explore-link a {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}
.hero-explore-link a:hover { border-bottom-width: 3px; }
.hero-explore-link .hero-explore-detail {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* MAIN content area */
main.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
main.content.wide {
  max-width: 880px;
}

/* PAGE HEADER (inside main, for each page's title) */
.page-kicker {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 12px 0;
}
.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 24px 0;
}
.page-byline {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 32px 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.page-byline a { color: var(--muted); text-decoration: none; }
.page-byline a:hover { text-decoration: underline; }

/* Body typography */
h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin: 44px 0 14px 0;
}
h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  margin: 28px 0 10px 0;
}
p { margin: 0 0 18px 0; }
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

blockquote {
  font-style: italic;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 22px 0;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

ul, ol { margin: 0 0 18px 0; padding-left: 22px; }
li { margin-bottom: 6px; }

code {
  font-family: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 0.85em;
  background: rgba(214, 207, 191, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

/* STATUS BADGE */
.status-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 3px;
  vertical-align: 3px;
}
.status-badge.done { color: var(--done); background: rgba(125,125,125,0.14); }
.status-badge.current { color: #fff; background: var(--current); }
.status-badge.pending { color: #fff; background: var(--pending); }
.status-badge.future { color: var(--future); background: rgba(184,179,164,0.18); }

/* CALLOUT BOX */
.callout {
  background: rgba(214, 207, 191, 0.3);
  border-left: 4px solid var(--ink);
  padding: 18px 22px;
  margin: 28px 0;
}
.callout h2,
.callout h3 {
  margin-top: 0;
}
.callout.accent {
  border-left-color: var(--accent);
  background: rgba(158, 31, 12, 0.06);
}

/* DOCUMENT THUMBNAIL BLOCK — side-by-side scans of primary-source covers */
.doc-thumbs {
  display: flex;
  gap: 20px;
  margin: 24px 0 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.doc-thumb {
  flex: 1 1 240px;
  max-width: 280px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.doc-thumb img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(126, 116, 96, 0.35);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  display: block;
  margin: 0 auto 8px;
}
.doc-thumb a { color: var(--accent); text-decoration: none; }
.doc-thumb a:hover { text-decoration: underline; }
.doc-thumb-caption { display: block; line-height: 1.45; }

/* LANDING / OVERVIEW CARDS */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.card .card-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}
.card .card-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 8px 0;
  color: var(--ink);
}
.card .card-desc {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 14px 0;
}
.card .card-ask {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
  font-style: italic;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}

/* VISUALIZATION FRAME (shared with funding/lifecycle/timeline visuals) */
.viz {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--rule);
  padding: 24px 22px;
  margin: 28px 0;
}
.viz-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin: 0 0 4px 0;
}
.viz-sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 20px 0;
}
.viz-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  line-height: 1.5;
}

/* TIMELINE (vertical, used on history page) */
.timeline-legend {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.timeline-legend .swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: -1px;
  border: 1.5px solid var(--ink);
}
.timeline {
  border-left: 2px solid var(--rule);
  padding: 4px 0 4px 28px;
  margin-left: 8px;
  position: relative;
}
.event {
  position: relative;
  padding: 0 0 26px 0;
}
.event:last-child { padding-bottom: 0; }
.event::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--delivered);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px var(--bg);
}
.event.rail::before { background: var(--rail); }
.event.brt::before { background: var(--brt); }
.event.downgrade::before { background: var(--downgrade); }
.event.delivered::before { background: var(--delivered); }

.event .year {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 2px;
}
.event .headline {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
}
.event .badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
}
.event.rail .badge { color: var(--rail); }
.event.brt .badge { color: #b07a1c; }
.event.downgrade .badge { color: #8e5a1c; }

/* LIFECYCLE (used on present page) */
.lifecycle {
  border-left: 2px solid var(--rule);
  padding: 4px 0 4px 0;
  margin-left: 16px;
  position: relative;
}
.phase {
  position: relative;
  padding: 0 0 30px 36px;
}
.phase:last-child { padding-bottom: 0; }
.phase::before {
  content: "";
  position: absolute;
  left: -12px; top: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--future);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px var(--bg);
}
.phase.done::before { background: var(--done); }
.phase.current::before { background: var(--current); }
.phase.pending::before { background: var(--pending); }
.phase-num {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 10px;
}
.phase-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  color: var(--ink);
  display: inline;
}
.phase-desc {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  margin: 10px 0 14px 0;
}
.entities {
  background: rgba(214, 207, 191, 0.22);
  border-left: 2px solid var(--rule);
  padding: 12px 16px;
  margin: 0;
  list-style: none;
}
.entities li {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 5px 0;
  padding-left: 0;
}
.entities li strong {
  color: var(--ink);
  font-weight: 700;
  margin-right: 4px;
}
.entities li .role {
  color: var(--muted);
  font-style: italic;
  margin-right: 4px;
}
.timing {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* FUNDING VISUALIZATIONS */
/* Stack */
.stack-target {
  background: rgba(158, 31, 12, 0.08);
  border: 2px solid var(--accent);
  padding: 14px 18px;
  margin-bottom: 10px;
  text-align: center;
}
.stack-target .label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}
.stack-target .amount {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
}
.stack-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0;
}
.stack-source {
  border: 2px dashed var(--muted);
  background: rgba(255,255,255,0.5);
  padding: 10px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.stack-source.committed {
  border-style: solid;
  border-color: var(--federal);
  background: rgba(74, 111, 160, 0.08);
}
.stack-source .src-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.stack-source .src-status {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.stack-gap {
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 6px,
    rgba(204,204,204,0.4) 6px, rgba(204,204,204,0.4) 12px
  );
  border: 1px dashed var(--muted);
  padding: 22px 16px;
  margin: 8px 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Peer comparison bars */
.peer-row {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.peer-row .name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.peer-row .name .sub {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}
.peer-bar {
  display: flex;
  height: 28px;
  border: 1px solid var(--ink);
  background: var(--bg);
  overflow: hidden;
}
.peer-bar .seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 2px rgba(0,0,0,0.4);
  overflow: hidden;
  white-space: nowrap;
}
.seg.federal { background: var(--federal); }
.seg.local-tax { background: var(--local-tax); }
.seg.state { background: var(--state); }
.seg.value-cap { background: var(--value-cap); color: var(--ink); text-shadow: none; }
.seg.other { background: var(--other); color: var(--ink); text-shadow: none; }
.seg.tbd {
  background: repeating-linear-gradient(
    45deg, transparent, transparent 5px,
    var(--tbd) 5px, var(--tbd) 10px
  );
  color: var(--muted);
  text-shadow: none;
}
.peer-row .total {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.peer-row.geary .name { color: var(--accent); }
.peer-row.geary .peer-bar { border-color: var(--accent); border-width: 2px; }
.peer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.peer-legend .swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 5px;
  vertical-align: -1px;
  border: 1px solid var(--ink);
}

/* Flow diagram */
.flow-source {
  display: grid;
  grid-template-columns: 24px 1fr 90px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.flow-source .arrow { text-align: center; color: var(--muted); }
.flow-source .arrow.large { font-size: 26px; color: var(--federal); }
.flow-source .arrow.medium { font-size: 22px; color: var(--value-cap); }
.flow-source .arrow.small { font-size: 18px; color: var(--muted); }
.flow-source .arrow.unknown { font-size: 18px; color: var(--tbd); }
.flow-source .src {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
}
.flow-source .src strong { font-weight: 700; }
.flow-source .src .desc {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 1px;
}
.flow-source .scale {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-style: italic;
}
.flow-pot {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid var(--accent);
  background: rgba(158,31,12,0.06);
  text-align: center;
}
.flow-pot .pot-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}
.flow-pot .pot-amount {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
}
.flow-pot .pot-sub {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* OVERSIGHT BLOCK (used on lifecycle page) */
.oversight {
  margin: 42px 0 0 0;
  padding: 22px 24px;
  background: rgba(214, 207, 191, 0.3);
  border-left: 4px solid var(--ink);
}
.oversight h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 0 0 12px 0;
}
.oversight p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 12px 0;
}
.oversight ul {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  padding-left: 18px;
  margin: 0;
}
.oversight ul strong { color: var(--ink); }

/* GLOSSARY LISTS */
dl.glossary { margin: 0; }
dl.glossary dt {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-top: 18px;
}
dl.glossary dt .full {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
  margin-left: 8px;
  font-style: italic;
}
dl.glossary dd {
  margin: 4px 0 0 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.glossary-section {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 36px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.glossary-subsection {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 22px 0 4px 0;
}

/* LOG ENTRIES */
.log-entry {
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
}
.log-entry:first-of-type { padding-top: 0; }
.log-entry:last-of-type { border-bottom: none; }
.log-date {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}
.log-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 10px 0;
  color: var(--ink);
}
.log-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 2px 8px;
  background: rgba(214,207,191,0.4);
  border-radius: 2px;
  margin-left: 8px;
  vertical-align: 2px;
}

/* OBSTACLE NAV (prev/next) */
.obstacle-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 0 0;
  padding: 22px 0 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
}
.obstacle-nav a {
  text-decoration: none;
  color: var(--muted);
  flex: 1 1 auto;
}
.obstacle-nav a.prev { text-align: left; }
.obstacle-nav a.next { text-align: right; }
.obstacle-nav a:hover { color: var(--accent); }
.obstacle-nav .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.obstacle-nav .title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  font-weight: 700;
}

/* SITE FOOTER (every page) */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--rule);
  margin-top: 64px;
}
.site-footer-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
}
.footer-nav {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px 0;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 4px;
}
.footer-nav a:hover { color: var(--accent); }
.footer-meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}
.footer-meta a { color: var(--muted); text-decoration: underline; }

/* DEPENDENCY DEEP-DIVE TABLES (dependencies page), 3-column layout
   Selectors use .struct-table.dep-deeptable to override .struct-table rules
   defined later in the file. */
.struct-table.dep-deeptable td:first-child {
  width: 55%;
  white-space: normal;
  font-weight: 400;
}
.struct-table.dep-deeptable td:nth-child(2) { width: 14%; white-space: nowrap; }
.struct-table.dep-deeptable td:nth-child(3) {
  width: 31%;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: normal;
}
.struct-table.dep-deeptable td:first-child .dep-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--ink);
}
.struct-table.dep-deeptable td:first-child .dep-desc {
  margin: 0 0 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  font-weight: 400;
}

/* Attachment chips on dependency tickets */
.dep-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.dep-att {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #ffffff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
  transition: border-color 120ms ease, background 120ms ease;
}
.dep-att:hover {
  border-color: var(--accent);
  background: var(--bg-elev);
  text-decoration: none;
}
.dep-att::before {
  content: "📎";
  font-size: 10px;
  opacity: 0.65;
}
.dep-att-pdf::after {
  content: "PDF";
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(158,31,12,0.10);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 3px;
  letter-spacing: 0.05em;
}
.dep-att-link::after {
  content: "LINK";
  font-size: 9px;
  font-weight: 700;
  color: #555;
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 3px;
  letter-spacing: 0.05em;
}
.dep-att-page::after {
  content: "PAGE";
  font-size: 9px;
  font-weight: 700;
  color: #4a6fa0;
  background: rgba(74,111,160,0.10);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 3px;
  letter-spacing: 0.05em;
}

/* PDF modal viewer */
.pdf-modal {
  width: 92vw;
  max-width: 1200px;
  height: 90vh;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: white;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.pdf-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}
.pdf-modal[open] {
  display: flex;
  flex-direction: column;
}
.pdf-modal-header {
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13px;
  flex-shrink: 0;
}
.pdf-modal-title {
  flex: 1;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pdf-modal-newtab {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
}
.pdf-modal-newtab:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}
.pdf-modal-close {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
}
.pdf-modal-close:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.pdf-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #f5f5f5;
  min-height: 0;
}
@media (max-width: 720px) {
  .pdf-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }
}
@media (max-width: 720px) {
  .struct-table.dep-deeptable td:first-child,
  .struct-table.dep-deeptable td:nth-child(2),
  .struct-table.dep-deeptable td:nth-child(3) {
    width: auto;
  }
}

/* DEPENDENCY STACK (dependencies page) */
.dep-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 20px 0 30px;
  font-family: var(--sans);
}
.dep-tier {
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-elev);
  border-top-width: 3px;
}
.dep-tier-1 { border-top-color: #cd853f; background: rgba(205,133,63,0.04); }
.dep-tier-2 { border-top-color: #9e1f0c; background: rgba(158,31,12,0.04); }
.dep-tier-3 { border-top-color: #3a7d7d; background: rgba(58,125,125,0.04); }
.dep-tier-4 { border-top-color: #6b8e4a; background: rgba(107,142,74,0.04); }
.dep-tier-5 { border-top-color: #4a6fa0; background: rgba(74,111,160,0.04); }

.dep-tier-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  color: var(--ink);
}
.dep-tier-label .dep-tier-sub {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.dep-tier-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dep-item {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border-left: 3px solid;
  line-height: 1.3;
}
.dep-item::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}
.dep-resolved {
  background: rgba(107,142,74,0.15);
  border-left-color: #6b8e4a;
  color: #3a5e2a;
}
.dep-in-progress {
  background: rgba(74,111,160,0.15);
  border-left-color: #4a6fa0;
  color: #2a4a70;
}
.dep-pending {
  background: rgba(212,165,42,0.20);
  border-left-color: #c89818;
  color: #7a5810;
}
.dep-at-risk {
  background: rgba(205,133,63,0.20);
  border-left-color: #cd853f;
  color: #7a4a10;
}
.dep-blocked {
  background: rgba(158,31,12,0.15);
  border-left-color: #9e1f0c;
  color: #6a1500;
}
.dep-unknown {
  background: rgba(128,128,128,0.12);
  border-left-color: #888;
  color: #555;
}

.dep-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 20px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
}
.dep-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dep-legend-item::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dep-legend-resolved::before    { background: #6b8e4a; }
.dep-legend-in-progress::before { background: #4a6fa0; }
.dep-legend-pending::before     { background: #c89818; }
.dep-legend-at-risk::before     { background: #cd853f; }
.dep-legend-blocked::before     { background: #9e1f0c; }
.dep-legend-unknown::before     { background: #888; }

/* NESTING VIZ, three alternative layouts on the structure page */

/* Option A: Nested boxes (Russian doll) */
.viz-nested {
  font-family: var(--sans);
  font-size: 13px;
  margin: 16px 0 30px;
}
.nb-level {
  border: 2px solid;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--bg-elev);
}
.nb-level .nb-level { margin-top: 12px; }
.nb-federal { border-color: #4a6fa0; background: rgba(74,111,160,0.06); }
.nb-state    { border-color: #6b8e4a; background: rgba(107,142,74,0.07); }
.nb-region   { border-color: #3a7d7d; background: rgba(58,125,125,0.08); }
.nb-sf       { border-color: #9e1f0c; background: rgba(158,31,12,0.08); }
.nb-project  { border-color: #cd853f; background: rgba(205,133,63,0.10); }
.nb-label {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  color: var(--ink);
}
.nb-entities {
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 6px;
}
.nb-cac {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px dashed rgba(0,0,0,0.15);
  padding-top: 6px;
  margin-top: 6px;
}

/* Option B: Map + hierarchy hybrid */
.viz-mapdiag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0 30px;
  font-family: var(--sans);
  align-items: start;
}
.md-hierarchy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.md-tier {
  border-left: 4px solid;
  padding: 8px 12px;
  background: var(--bg-elev);
  border-radius: 0 5px 5px 0;
  font-size: 12px;
  line-height: 1.45;
}
.md-tier strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.md-tier-fed     { border-color: #4a6fa0; }
.md-tier-state   { border-color: #6b8e4a; }
.md-tier-region  { border-color: #3a7d7d; background: rgba(58,125,125,0.10); }
.md-tier-sf      { border-color: #9e1f0c; background: rgba(158,31,12,0.10); }
.md-tier-proj    { border-color: #cd853f; }
.md-tier .md-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.md-arrow {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  padding-left: 12px;
}

.md-map {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 2px;
  background: rgba(255,255,255,0.6);
  padding: 8px;
  border-radius: 6px;
  aspect-ratio: 1;
  font-family: var(--sans);
}
.md-county {
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  text-align: center;
  line-height: 1.05;
  padding: 1px;
}
.md-sonoma  { grid-area: 1/1/4/4; background: #4a7d3a; }
.md-napa    { grid-area: 1/4/3/6; background: #7da352; }
.md-solano  { grid-area: 1/6/3/9; background: #2a7d7d; }
.md-marin   { grid-area: 4/1/7/3; background: #4a8eb0; }
.md-cc      { grid-area: 3/6/5/9; background: #6e5a9c; }
.md-sf      { grid-area: 5/3/6/5; background: #9e1f0c; outline: 2px solid #cd853f; outline-offset: 1px; z-index: 2; }
.md-alameda { grid-area: 5/5/7/8; background: #b04030; }
.md-sm      { grid-area: 6/3/9/5; background: #d97a2c; }
.md-sc      { grid-area: 7/5/10/9; background: #b08820; }
.md-map-caption {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding-top: 6px;
  font-style: italic;
}

/* Option C: Concentric circles (SVG container) */
.viz-circles {
  margin: 16px 0 30px;
  display: flex;
  justify-content: center;
}
.viz-circles svg {
  max-width: 600px;
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .viz-mapdiag { grid-template-columns: 1fr; }
  .md-map { max-width: 360px; margin: 0 auto; }
}

/* STRUCT TABLES (structure page) */
.struct-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 22px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.struct-table thead {
  background: rgba(158, 31, 12, 0.06);
}
.struct-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
}
.struct-table td {
  padding: 10px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.struct-table tbody tr:last-child td { border-bottom: none; }
.struct-table td strong { font-weight: 700; color: var(--ink); }
.struct-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
  width: 160px;
}
.struct-table td em {
  font-style: italic;
  color: var(--muted);
}
@media (max-width: 720px) {
  .struct-table, .struct-table tbody, .struct-table tr, .struct-table td {
    display: block;
    width: 100%;
  }
  .struct-table thead { display: none; }
  .struct-table tr {
    border-bottom: 1px solid var(--rule);
    padding: 10px 14px;
  }
  .struct-table tr:last-child { border-bottom: none; }
  .struct-table td {
    padding: 3px 0;
    border: none;
    white-space: normal;
    width: auto;
  }
  .struct-table td:first-child {
    width: auto;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
  }
}

/* SCENARIO BLOCKS (imagine page) */
.scenario {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 24px 0;
}
.scenario h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.35;
}
.scenario h3 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 700;
}
.scenario .scenario-distance {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}
.scenario-scene {
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 16px 0;
}
.scenario-meta {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  background: var(--bg);
  border-radius: 5px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 14px;
}
.scenario-meta dt {
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding-top: 2px;
}
.scenario-meta dd { margin: 0; color: var(--ink); }
.scenario-meta dd em { color: var(--muted); }

@media (max-width: 600px) {
  .scenario { padding: 16px 18px; }
  .scenario-meta { grid-template-columns: 1fr; gap: 2px 0; }
  .scenario-meta dt { margin-top: 8px; }
  .scenario-meta dt:first-child { margin-top: 0; }
}

/* ============================================================
   DECISION CHAIN, reusable layered government-entity diagram
   Self-contained: drop a <section class="dchain"> on any page.
   Tier colors via [data-tier="federal|state|regional|sf-political|sf-operational"].
   Mark veto-authority nodes with class "dchain-node--veto".
   ============================================================ */
.dchain {
  margin: 28px 0 32px;
  font-family: var(--sans);
}
.dchain-header { margin-bottom: 14px; }
.dchain-header h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--ink);
}
.dchain-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.dchain-band {
  display: flex;
  align-items: stretch;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  gap: 14px;
}
.dchain-band[data-tier="federal"]        { border-top: 3px solid var(--federal); }
.dchain-band[data-tier="state"]          { border-top: 3px solid var(--state); }
.dchain-band[data-tier="regional"]       { border-top: 3px solid #3a7d7d; }
.dchain-band[data-tier="sf-political"]   { border-top: 3px solid var(--accent); }
.dchain-band[data-tier="sf-operational"] { border-top: 3px solid var(--muted); }

.dchain-label {
  flex: 0 0 110px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  align-self: center;
  border-right: 1px solid var(--rule);
  padding-right: 14px;
  line-height: 1.25;
}
.dchain-label span {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.dchain-nodes {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dchain-node {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 8px 11px;
  min-width: 130px;
  flex: 1 1 auto;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.dchain-node:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.dchain-node-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.25;
}
.dchain-node-role {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}
.dchain-node--veto { border-left: 3px solid var(--accent); }
.dchain-node--veto .dchain-node-name::before {
  content: '★ ';
  color: var(--accent);
}

.dchain-flow {
  height: 22px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dchain-flow::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--rule);
}
.dchain-flow::after {
  content: '▼';
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 0 5px;
  position: relative;
  z-index: 1;
}

.dchain-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-family: var(--sans);
}
.dchain-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dchain-legend-veto { color: var(--accent); font-weight: 700; font-size: 14px; }

/* RESPONSIVE */
@media (max-width: 720px) {
  body { font-size: 16px; }
  main.content { padding: 32px 18px 56px; }
  .page-title { font-size: 28px; }
  h2 { font-size: 21px; }
  .cards { grid-template-columns: 1fr; }
  .peer-row { grid-template-columns: 130px 1fr; }
  .peer-row .total { display: none; }
  .obstacle-nav { flex-direction: column; }
  .site-header-wrap { flex-direction: column; align-items: flex-start; }

  .dchain-band { flex-direction: column; gap: 8px; padding: 12px; }
  .dchain-label {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 8px 0;
    flex: none;
    text-align: left;
  }
  .dchain-node { min-width: 0; flex: 1 1 calc(50% - 4px); }
}
