/* Production overrides — footnote, density, leg-foot, rail empty CTA */

/* footnote */
.footnote { padding: 64px 0 32px; }
.footnote-cols {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.footnote-col .t-eyebrow { margin-bottom: 12px; }
.footnote-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footnote-links a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.footnote-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.footnote-rule { display: none; }

.footnote-colophon { padding: 32px 0 24px; }
.footnote-colophon .t-eyebrow { margin-bottom: 8px; }
.footnote-body { max-width: 720px; font-size: 14px; color: var(--ink-2); margin: 8px 0 24px; line-height: 1.6; }
.footnote-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; padding: 16px 0; border-top: 1px solid var(--rule);
  font-size: 11px;
}
.footnote-grid .t-label { display: block; margin-bottom: 6px; }

.footnote-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--rule);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.footnote-bottom .dim { color: var(--ink-3); }

/* leg-foot — "view all" CTA below legislation grid */
.leg-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 24px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--rule);
  gap: 24px;
  flex-wrap: wrap;
}
.leg-viewall {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition: background .12s, color .12s;
}
.leg-viewall:hover { background: var(--ink); color: var(--paper); }

/* search form (used on /search) */
.search-form {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 16px;
  max-width: 720px;
}
.search-form-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.search-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  flex: 1 1 200px;
  min-width: 0;
}
.search-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── data-debt list (F5 fix-up R4) ──────────────────────────────────────
   Five BEM classes that ship unstyled in F5 (the page rendered as a
   default <ul> with browser bullets). Greenfield — grepped all six
   stylesheets pre-fix and confirmed zero existing rules; no
   collisions. Color tokens (--paper-2, --rule, --ink-*) match F2/F3/F4
   editorial conventions. */
.data-debt-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.data-debt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title  meta"
    "needs  needs"
    "action action";
  row-gap: 6px;
  column-gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.data-debt-row__title {
  grid-area: title;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
}
.data-debt-row__title a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
.data-debt-row__title a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}
.data-debt-row__meta {
  grid-area: meta;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.data-debt-row__needs {
  grid-area: needs;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  padding: 4px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--accent, var(--ink-3));
}
.data-debt-row__action {
  grid-area: action;
}
.data-debt-row__action a {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-3);
}
.data-debt-row__action a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.data-debt-pager {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}
.data-debt-loadmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition: background .12s, color .12s;
}
.data-debt-loadmore:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── calibration dashboard panels (G1 fix-up R-T1) ──────────────────────
   Six <section class="cal-panel"> blocks render the admin calibration
   dashboard. Without these rules the panels stack with no visual
   separation. Border-top divider between panels (suppressed on the
   first); generous vertical margin keeps headings + tables breathing.
   --rule token comes from styles.css design tokens (oklch(0.88 0.008 85)).
   Mirrors the same pattern as F5's data-debt-list border-top approach. */
.cal-panel {
  margin: 32px 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.cal-panel:first-of-type {
  border-top: 0;
}

/* G1 fix-up Phase 2.3 — visual alert cue for >40% deterministic-only or
   llm-only ratios on the badge volume panel (spec §5.7 threshold). */
.cal-alert {
  background: #fff3e0;
}

/* ── G2 admin queues — OCR queue + errors queue ────────────────────────
   Two admin tables (templates/admin/data_debt.html + errors.html).
   Both reuse .cal-panel for the section divider; .queue-table tightens
   the table-cell padding so the wider columns (last_error_message,
   title) don't run into the edge of the viewport at the typical admin
   resolution. Per-row id="item-N" is preserved so source-anchor
   buttons can deep-link via #item-N fragment (browser-native scroll;
   no .highlighted class needed). */
.queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.queue-table th,
.queue-table td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule, #ddd);
}
.queue-table th {
  font-weight: 600;
  border-bottom: 2px solid var(--rule, #ddd);
}
.queue-pager {
  margin-top: 16px;
}
.queue-flash {
  margin: 12px 0;
  padding: 8px 12px;
  list-style: none;
  background: var(--paper-3, #f5f5f5);
  border-left: 2px solid var(--accent, #4a4a4a);
}

/* rail empty-state CTA */
.rail-empty-cta {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 0 18px;
  padding: 12px 14px;
  background: var(--paper-3);
  border-left: 2px solid var(--accent, var(--ink));
  font-size: 12px; line-height: 1.5; color: var(--ink-2);
}
.rail-empty-icon {
  font-size: 20px; line-height: 1; color: var(--accent, var(--ink-2));
  flex-shrink: 0;
  transform: translateY(-1px);
}
.rail-empty-text strong { color: var(--ink); font-weight: 600; }

/* G3 — admin badge audit viewer */
.audit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--paper-2, #f6f6f4);
  border-radius: 4px;
}
.audit-filter label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}
.audit-filter input { padding: 0.25rem 0.4rem; font-family: inherit; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.audit-table th, .audit-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule, #e6e6e0);
  vertical-align: top;
}
.badge-action { padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.8rem; }
.badge-action-added    { background: #d4edda; color: #155724; }
.badge-action-removed  { background: #f8d7da; color: #721c24; }
.badge-action-modified { background: #fff3cd; color: #856404; }
.audit-pager { margin-top: 1rem; }
.audit-pager a { margin-right: 1rem; }

/* G3 — manage panel */
.manage-current { list-style: none; padding-left: 0; }
.manage-current li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule, #e6e6e0);
}
.manage-chip { padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.9rem; }
.manage-chip.badge-process { background: #fff3cd; }
.manage-chip.badge-policy  { background: #d1ecf1; }
.manage-meta { font-size: 0.8rem; color: var(--ink-3, #6a6a60); }
.manage-remove {
  background: none;
  border: 1px solid #c66;
  color: #c66;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.manage-remove:hover { background: #f8d7da; }
.manage-add { display: flex; gap: 1rem; align-items: end; margin-top: 0.5rem; }

/* G4 — cross-stage conflict resolution */
.conflict-queue { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.conflict-queue tr { border-bottom: 1px solid var(--rule, #e6e6e0); }
.conflict-queue td {
  vertical-align: top;
  padding: 0.6rem;
  width: 25%;
}
.conflict-queue .raw h3 { margin: 0 0 0.25rem 0; font-size: 1rem; }
.conflict-queue .stage-1 .facts-json,
.conflict-queue .raw .raw-text {
  font-family: var(--font-mono, ui-monospace, "JetBrains Mono", monospace);
  font-size: 0.8rem;
  background: var(--paper-2, #f6f6f4);
  padding: 0.4rem;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 18rem;
  overflow: auto;
}
.conflict-reasons {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
}
.conflict-reasons code {
  font-size: 0.75rem;
  background: #fff3cd;
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
}
.conflict-queue .actions button,
.conflict-queue .actions form button {
  display: block;
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
}
.conflict-queue .actions .btn-accept-s1 {
  background: #d4edda; border: 1px solid #155724; color: #155724;
}
.conflict-queue .actions .btn-accept-s2 {
  background: #f8d7da; border: 1px solid #721c24; color: #721c24;
}
.conflict-queue .actions .btn-re-prompt {
  background: #fff3cd; border: 1px solid #856404; color: #856404;
}
.conflict-queue .actions .btn-edit-facts {
  background: #d1ecf1; border: 1px solid #0c5460; color: #0c5460;
}
.conflict-form { padding: 0.4rem; }
.conflict-form label { display: block; font-size: 0.85rem; margin-bottom: 0.3rem; }
.conflict-form input, .conflict-form textarea {
  width: 100%; padding: 0.25rem 0.4rem; font-family: inherit;
}
.conflict-form .btn-submit {
  background: var(--paper-2, #f6f6f4); border: 1px solid var(--rule, #ccc);
  padding: 0.3rem 0.6rem; font-size: 0.85rem; cursor: pointer;
}
.conflict-pager { margin-top: 1rem; }
.conflict-pager a { margin-right: 1rem; }
.conflict-resolved {
  padding: 0.6rem;
  background: #d4edda;
  border-left: 3px solid #155724;
  font-size: 0.9rem;
}
.conflict-resolved.failed {
  background: #fff3cd;
  border-left-color: #856404;
}
