/* ============================================================
   Policy Index — main.css
   Design register: Accountability Index visual language,
   recoloured for Policy Index. System-UI font, square edges,
   hairline borders, outline micro-labels, compact density.
   ============================================================ */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-2:        #f4f5f3;
  --paper:       #ffffff;
  --row-hover:   #f3f7f5;
  --ink:         #15171a;
  --ink-1:       #15171a;  /* alias for --ink; templates from Phase C/D used --ink-1 */
  --ink-2:       #3b3f44;
  --ink-3:       #6b7077;
  --rule:        #dcdfdb;
  --rule-2:      #ebede9;
  --accent:      #0e8a7a;
  --accent-hover:#076457;
  --hero-bg:     #0c1c2e;
  --hero-rule:   #1a3556;
  --pos:         #1f6c4a;
  --neg:         #a23a1f;
  --warn:        #a87d1c;
  --violet:      #5b3f87;
  --pos-bg:      #e8efe8;
  --neg-bg:      #f6e8e2;
  --warn-bg:     #f6efde;
  --maxw:        1280px;
  --gutter:      32px;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink) }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--hero-bg);
  color: #fff;
  border-bottom: 1px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar .wrap {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 0;
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding-right: 18px;
  margin-right: 8px;
  border-right: 1px solid var(--hero-rule);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.navbar ul {
  list-style: none;
  display: flex;
  padding: 0 0 0 4px;
  margin: 0;
  align-items: stretch;
  flex: none;
}

.navbar ul a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 46px;
  color: #cbd0d6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.navbar ul a:hover { color: #fff }

.navbar ul a.active {
  color: #fff;
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.navbar .spacer { flex: 1 }

.navbar form {
  display: flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--hero-rule);
  background: #0e2138;
  flex: none;
}

.navbar form input {
  height: 100%;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  outline: none;
  width: 220px;
}

.navbar form input::placeholder { color: #7a90a6 }

.navbar form button {
  height: 100%;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--hero-rule);
  background: transparent;
  color: #cbd0d6;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.navbar form button:hover { color: #fff }

.mobile-nav { display: none }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--hero-bg);
  color: #fff;
  border-bottom: 1px solid #000;
}

.hero .wrap { padding-top: 42px; padding-bottom: 42px }

.hero h1 {
  margin: 0 0 12px;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #fff;
}

.hero p {
  margin: 0;
  font-size: 16px;
  max-width: 62ch;
  color: #cbd5e0;
  line-height: 1.55;
}

.hero .meta-strip {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  font-size: 12.5px;
  color: #9aa9b8;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.hero .meta-strip .pipe { color: #3a4d63 }

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--hero-rule);
  color: #fff;
  background: #0e2138;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.hero-actions a:hover {
  border-color: var(--accent);
  background: #102a47;
  color: #fff;
}

/* ── Hero search ────────────────────────────────────────────── */
.hero-search {
  display: flex;
  align-items: stretch;
  margin-top: 24px;
  max-width: 640px;
  border: 1px solid var(--hero-rule);
  background: #0e2138;
}

.hero-search input[type="search"] {
  flex: 1;
  border: 0;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  background: transparent;
  color: #fff;
  outline: none;
  min-width: 0;
}

.hero-search input[type="search"]::placeholder { color: #7e8ea0 }

.hero-search input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.hero-search button {
  flex: none;
  border: 0;
  border-left: 1px solid var(--hero-rule);
  background: transparent;
  padding: 0 22px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
}

.hero-search button:hover { background: #102a47 }

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 36px 0 56px }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head .meta {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── Filter strip ───────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-tab {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  margin: 0 -1px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.3;
  text-decoration: none;
}

.filter-tab:hover { background: var(--bg-2); color: var(--ink); z-index: 2; position: relative }

.filter-tab.active,
.filter-tab[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 600;
  z-index: 1;
  position: relative;
}

.filter-tab .n {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.filter-tab.active .n,
.filter-tab[aria-pressed="true"] .n { color: #cbd0d6 }

.filters .spacer { flex: 1; min-width: 12px }
.filters .sort { font-size: 12.5px; color: var(--ink-3) }

/* ── Inline filter forms (year / dept selects in filter strip) ─ */
.inline-filter-form { display: contents }

.filter-select {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding: 7px 28px 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  margin-left: -1px;
  line-height: 1.3;
}

.filter-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; z-index: 2; position: relative }
.filter-select:hover { background-color: var(--bg-2); color: var(--ink) }
.filter-select option { font-weight: 400 }

/* ── Search bar ── */
.search-bar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  overflow: hidden;
}

.search-bar input[type="search"] {
  flex: 1;
  border: 0;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.search-bar input[type="search"]::placeholder { color: var(--ink-3) }

.search-bar button {
  flex: none;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  padding: 9px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.search-bar button:hover { background: var(--bg-2); color: var(--ink) }

.search-bar .clear-search {
  flex: none;
  padding: 9px 14px;
  border-left: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}

.search-bar .clear-search:hover { color: var(--neg) }

/* ── Active filter tags ── */
.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.active-filters .af-label { color: var(--ink-3) }

.af-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  padding: 3px 9px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.af-tag:hover { background: var(--neg); border-color: var(--neg); color: #fff }

.af-clear {
  color: var(--ink-3);
  text-decoration: underline;
  font-size: 12px;
  margin-left: 4px;
}

.af-clear:hover { color: var(--neg) }

/* ── Issue list (home page) ─────────────────────────────────── */
.issues {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.issue {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 200px 96px 64px;
  align-items: center;
  gap: 20px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}

.issue:hover { background: var(--row-hover) }

/* Status micro-label — outline style */
.lbl {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  line-height: 1.5;
  justify-self: start;
  white-space: nowrap;
}

.lbl.active     { color: var(--pos);    border-color: var(--pos) }
.lbl.monitoring { color: var(--warn);   border-color: var(--warn) }
.lbl.stalled    { color: var(--neg);    border-color: var(--neg) }
.lbl.closed     { color: var(--ink-2);  border-color: var(--ink-3) }

.issue-title { min-width: 0 }

.issue-title h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issue:hover .issue-title h3 { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px }

.issue-title p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issue-body {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.issue-body-extra { color: var(--ink-3) }

.issue-date {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.issue-docs {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.issue-docs-label { color: var(--ink-3); opacity: .7 }

/* ── Browse-by-policy-area chip strip ──────────────────────── */
.theme-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}

.theme-strip-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.3;
}

.theme-chip:hover { background: var(--ink); border-color: var(--ink); color: #fff }
.theme-chip:hover .n { color: #cbd0d6 }

.theme-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.theme-chip.active .n { color: #cbd0d6 }

.theme-chip .n {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.theme-chip-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 4px;
  margin-left: auto;
}
.theme-chip-more:hover { color: var(--ink); text-decoration: underline }

/* ── Policy Navigator ───────────────────────────────────────── */
.explore-page { background: var(--bg) }

.explore-list {
  display: grid;
  gap: 12px;
}

.explore-theme {
  border: 1px solid var(--rule);
  background: var(--paper);
}

.explore-theme summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  cursor: pointer;
}

.explore-theme summary::-webkit-details-marker { display: none }

.explore-theme summary:hover {
  background: var(--row-hover);
}

.explore-theme-title {
  min-width: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}

.explore-count {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.explore-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  flex: none;
  transition: transform .12s;
}

.explore-theme[open] .explore-chevron { transform: rotate(180deg) }

.explore-theme-body {
  border-top: 1px solid var(--rule-2);
  padding: 0 18px 16px;
}

.explore-description {
  margin: 14px 0;
  max-width: 72ch;
  color: var(--ink-2);
  font-size: 13.5px;
}

.explore-issues {
  display: grid;
  border-top: 1px solid var(--rule-2);
}

.explore-issue {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-2);
  color: inherit;
  text-decoration: none;
}

.explore-issue:hover {
  color: inherit;
  background: var(--row-hover);
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 10px;
  padding-right: 10px;
}

.explore-issue-title {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.explore-issue:hover .explore-issue-title {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.explore-issue-meta {
  color: var(--ink-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 170px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  font-size: 10.5px;
  line-height: 1.45;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stage-badge.tone-positive { color: var(--pos); background: var(--pos-bg) }
.stage-badge.tone-warning  { color: var(--warn); background: var(--warn-bg) }
.stage-badge.tone-negative { color: var(--neg); background: var(--neg-bg) }
.stage-badge.tone-accent   { color: var(--accent); background: #e6f1ee }
.stage-badge.tone-neutral  { color: var(--ink-2); background: var(--bg-2) }

.explore-body-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 180px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  background: var(--bg-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.explore-actions a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  color: var(--ink);
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.explore-actions a:hover {
  background: var(--bg-2);
  border-color: var(--ink);
  color: var(--ink);
}

.other-theme {
  border-color: var(--ink-3);
}

.custom-view-builder {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}

.explore-pivot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.explore-pivot-main { min-width: 0 }

.pivot-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.active-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 280px;
  padding: 5px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.filter-chip:hover {
  border-color: var(--ink);
  background: var(--bg-2);
  color: var(--ink);
}

.filter-chip span {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
}

.filter-chip.muted {
  color: var(--ink-3);
  background: var(--bg-2);
}

.pivot-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex: none;
}

.pivot-summary {
  flex: none;
  min-width: 180px;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.pivot-summary strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.pivot-action-link,
.pivot-action-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pivot-action-form { margin: 0 }

.pivot-action-form button {
  font-family: inherit;
  cursor: pointer;
}

.pivot-action-link:hover,
.pivot-action-form button:hover {
  border-color: var(--ink);
  background: var(--bg-2);
  color: var(--ink);
}

.view-mode-switcher {
  display: inline-flex;
  gap: 0;
  margin: 0 0 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.view-mode-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 6px 12px;
  border-right: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.view-mode-switcher a:last-child { border-right: 0 }

.view-mode-switcher a:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.view-mode-switcher a.active {
  background: var(--ink);
  color: #fff;
}

.explore-viz-shell {
  max-width: 100%;
  margin-bottom: 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.viz-heading {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-2);
}

.viz-heading h2 {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.3;
}

.viz-heading p,
.viz-noscript {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.explore-viz-container {
  position: relative;
  width: 100%;
  min-height: 380px;
  overflow: hidden;
}

.explore-viz-container svg {
  display: block;
  width: 100%;
  height: auto;
}

.treemap-leaf {
  cursor: pointer;
}

.treemap-leaf rect {
  stroke: #fff;
  stroke-width: 1;
}

.treemap-leaf:hover rect {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.sankey-node rect {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 1;
}

.sankey-node:hover rect {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.sankey-link {
  fill: none;
  stroke: #9aa9b8;
  stroke-opacity: .34;
}

.sankey-link:hover {
  stroke-opacity: .62;
}

.viz-table-fallback {
  margin-top: 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.viz-table-fallback summary {
  cursor: pointer;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.viz-table-fallback:not([open]) summary { border-bottom: 0 }

.viz-table-fallback .pivot-groups {
  padding: 14px;
}

.explore-viz-tooltip {
  position: fixed;
  z-index: 80;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 23, 26, .14);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}

.explore-viz-tooltip.is-pathway {
  max-width: 340px;
  padding: 12px 14px 11px;
  border: 1px solid rgba(12, 28, 46, .12);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(12, 28, 46, .18);
}

.explore-viz-tooltip .tt-lane {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lane, #6b7077) 14%, #fff);
  color: var(--lane, #6b7077);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.explore-viz-tooltip .tt-lane::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lane, #6b7077);
}

.explore-viz-tooltip .tt-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: .01em;
}

.explore-viz-tooltip .tt-title {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.32;
  color: var(--ink);
}

.explore-viz-tooltip .tt-body {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-2);
}

.explore-viz-tooltip .tt-summary {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.explore-viz-tooltip .tt-hint {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--rule-2);
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pivot-groups {
  display: grid;
  gap: 14px;
}

.pivot-group {
  border: 1px solid var(--rule);
  background: var(--paper);
}

.pivot-group-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-2);
}

.pivot-group-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.pivot-group-head span {
  color: var(--ink-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pivot-issue-list {
  display: grid;
}

.pivot-issue {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-2);
  color: inherit;
  text-decoration: none;
}

.pivot-issue:last-child { border-bottom: 0 }

.pivot-issue:hover {
  color: inherit;
  background: var(--row-hover);
}

.pivot-issue-title {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.pivot-issue:hover .pivot-issue-title {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pivot-issue-meta,
.pivot-doc-count {
  color: var(--ink-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pivot-doc-count {
  color: var(--ink-2);
  font-weight: 600;
}

.pivot-empty {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  text-align: left;
}

.explore-sidebar {
  position: sticky;
  top: 62px;
}

.explore-filter-panel {
  border: 1px solid var(--rule);
  background: var(--paper);
}

.explore-filter-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--rule-2);
}

.explore-filter-panel summary::-webkit-details-marker { display: none }

.explore-filter-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.explore-filter-form label {
  display: grid;
  gap: 5px;
}

.explore-filter-form label > span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.explore-filter-form select,
.explore-filter-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
}

.explore-filter-form select[multiple] {
  min-height: 104px;
}

.explore-filter-form button {
  appearance: none;
  min-height: 36px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.explore-filter-form button:hover {
  background: var(--ink-2);
}

.signal-page { padding: 30px var(--gutter) 56px }

.signal-page-head {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.signal-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.signal-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.signal-filters label > span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timeline-filter-toolbar {
  display: grid;
  gap: 12px;
  padding: 16px 0 18px;
  margin: 0 0 28px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 60px;
}

.timeline-filter-head,
.timeline-filter-controls,
.timeline-signal-tabs,
.timeline-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-filter-head {
  justify-content: space-between;
  gap: 12px;
}

.timeline-filter-summary {
  color: var(--ink-2);
  font-size: 13px;
}

.timeline-filter-summary strong { font-weight: 650 }

.timeline-sort {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.timeline-sort span {
  margin-right: 8px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timeline-sort a,
.timeline-signal-tabs a,
.timeline-filter-clear,
.timeline-active-filters a {
  text-decoration: none;
}

.timeline-sort a {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  padding: 5px 10px;
  margin-right: -1px;
  font-size: 12.5px;
  font-weight: 550;
}

.timeline-sort a:hover,
.timeline-sort a.active {
  position: relative;
  z-index: 1;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.timeline-signal-tabs {
  gap: 6px;
}

.timeline-signal-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  padding: 5px 9px;
  font-size: 12.5px;
  font-weight: 600;
}

.timeline-signal-tabs a span {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.timeline-signal-tabs a:hover {
  border-color: var(--ink-3);
  background: var(--bg-2);
}

.timeline-signal-tabs a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.timeline-signal-tabs a.active span {
  color: #cbd0d6;
}

.timeline-filter-controls {
  align-items: flex-start;
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.filter-menu summary::-webkit-details-marker { display: none }

.filter-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
}

.filter-menu[open] summary {
  border-color: var(--ink);
  background: var(--bg-2);
  color: var(--ink);
}

.filter-menu summary strong {
  min-width: 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.filter-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, calc(100vw - 36px));
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 12px 24px rgba(18, 24, 32, .12);
  padding: 6px;
}

.filter-menu-panel label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 7px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}

.filter-menu-panel label:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.filter-menu-panel input {
  accent-color: var(--ink);
}

.filter-menu-panel span {
  min-width: 0;
}

.filter-menu-panel small {
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.timeline-filter-apply {
  min-height: 34px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.timeline-filter-apply:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.timeline-filter-clear {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--ink-3);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.timeline-active-filters {
  gap: 6px;
}

.timeline-active-filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 550;
}

.timeline-active-filters a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.predecessor-bills {
  margin: 18px 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}
.predecessor-bills-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.predecessor-bills-head .count {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 12.5px;
}
.predecessor-bills-blurb {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.predecessor-bills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.predecessor-bills-list a { font-weight: 550; }
.predecessor-bills-list .meta {
  color: var(--ink-3);
  font-size: 12.5px;
}

.archive-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px dashed var(--rule);
  background: var(--bg-2);
  font-size: 13px;
  color: var(--ink-2);
}
.archive-banner-text strong { color: var(--ink); }
.archive-banner-actions .btn-link { font-weight: 550; }

.tl-item.is-archived { opacity: 0.55; border-style: dashed; }
.tl-item.is-archived::before {
  content: "Archived";
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 6px;
}
.tl-item.is-context { border-left-style: dashed; }

.archive-reason {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  font-style: italic;
}

.parent-doc-link {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.parent-doc-link .lbl {
  color: var(--ink-3);
  font-weight: 550;
  margin-right: 4px;
}
.parent-doc-link a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
.parent-doc-link a:hover {
  text-decoration-color: var(--accent, #1a5fb4);
  color: var(--accent, #1a5fb4);
}

.tl-item .actions button.restore,
.tl-item .actions form button.restore,
.actions-compact button.restore {
  border-color: var(--rule);
  color: var(--accent, #1a5fb4);
}
.tl-item .actions button.restore:hover,
.actions-compact button.restore:hover {
  border-color: var(--accent, #1a5fb4);
  background: var(--bg-2);
}
.inline-action-form { display: inline; margin: 0; }

.pin-context-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pin-context-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pin-context-form input[type="text"] {
  padding: 6px 8px;
  border: 1px solid var(--rule);
  font-size: 12.5px;
  width: 100%;
  box-sizing: border-box;
}
.pin-context-help {
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  white-space: nowrap;
}
.role-chip.role-instrument           { border-color: #1a3a6e; color: #1a3a6e; background: #f0f4fb; }
.role-chip.role-law_commission       { border-color: #5a3fb4; color: #5a3fb4; background: #f4f1fb; }
.role-chip.role-committee_scrutiny   { border-color: #006e2c; color: #006e2c; background: #eef7f1; }
.role-chip.role-regulator_response   { border-color: #b27600; color: #8a5a00; background: #fbf6e7; }
.role-chip.role-consultation         { border-color: #2c6e8f; color: #2c6e8f; background: #eef5fa; }
.role-chip.role-strategy             { border-color: #4a4a4a; color: #4a4a4a; background: #f3f3f3; }
.role-chip.role-analysis             { border-color: #4a6e8f; color: #4a6e8f; background: #f1f5f8; }
.role-chip.role-operational_guidance { border-color: #1a6e62; color: #1a6e62; background: #ecf6f3; }
.role-chip.role-announcement         { border-color: #6a6a6a; color: #6a6a6a; background: #f7f7f7; }
.role-chip.role-parliamentary_record { border-color: #8a4a8a; color: #8a4a8a; background: #f7f0f7; }
.role-chip.role-predecessor          { border-color: #8a5a00; color: #8a5a00; background: #fbf6e7; border-style: dashed; }

.primary-home-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px dashed var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.primary-home-chip:hover {
  border-color: var(--accent, #1a5fb4);
  color: var(--accent, #1a5fb4);
}

.coverage-panel {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}
.coverage-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.coverage-panel-blurb {
  margin: 0 0 10px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.coverage-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.coverage-panel-tile {
  border: 1px solid var(--rule);
  background: #fff;
  padding: 8px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.coverage-panel-tile .lbl {
  color: var(--ink-3);
  font-weight: 550;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.coverage-panel-tile .val {
  font-weight: 600;
  color: var(--ink);
}
.coverage-panel-tile.is-empty .val { color: var(--ink-3); font-weight: 500; }
.coverage-panel-tile.is-empty { background: #fbfbfb; }
.coverage-panel-tile.is-selected { border-color: var(--ink); background: #f7f7f7; }
.coverage-panel-tile a { color: inherit; text-decoration: none; }
.coverage-panel-tile a:hover .val { text-decoration: underline; }

.signal-section { margin-top: 34px }
.signal-section:first-of-type { margin-top: 0 }

.signal-list {
  display: grid;
  gap: 12px;
}

.signal-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 15px 16px 14px;
}

.signal-card:hover {
  background: var(--row-hover);
  border-color: var(--ink);
}

.signal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.signal-card .lbl.bill { color: var(--neg); border-color: var(--neg) }
.signal-card .lbl.consultation_closed { color: var(--warn); border-color: var(--warn) }
.signal-card .lbl.guidance { color: var(--ink-2); border-color: var(--ink-3) }

.signal-card h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
}

.signal-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.signal-card h3 a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signal-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.signal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.signal-actions a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.signal-actions a:hover {
  background: var(--bg-2);
  border-color: var(--ink);
  color: var(--ink);
}

.empty-state.compact {
  padding: 20px 0;
  text-align: left;
}

/* ── Status bar (issue page) ────────────────────────────────── */
.statusbar {
  background: var(--pos);
  color: #fff;
  border-bottom: 1px solid #194e36;
}

.statusbar.monitoring { background: var(--warn); border-color: #7a5a10 }
.statusbar.stalled    { background: var(--neg);  border-color: #7a2710 }
.statusbar.closed     { background: var(--ink-2); border-color: #2a2e33 }

.statusbar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.statusbar .sb-lbl {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  line-height: 1.5;
}

.statusbar .sb-count {
  margin-left: auto;
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
}

/* ── Crumbs bar ─────────────────────────────────────────────── */
.crumbs-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--rule-2);
}

.crumbs-bar .wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.crumbs-bar a { color: var(--ink-2); text-decoration: none }
.crumbs-bar a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px }
.crumbs-bar .sep { color: var(--rule) }
.crumbs-bar .here { color: var(--ink); font-weight: 600 }

/* ── Issue page layout ──────────────────────────────────────── */
.page {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  padding: 32px 0 56px;
}

.page > .main { min-width: 0 }
.page > .rail  { font-size: 13px }

/* ── Page header ────────────────────────────────────────────── */
.page-head h1 {
  margin: 0 0 14px;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.page-head .standfirst {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 62ch;
}

.page-head .head-rule {
  margin: 24px 0 18px;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* ── Lifecycle banner ───────────────────────────────────────── */
.lifecycle-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}

.lifecycle-banner .lb-k {
  display: block;
  margin-bottom: 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: currentColor;
}

.lifecycle-banner strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.lifecycle-banner .lb-days {
  flex: none;
  padding: 4px 9px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lifecycle-banner.tone-positive {
  border-color: var(--pos);
  background: var(--pos-bg);
  color: var(--pos);
}

.lifecycle-banner.tone-warning {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}

.lifecycle-banner.tone-negative {
  border-color: var(--neg);
  background: var(--neg-bg);
  color: var(--neg);
}

.lifecycle-banner.tone-accent {
  border-color: var(--accent);
  background: #e6f1ee;
  color: var(--accent);
}

.lifecycle-banner.tone-neutral {
  border-color: var(--ink-3);
  background: var(--bg-2);
  color: var(--ink-2);
}

/* ── Order toggle ───────────────────────────────────────────── */
.order {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 30px;
}

.order .lbl {
  font-size: 13px;
  color: var(--ink-3);
  margin-right: 14px;
}

.order button, .order a {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  margin: 0 -1px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.order button:hover, .order a:hover {
  background: var(--bg-2);
  color: var(--ink);
  z-index: 2;
  position: relative;
}

.order button[aria-pressed="true"],
.order button.active,
.order a.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 600;
  z-index: 1;
  position: relative;
}

.issue-view-switcher {
  margin-bottom: 16px;
}

.issue-workflow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--rule);
}

.issue-workflow-bar.solo {
  justify-content: flex-end;
}

.issue-workflow-bar .issue-view-switcher {
  margin-bottom: 0;
}

.issue-thread-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .1s, border-color .1s, color .1s;
}

.issue-thread-action:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: #fff;
}

.issue-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-actions-group form {
  margin: 0;
}

.issue-brief-action {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.issue-brief-action:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.issue-brief-action:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* AI briefing: single button at rest, options revealed in a popover. */
.brief-popover {
  position: relative;
  display: inline-block;
}
/* Hide the default <details> disclosure triangle so summary looks like a button. */
.brief-popover > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brief-popover > summary::-webkit-details-marker { display: none; }
.brief-popover > summary::marker { content: ''; }
.brief-popover-caret {
  font-size: 0.7em;
  line-height: 1;
  transition: transform 200ms ease;
}
.brief-popover[open] > summary .brief-popover-caret {
  transform: rotate(180deg);
}
.brief-popover-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: 260px;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 30, 70, 0.12);
  padding: 14px;
}
.brief-popover-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.brief-popover-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3, #6a6a6a);
  font-weight: 600;
}
.brief-popover-select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.brief-popover-submit {
  width: 100%;
  padding: 8px 12px;
  margin-top: 4px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.brief-popover-submit:hover { background: #000; border-color: #000; }
.brief-popover-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.page-messages {
  display: grid;
  gap: 8px;
  margin: -4px 0 18px;
}

.page-message {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.page-message.success {
  border-color: rgba(31, 108, 74, .34);
  background: #f0f8f3;
  color: #164d36;
}

.page-message.warning {
  border-color: rgba(168, 125, 28, .34);
  background: #fff8e8;
  color: #6f4d08;
}

.page-message.error {
  border-color: rgba(162, 58, 31, .34);
  background: #fff1ee;
  color: #7a2710;
}

.page-message.info {
  border-color: rgba(44, 103, 150, .28);
  background: #f0f6fb;
  color: #244c6d;
}

.pathway-shell {
  margin: 0 0 20px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfb 100%);
  box-shadow: 0 16px 34px rgba(12, 28, 46, .08);
  overflow: hidden;
}

.pathway-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid var(--rule-2);
  background:
    linear-gradient(135deg, rgba(12, 28, 46, .04), rgba(14, 138, 122, .07)),
    var(--paper);
}

.pathway-heading h2 {
  margin: 0 0 5px;
  font-size: 19px;
  line-height: 1.3;
}

.pathway-heading p,
.pathway-noscript {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.pathway-heading p {
  max-width: 720px;
}

.pathway-mode-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(14, 138, 122, .28);
  border-radius: 999px;
  background: rgba(14, 138, 122, .08);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pathway-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--rule-2);
  font-size: 11.5px;
  color: var(--ink-3);
}

.pathway-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.pathway-legend-item .swatch {
  display: inline-block;
  width: 22px;
  height: 8px;
  border-radius: 2px;
  position: relative;
}

.pathway-legend-item.kind-sequence .swatch {
  background: #74808b;
}

.pathway-legend-item.kind-lane .swatch {
  background:
    repeating-linear-gradient(
      90deg,
      #adb7c1 0,
      #adb7c1 4px,
      transparent 4px,
      transparent 8px
    );
  height: 3px;
  align-self: center;
}

.pathway-legend-item.kind-source .swatch {
  background: var(--accent);
}

.pathway-legend-item.is-disabled {
  opacity: .35;
}

.pathway-legend-hint {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
  font-style: italic;
}

.policy-pathway-container {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(14, 138, 122, .04), transparent 60%),
    #fbfcfb;
  scrollbar-width: thin;
}

.policy-pathway-container::-webkit-scrollbar { height: 8px }
.policy-pathway-container::-webkit-scrollbar-thumb {
  background: rgba(12, 28, 46, .18);
  border-radius: 4px;
}

.policy-pathway-container svg {
  display: block;
  height: auto;
  min-width: 720px;
}

.pathway-canvas-bg {
  fill: #fbfcfb;
}

.pathway-map-header {
  pointer-events: none;
}

.pathway-stat-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.pathway-stat-value {
  fill: var(--ink-3);
  font-size: 12.5px;
}

.pathway-date-rail {
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-opacity: .38;
}

.pathway-rail-tag {
  fill: var(--ink-3);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
}

.pathway-time-grid line {
  stroke: var(--rule);
  stroke-dasharray: 2 6;
  stroke-opacity: .85;
}

.pathway-lane-band {
  fill: #fff;
  stroke: var(--rule-2);
}

.pathway-lane-band.is-alt {
  fill: #f5f7f5;
}

.pathway-lane-band.is-empty {
  fill: #f9faf9;
  opacity: .58;
}

.pathway-lane-rule {
  stroke: var(--rule);
  stroke-dasharray: 1 7;
  stroke-linecap: round;
  stroke-opacity: .75;
}

.pathway-lane-swatch {
  opacity: .92;
}

.pathway-lane-label {
  fill: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0;
}

.pathway-lane-count {
  fill: var(--ink-3);
  font-size: 12px;
}

.pathway-link {
  fill: none;
  stroke: #74808b;
  stroke-width: 1.4;
  stroke-opacity: .42;
  transition: opacity .16s ease, stroke-width .16s ease;
}

.pathway-link.kind-sequence {
  stroke-width: 1.6;
  stroke-opacity: .5;
}

.pathway-link.kind-lane {
  stroke: #adb7c1;
  stroke-dasharray: 5 6;
  stroke-opacity: .34;
}

.pathway-link.kind-source {
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-opacity: .68;
}

.pathway-link.is-muted {
  stroke-opacity: .12;
}

.pathway-link.is-highlight {
  stroke-width: 2.6;
  stroke-opacity: .95;
}

.pathway-node {
  cursor: pointer;
  transition: opacity .16s ease;
}

.pathway-node.is-muted {
  opacity: .32;
}

.pathway-node-card {
  fill: #fff;
  stroke-width: 1.2;
  filter: drop-shadow(0 6px 12px rgba(12, 28, 46, .12));
}

.pathway-node-title-link,
.pathway-node-action-link {
  cursor: pointer;
  outline: none;
  text-decoration: none;
}

.pathway-node-title-link text,
.pathway-node-action-link text {
  text-decoration: none;
}

.pathway-node-title-link:hover .pathway-node-card-title,
.pathway-node-action-link:hover text {
  text-decoration: underline;
}

.pathway-node-card-text {
  pointer-events: auto;
}

.pathway-node-card-date {
  fill: var(--ink-3);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pathway-node-card-title {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 720;
}

.pathway-node-card-meta {
  fill: var(--ink-3);
  font-size: 11.25px;
  font-weight: 600;
  letter-spacing: .01em;
}

.pathway-node-actions rect {
  fill: #f4f6f4;
  stroke: var(--rule-2);
  stroke-width: 1;
  transition: fill .12s ease, stroke .12s ease;
}

.pathway-node-actions text {
  fill: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pathway-node-action-link.is-source rect {
  fill: rgba(14, 138, 122, .1);
  stroke: rgba(14, 138, 122, .3);
}

.pathway-node-action-link.is-source text {
  fill: var(--accent-hover);
}

.pathway-node-action-link:hover rect {
  fill: var(--ink);
  stroke: var(--ink);
}

.pathway-node-action-link:hover text {
  fill: #fff;
  text-decoration: none;
}

.pathway-node-action-link.is-source:hover rect {
  fill: var(--accent-hover);
  stroke: var(--accent-hover);
}

.pathway-node-callout {
  stroke: var(--rule);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.pathway-node-ring {
  fill: #fff;
  stroke-width: 2.4;
  filter: drop-shadow(0 2px 4px rgba(12, 28, 46, .16));
}

.pathway-node-dot {
  stroke: #fff;
  stroke-width: 1.2;
}

.pathway-node:hover .pathway-node-ring,
.pathway-node:hover .pathway-node-card {
  stroke: var(--ink);
}

.pathway-cluster-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.pathway-axis text {
  fill: var(--ink-3);
  font-size: 12px;
}

.pathway-axis path,
.pathway-axis line {
  stroke: var(--rule);
}

.pathway-readout {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.pathway-readout-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pathway-readout-head h3 {
  margin: 4px 0 0;
  max-width: 760px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 650;
}

.pathway-readout-head > span {
  flex: none;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pathway-readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.pathway-phase {
  border: 1px solid var(--rule-2);
  background: #fbfcfb;
  padding: 12px;
}

.pathway-phase-date {
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pathway-phase h4,
.pathway-relationships h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.pathway-phase p,
.pathway-relationships p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.pathway-source-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.pathway-source-links a {
  color: var(--accent);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pathway-relationships {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
}

.pathway-relationships p + p {
  margin-top: 7px;
}

.pathway-readout-notes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pathway-readout-notes span {
  padding: 5px 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink-3);
  font-size: 12px;
}

.pathway-build-actions {
  margin-top: 8px;
}

.pathway-build-actions form {
  margin: 0;
}

.pathway-build-actions .doc-action-btn {
  cursor: pointer;
}

.pathway-build-help,
.pathway-build-meta {
  display: block;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.4;
}

.pathway-build-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule-2);
}

/* ── Year groups ────────────────────────────────────────────── */
.year { margin: 0 0 28px }

.year-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.year-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.year-head .rule { flex: 1; height: 1px; background: var(--rule) }
.year-head .count { font-size: 12px; color: var(--ink-3) }

/* ── Timeline ───────────────────────────────────────────────── */
.tl {
  position: relative;
  padding-left: 28px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--rule);
}

.tl-item {
  position: relative;
  margin-bottom: 14px;
}

.tl-item:last-child { margin-bottom: 0 }

.tl-item .dot {
  position: absolute;
  left: -28px;
  top: 14px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 50%;
}

/* Coloured dots by document type */
.tl-item.type-consultation_open    .dot { border-color: var(--accent) }
.tl-item.type-consultation_closed  .dot { border-color: var(--warn) }
.tl-item.type-consultation_outcome .dot { border-color: var(--violet) }
.tl-item.type-policy_paper         .dot { border-color: var(--violet) }
.tl-item.type-green_paper          .dot { border-color: var(--pos) }
.tl-item.type-white_paper          .dot { border-color: var(--ink) }
.tl-item.type-command_paper        .dot { border-color: var(--ink) }
.tl-item.type-bill                 .dot { border-color: var(--neg) }
.tl-item.type-act                  .dot { border-color: var(--neg) }
.tl-item.type-bill_introduced      .dot { border-color: var(--neg) }
.tl-item.type-bill_second_reading  .dot { border-color: var(--neg) }
.tl-item.type-bill_committee_stage .dot { border-color: var(--neg) }
.tl-item.type-bill_report_stage    .dot { border-color: var(--neg) }
.tl-item.type-bill_third_reading   .dot { border-color: var(--neg) }
.tl-item.type-bill_lords_stages    .dot { border-color: var(--neg) }
.tl-item.type-bill_royal_assent    .dot { border-color: var(--neg); background: var(--neg) }
.tl-item.type-guidance             .dot { border-color: var(--ink-3) }
.tl-item.type-news_announcement    .dot { border-color: var(--accent) }
.tl-item.type-research             .dot { border-color: var(--ink-2) }

/* ── Bill detail: legislative stages timeline ─── */
.bill-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 22px;
  border-left: 2px solid var(--rule);
  margin-left: 8px;
}

.bill-stage {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  align-items: flex-start;
  position: relative;
}

.bs-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--paper);
  position: absolute;
  left: -27px;
  top: 14px;
  flex: none;
}

.bill-stage.done .bs-dot {
  border-color: var(--neg);
  background: var(--neg);
}

.bs-body { flex: 1; min-width: 0 }

.bs-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--ink-3);
}

.bs-house {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
}

.bs-house.commons { border-color: #2672c8; color: #2672c8 }
.bs-house.lords   { border-color: var(--violet); color: var(--violet) }

.bs-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.bill-stage.pending .bs-name { color: var(--ink-3) }

/* ── Bill detail: documents (publications + Hansard debates) ─── */
.bill-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bill-doc-row {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.bill-doc-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.bdr-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-3);
}

.bdr-type {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
}

.bdr-house {
  font-size: 11px;
  color: var(--ink-3);
}

.bdr-date {
  font-size: 12px;
  color: var(--ink-3);
}

.bdr-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.bdr-title a { color: inherit; text-decoration: none }
.bdr-title a:hover { text-decoration: underline }

.bdr-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
}

.bdr-att {
  color: var(--ink-2);
  text-decoration: none;
}

.bdr-att:hover { text-decoration: underline; color: var(--ink) }

.bdr-att-title {
  color: var(--ink-3);
  font-weight: 400;
}

.tl-item .doc {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  transition: border-color .12s, background .12s;
}

.tl-item .doc:hover {
  background: var(--row-hover);
  border-color: var(--ink);
}

.tl-item .doc .top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tl-item .doc .top .pipe { color: var(--rule) }

/* Document type outline micro-label */
.tl-item .doc .top .lbl {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  line-height: 1.5;
  background: transparent;
  align-self: unset;
}

/* Timeline event-pill colours.
 *
 * Driven by data-role first (the policy-spine role from
 * SOURCE_ROLE_CHOICES — same dimension as .role-chip on the right of the
 * row, so the two chip systems stay visually consistent) and falling back
 * to data-family for rows where the role is unset.
 *
 * Outline-only — no background fill — to match the rest of the .lbl system. */
.tl-item .doc .top .lbl[data-role="instrument"]           { color: #1a3a6e; border-color: #1a3a6e }
.tl-item .doc .top .lbl[data-role="parliamentary_record"] { color: #8a4a8a; border-color: #8a4a8a }
.tl-item .doc .top .lbl[data-role="committee_scrutiny"]   { color: #006e2c; border-color: #006e2c }
.tl-item .doc .top .lbl[data-role="consultation"]         { color: #2c6e8f; border-color: #2c6e8f }
.tl-item .doc .top .lbl[data-role="regulator_response"]   { color: #8a5a00; border-color: #b27600 }
.tl-item .doc .top .lbl[data-role="analysis"]             { color: #4a6e8f; border-color: #4a6e8f }
.tl-item .doc .top .lbl[data-role="operational_guidance"] { color: #1a6e62; border-color: #1a6e62 }
.tl-item .doc .top .lbl[data-role="announcement"]         { color: #6a6a6a; border-color: #6a6a6a }
.tl-item .doc .top .lbl[data-role="strategy"]             { color: #4a4a4a; border-color: #4a4a4a }
.tl-item .doc .top .lbl[data-role="law_commission"]       { color: #5a3fb4; border-color: #5a3fb4 }
.tl-item .doc .top .lbl[data-role="predecessor"]          { color: #8a5a00; border-color: #8a5a00; border-style: dashed }

/* Family fallback for rows with no role set (synthetic events, ambiguous
 * sources). Family is the same coarser grouping used by the quick filters. */
.tl-item .doc .top .lbl[data-role=""][data-family="consultation"]       { color: #2c6e8f; border-color: #2c6e8f }
.tl-item .doc .top .lbl[data-role=""][data-family="policy_strategy"]    { color: #5a3fb4; border-color: #5a3fb4 }
.tl-item .doc .top .lbl[data-role=""][data-family="legislative_record"] { color: #1a3a6e; border-color: #1a3a6e }
.tl-item .doc .top .lbl[data-role=""][data-family="scrutiny_evidence"]  { color: #006e2c; border-color: #006e2c }
.tl-item .doc .top .lbl[data-role=""][data-family="analysis"]           { color: #4a6e8f; border-color: #4a6e8f }
.tl-item .doc .top .lbl[data-role=""][data-family="implementation"]     { color: #1a6e62; border-color: #1a6e62 }
.tl-item .doc .top .lbl[data-role=""][data-family="announcements"]      { color: #6a6a6a; border-color: #6a6a6a }

/* Paper-stage overrides — within the strategy role, green papers
 * (exploratory) and white papers (committed direction) read very differently,
 * so colour them by lifecycle stage rather than the flat strategy grey. */
.tl-item .doc .top .lbl.green_paper[data-role="strategy"]   { color: var(--pos);    border-color: var(--pos) }
/* White papers read as the chip's namesake — clean black outline on the
 * page's paper background, no colour fill. */
.tl-item .doc .top .lbl.white_paper[data-role="strategy"]   { color: var(--ink);    border-color: var(--ink) }

.tl-item .doc h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.tl-item .doc h4 a {
  color: inherit;
  text-decoration: none;
}

.tl-item .doc h4 a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tl-item .doc p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

.body-chip {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.5;
}

.provenance-chip {
  display: inline-block;
  padding: 1px 5px;
  border: 1px dotted var(--rule);
  color: var(--ink-3);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.5;
  cursor: help;
}

/* Relationship-type chip — semantically describes how this event
   relates to its thread. Set by the on-demand thread builder; legacy
   events render without one. */
.rel-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.5;
  cursor: help;
}
.rel-chip[data-confidence="low"] { opacity: 0.55; }

.rel-direct               { background: #1a3d6b; color: #fff; }
.rel-implementation       { background: #2c5e3a; color: #fff; }
.rel-scrutiny             { background: #6b3470; color: #fff; }
.rel-evidence             { background: #7a5b1f; color: #fff; }
.rel-political_commitment { background: #7a2c2c; color: #fff; }
.rel-stakeholder_activity { background: #2c5b6b; color: #fff; }
.rel-adjacent             { background: #e3e1da; color: #555; }
.rel-weak_match           { background: transparent; border: 1px dashed var(--rule); color: var(--ink-3); }

.rel-reason {
  margin: 4px 0 6px;
  font-size: 13px;
  color: var(--ink-2, #555);
  line-height: 1.45;
  font-style: italic;
}
.rel-reason-lbl {
  font-style: normal;
  font-weight: 600;
  letter-spacing: .03em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-3, #777);
  margin-right: 4px;
}

/* Compact action row: text-link primaries, first attachment inline,
   additional attachments behind a +N more disclosure, admin actions
   tucked under an overflow ⋯. Replaced the old full-button row to
   reduce vertical noise on long timelines. */
.tl-item .doc .actions-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.tl-item .doc .actions-compact > a {
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-item .doc .actions-compact > a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tl-item .doc .actions-compact .arr { color: var(--ink-3); font-size: 11px }
.tl-item .doc .actions-compact .pipe { color: var(--rule); user-select: none }

/* Disclosures (+N more, ⋯) share the same pill styling on summary. */
.tl-item .doc .actions-compact details {
  display: inline-block;
  margin: 0;
}

.tl-item .doc .actions-compact details > summary {
  list-style: none;
  cursor: pointer;
  padding: 3px 8px;
  border: 1px dashed var(--rule);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  user-select: none;
}

.tl-item .doc .actions-compact details > summary::-webkit-details-marker { display: none }
.tl-item .doc .actions-compact details > summary::marker { content: "" }

.tl-item .doc .actions-compact details > summary:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.tl-item .doc .actions-compact details[open] > summary {
  color: var(--ink);
  border-color: var(--ink-3);
  background: var(--bg-2);
}

/* Overflow ⋯ pulls right so the row reads: primaries · attachments … ⋯ */
.tl-item .doc .actions-compact .actions-overflow { margin-left: auto }

/* Expanded content sits on its own row below the action strip,
   inline (not absolute) so it never hides behind sibling cards. */
.tl-item .doc .actions-compact details[open] > .more-list,
.tl-item .doc .actions-compact details[open] > form {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}

.tl-item .doc .actions-compact .more-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-item .doc .actions-compact .more-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tl-item .doc .actions-compact .more-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tl-item .doc .actions-compact .more-list .arr { color: var(--ink-3); font-size: 11px }

.tl-item .doc .actions-compact .actions-overflow form { margin: 0 }

.tl-item .doc .actions-compact .actions-overflow form button.danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #d9a8a9;
  background: var(--paper);
  color: #9f1f21;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.tl-item .doc .actions-compact .actions-overflow form button.danger:hover {
  background: #fff4f4;
  border-color: #9f1f21;
}

.tl-item .doc .actions-compact .actions-overflow form button.danger .arr { color: #9f1f21 }

/* ── Right rail ─────────────────────────────────────────────── */
.rail .block { margin-bottom: 28px }

.rail .k {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.rail .sub-k {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.thread-qa-summary {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-bottom: 10px;
}

.thread-qa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-qa-item {
  padding: 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
}

.thread-qa-top,
.thread-qa-actions,
.thread-qa-move {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.thread-qa-top {
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.thread-qa-kind,
.thread-qa-method {
  padding: 1px 5px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 700;
}

.thread-qa-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.thread-qa-title:hover { color: var(--accent); text-decoration: underline }

.thread-qa-reason {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.thread-qa-actions {
  margin-top: 8px;
}

.thread-qa-actions form,
.thread-qa-move {
  margin: 0;
}

.thread-qa-actions button,
.thread-qa-move button,
.thread-qa-move input {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
}

.thread-qa-actions button,
.thread-qa-move button {
  padding: 4px 8px;
  cursor: pointer;
}

.thread-qa-actions button:hover,
.thread-qa-move button:hover {
  border-color: var(--ink);
  background: var(--bg-2);
}

.thread-qa-actions button.danger {
  color: #9f1f21;
  border-color: #d9a8a9;
}

.thread-qa-actions button.danger:hover {
  background: #fff4f4;
  border-color: #9f1f21;
}

.thread-qa-move {
  margin-top: 7px;
}

.thread-qa-move input {
  min-width: 0;
  flex: 1 1 120px;
  padding: 4px 6px;
}

.rail .dept-list { display: flex; flex-direction: column; gap: 6px }

.rail .dept-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.rail .dept-row .tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 1px 5px;
  line-height: 1.5;
  flex: none;
  margin-top: 1px;
  text-transform: uppercase;
}

.rail .meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 10px;
}

.rail .meta-row .item { font-size: 13px }

.rail .meta-row .item .l {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rail .meta-row .item .v {
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.rail hr { border: 0; border-top: 1px solid var(--rule); margin: 0 0 24px }

/* ── Document detail page ───────────────────────────────────── */
.doc-detail { padding: 28px var(--gutter) 56px }

.doc-header {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.doc-header h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.doc-header .standfirst {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 62ch;
}

.doc-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 12.5px;
  color: var(--ink-3);
}

.doc-meta-bar .govuk-link {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  text-underline-offset: 3px;
}

.consult-dates {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.consult-dates .cd-item { display: flex; flex-direction: column; gap: 2px }

.consult-dates .cd-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.consult-dates .cd-value { font-size: 14px; font-weight: 500; color: var(--ink) }

.linked-doc {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.linked-doc .arr { color: var(--accent); flex-shrink: 0; margin-top: 1px }

.linked-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 4px }
.linked-list li { display: flex; align-items: center; gap: 8px }

.attachments { margin: 18px 0 }

.attachments-heading {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.attachment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px }

.attachment-item {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
}

.attachment-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px }

.att-meta { font-size: 11.5px; color: var(--ink-3); padding-left: 0 }

.pdf-embed {
  margin-top: 10px;
  border: 1px solid var(--rule);
  background: var(--bg-2, #f6f6f4);
}
.pdf-embed iframe {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 480px;
  border: 0;
}
@media (max-width: 720px) {
  .pdf-embed iframe { height: 60vh; min-height: 360px }
}

.pdf-preview-toggle { margin-top: 8px }
.pdf-preview-toggle > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 0;
  user-select: none;
}
.pdf-preview-toggle > summary:hover { color: var(--accent) }
.pdf-preview-toggle[open] > summary { color: var(--ink); font-weight: 600 }

.no-preview-card {
  margin-top: 24px;
  padding: 22px 22px 20px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
}
.no-preview-heading {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.no-preview-body {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.no-preview-cta {
  display: inline-block;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.no-preview-cta:hover { background: var(--accent); color: #fff }

.full-text {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.full-text-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.full-text-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  max-width: 66ch;
}

.full-text-body p { margin: 0 0 1rem }

.full-text-body .hs-turn {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  margin: 0 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.full-text-body .hs-turn:first-child { border-top: 0; padding-top: 0 }
.full-text-body .hs-speaker {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.full-text-body .hs-utterance { color: var(--ink-2) }

@media (max-width: 700px) {
  .full-text-body .hs-turn { grid-template-columns: 1fr; gap: 4px }
  .full-text-body .hs-speaker { color: var(--ink-3); font-size: 11.5px }
}

/* Doc action buttons (sidebar) */
.doc-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 8px;
  transition: border-color .1s, background .1s;
}

.doc-action-btn:hover { background: var(--bg-2); border-color: var(--ink); color: var(--ink) }

.doc-action-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.doc-action-btn.primary:hover { background: var(--ink-2); color: #fff }

.doc-action-form { margin: 0 }

.doc-action-btn.danger {
  color: #9f1f21;
  border-color: #d9a8a9;
}

.doc-action-btn.danger:hover {
  background: #fff4f4;
  border-color: #9f1f21;
  color: #9f1f21;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  padding: 48px 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

.empty-state code {
  display: block;
  margin: 12px auto 0;
  max-width: 520px;
  font-size: 12.5px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  padding: 8px 14px;
  text-align: left;
  color: var(--ink-2);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer.site {
  background: var(--hero-bg);
  color: #cbd5e0;
  padding: 28px 0;
  margin-top: 0;
  border-top: 1px solid var(--accent);
}

footer.site .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

footer.site h4 { margin: 0 0 6px; color: #fff; font-size: 14px; font-weight: 600 }
footer.site p  { margin: 0; font-size: 12.5px; color: #9aa9b8; line-height: 1.55 }
footer.site .right { font-size: 12px; color: #9aa9b8; text-align: right }
footer.site a  { color: #cbd5e0 }
footer.site a:hover { color: #fff }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .issue {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    row-gap: 4px;
    column-gap: 12px;
  }
  .issue-body { grid-column: 2 / 3; font-size: 12px }
  .issue-date { grid-column: 3 / 4; grid-row: 1 / 2 }
  .issue-docs { grid-column: 3 / 4; grid-row: 2 / 3 }
}

@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; gap: 24px }
  .page > .rail { order: 2 }
  .explore-pivot-layout { grid-template-columns: 1fr }
  .explore-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .explore-viz-shell { display: none }
  .viz-table-fallback { display: block }
  .issue-view-switcher { display: none }
  .issue-workflow-bar {
    justify-content: stretch;
  }
  .issue-actions-group {
    flex-direction: column;
    width: 100%;
  }
  .issue-actions-group form {
    width: 100%;
  }
  .issue-thread-action {
    width: 100%;
    white-space: normal;
  }
  .timeline-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .timeline-sort,
  .timeline-filter-controls,
  .timeline-filter-controls .filter-menu,
  .timeline-filter-apply {
    width: 100%;
  }
  .timeline-sort a {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
  .filter-menu summary {
    width: 100%;
    justify-content: space-between;
  }
  .filter-menu-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
  .pathway-shell .policy-pathway-container,
  .pathway-shell .pathway-legend { display: none }
  .pathway-shell .pathway-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .pathway-shell::after {
    content: 'Map view is desktop-only — switch to Timeline below for full browsing on this screen size.';
    display: block;
    padding: 14px 18px;
    font-size: 12.5px;
    color: var(--ink-3);
    background: #fbfcfb;
    border-top: 1px dashed var(--rule-2);
  }
}

@media (max-width: 720px) {
  :root { --gutter: 16px }
  .wrap { max-width: 100% }
  .navbar .wrap {
    height: 54px;
    min-width: 0;
  }
  .navbar .brand {
    padding-right: 12px;
    margin-right: 0;
    min-width: 0;
  }
  .navbar .nav-links,
  .navbar .nav-search,
  .navbar .auth-strip { display: none }
  .mobile-nav {
    display: block;
    margin-left: auto;
    position: relative;
  }
  .mobile-nav summary {
    list-style: none;
    cursor: pointer;
    padding: 7px 10px;
    border: 1px solid var(--hero-rule);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }
  .mobile-nav summary::-webkit-details-marker { display: none }
  .mobile-nav[open] summary {
    border-color: var(--accent);
    background: #0e2138;
  }
  .mobile-nav-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 90;
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    border: 1px solid var(--hero-rule);
    background: var(--hero-bg);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
    padding: 8px;
  }
  .mobile-nav-panel > a {
    display: block;
    padding: 10px 9px;
    color: #cbd0d6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
  }
  .mobile-nav-panel > a.active,
  .mobile-nav-panel > a:hover {
    color: #fff;
    background: #0e2138;
  }
  .mobile-nav-panel form {
    display: flex;
    height: 36px;
    margin: 8px 0;
    border: 1px solid var(--hero-rule);
    background: #0e2138;
  }
  .mobile-nav-panel input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0 9px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 16px;
  }
  .mobile-nav-panel button {
    border: 0;
    border-left: 1px solid var(--hero-rule);
    background: transparent;
    color: #fff;
    padding: 0 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }
  .mobile-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px;
    border-top: 1px solid var(--hero-rule);
    color: #9aa9b8;
    font-size: 13px;
  }
  .mobile-auth a {
    color: #cbd0d6;
    text-decoration: none;
  }
  .mobile-auth form {
    display: inline;
    height: auto;
    margin: 0;
    border: 0;
    background: transparent;
  }
  .mobile-auth button {
    border: 0;
    padding: 0;
    color: #cbd0d6;
    background: transparent;
    text-decoration: underline;
  }
  .hero .wrap {
    padding-top: 34px;
    padding-bottom: 34px;
  }
  .hero h1,
  .hero p,
  .page-head h1,
  .standfirst {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .hero p,
  .hero .meta-strip span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .hero .meta-strip {
    gap: 8px;
  }
  .hero .meta-strip .pipe {
    display: none;
  }
  .search-bar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .search-bar input[type="search"] {
    flex-basis: 100%;
  }
  .search-bar button,
  .search-bar .clear-search {
    flex: 1 1 auto;
    border-left: 0;
    border-top: 1px solid var(--rule);
    text-align: center;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters {
    align-items: stretch;
  }
  .filters .spacer {
    display: none;
  }
  .inline-filter-form {
    display: block;
    width: 100%;
  }
  .explore-theme summary { align-items: flex-start }
  .explore-theme-title { font-size: 15.5px }
  .explore-count { display: block; margin-top: 2px }
  .explore-issue {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 6px;
  }
  .explore-issue-meta,
  .explore-body-chip { justify-self: start }
  .pivot-topbar {
    display: grid;
    gap: 12px;
  }
  .pivot-summary {
    min-width: 0;
    text-align: left;
  }
  .pivot-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .pivot-action-link,
  .pivot-action-form,
  .pivot-action-form button {
    width: 100%;
  }
  .explore-filter-form select,
  .explore-filter-form input {
    max-width: 100%;
  }
  .explore-filter-form select[multiple] {
    min-height: 92px;
  }
  .pivot-issue {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 7px;
  }
  .pivot-issue-meta,
  .pivot-doc-count,
  .pivot-issue .explore-body-chip {
    justify-self: start;
  }
  .signal-filters { align-items: stretch }
  .signal-filters label,
  .signal-filters .filter-select { width: 100% }
  .hero h1 { font-size: 34px }
  .page-head h1 { font-size: 28px }
  .lifecycle-banner { align-items: flex-start; flex-direction: column }
  .lifecycle-banner .lb-days { align-self: flex-start }
  .filters { flex-wrap: wrap; gap: 4px }
  .filter-select { flex: 1 1 auto }
  .search-bar input[type="search"] { font-size: 16px } /* prevent iOS zoom */
  .watchlist-table,
  .issue-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Watchlist UI (Phase 5b) ──────────────────────────────────────────────── */

.navbar .auth-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  margin-left: 6px;
  height: 46px;
  border-left: 1px solid var(--hero-rule);
  color: #cbd0d6;
  font-size: 13px;
}
.navbar .auth-strip .user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  flex-shrink: 0;
}
.navbar .auth-strip .user-handle {
  color: #cbd0d6;
  font-size: 12.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.navbar .auth-strip .logout-form {
  border: 0;
  background: transparent;
  height: auto;
  margin: 0;
  padding: 0;
}
.navbar .auth-strip .logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd0d6;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.navbar .auth-strip .logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}
.navbar .auth-strip .auth-link {
  color: #cbd0d6;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
}
.navbar .auth-strip .auth-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.navbar .auth-strip .auth-link-primary {
  background: var(--accent, #4a8bd6);
  color: #0a1828;
  font-weight: 600;
}
.navbar .auth-strip .auth-link-primary:hover {
  background: var(--accent-hover, #6aa3df);
  color: #0a1828;
}

/* Replace the loud default browser focus ring on navbar links/buttons
   with a subtle accent-coloured underline that matches the active state. */
.navbar a:focus-visible,
.navbar button:focus-visible,
.navbar input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(80, 140, 220, 0.45);
  border-radius: 2px;
}
.navbar ul a:focus-visible {
  border-radius: 0;
  border-bottom-color: var(--accent);
  box-shadow: none;
}
.navbar form input:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(80, 140, 220, 0.45);
}

@media (max-width: 720px) {
  .navbar .auth-strip { display: none }
  .issue {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 5px;
    padding: 13px 12px;
  }
  .issue .lbl,
  .issue-title,
  .issue-body,
  .issue-date,
  .issue-docs {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
    text-align: left;
    max-width: 100%;
  }
  .issue-title h3,
  .issue-title p,
  .issue-body {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Generic buttons used across watchlist + auth pages */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
}
.btn:hover { background: var(--bg-2); color: var(--ink); text-decoration: none }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff }
.btn-danger {
  background: var(--bg);
  border-color: #b32d2e;
  color: #b32d2e;
}
.btn-danger:hover { background: #b32d2e; color: #fff }
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.btn-link:hover { color: var(--accent-hover) }

/* Watchlist sidebar chips (issue + document detail) */
.wl-chips { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px }
.wl-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .1s, background .1s, color .1s;
}
.wl-chip:hover { border-color: var(--ink); background: var(--bg-2); color: var(--ink) }
.wl-chip .wl-chip-action { color: var(--ink-3); font-size: 11px; font-weight: 400 }
.wl-chip:hover .wl-chip-action { color: var(--ink) }
.wl-chip.is-saved {
  background: #e8f3ec;
  border-color: #b6d8c2;
  color: #1c5230;
}
.wl-chip.is-saved:hover { background: #dcecdf; border-color: #1c5230; color: #1c5230 }
.wl-chip.is-saved .wl-chip-action { color: #1c5230; opacity: .65 }
.wl-chip.is-saved:hover .wl-chip-action { opacity: 1 }
.wl-new { font-size: 12px }

/* Watchlist list page cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cards .card {
  border: 1px solid var(--rule);
  padding: 14px 16px;
  background: var(--bg);
}
.cards .card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600 }
.cards .card h4 a { color: var(--ink); text-decoration: none }
.cards .card h4 a:hover { color: var(--accent); text-decoration: underline }
.cards .card .meta { color: var(--ink-3); font-size: 12.5px; margin: 0 0 6px }
.cards .card p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5 }
.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-3);
  vertical-align: middle;
}

/* Watchlist detail table */
.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.watchlist-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
}
.watchlist-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 14px;
  vertical-align: top;
}
.watchlist-table td a { color: var(--ink); text-decoration: none; font-weight: 500 }
.watchlist-table td a:hover { color: var(--accent); text-decoration: underline }
.watchlist-table .meta { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0 }

.watchlist-note { margin-top: 4px }
.watchlist-note > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-3);
  list-style: none;
}
.watchlist-note > summary::-webkit-details-marker { display: none }
.watchlist-note > summary:hover { color: var(--accent) }
.watchlist-note[open] > summary { color: var(--ink-2); margin-bottom: 6px }
.watchlist-note textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 6px;
}
.watchlist-note textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Form layout for watchlist create/edit */
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 16px }
.form-row { display: flex; flex-direction: column; gap: 6px }
.form-row label { font-size: 13px; font-weight: 500; color: var(--ink-2) }
.form-row .form-control {
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.form-row .form-control:focus { outline: none; border-color: var(--accent) }
.form-row .error { color: #b32d2e; font-size: 12px; margin: 0 }
.form-actions { display: flex; gap: 8px; margin-top: 4px }

/* Auth pages (allauth login/signup/logout) */
.auth-section { padding-top: 48px }
.auth-wrap { max-width: 480px }
.auth-wrap h2 { margin: 0 0 8px; font-size: 24px }
.auth-wrap .standfirst { color: var(--ink-2); margin: 0 0 24px; font-size: 14.5px; line-height: 1.55 }
.auth-form { display: flex; flex-direction: column; gap: 16px }
.auth-form .auth-errors {
  background: #fff4f4;
  border: 1px solid #f3c2c2;
  color: #8a1f1f;
  padding: 10px 12px;
  font-size: 13px;
}
.auth-label { display: flex; flex-direction: column; gap: 5px }
.auth-label > span { font-size: 13px; font-weight: 500; color: var(--ink-2) }
.auth-label input {
  padding: 9px 11px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.auth-label input:focus { outline: none; border-color: var(--accent) }
.auth-error { color: #b32d2e; font-size: 12px }
.auth-hint { color: var(--ink-3); font-size: 12px }
.auth-submit {
  margin-top: 4px;
  padding: 10px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover) }
.auth-meta { color: var(--ink-3); font-size: 13px; margin: 8px 0 0 }
.auth-meta a { color: var(--accent) }

/* Empty state on watchlist list */
.watchlist-empty {
  margin: 20px 0;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ============================================================
   POLISH PASS — typography tokens, citation chips, skeleton,
   error pages, empty-state card, global focus, print sheet.
   Appended 2026-05-12.
   ============================================================ */

/* ── Typography tokens — gives every new component a single ladder
   to choose from, so future styles don't reach for magic numbers. */
:root {
  --fs-meta:   11.5px;   /* uppercase eyebrow / dense meta              */
  --fs-xs:     12px;     /* tertiary meta, dense table cells            */
  --fs-sm:     12.5px;   /* secondary meta                              */
  --fs-base:   13px;     /* default control text, list dense rows       */
  --fs-body:   14.5px;   /* prose body                                  */
  --fs-lead:   16px;     /* hero standfirst, large summary              */
  --fs-h4:     17px;     /* card titles                                 */
  --fs-h3:     20px;     /* section subhead                             */
  --fs-h2:     24px;     /* page section                                */
  --fs-h1:     32px;     /* page hero (default; hero block overrides)   */

  --lh-tight:  1.2;
  --lh-snug:   1.35;
  --lh-base:   1.55;
  --lh-loose:  1.7;

  --rad-sm:    3px;
  --rad-md:    6px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* No global heading defaults — every page in this codebase already has
   scoped heading rules (.hero h1, .lp-hero h1, .section-head h2, …) and
   a generic `main h1:not([class])` net is 0,1,2 specificity — high
   enough to beat `.lp-hero h1` (0,1,1) and silently shrink the landing
   hero from 56px to 32px. If a new template ever needs a default, give
   it a class and a scoped rule. The typography tokens above still give
   future styles a single ladder to choose from. */

/* ── Citation chips — used in workspace synthesis, document detail,
   and anywhere we attach a dated source pill to a claim. */
.ws-cite-list {
  display: inline;
  margin-left: 2px;
  vertical-align: baseline;
  white-space: nowrap;
}

.ws-cite-list .ws-cite + .ws-cite,
.ws-cite-list .ws-cite-unlinked + .ws-cite,
.ws-cite-list .ws-cite + .ws-cite-unlinked,
.ws-cite-list .ws-cite-unlinked + .ws-cite-unlinked {
  margin-left: 2px;
}

.ws-cite,
.ws-cite-unlinked {
  display: inline;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 0.72em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  vertical-align: super;
  text-decoration: none;
  white-space: nowrap;
  transition: color .12s;
}

.ws-cite:hover,
.ws-cite:focus {
  color: var(--accent);
  text-decoration: none;
}

.ws-cite-unlinked {
  color: var(--ink-3);
  opacity: 0.7;
  cursor: help;
}

.ws-cite-note {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: var(--lh-base);
  margin: 6px 0 16px;
}

/* ── Skeleton loaders — pulse rather than spin so they imply
   "content is on its way" and mirror the final layout. */
@keyframes ps-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@keyframes ps-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skel,
.skel-line,
.skel-block {
  display: block;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--rule-2) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: ps-shimmer 1.4s linear infinite;
  border-radius: var(--rad-sm);
  color: transparent;
  user-select: none;
}

.skel-line { height: 12px; margin: 0 0 8px; }
.skel-line.is-sm    { height: 9px; }
.skel-line.is-lg    { height: 18px; }
.skel-line.w-30 { width: 30%; }
.skel-line.w-50 { width: 50%; }
.skel-line.w-70 { width: 70%; }
.skel-line.w-90 { width: 90%; }

.skel-block { height: 60px; margin: 0 0 10px; }

.skel-stack {
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--rad-md);
}

@media (prefers-reduced-motion: reduce) {
  .skel,
  .skel-line,
  .skel-block { animation: none; background: var(--bg-2); }
}

/* ── Error pages (404/403/400/500) — on-brand recovery surface. */
.errpage {
  padding: 96px 0 120px;
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, var(--bg-2) 100%);
  min-height: 60vh;
}

.errpage .wrap { max-width: 720px; }

.errpage-code {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}

.errpage h1 {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  max-width: 18ch;
}

.errpage p {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.errpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.errpage-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--rad-sm);
  transition: background .12s, border-color .12s, color .12s;
}

.errpage-btn:hover {
  background: var(--bg-2);
  border-color: var(--ink-3);
  color: var(--ink);
  text-decoration: none;
}

.errpage-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.errpage-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.errpage-search {
  display: flex;
  align-items: stretch;
  max-width: 520px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--rad-sm);
  overflow: hidden;
}

.errpage-search input[type="search"] {
  flex: 1;
  border: 0;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.errpage-search input[type="search"]:focus {
  background: var(--bg-2);
}

.errpage-search button {
  flex: none;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  padding: 0 20px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.errpage-search button:hover { background: var(--bg-2); color: var(--ink); }

@media (max-width: 700px) {
  .errpage { padding: 56px 0 72px; }
  .errpage h1 { font-size: 30px; }
}

/* ── Empty state card — opt-in upgrade of the centered text. Use as
   <div class="empty-state is-card"> for a designed surface, or stay
   with plain .empty-state for compact contexts. */
.empty-state.is-card {
  padding: 36px 24px;
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: var(--rad-md);
  color: var(--ink-2);
}

.empty-state.is-card .empty-icon {
  display: inline-block;
  width: 36px;
  height: 36px;
  margin: 0 0 12px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-3);
  line-height: 36px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.empty-state.is-card h3 {
  margin: 0 0 6px;
  font-size: var(--fs-h4);
  font-weight: 600;
  color: var(--ink);
}

.empty-state.is-card p {
  margin: 0 auto;
  max-width: 52ch;
  font-size: var(--fs-body);
  line-height: var(--lh-base);
}

.empty-state.is-card .empty-actions {
  margin-top: 16px;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Global :focus-visible — accessible focus rings on everything
   keyboard-driven that doesn't already have a scoped rule. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--rad-sm);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The navbar block above already has tuned focus rules; this resets
   the global one inside the navbar so it doesn't double up. */
.navbar a:focus-visible,
.navbar button:focus-visible,
.navbar input:focus-visible,
.hero-search :focus-visible {
  outline: none;
}

/* Subtle hover affordance on clickable rows that don't have their own
   hover treatment yet. */
[role="link"]:hover,
a:has(> h3):hover,
a.card:hover {
  cursor: pointer;
}

/* ── Print stylesheet — Cmd-P should produce something a partner
   could hand to a client. Hide nav/footer/floating chips, force
   light backgrounds, surface link URLs. */
@media print {
  /* Page setup */
  @page {
    size: A4;
    margin: 18mm 16mm 20mm;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  /* Strip chrome */
  .navbar,
  footer.site,
  .crumbs-bar,
  .ws-actions-bar,
  .ws-action-menu,
  .ws-chat,
  .hero-actions,
  .filters,
  .filter-tab,
  .search-bar,
  .ws-export-bar,
  .nav-search,
  .auth-strip,
  .mobile-nav,
  #cc-chip, #bj-chip, #brief-chip,
  .page-messages,
  [data-print-hide] {
    display: none !important;
  }

  /* Make sure main is the only thing taking space */
  main { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }

  /* Headings — keep prominence but trim air */
  h1 { font-size: 22pt; margin: 0 0 6mm; }
  h2 { font-size: 14pt; margin: 6mm 0 2mm; page-break-after: avoid; }
  h3 { font-size: 12pt; margin: 4mm 0 2mm; page-break-after: avoid; }

  /* Reveal link URLs in print — partners reading the PDF know where
     citations point. Skip mailto:, javascript:, and anchor-only links. */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
    word-break: break-all;
  }
  a[href^="#"]:after,
  a[href^="mailto:"]:after,
  a[href^="javascript:"]:after,
  a.ws-cite:after,
  a.ws-cite-unlinked:after,
  .ws-cite-list a:after { content: ""; }

  /* Avoid awkward breaks in evidence cards */
  .tl-item,
  .issue,
  .ws-chat-turn,
  .ai-report-card,
  .empty-state {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Citations stay tidy */
  .ws-cite,
  .ws-cite-unlinked {
    background: transparent !important;
    border: 1px solid #999 !important;
    color: #000 !important;
  }

  /* Hide skeleton loaders entirely in print */
  .skel, .skel-line, .skel-block, .skel-stack { display: none !important; }

  /* Backgrounds and dark UI bands flattened */
  .hero, .crumbs-bar, .ws-meta-band, .ws-chat,
  .errpage, .navbar, footer.site {
    background: #fff !important;
    color: #000 !important;
    border-color: #999 !important;
  }
}
