:root {
  --bg: #07100e;
  --panel: #101b18;
  --panel-2: #14231f;
  --text: #eef5f2;
  --muted: #9fb1aa;
  --line: #263b35;
  --line-strong: #3b564e;
  --accent: #d9b96e;
  --accent-2: #f0d99f;
  --shadow: 0 18px 52px rgba(0,0,0,.30);
  --radius: 16px;
  --contradiction: #ef6f5b;
  --narrative: #ff9f5a;
  --theology: #43aa8b;
  --law: #f4c95d;
  --ethics: #e66db2;
  --chronology: #9c72e5;
  --cosmology: #48bfe3;
  --biology: #55c59a;
  --earth-science: #6fb1ff;
  --history: #e59b5b;
  --textual: #7f93ae;
  --biblical: #c993ff;
  --science: #48bfe3;
  --prophecy: #b68cff;
  --violence: #e75b62;
  --slavery: #c47f52;
  --women: #e66db2;
  --sexuality: #f28ba8;
  --kinship: #e2a85d;
  --supernatural: #57c4b8;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% -10%, rgba(67,170,139,.14), transparent 34rem),
    radial-gradient(circle at 92% 4%, rgba(217,185,110,.11), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: var(--accent-2); }

.audit-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
  padding: .65rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(5,12,10,.94);
}
.audit-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .4rem .68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.audit-nav a:hover,
.audit-nav a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(217,185,110,.06);
  outline: none;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem clamp(1rem, 4vw, 4rem) 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7,16,14,.76);
  backdrop-filter: blur(14px);
}
.brand-wrap { max-width: 850px; }
.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: .55rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 6vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -.048em;
  line-height: .94;
}
h2 { margin-bottom: .25rem; font-size: clamp(1.25rem, 2.2vw, 1.8rem); letter-spacing: -.02em; }
h3 { margin-bottom: .7rem; font-size: 1rem; }
.subtitle { max-width: 780px; margin-bottom: 0; color: var(--muted); font-size: 1.06rem; }
.header-actions { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: .65rem; }

main { padding: 1.25rem clamp(1rem, 4vw, 4rem) 4rem; }
.panel, .stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,35,31,.94), rgba(13,24,21,.97));
  box-shadow: var(--shadow);
}
.notice { margin-bottom: 1rem; padding: .85rem 1rem; color: #c6d3cf; font-size: .84rem; }
.notice strong { color: var(--accent-2); }
.controls { display: flex; align-items: end; gap: 1rem; padding: 1rem; margin-bottom: 1rem; }
.control-group { min-width: 190px; }
.control-group.grow { flex: 1; }
label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
input[type="search"], select {
  width: 100%; min-height: 44px; border: 1px solid #314941; border-radius: 10px;
  padding: .7rem .8rem; outline: none; background: #081310; color: var(--text);
}
input[type="search"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,185,110,.12); }
.toggle { display: flex; align-items: center; gap: .55rem; min-height: 44px; margin: 0; padding: 0 .3rem; white-space: nowrap; }
.toggle input { accent-color: var(--accent); }
.button { min-height: 42px; border: 1px solid var(--accent); border-radius: 10px; padding: .65rem .95rem; background: var(--accent); color: #17150f; font-weight: 800; cursor: pointer; }
.button:hover { filter: brightness(1.06); }
.button.ghost { background: transparent; color: var(--accent-2); }
.text-button { border: 0; padding: .2rem; background: transparent; color: var(--accent-2); cursor: pointer; }
.text-button.active { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { padding: 1rem 1.15rem; }
.stat-value { display: block; font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.stat-label { display: block; margin-top: .4rem; color: var(--muted); font-size: .78rem; }

.visualization-panel { padding: 1rem; margin-bottom: 1rem; overflow: hidden; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-heading.compact { align-items: center; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem .75rem; max-width: 760px; }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .69rem; }
.legend-swatch { width: 9px; height: 9px; border-radius: 50%; }
.chart-shell { position: relative; min-height: 480px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #06100d; }
#arcChart { display: block; width: 100%; height: 480px; }
.chart-note, .filter-help, .muted { margin: .7rem 0 0; color: var(--muted); font-size: .78rem; }
.tooltip {
  position: absolute; z-index: 4; width: min(340px, calc(100% - 20px)); pointer-events: none; opacity: 0;
  transform: translateY(4px); border: 1px solid #456159; border-radius: 10px; padding: .75rem;
  background: rgba(5,12,10,.98); box-shadow: 0 14px 30px rgba(0,0,0,.44); transition: opacity .12s ease, transform .12s ease; font-size: .78rem;
}
.tooltip.visible { opacity: 1; transform: translateY(0); }
.tooltip strong { display: block; margin-bottom: .25rem; color: white; font-size: .88rem; }


.content-grid { display: grid; grid-template-columns: minmax(250px, .76fr) minmax(0, 2.24fr); gap: 1rem; }
.filters-panel, .issues-panel { padding: 1rem; }
.category-filters, .source-filters, .dependency-filters { display: grid; gap: .5rem; }
.category-button, .source-button, .dependency-button {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: .62rem .72rem; background: #081310; cursor: pointer; text-align: left;
}
.category-button.active { border-color: var(--category-color); box-shadow: inset 3px 0 0 var(--category-color); }
.source-button.active, .dependency-button.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.category-name, .source-name, .dependency-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.category-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--category-color); }
.category-count, .source-count, .dependency-count { color: var(--muted); font-size: .72rem; }
.source-name span, .dependency-name span {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.dependency-button .source-kind {
  margin-top: .15rem;
  line-height: 1.3;
}
.dependency-count {
  flex: 0 0 auto;
  align-self: center;
  padding-left: .35rem;
}
.source-kind { display: block; color: var(--muted); font-size: .64rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.coverage-bars { display: grid; gap: .65rem; }
.coverage-row { display: grid; grid-template-columns: 100px 1fr 28px; align-items: center; gap: .5rem; font-size: .72rem; }
.coverage-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-track { height: 7px; border-radius: 99px; overflow: hidden; background: #263b35; }
.coverage-fill { height: 100%; border-radius: inherit; background: var(--bar-color); }

.result-summary { color: var(--muted); font-size: .78rem; }
.issue-list { display: grid; gap: .7rem; }
.issue-card {
  display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: .85rem; border: 1px solid var(--line); border-radius: 12px;
  padding: .9rem; background: rgba(6,16,13,.74); cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.issue-card:hover, .issue-card:focus-visible { transform: translateY(-1px); border-color: #456159; background: rgba(14,28,23,.97); outline: none; }
.issue-color { border-radius: 99px; background: var(--category-color); }
.issue-card h3 { margin: 0 0 .25rem; font-size: 1rem; }
.issue-summary { margin: 0; color: var(--muted); font-size: .83rem; }
.issue-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.tag { border: 1px solid #334d45; border-radius: 999px; padding: .18rem .46rem; color: #cbd7d3; font-size: .65rem; }
.tag.source-tag { border-color: #554a2d; color: var(--accent-2); }
.tag.dependency-low { border-color: #3d6757; }
.tag.dependency-medium { border-color: #6b5b35; }
.tag.dependency-high { border-color: #6e3f57; }
.reference-stack { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; color: var(--muted); font-size: .69rem; white-space: nowrap; }

.dialog { width: min(860px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); border: 1px solid #3d5b52; border-radius: 16px; padding: 1.25rem; background: #0b1713; color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.66); }
.dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; top: 0; float: right; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #10201b; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.detail-category { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .7rem; color: var(--muted); font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1rem 0; }
.detail-block { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; background: #07110e; }
.detail-block h3 { color: var(--accent-2); }
.editorial-note { border-left: 3px solid var(--accent); padding: .7rem .8rem; background: rgba(217,185,110,.07); color: #ced8d4; font-size: .82rem; }
.verse-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.verse-link { display: block; border-left: 3px solid var(--category-color); padding-left: .65rem; text-decoration: none; }
.verse-link strong { display: block; color: white; }
.verse-link span { color: var(--muted); font-size: .8rem; }
.source-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.source-list a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; text-decoration: none; }
.source-list small { display: block; margin-top: .2rem; color: var(--muted); }
.source-library { display: grid; gap: .75rem; }
.source-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; background: #07110e; }
.source-card h3 { margin-bottom: .25rem; }
.source-card p { color: var(--muted); font-size: .82rem; }
.source-card .source-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.method-dialog li { margin-bottom: .35rem; }

footer { padding: 0 clamp(1rem, 4vw, 4rem) 2rem; color: var(--muted); font-size: .75rem; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .site-header { flex-direction: column; padding-top: 2rem; }
  .header-actions { justify-content: flex-start; }
  .content-grid { grid-template-columns: 1fr; }
  .filters-panel { order: 2; }
  .controls { align-items: stretch; flex-wrap: wrap; }
  .control-group.grow { flex-basis: 100%; }
  .toggle { flex: 1; }
  .section-heading { flex-direction: column; }
  .section-heading.compact { flex-direction: row; }
  .legend { justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .audit-nav { justify-content: flex-start; overflow-x: visible; padding-inline: .75rem; }
  .audit-nav a { flex: 0 0 auto; }
  main { padding-inline: .75rem; }
  .site-header { padding-inline: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-card { padding: .8rem; }
  .issue-card { grid-template-columns: 4px minmax(0, 1fr); }
  .reference-stack { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  #arcChart { height: 390px; }
  .chart-shell { min-height: 390px; }
  .choice-grid { grid-template-columns: 1fr; }
}


/* ScriptureAudit unified navigation shell — scoped to avoid changing original audit controls. */
.suite-nav, .suite-nav * {box-sizing:border-box;}
.suite-nav {position:relative; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:11px clamp(16px,4vw,64px); min-height:59px; border-bottom:1px solid #263238; background:#080f15; font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; font-size:13px;}
.suite-brand {display:inline-flex; align-items:center; gap:9px; text-decoration:none; font-weight:550; color:#e9efef; white-space:nowrap; letter-spacing:-.025em;}
.suite-brand-bold {font-weight:800; color:#e2c68e;}
.suite-brand-mark {display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border:1px solid #7e7355; border-radius:8px; color:#e2c68e; font-size:20px; line-height:1;}
.suite-links {display:flex; align-items:center; gap:14px;}
.suite-back {color:#c5cfd1; text-decoration:none; white-space:nowrap;}
.suite-back:hover,.suite-back:focus-visible {color:#fff; text-decoration:underline; text-underline-offset:4px;}
.suite-select {position:relative;}
.suite-select summary {display:flex; align-items:center; gap:10px; padding:8px 11px; border:1px solid #39474d; border-radius:9px; color:#edf0ec; background:#172028; cursor:pointer; list-style:none; white-space:nowrap;}
.suite-select summary::-webkit-details-marker {display:none;}
.suite-select summary:hover,.suite-select[open] summary {border-color:#aa946f;}
.suite-menu {position:absolute; top:calc(100% + 9px); right:0; z-index:100; width:min(250px, calc(100vw - 32px)); max-height:70vh; overflow:auto; padding:7px; background:#101922; border:1px solid #455056; border-radius:12px; box-shadow:0 24px 48px #0009;}
.suite-option {display:block; padding:8px 10px; text-decoration:none; border-radius:7px; color:#d9e1e3; line-height:1.3; font-size:13px;}
.suite-option:hover,.suite-option:focus-visible {background:#27333b; color:white;}
.suite-option.is-current {color:#f0d9a7; background:#332e26; font-weight:700;}
@media(max-width:530px){.suite-nav{padding:10px 14px; gap:8px}.suite-back{display:none}.suite-brand{font-size:13px}.suite-select summary{font-size:12px; padding:7px 9px}}
