:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #dce3ec;
  --text: #16202e;
  --text-muted: #526277;
  --primary: #14539a;
  --primary-soft: #e6f0fb;
  --success: #0f7b4c;
  --success-soft: #e4f6ed;
  --warn: #9a5b08;
  --warn-soft: #fef3dc;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

.topbar {
  background: #0f2544;
  color: #ffffff;
  border-bottom: 3px solid #2b74c7;
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.78rem;
  color: #b7cae3;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.nav a {
  color: #dce8f8;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav a.active {
  background: #2b74c7;
  color: #ffffff;
}

.container {
  max-width: 1380px;
  margin: 1.25rem auto 2.5rem;
  padding: 0 1.25rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.45rem;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 37, 68, 0.04);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
}

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.kpi-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 155px;
}

.filter-field.grow {
  flex: 1 1 220px;
}

.filter-field label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-field input,
.filter-field select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  background: #ffffff;
  color: var(--text);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  font-size: 0.86rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.9rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-sm {
  padding: 0.28rem 0.62rem;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

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

th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td {
  background: #fafcff;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.badge {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-muted {
  background: #edf1f7;
  color: var(--text-muted);
}

.badge-bio {
  background: #dff4fa;
  color: #0b5d75;
  border: 1px solid #96d4e6;
}

.bio-metrics {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #0b5d75;
  background: #f2fafd;
  border: 1px solid #cceaf4;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  margin-top: 0.25rem;
  display: inline-block;
}

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

.bar-track {
  height: 8px;
  background: #e6ecf3;
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
}

.bar-fill.success {
  background: var(--success);
}

.hypothesis-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}

.hypothesis-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.hypothesis-title {
  font-size: 1.04rem;
  font-weight: 700;
}

.hypothesis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.score-pill {
  text-align: right;
  min-width: 145px;
}

.score-number {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

.provenance-drawer {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.provenance-drawer summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}

.provenance-list {
  margin: 0.65rem 0 0;
  padding-left: 1.25rem;
}

.provenance-list li {
  margin-bottom: 0.35rem;
}

.contradiction-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.9rem;
  background: var(--surface);
}

.contradiction-card.genuine {
  border-left-color: var(--danger);
}

.quote-box {
  background: var(--surface-alt);
  border-left: 3px solid var(--primary);
  padding: 0.45rem 0.7rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
}

.footer {
  max-width: 1380px;
  margin: 1rem auto 2rem;
  padding: 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Additional styles for the static read-only demo snapshot */

.demo-banner {
  background: #16365e;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6f0fc;
  font-size: 0.79rem;
}

.demo-banner-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.42rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.demo-pill {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(43, 116, 199, 0.35);
  border: 1px solid rgba(150, 212, 230, 0.45);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.nav button.nav-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #dce8f8;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav button.nav-tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav button.nav-tab.active {
  background: #2b74c7;
  color: #ffffff;
}

.tab-panel[hidden] {
  display: none;
}

.status-banner {
  background: var(--primary-soft);
  border: 1px solid #bfd7f4;
  color: var(--primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.error-banner {
  background: var(--danger-soft);
  border: 1px solid #f4c2be;
  color: var(--danger);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.empty-state {
  color: var(--text-muted);
  padding: 0.5rem 0;
  margin: 0;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pill-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #edf1f7;
  color: var(--text-muted);
}

.sub-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.section-head h2 {
  margin: 0;
}
