/* profitoverpeople.co.uk — International Typographic Style
 * Open 12-column editorial grid · White ground · Neutral hairlines · Helvetica Neue · Single Crimson semantic accent.
 */

:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --surface-strong: #efefed;
  --ink: #111111;
  --ink-secondary: #4d4d4d;
  --ink-muted: #737373;
  --rule: #e5e5e3;
  --rule-control: #cccccc;
  --rule-dossier: #d4d4d4;
  --accent: #c8102e;
  --font-sans: "Helvetica Neue", Helvetica, Arial, -apple-system, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-control);
}

a:hover {
  text-decoration-color: var(--ink);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  padding: 1px 4px;
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  padding: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-exception,
.is-alert {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   OPEN EDITORIAL CONTAINER (NO OUTER CAGE BORDERS)
   ============================================================ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   BAND 1 — UTILITY MASTHEAD
   ============================================================ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.masthead-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand-domain {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-domain:hover {
  text-decoration: underline;
  text-decoration-color: var(--ink);
}

.brand-descriptor {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead-utils {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.util-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.util-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.util-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink);
}

/* Buttons */
.btn-hairline,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
}

.btn-hairline {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule-control);
}

.btn-hairline:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface);
}

.btn-hairline:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: #2b2b2b;
  border-color: #2b2b2b;
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================================
   BAND 2 — EDITORIAL TITLE & UNBOXED TABULAR FIGURES
   ============================================================ */
.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 32px;
  align-items: start;
  padding: 20px 0 18px;
}

.hero-intro h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero-deck {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-secondary);
  max-width: 56ch;
}

.hero-deck strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 2px;
}

.figure-col {
  min-width: 0;
}

.figure-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.figure-label {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.figure-detail {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.figure-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(200, 16, 46, 0.45);
}

.figure-link:hover,
.figure-link[aria-pressed="true"] {
  text-decoration-color: var(--accent);
}

.figure-link[aria-pressed="true"] {
  font-weight: 600;
}

.figure-sep {
  color: var(--ink-muted);
}

/* Empty Callout */
.empty-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 13.5px;
}

/* ============================================================
   BAND 3 — PRIMARY VIEW NAVIGATION (ANCHOR RULE #1)
   ============================================================ */
.nav-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.tab-bar {
  display: flex;
  align-items: stretch;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 11px 0 10px;
  margin-bottom: -1px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.tab-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.tab-btn.active .tab-count {
  color: var(--ink-secondary);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.rows-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
}

.select-quiet {
  height: 26px;
  padding: 0 18px 0 2px;
  border: none;
  border-bottom: 1px solid var(--rule-control);
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234d4d4d' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
}

.select-quiet:hover,
.select-quiet:focus {
  border-bottom-color: var(--ink);
  outline: none;
}

.breakdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.breakdown-toggle:hover {
  color: var(--ink);
}

.filter-badge-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ============================================================
   BAND 4 — UNIFIED SEARCH & QUICK FILTER STRIP
   ============================================================ */
.filter-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

/* When breakdown drawer is collapsed, Band 4 takes the clean anchor rule above the table */
.filter-strip:has(+ #breakdownBand[hidden]),
.filter-strip.is-anchor-bottom {
  border-bottom-color: var(--ink);
}

.search-wrap {
  position: relative;
  flex: 0 1 280px;
  min-width: 190px;
}

.search-input {
  width: 100%;
  height: 28px;
  padding: 2px 24px 2px 0;
  border: none;
  border-bottom: 1px solid var(--rule-control);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink);
}

.search-input:focus {
  border-bottom-color: var(--ink);
  outline: none;
}

.search-input::placeholder {
  color: var(--ink-muted);
}

.search-key {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 5px;
  border: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-muted);
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.search-wrap:focus-within .search-key,
.search-wrap.has-value .search-key {
  opacity: 0;
}

/* Clean typographic status switch (no black cage border) */
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.seg-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

.seg-btn.active {
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 600;
}

/* Inline active filters (quiet hairline tokens, no red FILTERED stamp) */
.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.active-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.filter-chip button {
  padding: 0 1px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}

.filter-chip button:hover {
  color: var(--accent);
}

.reset-link {
  padding: 2px 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.reset-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   BAND 5 — MODULAR 3-COLUMN BREAKDOWN & REFINE BAND (ANCHOR RULE #2)
   ============================================================ */
.breakdown-band {
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--ink);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: minmax(0, 3.2fr) minmax(0, 6.2fr) minmax(0, 2.6fr);
  gap: 28px;
  align-items: start;
}

.breakdown-col {
  min-width: 0;
}

.breakdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.breakdown-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.breakdown-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.metric-switch {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

.metric-opt {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-muted);
  cursor: pointer;
}

.metric-opt:hover {
  color: var(--ink);
}

.metric-opt.active {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.metric-sep {
  color: var(--rule-control);
}

/* Col 1: Financial Year Proportional Bars */
.year-bars {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.year-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  width: calc(100% + 8px);
  height: 20px;
  padding: 0 4px;
  margin: 0 -4px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.year-row:hover {
  background: var(--surface);
}

.year-row.selected {
  background: var(--surface);
  font-weight: 600;
}

.year-row-label {
  white-space: nowrap;
}

.year-bar-track {
  display: block;
  height: 4px;
  background: var(--surface-strong);
  overflow: hidden;
}

.year-bar-fill {
  display: block;
  height: 100%;
  background: var(--ink);
}

.year-row.selected .year-bar-fill {
  background: var(--accent);
}

.year-row-val {
  text-align: right;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.year-row.selected .year-row-val {
  color: var(--ink);
}

/* Col 2: Political Party 3-Column Grid on desktop (18 parties = 6 balanced rows, zero inner scroll) */
.party-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px 16px;
}

.party-row {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: calc(100% + 11px);
  height: 20px;
  padding: 0 5px 0 4px;
  margin: 0 -6px;
  border: none;
  border-left: 2px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.party-row:hover {
  background: var(--surface);
}

.party-row.selected {
  background: var(--surface);
  border-left-color: var(--ink);
  font-weight: 600;
}

.party-swatch {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.16);
}

.party-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-count {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.party-row.selected .party-count {
  color: var(--ink);
}

/* Col 3: Classification Selects */
.refine-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.refine-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.select-underlined {
  width: 100%;
  height: 26px;
  padding: 0 18px 0 0;
  border: none;
  border-bottom: 1px solid var(--rule-control);
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234d4d4d' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}

.select-underlined:hover,
.select-underlined:focus {
  border-bottom-color: var(--ink);
  outline: none;
}

/* ============================================================
   BAND 6 — MAIN CONTENT & REGISTER TABLES
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-intro {
  margin: 0;
  padding: 16px 0 14px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--rule);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table > thead > tr > th {
  text-align: left;
  padding: 10px 12px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-control);
  white-space: nowrap;
  user-select: none;
  vertical-align: bottom;
}

.table-audit > thead > tr > th {
  border-bottom-color: var(--ink);
}

.data-table > thead > tr > th:first-child,
.data-table > tbody > tr > td:first-child {
  padding-left: 0;
}

.data-table > thead > tr > th:last-child,
.data-table > tbody > tr > td:last-child {
  padding-right: 0;
}

.data-table > thead > tr > th.sortable {
  cursor: pointer;
}

.data-table > thead > tr > th.sortable:hover {
  color: var(--ink);
}

.data-table > thead > tr > th.active-sort {
  color: var(--ink);
  font-weight: 600;
}

/* Pure geometric sort indicator (zero Unicode arrows) */
.data-table > thead > tr > th.active-sort::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: 2px;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
}

.data-table > thead > tr > th.active-sort.desc::after {
  border-top: 4.5px solid var(--ink);
}

.data-table > thead > tr > th.active-sort.asc::after {
  border-bottom: 4.5px solid var(--ink);
}

.data-table > tbody > tr > td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.data-table > thead > tr > th.num,
.data-table > tbody > tr > td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table > tbody > tr > td.date-cell,
.data-table > tbody > tr > td.year-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Clear horizontal breathing room between right-aligned numbers and left-aligned text */
.data-table > tbody > tr > td.num + td:not(.num),
.data-table > thead > tr > th.num + th:not(.num),
.sub-table td.num + td:not(.num),
.sub-table th.num + th:not(.num) {
  padding-left: 22px;
}

.data-table > tbody > tr.mp-row {
  cursor: pointer;
}

.data-table > tbody > tr.mp-row:hover {
  background: var(--surface);
}

.data-table > tbody > tr.mp-row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.data-table > tbody > tr.mp-row.expanded {
  background: var(--surface);
}

.data-table > tbody > tr.mp-row.expanded > td {
  border-bottom-color: transparent;
}

.empty-cell {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--ink-muted);
  font-size: 13.5px;
}

/* MP Identity Cell — Natural Full-Colour Portrait + Minimal Geometric + / - Toggle */
.mp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-toggle {
  position: relative;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.row-toggle::before,
.row-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--ink-muted);
  transform: translate(-50%, -50%);
  transition: opacity 0.12s ease, background-color 0.12s ease;
}

.row-toggle::before {
  width: 8px;
  height: 1px;
}

.row-toggle::after {
  width: 1px;
  height: 8px;
}

.mp-row:hover .row-toggle::before,
.mp-row:hover .row-toggle::after,
.mp-row.expanded .row-toggle::before {
  background: var(--ink);
}

.mp-row.expanded .row-toggle::after {
  opacity: 0;
}

.mp-photo {
  width: 28px;
  height: 28px;
  background: var(--surface-strong);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.mp-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.mp-meta {
  min-width: 0;
}

.mp-name {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.28;
}

.mp-former {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-muted);
  white-space: nowrap;
}

.mp-seat {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.mp-flag {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
}

.party-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.3;
  white-space: nowrap;
}

.party-inline .party-swatch {
  margin-top: 1px;
}

/* Compact Honest Years Cell */
.years-cell {
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.years-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.years-range {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.yr-tok {
  white-space: nowrap;
}

.money-paid {
  font-weight: 600;
  color: var(--ink);
}

.money-adj {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.3;
}

.details-cell {
  max-width: 340px;
  word-break: break-word;
  font-size: 13.5px;
  line-height: 1.4;
}

.details-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.status-text {
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink-secondary);
}

.status-text.is-alert {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   INLINE EXPANDED MP DOSSIER
   ============================================================ */
.detail-row > td {
  padding: 0 !important;
  background: var(--surface);
  border-top: 1px solid var(--rule-dossier);
  border-bottom: 1px solid var(--rule-dossier);
}

.dossier {
  padding: 16px 20px 20px 60px;
}

.dossier-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.dossier-bar strong {
  color: var(--ink);
  font-weight: 600;
}

.dossier-links {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 12px;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-top: 1px solid var(--rule-dossier);
  border-bottom: 1px solid var(--rule-dossier);
  font-size: 12px;
}

.sub-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.sub-table td {
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.4;
}

.sub-table th:first-child,
.sub-table td:first-child {
  padding-left: 12px;
}

.sub-table th:last-child,
.sub-table td:last-child {
  padding-right: 12px;
}

.sub-table tr:last-child td {
  border-bottom: none;
}

.sub-table th.num,
.sub-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sub-table td.date-cell,
.sub-table td.year-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 24px;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
  flex-wrap: wrap;
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager-page {
  color: var(--ink-secondary);
}

/* ============================================================
   RULES & METHOD — OPEN 3-COLUMN SWISS EDITORIAL PROSE
   ============================================================ */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 28px 0 36px;
}

.method-col h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.method-col p,
.method-col ul {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.method-col ul {
  padding-left: 18px;
}

.method-col li {
  margin-bottom: 6px;
}

.method-col strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding: 20px 0 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
}

.site-footer strong {
  color: var(--ink);
  font-weight: 600;
}

.footer-stats {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   REFRESH IPSA DISCLOSURES MODAL
   ============================================================ */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.42);
  z-index: 50;
}

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  background: var(--bg);
  border: 1px solid var(--rule-dossier);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.14);
  z-index: 60;
  display: flex;
  flex-direction: column;
}

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

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.dialog-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--surface);
}

.dialog-body {
  padding: 16px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dialog-hint {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.dialog-btns {
  display: flex;
  gap: 8px;
}

.preset-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.preset-link {
  padding: 2px 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
}

.preset-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.year-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.year-choice:hover {
  background: var(--surface);
}

.year-choice.checked {
  border-color: var(--ink);
  background: var(--surface);
}

.year-choice input {
  margin: 2px 0 0;
  accent-color: var(--ink);
}

.year-choice-title {
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.year-choice-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  cursor: pointer;
}

.check-row input {
  accent-color: var(--ink);
}

.progress-box {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

.progress-pct {
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}

.progress-track {
  height: 3px;
  background: var(--surface-strong);
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.log-box {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 8px 10px;
  color: var(--ink-secondary);
}

.log-line.error {
  color: var(--accent);
  font-weight: 600;
}

.log-line.done {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   ANALYSIS TAB — SWISS EMPIRICAL CORRELATIONS (GET /api/correlations)
   ============================================================ */
.analysis-status {
  padding: 28px 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.analysis-intro-band {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 32px;
  align-items: start;
  padding: 24px 0 20px;
}

.analysis-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.analysis-deck {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--ink-secondary);
  max-width: 58ch;
}

.window-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.analysis-benchmarks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 2px;
}

.analysis-notice {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-secondary);
}

/* Reusable 12-Col Swiss Finding Module (4fr Prose | 8fr Visual) */
.finding-module {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 36px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.finding-prose {
  min-width: 0;
}

.finding-prose h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.finding-takeaway {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.finding-footnote {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.finding-stat {
  color: var(--ink-secondary);
}

.finding-source {
  margin-top: 2px;
}

.finding-cue {
  margin-top: 6px;
  color: var(--ink-muted);
}

.finding-visual {
  min-width: 0;
}

.finding-visual-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sub-section {
  min-width: 0;
}

.sub-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sub-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.sub-stat {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Modules 1 & 2: Horizontal Rate Bar + 95% Wilson CI Whisker Chart */
.ci-chart {
  min-width: 0;
}

.ci-axis-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 52px 64px;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.ci-axis-label.num {
  text-align: right;
}

.ci-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--ink-muted);
}

.ci-baseline-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--bg);
  padding: 0 3px;
}

.ci-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ci-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 52px 64px;
  align-items: center;
  gap: 12px;
  width: calc(100% + 12px);
  min-height: 28px;
  padding: 4px 6px;
  margin: 0 -6px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.ci-row:hover {
  background: var(--surface);
}

.ci-row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ci-row-name.has-sub {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.ci-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--ink);
}

.ci-row-sub {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ci-track {
  position: relative;
  height: 18px;
}

.ci-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  height: 6px;
  background: var(--surface-strong);
}

.ci-bar {
  position: absolute;
  left: 0;
  top: 3px;
  height: 6px;
  background: var(--ink);
}

.ci-bar.is-small-sample {
  background: #8a8a8a;
}

.ci-bar.is-accent {
  background: var(--accent);
}

.ci-whisker {
  position: absolute;
  top: 13px;
  height: 1px;
  background: var(--ink-muted);
  pointer-events: none;
}

.ci-whisker::before,
.ci-whisker::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 1px;
  height: 5px;
  background: var(--ink-muted);
}

.ci-whisker::before {
  left: 0;
}

.ci-whisker::after {
  right: 0;
}

.ci-baseline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--ink-muted);
  pointer-events: none;
  z-index: 2;
}

.ci-row-rate {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.ci-row-rate.is-accent {
  color: var(--accent);
}

.ci-row-frac {
  text-align: right;
  color: var(--ink-muted);
  white-space: nowrap;
}

.party-rate-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.party-combined-note {
  color: var(--ink-secondary);
}

.text-disclosure {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule-control);
}

.text-disclosure:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.minor-party-rows {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

/* Hairline Sub-Tables (Within-Party Control & Annual Fee Table-Chart) */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mini-table th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-control);
  white-space: nowrap;
}

.mini-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  vertical-align: middle;
}

.mini-table tr:last-child td {
  border-bottom: none;
}

.mini-table th:first-child,
.mini-table td:first-child {
  padding-left: 0;
}

.mini-table th:last-child,
.mini-table td:last-child {
  padding-right: 0;
}

.mini-table th.num,
.mini-table td.num {
  text-align: right;
  white-space: nowrap;
}

.cell-filter-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule-control);
  cursor: pointer;
  white-space: nowrap;
}

.cell-filter-btn:hover {
  text-decoration-color: var(--ink);
}

.cell-filter-btn.is-accent {
  color: var(--accent);
  text-decoration-color: rgba(200, 16, 46, 0.45);
}

.cell-filter-btn.is-accent:hover {
  text-decoration-color: var(--accent);
}

.cell-frac {
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 3px;
}

/* Module 2c: Distance Corroboration Quintile Strip */
.quintile-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.q-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.q-rate {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-bottom: 5px;
}

.q-track {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule-control);
}

.q-bar {
  width: 100%;
  max-width: 36px;
  background: var(--ink);
}

.q-label {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.q-range {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

/* Module 3: 5-Column Vertical Office Spend Step Chart */
.visual-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.step-chart {
  position: relative;
}

.step-ref-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 147px;
  pointer-events: none;
  z-index: 1;
}

.col-ref-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--ink-muted);
}

.col-ref-label {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  background: var(--bg);
  padding-left: 6px;
  white-space: nowrap;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.step-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  text-align: center;
  cursor: pointer;
  min-width: 0;
}

.step-col.is-static {
  cursor: default;
}

.step-col:not(.is-static):hover .step-stage {
  background: var(--surface);
}

.step-col:not(.is-static):hover .step-val {
  background: var(--surface);
}

.step-stage {
  height: 148px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid var(--rule-control);
  padding-top: 22px;
  transition: background-color 0.1s ease;
}

.step-val {
  position: relative;
  z-index: 3;
  background: var(--bg);
  padding: 0 3px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-bottom: 5px;
  line-height: 1.2;
}

.step-val.is-accent {
  color: var(--accent);
}

.step-bar {
  position: relative;
  z-index: 2;
  width: 44px;
  max-width: 72%;
  background: var(--ink);
}

.step-bar.is-accent {
  background: var(--accent);
}

.step-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 7px;
  text-align: center;
}

.step-band {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.step-sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.step-note {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.3;
}

.comparison-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}

.comp-item {
  min-width: 0;
}

.comp-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.comp-val {
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.comp-detail {
  margin-top: 1px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}

/* Module 4: Annual Fee Tracking & Repeat Persistence Subgrid */
.persist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

.persist-col-fees,
.persist-col-rates {
  min-width: 0;
}

.persist-col-fees .mini-table th,
.persist-col-fees .mini-table td {
  padding: 7px 6px;
}

.persist-col-fees .mini-table th:first-child,
.persist-col-fees .mini-table td:first-child {
  padding-left: 0;
}

.persist-col-fees .mini-table th:last-child,
.persist-col-fees .mini-table td:last-child {
  padding-right: 0;
}

.inline-bar-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-bar-track {
  display: inline-block;
  width: 36px;
  height: 4px;
  background: var(--surface-strong);
  flex-shrink: 0;
}

.inline-bar-fill {
  display: block;
  height: 100%;
  background: var(--ink);
}

.inline-bar-fill.is-partial {
  background: #8a8a8a;
}

.partial-tag {
  margin-left: 5px;
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 400;
}

.persist-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.persist-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.persist-label {
  color: var(--ink);
}

.persist-note {
  color: var(--ink-muted);
}

.persist-nums {
  white-space: nowrap;
}

.persist-pct {
  font-weight: 600;
  color: var(--ink);
}

.persist-frac {
  color: var(--ink-muted);
  margin-left: 5px;
}

.persist-track {
  height: 5px;
  background: var(--surface-strong);
}

.persist-fill {
  height: 100%;
  background: var(--ink);
}

/* Module 5: 12-Month Apr–Mar Vertical Seasonality Chart */
.season-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.legend-swatch.sw-ink {
  background: var(--ink);
}

.legend-swatch.sw-accent {
  background: var(--accent);
}

.legend-swatch.sw-agg {
  background: var(--rule-dossier);
}

.month-chart {
  position: relative;
}

.month-ref-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 155px;
  pointer-events: none;
  z-index: 1;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}

.month-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  text-align: center;
  cursor: pointer;
  min-width: 0;
}

.month-col:hover .month-stage {
  background: var(--surface);
}

.month-col:hover .month-val {
  background: var(--surface);
}

.month-stage {
  height: 156px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid var(--rule-control);
  padding-top: 22px;
  transition: background-color 0.1s ease;
}

.month-val {
  position: relative;
  z-index: 3;
  background: var(--bg);
  padding: 0 2px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  margin-bottom: 4px;
  line-height: 1.15;
}

.month-val.is-peak {
  color: var(--accent);
  font-weight: 600;
}

.month-bar-agg {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 28px;
  background: var(--rule-dossier);
}

.month-bar-ind {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 28px;
  background: var(--ink);
}

.month-bar-ind.is-peak {
  background: var(--accent);
}

.month-label {
  padding-top: 6px;
  font-size: 12px;
  color: var(--ink-secondary);
  text-align: center;
}

.month-col.is-peak .month-label {
  color: var(--ink);
  font-weight: 600;
}

.quarter-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.quarter-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.quarter-item:not(:first-child) {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}

.quarter-name {
  color: var(--ink-muted);
}

.quarter-val {
  font-weight: 600;
  color: var(--ink);
}

.quarter-val.is-peak {
  color: var(--accent);
}

/* Section C: Tested & Non-Significant Variables */
.null-section {
  border-top: 1px solid var(--ink);
  padding: 28px 0 32px;
}

.null-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.null-intro {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  max-width: 78ch;
}

.analysis-methods-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 86ch;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   1280px (default) · ~820px narrow desktop (<=1023px) · 390px mobile (<=640px / <=560px)
   ============================================================ */

/* Narrow Desktop (~820px pane, 700px–1023px) */
@media (max-width: 1023px) {
  .page {
    padding: 0 24px;
  }

  .breakdown-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 28px;
  }

  .party-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 16px;
  }

  .breakdown-col-refine {
    grid-column: 1 / -1;
  }

  .breakdown-col-refine .refine-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .breakdown-col-refine .refine-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  /* Zero horizontal clipping for 7-col MPs & 8-col Claims inside 772px */
  .data-table {
    font-size: 13px;
  }

  .data-table > thead > tr > th {
    padding: 9px 7px 8px;
  }

  .data-table > tbody > tr > td {
    padding: 9px 7px;
  }

  .data-table > thead > tr > th:first-child,
  .data-table > tbody > tr > td:first-child {
    padding-left: 0;
  }

  .data-table > thead > tr > th:last-child,
  .data-table > tbody > tr > td:last-child {
    padding-right: 0;
  }

  .data-table > tbody > tr > td.num + td:not(.num),
  .data-table > thead > tr > th.num + th:not(.num) {
    padding-left: 14px;
  }

  .party-inline {
    white-space: normal;
    align-items: flex-start;
    font-size: 12.5px;
  }

  .party-inline .party-swatch {
    margin-top: 5px;
  }

  .table-claims {
    font-size: 12.5px;
  }

  .table-claims > thead > tr > th,
  .table-claims > tbody > tr > td {
    padding: 8px 6px;
  }

  .table-claims > thead > tr > th:first-child,
  .table-claims > tbody > tr > td:first-child {
    padding-left: 0;
  }

  .table-claims > thead > tr > th:last-child,
  .table-claims > tbody > tr > td:last-child {
    padding-right: 0;
  }

  .table-claims .details-cell {
    max-width: 190px;
    font-size: 12.5px;
  }

  .table-audit .code-filename {
    font-size: 11.5px;
    word-break: break-word;
  }

  .dossier {
    padding: 14px 16px 16px 24px;
  }
}

@media (max-width: 960px) {
  .nav-band {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .tab-bar {
    width: 100%;
    gap: 20px;
  }

  .nav-controls {
    width: 100%;
    justify-content: space-between;
    padding: 7px 0;
    border-top: 1px solid var(--rule);
  }

  .finding-module {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 0;
  }

  .finding-prose {
    max-width: 68ch;
  }
}

@media (max-width: 880px) {
  .hero-band,
  .analysis-intro-band {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0 14px;
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 0 28px;
  }
}

@media (max-width: 760px) {
  .persist-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 700px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .breakdown-col-refine .refine-stack {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .breakdown-col-refine .refine-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
  }
}

/* Mobile (<= 640px, verified at 390x844) */
@media (max-width: 640px) {
  .page {
    padding: 0 16px;
  }

  .masthead {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 0;
  }

  .masthead-brand {
    width: 100%;
  }

  .brand-descriptor,
  .util-meta {
    display: none;
  }

  .masthead-utils {
    width: 100%;
    gap: 14px;
  }

  .masthead-utils .btn-hairline {
    margin-left: auto;
  }

  .hero-intro h1 {
    font-size: 24px;
  }

  .hero-figures,
  .analysis-benchmarks {
    gap: 12px;
  }

  .figure-value {
    font-size: 20px;
  }

  .tab-bar {
    gap: 16px;
  }

  .comparison-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quarter-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
  }

  .quarter-item:not(:first-child) {
    border-left: none;
    padding-left: 0;
  }

  .ci-scale > span:first-child,
  .ci-scale > span:last-child {
    visibility: hidden;
  }

  .filter-strip {
    gap: 10px 14px;
  }

  .search-wrap {
    flex: 1 1 100%;
  }

  .active-filters {
    margin-left: 0;
    width: 100%;
  }

  .dossier {
    padding: 12px 10px 14px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
  }

  .dossier > .table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }

  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-stats {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  /* Fit Member, Party, Claims, Paid cleanly inside 358px with 0px horizontal overflow */
  .table-mps {
    table-layout: fixed;
    width: 100%;
    font-size: 12px;
  }

  .table-mps .col-years,
  .table-mps .col-claimed,
  .table-mps .col-latest {
    display: none;
  }

  .table-mps > thead > tr > th:nth-child(1) {
    width: 44%;
  }

  .table-mps > thead > tr > th:nth-child(2) {
    width: 21%;
  }

  .table-mps > thead > tr > th:nth-child(4) {
    width: 13%;
  }

  .table-mps > thead > tr > th:nth-child(6) {
    width: 22%;
  }

  .table-mps > thead > tr > th {
    font-size: 11px;
    padding: 8px 4px;
  }

  .table-mps > thead > tr > th.active-sort::after {
    margin-left: 3px;
  }

  .table-mps > tbody > tr:not(.detail-row) > td {
    padding: 8px 4px;
  }

  .table-mps > thead > tr > th:nth-child(1),
  .table-mps > tbody > tr:not(.detail-row) > td:nth-child(1) {
    padding-left: 0;
  }

  .table-mps > thead > tr > th:nth-child(6),
  .table-mps > tbody > tr:not(.detail-row) > td:nth-child(6) {
    padding-right: 0;
  }

  .mp-photo {
    width: 22px;
    height: 22px;
    font-size: 9.5px;
  }

  .mp-cell {
    gap: 6px;
  }

  .mp-name,
  .mp-seat {
    overflow-wrap: break-word;
  }

  .mp-former {
    margin-left: 4px;
    font-size: 11px;
    white-space: normal;
  }

  .table-mps .party-inline {
    font-size: 11.5px;
    gap: 5px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .table-mps .money-paid {
    font-size: 12px;
  }

  .table-mps .money-adj {
    font-size: 10.5px;
    line-height: 1.2;
    white-space: normal;
  }

  .party-grid {
    grid-template-columns: 1fr;
  }

  /* Analysis Tab Mobile Fit (0px overflow at 390x844) */
  .ci-axis-row,
  .ci-row {
    grid-template-columns: 112px minmax(0, 1fr) 44px 48px;
    gap: 8px;
  }

  .ci-row-name.has-sub .ci-name-text {
    white-space: normal;
    line-height: 1.25;
  }

  .ci-scale,
  .ci-baseline-label {
    font-size: 10px;
  }

  .quintile-strip {
    gap: 6px;
  }

  .q-range {
    font-size: 10px;
  }

  .step-grid {
    gap: 4px;
  }

  .step-band {
    font-size: 10px;
    line-height: 1.2;
  }

  .step-sub,
  .step-note {
    font-size: 9.5px;
    line-height: 1.2;
  }

  .month-grid {
    gap: 3px;
  }

  .month-val {
    font-size: 10px;
  }

  .month-label {
    font-size: 10.5px;
  }
}
