/* ─────────────────────────────────────────────────────────────────────────
   Roto Research - minimal architectural reading interface
   Inter only · existing palette only (off-white / ink / muted / logo-orange)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg:        #f7f6f1;   /* warm paper, derived from logo backdrop */
  --paper:    #fdfcf8;
  --paper-2:  #ffffff;
  --ink:      #111111;
  --ink-2:    #1f2937;
  --mute:     #6b7280;
  --mute-2:   #9ca3af;
  --border:   #e6e3da;
  --border-2: #efece4;
  --hairline: #d8d4c8;
  --accent:   #e85d2f;   /* orange from logo */
  --accent-tint: rgba(232,93,47,0.08);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* density - overridden in .density-* */
  --u: 8px;
  --gap-section: 56px;
  --gap-block: 28px;
  --row-pad-y: 18px;
  --card-pad: 24px;
  --reading-line: 1.65;
}

.density-compact {
  --u: 6px;
  --gap-section: 36px;
  --gap-block: 18px;
  --row-pad-y: 12px;
  --card-pad: 18px;
  --reading-line: 1.55;
}
.density-cozy { /* defaults */ }
.density-roomy {
  --u: 10px;
  --gap-section: 80px;
  --gap-block: 40px;
  --row-pad-y: 28px;
  --card-pad: 34px;
  --reading-line: 1.75;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-feature-settings: "ss01", "cv11";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
a { color: inherit; text-decoration: none; }

#root, .shell {
  height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 256px 1fr;
}

/* ───── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  position: relative;
  border-right: 1px solid var(--border);
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: var(--bg);
}

.logo-link {
  display: block;
  width: 132px;
  padding: 4px;
}
.logo-mark {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

/* Sidebar brand: RotoArk logo over the wordmark. The logo PNG's backdrop is
   the same warm paper as the sidebar (--bg), and mix-blend-mode:multiply
   drops any residual off-white so it sits seamlessly on the sidebar. */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-logo {
  width: 118px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute-2);
  padding: 0 10px 8px;
  font-weight: 600;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.35;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-item:hover { background: rgba(0,0,0,0.035); }
.nav-item.is-active { background: rgba(0,0,0,0.05); color: var(--ink); font-weight: 500; }
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.nav-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--mute-2);
  flex-shrink: 0;
}
.nav-item.is-active .nav-dot { background: var(--accent); }
.nav-index {
  font-weight: 500;
  letter-spacing: 0;
}
.nav-index .nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.nav-label { flex: 1; }

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px 0;
  border-top: 1px solid var(--border-2);
  font-size: 11px;
}
.foot-label { color: var(--ink-2); font-weight: 500; letter-spacing: 0.02em; }
.foot-meta  { color: var(--mute); letter-spacing: 0.02em; }

/* ───── Main scroll area ────────────────────────────────────────────────── */

.main-scroll {
  overflow-y: auto;
  background: var(--paper);
  scroll-behavior: smooth;
}

.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 64px 120px;
  /* display:flex + min-height:100% only enables the vertical-centering trick
     below for sections that opt in (.report-content.center-vertical); every
     other section is a single flex item with no alignment override, so it
     stretches/top-aligns exactly as it did in plain block layout. */
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
/* Short, hero-like sections (e.g. Benefits) center in the viewport instead of
   top-aligning with a lot of empty space below - avoids the pointless
   scroll-up-and-down to see content that already fits on screen. Falls back
   to normal top alignment automatically if the content ever grows taller
   than the viewport (margin:auto just collapses to 0). */
.report-content.center-vertical {
  margin-top: auto;
  margin-bottom: auto;
}

/* ───── Hub ─────────────────────────────────────────────────────────────── */

.hub-head {
  margin-bottom: 56px;
  max-width: 720px;
}
.hub-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.hub-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 20px;
  color: var(--ink);
}
.hub-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--mute);
  max-width: 56ch;
  margin: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.meta-sep { color: var(--mute-2); }

/* Grid layout */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.card {
  background: var(--paper);
  padding: var(--card-pad) calc(var(--card-pad) + 4px);
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 14px;
  row-gap: 14px;
  min-height: 200px;
  transition: background 0.14s ease;
  position: relative;
}
.card:hover { background: var(--paper-2); }
.card:hover .card-title { color: var(--accent); }
.card-num {
  grid-row: 1;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mute-2);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  padding-top: 3px;
}
.card-body {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.card-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  transition: color 0.14s ease;
  text-wrap: balance;
}
.card-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--mute);
  margin: 0;
}
.card-foot {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.card-sep { color: var(--mute-2); }

/* List layout */

.hub-list {
  border-top: 1px solid var(--border);
}
.list-head, .list-row {
  display: grid;
  grid-template-columns: 48px 1fr 180px 140px 120px 70px;
  align-items: center;
  gap: 24px;
  padding: var(--row-pad-y) 0;
  border-bottom: 1px solid var(--border-2);
}
.list-head {
  padding: 14px 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.list-row {
  transition: background 0.14s ease;
  width: 100%;
}
.list-row:hover { background: rgba(0,0,0,0.02); }
.list-row:hover .row-title { color: var(--accent); }
.col-num { font-size: 12px; color: var(--mute-2); font-variant-numeric: tabular-nums; }
.row-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.14s ease;
  margin-bottom: 4px;
}
.row-sub {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.45;
}
.col-loc, .col-type, .col-date, .col-read {
  font-size: 13px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.col-loc { color: var(--ink-2); }

/* Editorial layout */

.hub-editorial {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}
.ed-row {
  display: grid;
  grid-template-columns: 60px 1fr 160px;
  gap: 36px;
  padding: 36px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
  transition: padding-left 0.18s ease;
}
.density-roomy .ed-row { padding: 56px 0; }
.density-compact .ed-row { padding: 22px 0; }
.ed-row:hover { padding-left: 12px; }
.ed-row:hover .ed-title { color: var(--accent); }
.ed-num {
  font-size: 12px;
  color: var(--mute-2);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding-top: 8px;
}
.ed-tag {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
  margin-bottom: 12px;
}
.ed-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
  color: var(--ink);
  transition: color 0.14s ease;
  text-wrap: balance;
  max-width: 22ch;
}
.density-compact .ed-title { font-size: 26px; }
.density-roomy .ed-title { font-size: 44px; }
.ed-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--mute);
  margin: 0;
  max-width: 56ch;
}
.ed-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ed-meta-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.ed-meta-line span:first-child { color: var(--mute-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; padding-top: 2px; }
.ed-meta-line span:last-child { color: var(--ink-2); }

/* ───── Report view ─────────────────────────────────────────────────────── */

.report-content { max-width: 1080px; padding-top: 64px; }
.report-content.is-wide { max-width: 96%; }

.report-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 48px;
  letter-spacing: 0.02em;
}
.report-crumb button {
  color: var(--mute);
  transition: color 0.14s ease;
}
.report-crumb button:hover { color: var(--accent); }
.crumb-sep { color: var(--mute-2); }

.report-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 36px;
  margin-bottom: 56px;
  position: relative;
  max-width: 760px;
}
.report-num {
  position: absolute;
  top: 0;
  left: -64px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.report-title {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: balance;
}
.report-sub {
  font-size: 18px;
  line-height: 1.45;
  color: var(--mute);
  margin: 0 0 28px;
  max-width: 56ch;
}

.report-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 80px;
  align-items: start;
}
.report-main {
  min-width: 0;
  max-width: 680px;
}

/* TOC */

.report-toc {
  position: sticky;
  top: 64px;
  font-size: 12px;
}
.toc-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-2);
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: toc;
}
.toc-list li a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  color: var(--ink-2);
  padding: 4px 0;
  transition: color 0.14s ease;
  font-size: 12.5px;
  line-height: 1.4;
}
.toc-list li a:hover { color: var(--accent); }
.toc-i { color: var(--mute-2); font-variant-numeric: tabular-nums; }

/* Section + blocks */

.rsection {
  margin-bottom: var(--gap-section);
  scroll-margin-top: 32px;
}
.rsection-h {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.prose p {
  font-size: 16px;
  line-height: var(--reading-line);
  color: var(--ink-2);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.prose p:last-child { margin-bottom: 0; }

/* Matrix table */

.matrix-wrap { overflow-x: auto; margin: 0 -2px; }
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.matrix thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--ink);
}
.matrix tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink-2);
  vertical-align: top;
  text-wrap: pretty;
}
.matrix tbody tr:last-child td { border-bottom: 1px solid var(--hairline); }
.matrix tbody td.matrix-label { color: var(--ink); font-weight: 500; }
.matrix thead th:first-child, .matrix tbody td:first-child { padding-left: 0; }
.matrix thead th:last-child,  .matrix tbody td:last-child { padding-right: 0; text-align: right; }
.matrix thead th:nth-child(n+2), .matrix tbody td:nth-child(n+2) { text-align: right; }
.footnote {
  font-size: 11.5px;
  color: var(--mute);
  margin-top: 14px;
  font-style: italic;
}

/* Definition list */

.def-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.def-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--border-2);
  align-items: baseline;
}
.def-row:first-child { border-top: 1px solid var(--hairline); }
.def-row:last-child { border-bottom: 1px solid var(--hairline); }
.def-row dt {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.def-row dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* Citations */

.citations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.citations li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-2);
}
.citations li:first-child { border-top: 1px solid var(--hairline); }
.citations li:last-child { border-bottom: 1px solid var(--hairline); }
.cite-code {
  font-family: 'Inter', monospace;
  font-feature-settings: "tnum";
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.cite-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.cite-note { grid-column: 2; font-size: 13px; color: var(--mute); margin-top: 4px; line-height: 1.5; }

/* Lots */

.lots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.lot {
  background: var(--paper);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.lot-name { font-size: 16px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.lot-conf {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
}
.tone-pos { color: var(--ink); background: rgba(0,0,0,0.06); }
.tone-mid { color: var(--accent); background: var(--accent-tint); }
.tone-low { color: var(--mute); background: rgba(0,0,0,0.04); }
.tone-req { color: var(--accent); background: var(--accent-tint); }
.lot-stats {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
}
.lot-stats > div { display: flex; flex-direction: column; gap: 2px; }
.stat-k {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute-2);
  font-weight: 600;
}
.stat-v { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.lot-note { font-size: 13px; line-height: 1.5; color: var(--mute); }

/* Section 02 proposed-site cards - same .lot shape, badge shows the
   proposed zoning designation instead of a confidence tag. */
.lot-zoning-badge {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 3px 8px; border-radius: 2px; color: var(--accent); background: var(--accent-tint);
  white-space: nowrap;
}

/* Systems */

.systems {
  display: flex;
  flex-direction: column;
}
.system {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border-2);
  align-items: start;
}
.system:first-child { border-top: 1px solid var(--hairline); }
.system:last-child { border-bottom: 1px solid var(--hairline); }
.sys-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-row: 1 / span 2;
}
.sys-name { font-size: 16px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.sys-status {
  align-self: start;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
}
.sys-detail { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.sys-pay {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  grid-column: 2;
}
.sys-pay span:first-child { color: var(--mute-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 600; }
.sys-pay span:last-child { color: var(--ink-2); }

/* Report nav (prev/next) */

.report-nav {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.rn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  transition: color 0.14s ease;
}
.rn-prev { text-align: left; }
.rn-next { text-align: right; align-items: flex-end; }
.rn-dir {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
}
.rn-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  transition: color 0.14s ease;
}
.rn:hover .rn-name { color: var(--accent); }

/* Compact density tightens hub + report typography slightly */
.density-compact .hub-title { font-size: clamp(32px, 4vw, 48px); }
.density-compact .card-title { font-size: 19px; }
.density-compact .card { min-height: 160px; }
.density-compact .report-title { font-size: clamp(28px, 3.5vw, 40px); }
.density-compact .prose p { font-size: 14.5px; }

.density-roomy .card { min-height: 240px; }
.density-roomy .hub-title { font-size: clamp(48px, 6vw, 76px); }

/* Scrollbar - discrete */
.main-scroll::-webkit-scrollbar,
.nav::-webkit-scrollbar { width: 8px; }
.main-scroll::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 4px; }
.main-scroll::-webkit-scrollbar-thumb:hover,
.nav::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

.tile-matrix-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 32px 0 40px;
  perspective: 1000px;
}

@media (max-width: 1200px) {
  .tile-matrix-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .tile-matrix-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.matrix-tile {
  width: 100%;
  aspect-ratio: 4/3; /* Wider aspect ratio to better fit landscape plans */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.matrix-tile.flipped {
  transform: rotateY(180deg);
}

.tile-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-face a {
  display: block;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-face img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: transform 0.3s ease;
  background-color: var(--paper-2);
}

.tile-face:hover img {
  transform: scale(1.05);
}

.tile-back {
  transform: rotateY(180deg);
}

/* ───── PDF Modal Vignette ───── */
.modal {
  display: none;
  position: fixed;
  z-index: 2147483647; /* Ensure it stays above tweaks panel */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content {
  position: absolute;
  top: 4%;
  left: 4%;
  width: 92%;
  height: 92%;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  z-index: 2147483647;
  transition: color 0.2s ease;
  line-height: 1;
  user-select: none;
}

.close-modal:hover {
  color: var(--accent);
}

/* ───── Inline Report Card Grids ───── */
.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0 var(--gap-block);
}
.report-card {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-color: var(--hairline);
}
.report-card h3 {
  margin-top: 0;
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.report-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}

/* Responsive: stack at narrow widths */
@media (max-width: 1100px) {
  .report-body { grid-template-columns: 1fr; gap: 40px; }
  .report-toc { position: static; }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 40px 24px 80px; }
  .hub-grid { grid-template-columns: 1fr; }
  .list-head, .list-row { grid-template-columns: 36px 1fr 90px; gap: 12px; }
  .list-head .col-type, .list-head .col-date, .list-head .col-read,
  .list-row  .col-type, .list-row  .col-date, .list-row  .col-read { display: none; }
  .ed-row { grid-template-columns: 40px 1fr; }
  .ed-meta { display: none; }
}

body { background-color: #faf9f7; }
.shell { background-color: #faf9f7; }

.citation-tag {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-block;
    margin: 2px 2px;
    font-size: 11px;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    text-wrap: nowrap;
}
.tag-zoning { background-color: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.tag-memo { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tag-doc { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.citation-tag:hover { filter: brightness(0.95); }

.cell-citations {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ───── Zoning, Site Limitations & Feasibility Views Styles ───── */
.zoning-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.zoning-tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  width: 100%;
}
.zoning-tab-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
  background: var(--border-2);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.zoning-tab-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.zoning-tab-btn.active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.zoning-view-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 10px 0;
}
.context-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  color: #92400e;
  font-size: 13.5px;
  line-height: 1.5;
}
.context-banner strong {
  color: #78350f;
  font-size: 14.5px;
}
.context-banner ol {
  margin: 8px 0 0 20px;
  padding: 0;
}

/* Booklet Morphing Sidebar back button styles */
.nav-item.nav-back {
  color: var(--accent) !important;
  background: rgba(232, 93, 47, 0.05);
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(232, 93, 47, 0.1);
  transition: all 0.2s ease-in-out;
}
.nav-item.nav-back:hover {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}
.nav-item.nav-back .nav-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 14px;
}
.nav-item.nav-back:hover .nav-arrow {
  transform: translateX(-3px);
}

/* ───── Sustainability Research Grid & Drawer Styles ───── */
.sustainability-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap-block);
  width: 100%;
}
/* Wrapping chip array (not a horizontal slidebar) - used for the
   sustainability domain-overview tabs and the card-library categories. */
.subnav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.subnav-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.16s ease;
}
.subnav-btn:hover {
  border-color: var(--hairline);
  background: var(--bg);
}
.subnav-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.sustainability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}
.sustainability-card {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.sustainability-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
  border-color: var(--hairline);
}
.sustainability-card-tag {
  align-self: flex-start;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 3px 8px;
  border-radius: 4px;
}
.sustainability-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
}
.sustainability-card-snippet {
  font-size: 13px;
  line-height: 1.5;
  color: var(--mute);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sliding Drawer Panel */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sliding-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(880px, 94vw);
  max-width: 100vw;
  background: var(--paper);
  border-left: 1px solid var(--border);
  z-index: 2000;
  box-shadow: -10px 0 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sliding-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}
.drawer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.drawer-nav-group {
  display: flex;
  gap: 8px;
}
.drawer-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--paper-2);
  color: var(--ink-2);
  transition: all 0.15s ease;
  cursor: pointer;
}
.drawer-btn:hover:not(:disabled) {
  background: var(--border-2);
  color: var(--ink);
}
.drawer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.drawer-btn-close {
  font-size: 20px;
  padding: 0 8px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--mute);
  transition: color 0.15s ease;
  cursor: pointer;
}
.drawer-btn-close:hover {
  color: var(--accent);
}
.drawer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}
.drawer-section {
  margin-bottom: 28px;
}
.drawer-section:last-child {
  margin-bottom: 0;
}
.drawer-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 8px;
  margin: 0 0 12px 0;
}
.drawer-section-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.drawer-section-body p {
  margin: 0 0 12px 0;
}
.drawer-section-body p:last-child {
  margin-bottom: 0;
}
.drawer-section-body ul, .drawer-section-body ol {
  margin: 0 0 12px 20px;
  padding: 0;
}
.drawer-section-body li {
  margin-bottom: 6px;
}
.drawer-section-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 0 0 12px 0;
}
/* Every table rendered inside a drawer (card body / person deep-dive) gets
   wrapped in .table-scroll by renderMarkdown() - this handles BOTH plain
   marked.js tables and the share of cards whose source body ships its own
   already-styled <table style="width:100%">. The actual table sizing rule is
   consolidated further down (search ".drawer-section-body table"); its
   min-width clamps the used width upward regardless of a smaller inline
   "width" value (normal CSS box-model behavior, not a specificity fight), so
   a table that would otherwise be squeezed to fit the drawer instead holds a
   legible minimum and this wrapper scrolls horizontally for it. */
.table-scroll { overflow-x: auto; margin: 0 0 12px 0; -webkit-overflow-scrolling: touch; }

/* ───── Grid/Matrix and Inline Drawer Layout ───── */
.card-titles-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 16px;
}

.matrix-title-card {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  position: relative;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  width: 100%;
}
.matrix-title-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--hairline);
}
.matrix-title-card:hover .card-title-text {
  color: var(--accent);
}
.matrix-title-card:hover .card-chevron {
  transform: translateX(4px);
  color: var(--accent);
}
.card-number-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--mute-2);
  font-variant-numeric: tabular-nums;
}
.card-title-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  flex: 1;
  transition: color 0.2s ease;
}
.card-chevron {
  font-size: 16px;
  color: var(--mute-2);
  transition: all 0.2s ease;
  align-self: flex-end;
}
.card-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 10%, rgba(232, 93, 47, 0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.matrix-title-card:hover .card-glow {
  opacity: 1;
}

.card-drawer-view {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-top: 16px;
  overflow: hidden;
  animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-meta-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.drawer-back-to-grid {
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.drawer-back-to-grid:hover {
  color: var(--accent);
}

.drawer-card-body-wrapper {
  padding: 32px;
}

.entitlement-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}
.entitlement-badge.high {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.entitlement-badge.moderate {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.entitlement-badge.extreme {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.row-injected-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ───── Summary Grid and Box Modules ───── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  width: 100%;
}

.summary-box {
  background: var(--paper-2);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.summary-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}
.summary-box h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.summary-box p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}

/* ───── Archive to Market Booklet Styles ───── */

/* Split Pane Layout */
.split-pane {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 32px;
  width: 100%;
  margin-top: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .split-pane {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.left-pane {
  display: flex;
  flex-direction: column;
}

.right-pane {
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.pane-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.pane-subtitle {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.4;
}

/* Style Frequency Table */
.style-frequency-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}

.style-frequency-table th {
  text-align: left;
  font-weight: 600;
  color: var(--mute-2);
  border-bottom: 2px solid var(--border);
  padding: 8px 12px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.style-frequency-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink-2);
}

.style-highlight-zero {
  background-color: rgba(232, 93, 47, 0.05);
  font-weight: 600;
}

.style-highlight-zero td {
  color: var(--accent);
}

.callout-opportunity {
  background: #fdf2f0;
  border-left: 3px solid var(--accent);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.55;
  color: #7c2d12;
  margin: 16px 0;
}

.callout-opportunity strong {
  color: var(--accent);
}

/* Explore Plans Button */
.explore-plans-btn {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(232, 93, 47, 0.2);
  margin-top: 12px;
}

.explore-plans-btn:hover {
  background: #d14a20;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232, 93, 47, 0.3);
}

/* Plan Navigator Modal Styles */
.plan-navigator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.plan-navigator-content {
  width: 90%;
  max-width: 1200px;
  height: 85%;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plan-navigator-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
}

.plan-navigator-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.plan-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.plan-search-input {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  width: 280px;
  background: var(--paper);
  color: var(--ink);
}

.plan-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 93, 47, 0.1);
}

.view-toggles {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 14px;
  border: none;
  background: var(--paper-2);
  color: var(--mute);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  background: var(--border-2);
  color: var(--ink);
}

.view-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.close-navigator-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.close-navigator-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.plan-navigator-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

.no-plans-found {
  text-align: center;
  padding: 48px;
  color: var(--mute);
  font-size: 14px;
}

/* Plan Navigator Grid View */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.plan-grid-card {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.plan-grid-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(232, 93, 47, 0.1);
}

.card-thumb-container {
  aspect-ratio: 4/5;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-2);
}

.card-thumb-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.plan-grid-card:hover .card-thumb-container img {
  transform: scale(1.05);
}

.card-info {
  padding: 10px 12px;
  background: var(--paper);
}

.card-filename {
  font-size: 11.5px;
  font-family: monospace;
  color: var(--ink-2);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Plan Navigator List View */
.plans-list-wrapper {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.plans-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.plans-list-table th {
  background: var(--paper-2);
  text-align: left;
  font-weight: 600;
  color: var(--mute-2);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.plans-list-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}

.cell-thumb {
  height: 50px;
}

.cell-thumb img {
  height: 40px;
  width: 32px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: white;
}

.cell-filename {
  font-family: monospace;
  color: var(--ink);
}

.open-plan-pdf-btn {
  background: var(--border-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.open-plan-pdf-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ADU Card Badge */
.adu-card {
  position: relative;
  padding-top: 32px !important;
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 24px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.08em;
  background: var(--accent-tint);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Passive Search Cards */
.civic-precedents h5 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.civic-precedents ul {
  margin: 0;
  padding-left: 20px;
}

.civic-precedents li {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mute);
  margin-bottom: 8px;
}

.convention-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.convention-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.convention-list li strong {
  color: var(--ink);
}

.convention-list li span {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
  margin-top: 2px;
}

/* Directory Tree Mapping */
.tree-container {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  max-height: 500px;
  overflow-y: auto;
  margin-top: 24px;
}

.tree-folder-node {
  margin-left: 16px;
  position: relative;
}

.tree-folder-node::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 10px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tree-folder-node:last-child::before {
  height: 10px;
  bottom: auto;
}

.tree-folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  user-select: none;
  transition: background 0.15s ease;
}

.tree-folder-header:hover {
  background: var(--border-2);
}

.tree-node-toggle {
  font-size: 9px;
  color: var(--mute);
  width: 12px;
  display: inline-block;
  text-align: center;
}

.tree-node-icon {
  font-size: 14px;
}

.tree-node-name {
  color: var(--ink);
}

.tree-folder-children {
  margin-left: 8px;
}

.tree-file-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 22px;
  margin-left: 16px;
  position: relative;
}

.tree-file-node::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tree-file-node::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 12px;
  width: 8px;
  height: 1px;
  background: var(--border);
}

.tree-file-node:last-child::before {
  height: 12px;
}

.tree-file-node .tree-node-name {
  color: var(--mute);
}

/* Research Infrastructure Styles */
.infra-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.infra-section h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.infra-section p {
  margin: 0 0 12px 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}

.infra-list {
  margin: 0 0 0 20px;
  padding: 0;
}

.infra-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.infra-list li strong {
  color: var(--ink);
  font-family: monospace;
}

.infra-section pre.code-block {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-family: monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
  margin: 12px 0;
}

/* Subpage Navigation Drawer */
.nav-sub-drawer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  margin-left: 12px;
  border-left: 1px solid var(--border-2);
  margin-top: 4px;
  margin-bottom: 6px;
  animation: slideDownSub 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-sub-item {
  position: relative;
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 8px;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  color: var(--mute);
  cursor: pointer;
  border-radius: 4px;
  font-weight: 400;
  transition: background 0.12s ease, color 0.12s ease;
  line-height: 1.3;
}

.nav-sub-item:hover {
  background: rgba(0, 0, 0, 0.025);
  color: var(--ink-2);
}

.nav-sub-item.is-active {
  color: var(--accent) !important;
  font-weight: 600 !important;
  background: rgba(0, 0, 0, 0.025);
}

@keyframes slideDownSub {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    max-height: 300px;
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Presentation Companion v2 - additions on top of the RotoArk base system.
   Everything above this line is the unmodified reference styles.css.
   ───────────────────────────────────────────────────────────────────────── */

/* Wrapper that holds the mobile bar + main-scroll as a single grid item
   (the base .shell grid expects exactly two top-level children). */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  grid-column: 2;
  grid-row: 1;
}
.shell > .sidebar { grid-column: 1; grid-row: 1; }
.main-col .main-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

/* Text logotype (no image asset shipped with this companion) */
.logo-word {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 4px;
}
.logo-word span { color: var(--accent); }
.logo-sub {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 0 4px;
  margin-top: 2px;
}

/* Mobile top bar + hamburger (sidebar collapses under 880px in the base sheet) */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mobile-bar .logo-word { font-size: 14px; padding: 0; }
.mobile-bar .logo-sub { padding: 0; }
.hamburger {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.hamburger span { display: block; width: 16px; height: 2px; background: var(--ink); border-radius: 1px; }

@media (max-width: 880px) {
  .mobile-bar { display: flex; }
  .shell { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    width: min(84vw, 320px);
    height: 100vh;
    box-shadow: 8px 0 32px rgba(0,0,0,0.18);
  }
  .sidebar.mobile-open { display: flex; }
  .sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 99;
  }
  .sidebar.mobile-open ~ .sidebar-scrim,
  .sidebar-scrim.open { display: block; }
  .main-scroll { height: calc(100vh - 63px); }
  .report-num { position: static; display: inline-block; margin-bottom: 8px; }
  .report-head { padding-bottom: 24px; margin-bottom: 36px; }
  .def-row { grid-template-columns: 1fr; gap: 6px; }
  .citations li { grid-template-columns: 1fr; gap: 4px; }
  .cite-note { grid-column: 1; }
  .system { grid-template-columns: 1fr; }
  .sliding-drawer { width: 100vw; }
  .roster-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: flex-start;
  }
  .roster-row .pending-tag { justify-self: start; }
  .precedent-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .sustainability-grid { grid-template-columns: 1fr; }
}

/* Section eyebrow index + count, used atop every top-level section */
.sec-eyebrow-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sec-pagerefs {
  font-size: 11px;
  color: var(--mute-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Source-pending tag - used wherever the source inputs contain no backing
   citation/figure for a claim the deck makes. Deliberately distinct from
   the accent-orange "known/sourced" language so gaps read as gaps. */
.pending-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}
.pending-tag::before { content: '\25CF'; font-size: 7px; color: #d97706; }
.pending-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--mute);
  font-style: italic;
  margin-top: 6px;
}

/* Generic wrapper for raw HTML dumped from the data modules (feasibility,
   sustainability tab copy, zoning REPORTS body text) - gives it the same
   reading typography as the rest of the companion. */
.html-block { max-width: 720px; }
.html-block h1 {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 18px; line-height: 1.15;
}
.html-block h2 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); margin: 36px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
.html-block h2:first-child { margin-top: 0; }
.html-block h3 {
  font-size: 16px; font-weight: 600; color: var(--ink); margin: 26px 0 10px;
}
.html-block h4 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 18px 0 8px; }
.html-block p { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin: 0 0 14px; }
.html-block ul, .html-block ol { margin: 0 0 16px 20px; padding: 0; }
.html-block li { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 6px; }
.html-block strong { color: var(--ink); font-weight: 600; }
.html-block code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px; background: var(--border-2); padding: 1px 5px; border-radius: 4px;
}
.html-block hr { border: none; border-top: 1px solid var(--hairline); margin: 28px 0; }
.html-block a { color: var(--accent); border-bottom: 1px solid var(--accent-tint); }
.html-block a:hover { border-bottom-color: var(--accent); }
.drawer-section-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-tint);
  word-break: break-all;
}
.drawer-section-body a:hover { border-bottom-color: var(--accent); }
.drawer-section-body table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  margin: 12px 0;
  font-size: 12.5px;
}
.drawer-section-body table th {
  text-align: left;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10.5px;
  border-bottom: 1px solid var(--ink);
  padding: 6px 10px;
}
.drawer-section-body table td {
  border-bottom: 1px solid var(--border-2);
  padding: 6px 10px;
  vertical-align: top;
}

/* Precedent cards (Approval Precedents section) */
.precedent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.precedent-card {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.precedent-card { padding: 0; overflow: hidden; gap: 0; }
.precedent-photo-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.precedent-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.precedent-photo-pending {
  display: flex; align-items: center; justify-content: center;
  color: var(--mute-2); font-size: 12px; letter-spacing: 0.04em;
  background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 10px, var(--border-2) 10px, var(--border-2) 20px);
}
.precedent-addr {
  font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
  padding: 16px 20px;
}

/* Leadership cards (City Leadership section) - photo + name + title + focus + bio */
.leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.leader-card {
  display: flex;
  gap: 16px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.leader-photo-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.leader-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
img[src*="lauren_oakes"].leader-photo { object-position: 50% 25%; }
img[src*="susan_koleda"].leader-photo { object-position: 30% 50%; }
.leader-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.leader-name { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.leader-title { font-size: 12.5px; font-weight: 500; color: var(--accent); }
.leader-focus {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mute-2); font-weight: 600; margin-top: 2px;
}
.leader-bio { font-size: 12.5px; line-height: 1.5; color: var(--mute); margin-top: 5px; }

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

/* Role roster (City Leadership section) */
.roster-list { display: flex; flex-direction: column; }
.roster-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border-2);
}
.roster-row:first-child { border-top: 1px solid var(--hairline); }
.roster-row:last-child { border-bottom: 1px solid var(--hairline); }
.roster-role { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.roster-name { font-size: 13.5px; color: var(--mute); }

/* Cross-reference chips (Benefits section links back to sourced data) */
.xref-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.xref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--border-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  transition: all 0.15s ease;
}
.xref-chip:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }

/* Site tab switcher, reused across Site Due Diligence / Proposed Zoning / Yield */
.site-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

/* subnav-tabs now wrap into a chip array (see rule above), so no horizontal
   scroll is needed. site-tabs still wrap via their own rule. */

/* App loading / error fallback */
#app-fallback {
  max-width: 560px; margin: 120px auto; text-align: center;
  font-size: 14px; color: var(--mute); line-height: 1.6;
}

/* Final mobile overrides - placed last so they win the cascade over the
   unconditional component rules declared earlier in this file (several of
   which, e.g. .roster-row's 3-column grid, would otherwise clip content
   like the "SOURCE PENDING" tag past the viewport edge on narrow screens). */
@media (max-width: 880px) {
  .roster-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: flex-start;
    padding: 14px 0;
  }
  .roster-row .pending-tag { justify-self: start; }
  .precedent-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Deck-migration components (baseline content pulled from the presentation)
   ═══════════════════════════════════════════════════════════════════════ */

.prose-body { font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 0 0 20px; max-width: 760px; }
.prose-body:last-child { margin-bottom: 0; }
.rsection-note { font-size: 13px; color: var(--mute); margin: -6px 0 16px; max-width: 640px; }
.lead-quote {
  margin: 24px 0 0; padding: 16px 22px; border-left: 3px solid var(--accent);
  background: var(--accent-tint); border-radius: 0 8px 8px 0;
  font-size: 16px; line-height: 1.55; font-style: italic; color: var(--ink); max-width: 760px;
}

/* Clickable leadership cards + drawer */
.leader-card.is-clickable { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.leader-card.is-clickable:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-1px); }
.leader-more { font-size: 11.5px; font-weight: 600; color: var(--accent); margin-top: 8px; letter-spacing: 0.01em; }

.person-head { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.person-head-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.person-head-title { font-size: 13px; color: var(--accent); font-weight: 500; margin-top: 2px; }
.person-bio { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.tk-row { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-2); align-items: start; }
.tk-row:first-of-type { border-top: none; }
.tk-k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 1px; }
.tk-support .tk-k { color: #15803d; }
.tk-against .tk-k { color: #b91c1c; }
.tk-hook .tk-k { color: var(--accent); }
.tk-v { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.deepdive-placeholder { opacity: 0.9; }

/* Department / family-tree roster */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.dept-col { display: flex; flex-direction: column; gap: 10px; }
.dept-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.rosterm { display: flex; align-items: center; gap: 10px; }
.rosterm-photo { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.rosterm-photo img { width: 100%; height: 100%; object-fit: cover; }
.rosterm-initials { font-size: 11px; font-weight: 600; color: var(--mute); }
.rosterm-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.rosterm-role { font-size: 11.5px; color: var(--mute); }

/* Precedent detail (timeline + facts) */
.precedent-detail { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.precedent-media { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.precedent-media .precedent-photo { width: 100%; height: auto; display: block; }
.precedent-media .precedent-photo-pending { width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; color: var(--mute-2); font-size: 12px; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 10px, var(--border-2) 10px, var(--border-2) 20px); }
.precedent-tag { position: absolute; top: 12px; left: 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; background: var(--accent); padding: 4px 9px; border-radius: 20px; }
.precedent-summary { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 18px; }
.timeline { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border-2); }
.timeline-row:first-child { border-top: none; }
.timeline-when { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; padding-top: 1px; }
.timeline-what { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.fact-list { margin: 0; }
.fact-row { padding: 12px 0; border-top: 1px solid var(--border-2); }
.fact-row:first-child { border-top: none; }
.fact-row dt { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); margin-bottom: 3px; }
.fact-row dd { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

/* Benefits (Community / City / Country Club) */
.benefit-stack { display: flex; flex-direction: column; gap: 4px; }
.benefit-block { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--border-2); align-items: start; }
.benefit-block:first-child { border-top: none; padding-top: 0; }
.benefit-num { font-size: 64px; font-weight: 700; color: var(--accent); line-height: 0.85; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.benefit-title { font-size: 19px; font-weight: 600; color: var(--ink); margin: 0 0 8px; letter-spacing: -0.01em; }
.benefit-body { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 12px; max-width: 720px; }
.benefit-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.benefit-points li { font-size: 13.5px; color: var(--mute); line-height: 1.5; }

/* Stat tiles + two-column tables */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat-tile { background: var(--paper-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--ink-2); margin-top: 5px; line-height: 1.35; }
.stat-sub { font-size: 11px; color: var(--mute); margin-top: 4px; line-height: 1.35; }
.table-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* Entitlement steps */
.entitlement-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.ent-step { border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; background: var(--paper-2); }
.ent-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ent-step-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.ent-step-code { font-size: 12px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* .ent-step-code doubles as a citation-tag pill here (clickable, opens the
   zoning PDF at the cited page) - .citation-tag's own sizing wins via source
   order, this rule only supplies the base color/weight for the CEQA link
   variant below. */
.ent-step-link { text-decoration: none; color: var(--accent); font-weight: 600; }
.ent-step-link:hover { text-decoration: underline; }
.ent-step-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ent-step-list li { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* Key Constraints numbered steps - one item per line, generous spacing so
   dense "(1) ... (2) ... (3) ..." runs read as separate breathing thoughts
   instead of a crowded paragraph. */
.constraint-steps { list-style: none; margin: 18px 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.constraint-steps li { display: flex; align-items: flex-start; gap: 14px; }
.constraint-step-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.constraint-step-body { font-size: 14px; line-height: 1.6; color: var(--ink-2); padding-top: 3px; }

/* Unit-mix scenarios - compact, self-contained tables (no overflow wrapper,
   so no horizontal or vertical scrollbars inside a card). */
.mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.mix-card { border: 1px solid var(--border); border-radius: 10px; padding: 20px; background: var(--paper-2); display: flex; flex-direction: column; min-width: 0; }
.mix-name { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 14px; letter-spacing: -0.01em; }
.mix-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.mix-table th {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--mute); text-align: right; padding: 0 0 8px; border-bottom: 1px solid var(--ink); white-space: nowrap;
}
.mix-table th:first-child { text-align: left; width: 42%; }
.mix-table th:nth-child(2) { width: 13%; }
.mix-table td {
  font-size: 12px; color: var(--ink-2); text-align: right; padding: 7px 0;
  border-bottom: 1px solid var(--border-2); white-space: nowrap;
}
.mix-table td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
.mix-table th:not(:first-child), .mix-table td:not(:first-child) { padding-left: 6px; }
.mix-table tbody tr:last-child td { border-bottom: none; }
.mix-total { font-size: 13px; font-weight: 600; color: var(--accent); margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--border-2); }
.mix-note { font-size: 12.5px; line-height: 1.55; color: var(--mute); margin: 0; }

@media (max-width: 880px) {
  .precedent-detail { grid-template-columns: 1fr; gap: 18px; }
  .table-2col { grid-template-columns: 1fr; }
  .benefit-block { grid-template-columns: 64px 1fr; gap: 16px; }
  .benefit-num { font-size: 46px; }
  .tk-row { grid-template-columns: 70px 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Animated charts (Profile & Housing Trends) - pure CSS keyframes, re-run
   whenever a tab mounts. Adapted from the Claude_Designed_Pages diagrams.
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes chartWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes chartGrow { from { width: 0; } to { width: var(--w); } }
@keyframes chartFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .chart-stacked, .progress-bar, .compare-bar { animation: none !important; }
  .chart-stacked { clip-path: none !important; }
  .progress-bar, .compare-bar { width: var(--w); }
}

.chart-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 8px; }
.chart-card { border: 1px solid var(--border); border-radius: 10px; padding: 22px; background: var(--paper-2); }
.chart-title { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.chart-tk { width: 14px; height: 2px; background: var(--accent); flex: none; }
.chart-hero { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.chart-hero-num { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.chart-hero-cap { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.chart-insight { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 18px 0 0; max-width: 720px; }

.chart-block { }
/* Charts stay hidden/collapsed until .in-view is added by the useInView
   scroll observer (see index.html) - so the reveal plays when the reader
   actually scrolls to it, not the instant the tab/section mounts. */
.chart-stacked { display: flex; height: 26px; border-radius: 3px; overflow: hidden; clip-path: inset(0 100% 0 0); }
.chart-stacked.in-view { animation: chartWipe 0.9s cubic-bezier(.2,.7,.2,1) both; }
.chart-seg { height: 100%; width: var(--w); }
.chart-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.chart-leg { display: flex; flex-direction: column; gap: 5px; opacity: 0; }
.chart-legend.in-view .chart-leg { animation: chartFade 0.5s ease both; }
.chart-leg-top { display: flex; align-items: center; gap: 7px; }
.chart-chip { width: 11px; height: 11px; border-radius: 2px; flex: none; }
.chart-pct { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.chart-leg-lbl { font-size: 11.5px; color: var(--mute); }

/* RHNA progress */
.progress-chart { display: flex; flex-direction: column; gap: 6px; }
.progress-row { display: grid; grid-template-columns: 128px 1fr 120px; gap: 16px; align-items: center; padding: 10px 0; }
.progress-cat { font-size: 13px; font-weight: 500; color: var(--ink); }
.progress-row.is-hi .progress-cat { color: var(--accent); font-weight: 700; }
.progress-track { position: relative; height: 24px; background: var(--border-2); border-radius: 5px; overflow: hidden; }
.progress-oblig { position: absolute; left: 0; top: 0; height: 100%; background: repeating-linear-gradient(45deg, #e2ded3, #e2ded3 6px, #ece9e0 6px, #ece9e0 12px); }
.progress-bar { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 5px; width: 0; }
.progress-chart.in-view .progress-bar { animation: chartGrow 1s cubic-bezier(.2,.7,.2,1) forwards; }
.progress-val { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.progress-pct { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-row.is-hi .progress-pct { color: var(--accent); }
.progress-sub { font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.progress-key { display: flex; gap: 22px; margin-top: 12px; font-size: 11.5px; color: var(--mute); }
.progress-key span { display: inline-flex; align-items: center; gap: 6px; }
.pk-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.pk-oblig { background: repeating-linear-gradient(45deg, #e2ded3, #e2ded3 4px, #ece9e0 4px, #ece9e0 8px); }
.pk-perm, .pk-a { background: var(--accent); }
.pk-b { background: #2b2925; }

/* LCF vs SCAG compare bars */
.compare-chart { display: flex; flex-direction: column; gap: 4px; }
.compare-key { display: flex; gap: 22px; margin-bottom: 14px; font-size: 11.5px; color: var(--mute); }
.compare-key span { display: inline-flex; align-items: center; gap: 6px; }
.compare-row { display: grid; grid-template-columns: 128px 1fr; gap: 16px; align-items: center; padding: 8px 0; }
.compare-lbl { font-size: 13px; font-weight: 500; color: var(--ink); }
.compare-bars { display: flex; flex-direction: column; gap: 6px; }
.compare-track { display: flex; align-items: center; gap: 8px; }
.compare-bar { height: 15px; border-radius: 4px; width: 0; min-width: 2px; }
.compare-chart.in-view .compare-bar { animation: chartGrow 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.cb-a { background: var(--accent); }
.cb-b { background: #2b2925; }
.compare-num { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }

@media (max-width: 880px) {
  .chart-2col { grid-template-columns: 1fr; }
  .progress-row { grid-template-columns: 92px 1fr 78px; gap: 10px; }
  .compare-row { grid-template-columns: 92px 1fr; gap: 10px; }
}

/* Profile as continuous themed bands (no tabs) */
.profile-band { padding-top: 44px; margin-top: 44px; border-top: 1px solid var(--border); }
.profile-band:first-of-type { padding-top: 8px; margin-top: 0; border-top: none; }
.band-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 22px; }
.band-num { font-size: 36px; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.band-meta { display: flex; flex-direction: column; gap: 3px; }
.band-title { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.015em; line-height: 1; }
.band-sub { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute-2); font-weight: 600; }
.profile-band .stat-grid { margin: 18px 0; }
.profile-band .chart-2col { margin-top: 18px; }
.prof-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
@media (max-width: 880px) { .prof-split { grid-template-columns: 1fr; gap: 26px; } }

/* Reference-table group parked at the bottom of a section */
.ref-tables { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
.ref-tables-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute-2); margin-bottom: 8px; }

/* Table of Contents inside sliding drawers */
.drawer-toc {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 28px;
}
.drawer-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mute);
  margin-bottom: 10px;
}
.drawer-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-toc-item {
  font-size: 13.5px;
  line-height: 1.4;
}
.drawer-toc-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.drawer-toc-link:hover {
  text-decoration: underline;
}




/* ── Corner controls (Home / Lock) ─────────────────────────────────────────
   Fixed top-right, always visible above the scrolling content. Minimal
   linework icons on a translucent paper chip so they read on any section. */
.corner-controls {
  position: fixed; top: 16px; right: 18px; z-index: 900;
  display: flex; gap: 6px;
  padding: 4px;
  background: rgba(253, 252, 248, 0.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line, #e2ded3);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(43, 41, 37, 0.06);
}
.corner-controls .cc-btn {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 7px;
  color: #55524c; cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.corner-controls .cc-btn svg { width: 17px; height: 17px; display: block; }
.corner-controls .cc-btn:hover { background: rgba(232, 93, 47, 0.10); color: var(--accent, #e85d2f); }
.corner-controls .cc-btn:active { transform: translateY(0.5px); }

/* On narrow screens the mobile bar owns the top strip — tuck the controls in
   beside it so they never cover the hamburger or the section label. */
@media (max-width: 860px) {
  .corner-controls { top: 10px; right: 10px; padding: 3px; }
  .corner-controls .cc-btn { width: 30px; height: 30px; }
}

/* ── Sustainability figures (floated beside their topic cards) ─────────────
   Injected into the research-tab HTML as <figure class="sust-fig"> before the
   matching .presentation-step card. Floated right per the design mock: the
   card content narrows to wrap beside the image; later cards return to full
   width once the float ends. Click opens the fullscreen lightbox below. */
.sust-fig {
  float: right; clear: right;
  width: 62%;
  margin: 0 0 20px 22px;
  cursor: zoom-in;
}
.sust-fig img {
  width: 100%; display: block;
  border: 1px solid var(--border); border-radius: 8px;
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.sust-fig:hover img { box-shadow: 0 6px 22px rgba(43,41,37,0.16); transform: translateY(-1px); }
.sust-fig figcaption { font-size: 12px; color: var(--mute, #8a8770); margin-top: 6px; line-height: 1.4; }
/* Cards form a BFC so they narrow beside the float instead of sliding under it. */
.html-block .presentation-step { overflow: hidden; }
@media (max-width: 880px) {
  .sust-fig { float: none; clear: none; width: 100%; margin: 0 0 18px; }
}

/* ── Fullscreen image lightbox ─────────────────────────────────────────────
   Opened by clicking any .sust-fig. Fixed overlay: the page underneath keeps
   its scroll position; ✕ (top-right), backdrop click, or Esc closes. */
#lightbox {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(24, 22, 18, 0.93);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw;
}
#lightbox img {
  max-width: 100%; max-height: calc(100% - 40px);
  border-radius: 8px; background: #fff;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
#lightbox .lb-caption {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.85); font-size: 13px; font-family: 'Inter', sans-serif;
  max-width: 80vw; text-align: center;
}
#lightbox .lb-close {
  position: fixed; top: 14px; right: 16px;
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#lightbox .lb-close:hover { background: rgba(232,93,47,0.85); border-color: transparent; }
#lightbox .lb-hint {
  position: fixed; top: 24px; left: 22px;
  color: rgba(255,255,255,0.45); font-size: 12px; font-family: 'Inter', sans-serif;
}

/* ── Presentations tab + panel ─────────────────────────────────────────── */
.sidebar-present { flex: 0 0 auto; }
.present-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--hairline); border-radius: 10px;
  cursor: pointer; transition: border-color 140ms ease, box-shadow 140ms ease;
}
.present-btn svg { width: 17px; height: 17px; color: var(--accent); flex: 0 0 auto; }
.present-btn:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(232,93,47,0.12); }

.pres-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.pres-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.pres-title { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; color: var(--ink); }
.pres-crumb {
  color: var(--mute); font-size: 13.5px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pres-close, .pres-back {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--paper-2);
  color: var(--ink-2); cursor: pointer; font-family: var(--font);
}
.pres-close { margin-left: auto; font-size: 20px; line-height: 1; }
.pres-back { display: none; font-size: 22px; line-height: 1; padding-bottom: 2px; }
.pres-close:hover, .pres-back:hover { border-color: var(--accent); color: var(--accent); }

.pres-body { flex: 1 1 auto; display: flex; min-height: 0; }
.pres-list {
  width: 280px; flex: 0 0 auto;
  border-right: 1px solid var(--border); background: var(--paper);
  overflow-y: auto; padding: 14px;
}
.pres-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--paper-2); cursor: pointer; font: inherit;
  transition: border-color 140ms ease;
}
.pres-item:hover { border-color: var(--accent); }
.pres-item.is-active { border-color: var(--accent); background: var(--accent-tint); }
.pres-item-title { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.pres-item-date { display: block; font-size: 12px; color: var(--mute); margin-top: 3px; }
.pres-empty { color: var(--mute); font-size: 13px; padding: 4px; }

.pres-viewer { flex: 1 1 auto; min-width: 0; background: #525659; }
.pres-viewer iframe { width: 100%; height: 100%; border: 0; display: block; }
.pres-placeholder {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: #cfd2d6; font-size: 14px;
}

@media (max-width: 768px) {
  .pres-overlay.has-active .pres-back { display: flex; }
  .pres-list { width: 100%; border-right: 0; }
  .pres-overlay.has-active .pres-list { display: none; }
  .pres-overlay:not(.has-active) .pres-viewer { display: none; }
}
