/* The US Budget Machine: shared styling for the hub page, the outcome pages and
 * the instrument pages.
 *
 * One stylesheet for all three on purpose. The hub, an outcome and an
 * instrument are the same page shape at three levels of detail, so a rule
 * written once here applies to all of them and cannot drift between copies.
 */

:root {
  --bm-white: #ffffff;
  --bm-bg: #f8fafc;
  --bm-subtle: #f1f5f9;
  --bm-border: #cbd5e1;
  --bm-border-dark: #94a3b8;
  --bm-text: #0f172a;
  --bm-muted: #475569;
  --bm-light: #64748b;
  --bm-accent: #0284c7;
  --bm-accent-hover: #0369a1;
  --bm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --bm-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --bm-radius: 5px;
  --bm-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12),
    0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

/* ---- the page shell ----
 *
 * practice.css does not carry the site's base layout: every page that uses it
 * also writes its own copy of the body, container, header and footer rules in
 * an inline block. The three US Budget Machine pages linked practice.css and had
 * no layout at all as a result, which is the bug this section fixes. The rules
 * below are the site's real shell, written once against this file's own
 * tokens so they also follow the dark theme rather than being hard-coded
 * light the way the inline copies are.
 */

* { box-sizing: border-box; }

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

.bay { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

header {
  width: 100%;
  border-bottom: 1px solid var(--bm-border);
  position: sticky;
  top: 0;
  background: var(--bm-white);
  z-index: 50;
}
header .bay {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand-group { display: flex; align-items: center; gap: 1rem; }
.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--bm-text);
}
.logo-icon { width: 22px; height: 22px; border-radius: var(--bm-radius); }

/* The logo in the site's own marker font, the same rule every other page
   carries in its own head, so the budget pages match the front page. The
   font is served from this site. */
@font-face {
  font-family: "Brand Marker";
  src: url("/fonts/PermanentMarker-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
header a.logo {
  font-family: "Brand Marker", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
header a.logo img.logo-icon { width: 26px; height: 26px; border-radius: 6px; display: block; flex: 0 0 auto; }

nav { display: flex; align-items: center; gap: 1.2rem; }
nav a, nav button {
  color: var(--bm-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
nav a:hover, nav button:hover { color: var(--bm-accent); }

.page-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }

h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0 0 0.5rem;
  color: var(--bm-text);
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2, h3, h4 { color: var(--bm-text); }

footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2rem 0;
  font-family: var(--bm-mono);
  font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid #334155;
  margin-top: 2rem;
}

/* ---- the title block every page in this family wears ---- */

.bm-title-block {
  border-left: 4px solid var(--bm-accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 0 0 1.75rem;
}
.bm-title-block h1 { margin: 0 0 0.35rem; }
/* Shown on every US Budget Machine page: Beta release on the tools that are out
   for use, In development on the one still being built (the Projector). */
.bm-dev-line { margin: 0 0 0.5rem; }
.bm-dev-badge {
  display: inline-block;
  font-family: var(--bm-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.bm-tagline {
  font-family: var(--bm-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bm-accent);
  margin: 0 0 0.5rem;
}
.bm-title-block .bm-lede {
  color: var(--bm-muted);
  max-width: 760px;
  margin: 0;
  font-size: 1rem;
}

/* ---- the folded how-to-use block ---- */

details.bm-howto {
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.75rem;
}
details.bm-howto > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--bm-text);
  font-size: 0.95rem;
}
details.bm-howto > summary:hover { color: var(--bm-accent); }
details.bm-howto h3 {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 1.1rem 0 0.4rem;
}
details.bm-howto ul { margin: 0; padding-left: 1.2rem; }
details.bm-howto li { margin: 0.3rem 0; color: var(--bm-muted); font-size: 0.93rem; }

/* ---- the Debt / GDP toggle ---- */

.bm-switch {
  display: flex;
  gap: 0;
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  overflow: hidden;
  margin: 0 0 0.75rem;
  width: fit-content;
  max-width: 100%;
}
.bm-switch button {
  appearance: none;
  border: none;
  background: var(--bm-white);
  color: var(--bm-muted);
  font-family: var(--bm-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  height: 44px;
  line-height: 1;
}
.bm-switch button + button { border-left: 1px solid var(--bm-border-dark); }
.bm-switch button:hover { background: var(--bm-subtle); color: var(--bm-text); }
.bm-switch button[aria-pressed="true"] {
  background: var(--bm-accent);
  border-color: var(--bm-accent);
  color: var(--bm-white);
}

.bm-headline {
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.bm-headline .bm-headline-number {
  font-family: var(--bm-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bm-text);
  margin: 0 0 0.4rem;
}
.bm-headline p { margin: 0.4rem 0 0; color: var(--bm-muted); font-size: 0.93rem; }
.bm-headline .bm-source {
  font-family: var(--bm-mono);
  font-size: 0.72rem;
  color: var(--bm-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.6rem;
}

/* ---- the sunburst ---- */

.bm-chart-card {
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}
.bm-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.bm-chart-head h2 {
  font-family: var(--bm-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}
.bm-chart-note { color: var(--bm-light); font-size: 0.85rem; margin: 0; }

.bm-sunburst-wrap { width: 100%; overflow-x: auto; }
.bm-sunburst { display: block; width: 100%; height: auto; min-width: 560px; margin: 0 auto; }
.bm-sunburst .bm-seg { cursor: pointer; transition: opacity 0.12s ease; }
.bm-sunburst .bm-seg:hover { opacity: 0.78; }
.bm-sunburst .bm-seg-stroke { stroke: var(--bm-white); stroke-width: 1.5; }
.bm-sunburst text { font-family: var(--bm-font); pointer-events: none; }
.bm-sunburst .bm-centre-name {
  font-family: var(--bm-mono);
  font-weight: 800;
  letter-spacing: 0.02em;
  fill: var(--bm-text);
}
.bm-sunburst .bm-centre-sub { fill: var(--bm-light); font-size: 15px; }
.bm-sunburst .bm-group-label {
  font-family: var(--bm-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  fill: #ffffff;
}
.bm-sunburst .bm-leaf-label { font-size: 12.5px; fill: var(--bm-text); }
.bm-sunburst a { text-decoration: none; }
.bm-sunburst a:focus-visible .bm-seg-stroke { stroke: var(--bm-text); stroke-width: 3; }

.bm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.bm-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--bm-muted);
}
.bm-legend .bm-dot {
  width: 11px; height: 11px; border-radius: 2px; flex: none;
}

/* ---- the dollar bars ---- */

.bm-bars { margin: 0; }
.bm-bar-group-name {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 1.25rem 0 0.5rem;
}
.bm-bar-group-name:first-child { margin-top: 0; }
.bm-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr minmax(96px, auto);
  gap: 0.75rem;
  align-items: center;
  padding: 0.3rem 0;
}
.bm-bar-row a { color: var(--bm-text); text-decoration: none; font-size: 0.9rem; }
.bm-bar-row a:hover { color: var(--bm-accent); text-decoration: underline; }
.bm-bar-track {
  background: var(--bm-subtle);
  border-radius: 2px;
  height: 18px;
  overflow: hidden;
}
.bm-bar-fill { height: 100%; border-radius: 2px; }
.bm-bar-value {
  font-family: var(--bm-mono);
  font-size: 0.8rem;
  color: var(--bm-muted);
  text-align: right;
  white-space: nowrap;
}
.bm-noshape {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--bm-subtle);
  border-radius: var(--bm-radius);
  font-size: 0.9rem;
  color: var(--bm-muted);
}
.bm-noshape strong { color: var(--bm-text); }

/* ---- group cards ---- */

.bm-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
  margin: 0 0 1.5rem;
}
.bm-group-card {
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-top: 3px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow);
  padding: 1.1rem 1.25rem;
}
.bm-group-card h3 {
  font-family: var(--bm-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.4rem;
}
.bm-group-card > p { color: var(--bm-muted); font-size: 0.9rem; margin: 0 0 0.8rem; }
.bm-group-card ul { margin: 0; padding: 0; list-style: none; }
.bm-group-card li { padding: 0.28rem 0; border-top: 1px solid var(--bm-subtle); }
.bm-group-card li:first-child { border-top: none; }
.bm-group-card li a {
  color: var(--bm-text);
  text-decoration: none;
  font-size: 0.91rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}
.bm-group-card li a:hover { color: var(--bm-accent); text-decoration: underline; }
.bm-group-card .bm-li-size {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  color: var(--bm-light);
  white-space: nowrap;
}

/* ---- instrument page ---- */

.bm-breadcrumb {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bm-light);
  margin: 0 0 1rem;
}
.bm-breadcrumb a { color: var(--bm-accent); text-decoration: none; }
.bm-breadcrumb a:hover { text-decoration: underline; }

.bm-factbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--bm-border);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  overflow: hidden;
  margin: 0 0 1.5rem;
}
.bm-fact { background: var(--bm-white); padding: 0.85rem 1rem; }
.bm-fact dt {
  font-family: var(--bm-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 0 0 0.3rem;
}
.bm-fact dd { margin: 0; font-size: 0.93rem; color: var(--bm-text); font-weight: 600; }

.bm-pill {
  display: inline-block;
  font-family: var(--bm-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.bm-pill-solid { background: #dcfce7; color: #166534; }
.bm-pill-approximate { background: #fef9c3; color: #854d0e; }
.bm-pill-unverified { background: #fee2e2; color: #991b1b; }

.bm-caveat {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: var(--bm-radius);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  color: #78350f;
}
.bm-caveat strong { display: block; margin-bottom: 0.25rem; }

.bm-section {
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow);
  padding: 1.25rem 1.4rem;
  margin: 0 0 1.25rem;
}
.bm-section h2 {
  font-family: var(--bm-mono);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.7rem;
  color: var(--bm-accent);
}
.bm-section p { margin: 0; color: var(--bm-text); font-size: 0.98rem; line-height: 1.65; }
.bm-section.bm-mine { border-left: 4px solid #16a34a; }
.bm-section.bm-mine h2 { color: #15803d; }

.bm-watch {
  background: var(--bm-subtle);
  border-radius: var(--bm-radius);
  padding: 1rem 1.2rem;
  margin: 0 0 1.5rem;
}
.bm-watch h2 {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 0 0 0.35rem;
}
.bm-watch p { margin: 0; font-size: 0.95rem; color: var(--bm-text); }

.bm-siblings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}
.bm-siblings a {
  font-size: 0.85rem;
  color: var(--bm-muted);
  text-decoration: none;
  border: 1px solid var(--bm-border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--bm-white);
}
.bm-siblings a:hover { color: var(--bm-accent); border-color: var(--bm-accent); }
.bm-siblings a[aria-current="page"] {
  background: var(--bm-text);
  border-color: var(--bm-text);
  color: var(--bm-white);
}

.bm-status { color: var(--bm-muted); font-size: 0.95rem; }

@media (max-width: 640px) {
  .bm-bar-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .bm-bar-value { text-align: left; }
  .bm-switch { width: 100%; }
  .bm-switch button { flex: 1; padding: 0.7rem 0.6rem; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bm-white: #111827;
    --bm-bg: #0b1220;
    --bm-subtle: #1f2937;
    --bm-border: #334155;
    --bm-border-dark: #475569;
    --bm-text: #e5e7eb;
    --bm-muted: #cbd5e1;
    --bm-light: #94a3b8;
    --bm-accent: #38bdf8;
    --bm-accent-hover: #0ea5e9;
    --bm-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.5);
  }
  :root:not([data-theme="light"]) .bm-pill-solid { background: #14532d; color: #bbf7d0; }
  :root:not([data-theme="light"]) .bm-pill-approximate { background: #713f12; color: #fef08a; }
  :root:not([data-theme="light"]) .bm-pill-unverified { background: #7f1d1d; color: #fecaca; }
  :root:not([data-theme="light"]) .bm-caveat {
    background: #27200c; border-color: #92400e; color: #fde68a;
  }
  :root:not([data-theme="light"]) .bm-sunburst .bm-seg-stroke { stroke: #111827; }
}

/* ---- the rules a president has to work inside ----
 *
 * These cards stack full width rather than sitting in the group grid: each
 * one holds several rules that open into real paragraphs, so a narrow column
 * would make them unreadable.
 */

.bm-rule-card { margin-bottom: 1.1rem; }
.bm-rule-card > h3 { font-size: 0.95rem; }

details.bm-rule {
  border-top: 1px solid var(--bm-border);
  padding: 0.55rem 0;
}
details.bm-rule:first-of-type { border-top: 1px solid var(--bm-border-dark); }
details.bm-rule > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}
details.bm-rule > summary::-webkit-details-marker { display: none; }
details.bm-rule > summary::before {
  content: "+";
  font-family: var(--bm-mono);
  font-weight: 700;
  color: var(--bm-accent);
  flex: none;
  width: 0.9em;
}
details.bm-rule[open] > summary::before { content: "\2212"; }
details.bm-rule > summary:hover .bm-rule-text { color: var(--bm-accent); }
.bm-rule-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bm-text);
  line-height: 1.5;
}
details.bm-rule h4 {
  font-family: var(--bm-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 0.9rem 0 0.25rem;
  padding-left: 1.5em;
}
details.bm-rule > p {
  margin: 0;
  padding-left: 1.5em;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--bm-muted);
}
details.bm-rule .bm-rule-source {
  font-family: var(--bm-mono);
  font-size: 0.72rem;
  color: var(--bm-light);
  margin-top: 0.8rem;
  padding-bottom: 0.3rem;
}

/* ---- the four questions: the link block on the wheel page ----
 *
 * This sits directly above the note listing the parts that carry no dollar
 * figure, because that is the point where a reader has just seen the real
 * sizes and starts asking why the number moves at all.
 */

.bm-ask {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.25rem;
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-left: 4px solid #6d28d9;
  border-radius: var(--bm-radius);
}
.bm-ask-head {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 0 0 0.75rem;
}
.bm-ask-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}
.bm-ask-grid a {
  display: block;
  text-decoration: none;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 0.7rem 0.85rem;
  background: var(--bm-bg);
}
.bm-ask-grid a:hover { border-color: #6d28d9; background: var(--bm-subtle); }
.bm-ask-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--bm-text);
  margin-bottom: 0.2rem;
}
.bm-ask-q { display: block; font-size: 0.84rem; color: var(--bm-muted); line-height: 1.45; }
.bm-ask-all { margin: 0.85rem 0 0; font-size: 0.88rem; }
.bm-ask-all a { color: var(--bm-accent); text-decoration: none; font-weight: 600; }
.bm-ask-all a:hover { text-decoration: underline; }

/* The thirteen parts with no dollar figure. These used to run as one long
 * line separated by dots, which read as a wall and wrapped differently at
 * every window width. A grid puts them in even rows instead.
 *
 * Two columns exactly, on direct instruction 2026-10-30. It used to fit as
 * many columns as the window had room for, which meant the same list read as
 * four or five short columns on a wide screen; two keeps every name on one
 * line and reads down the page in a fixed order whatever the width.
 */
.bm-noshape-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 1rem;
  margin-top: 0.7rem;
}
/* On a phone there is not room for two names side by side, so they stack. */
@media (max-width: 560px) {
  .bm-noshape-grid { grid-template-columns: minmax(0, 1fr); }
}
.bm-noshape-grid a {
  color: var(--bm-accent);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.1rem 0;
}
.bm-noshape-grid a:hover { text-decoration: underline; }

/* ---- the questions page itself ---- */

.bm-jump {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.6rem;
  margin: 0 0 2rem;
}
.bm-jump a {
  text-decoration: none;
  color: var(--bm-text);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--bm-border);
  border-top: 3px solid #6d28d9;
  border-radius: var(--bm-radius);
  padding: 0.7rem 0.85rem;
  background: var(--bm-white);
}
.bm-jump a:hover { color: var(--bm-accent); border-color: var(--bm-accent); }

.bm-question {
  margin: 0 0 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bm-border);
}
.bm-question:last-of-type { border-bottom: none; }
.bm-question .bm-tagline { margin-bottom: 0.3rem; }
.bm-question-head {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 1.1rem;
  color: var(--bm-text);
}
.bm-question .bm-section h3 {
  font-family: var(--bm-mono);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.7rem;
  color: var(--bm-accent);
}
.bm-question .bm-section.bm-mine h3 { color: #15803d; }
.bm-question .bm-section p { margin: 0 0 0.9rem; }
.bm-question .bm-section p:last-child { margin-bottom: 0; }

.bm-answer-list { margin: 0 0 0.9rem; padding-left: 1.3rem; }
.bm-answer-list li {
  margin: 0.55rem 0;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--bm-text);
}

/* ---- a worked sum, shown the way it would be written out ----
 *
 * Arithmetic set in a proportional typeface stops lining up the moment there
 * is more than one line of it, and a formula a reader is meant to follow has
 * to line up. Monospace, preserved line breaks, and its own scroll bar on a
 * narrow screen rather than breaking the line somewhere meaningless.
 */
.bm-formula {
  font-family: var(--bm-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  background: var(--bm-subtle);
  border: 1px solid var(--bm-border);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  padding: 0.9rem 1.1rem;
  margin: 0 0 0.9rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--bm-text);
}

/* ---- a figures table ---- */

.bm-table-wrap { width: 100%; overflow-x: auto; margin: 0 0 0.9rem; }
.bm-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 380px;
  font-size: 0.93rem;
}
.bm-table th, .bm-table td {
  border: 1px solid var(--bm-border);
  padding: 0.55rem 0.8rem;
  text-align: left;
}
.bm-table thead th {
  background: var(--bm-subtle);
  font-family: var(--bm-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bm-light);
}
.bm-table tbody th { font-weight: 600; color: var(--bm-text); }
.bm-table td { font-family: var(--bm-mono); color: var(--bm-muted); }
.bm-table tr.bm-table-total th, .bm-table tr.bm-table-total td {
  background: var(--bm-subtle);
  font-weight: 700;
  color: var(--bm-text);
}

/* ---- the AI-generated badge ----
 *
 * The same shape as the front page's own eyebrow tag, rebuilt here against
 * this file's tokens so it follows the dark theme too. It says the page was
 * written by a program, which matters most on these pages: they are full of
 * real figures and a program can be wrong in a confident voice.
 */

.bm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bm-subtle);
  color: var(--bm-accent);
  font-family: var(--bm-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  margin: 0.75rem 0 0;
}
.bm-title-block .bm-eyebrow + .bm-lede { margin-top: 0.85rem; }

/* ---- ideas from readers, on a question page ----
 *
 * This block sits between the answer and the note on how to read it: the
 * ideas people have posted about that one question, the buttons for showing
 * one kind or both, the paging controls, and the form for posting another.
 *
 * Every field and every button in the form is given the same height on
 * purpose, so a row reads as one straight line rather than as parts that
 * nearly match.
 */

.bm-ideas { margin: 1.5rem 0 0; }
/* The heading, intro and form, in the blue-barred box. */
.bm-ideas-top {
  padding: 1.1rem 1.25rem;
  background: var(--bm-white);
  border: 1px solid var(--bm-border);
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
}
.bm-ideas-intro {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--bm-muted);
}

/* the two kinds of idea */
.bm-ideas-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}
.bm-idea-filter {
  font-family: var(--bm-font);
  font-size: 0.82rem;
  font-weight: 600;
  height: 2.1rem;
  padding: 0 0.85rem;
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  background: var(--bm-bg);
  color: var(--bm-muted);
  cursor: pointer;
}
.bm-idea-filter:hover { background: var(--bm-subtle); color: var(--bm-text); }
.bm-idea-filter[aria-pressed="true"] {
  background: var(--bm-accent);
  border-color: var(--bm-accent);
  color: #ffffff;
}

/* one idea */
.bm-ideas-list { display: grid; gap: 0.7rem; }
.bm-idea {
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-bg);
  padding: 0.85rem 1rem;
}
.bm-idea-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.bm-idea-headtext { min-width: 0; }
.bm-idea-tag {
  display: inline-block;
  font-family: var(--bm-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: var(--bm-subtle);
  color: var(--bm-light);
  margin-bottom: 0.3rem;
}
.bm-idea-tag.is-agent { background: #ede9fe; color: #5b21b6; }
.bm-idea-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bm-idea-tag.is-status { background: #fef3c7; color: #92400e; }
.bm-idea-tag.is-goal { background: #e0f2fe; color: #075985; }
.bm-idea-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.bm-idea-page-btn.is-danger { color: #b91c1c; border-color: #fca5a5; }
.bm-idea-page-btn.is-danger:hover:not(:disabled) { background: #fef2f2; }
.bm-idea-page-btn.bm-idea-formbtn { height: 2.4rem; font-size: 0.9rem; }
.bm-idea-formbtn[hidden] { display: none; }
#bm-ideas-notice { margin: 0 0 0.7rem; }
.bm-ideas-filters.is-feed { gap: 0.7rem; align-items: flex-end; }
.bm-idea-select { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; font-weight: 600; color: var(--bm-muted); flex: 1 1 10rem; min-width: 0; }
.bm-idea-select select {
  font-family: var(--bm-font); font-size: 0.88rem; color: var(--bm-text);
  background: var(--bm-white); border: 1px solid var(--bm-border-dark); border-radius: var(--bm-radius);
  height: 2.4rem; padding: 0 0.5rem; width: 100%; min-width: 0;
}
.bm-idea-gap { margin: 0 0 0.2rem; font-size: 0.82rem; color: var(--bm-muted); }
.bm-idea-gap a { color: var(--bm-accent); }
.bm-idea-title {
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--bm-text);
}
.bm-idea-by { margin: 0; font-size: 0.82rem; color: var(--bm-muted); }
.bm-idea-by strong { color: var(--bm-text); }
.bm-idea-body {
  margin: 0.6rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--bm-muted);
  white-space: pre-line;
}

/* the vote checkbox, in the card's top right corner */
.bm-idea-vote {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bm-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.bm-idea-vote input { width: 1rem; height: 1rem; margin: 0; cursor: pointer; accent-color: var(--bm-accent); }
.bm-idea-vote input:disabled { cursor: not-allowed; }
.bm-idea-vote input:disabled + .bm-idea-vote-word { color: var(--bm-light); }

.bm-idea-message { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--bm-muted); min-height: 0; }
.bm-idea-message:empty { display: none; }
.bm-idea-message.is-bad { color: #b91c1c; }
.bm-idea-message.is-good { color: #15803d; }

.bm-ideas-empty { margin: 0; font-size: 0.9rem; color: var(--bm-muted); }

/* paging */
.bm-ideas-pager {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.bm-ideas-pager:empty { display: none; }
.bm-idea-page-btn {
  font-family: var(--bm-font);
  font-size: 0.82rem;
  font-weight: 600;
  height: 2.1rem;
  padding: 0 0.85rem;
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
  color: var(--bm-text);
  cursor: pointer;
}
.bm-idea-page-btn:hover:not(:disabled) { background: var(--bm-subtle); }
.bm-idea-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bm-idea-page-count {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bm-light);
}

/* the form */
.bm-ideas-form {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bm-border);
}
.bm-ideas-formhead {
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-light);
  margin: 0 0 0.3rem;
}
.bm-ideas-formnote { margin: 0 0 0.8rem; font-size: 0.84rem; color: var(--bm-muted); }
.bm-ideas-signin { margin: 0; font-size: 0.9rem; color: var(--bm-muted); }
.bm-ideas-signin a { color: var(--bm-accent); font-weight: 600; }
.bm-ideas-form[hidden], .bm-ideas-posthint[hidden] { display: none; }
.bm-ideas-posthint {
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--bm-border);
  font-size: 0.9rem;
  color: var(--bm-muted);
}
.bm-idea-hint-link {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--bm-accent); font-weight: 600; cursor: pointer; text-decoration: underline;
}

.bm-field { margin-bottom: 0.7rem; }
.bm-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bm-text);
  margin-bottom: 0.25rem;
}
.bm-field input[type="text"],
.bm-field select,
.bm-field textarea {
  width: 100%;
  font-family: var(--bm-font);
  font-size: 0.92rem;
  color: var(--bm-text);
  background: var(--bm-white);
  border: 1px solid var(--bm-border-dark);
  border-radius: var(--bm-radius);
  padding: 0 0.65rem;
  height: 2.4rem;
  line-height: 2.4rem;
}
.bm-field textarea {
  height: 7rem;
  line-height: 1.5;
  padding: 0.5rem 0.65rem;
  resize: vertical;
}
.bm-field select { line-height: normal; }
.bm-field input[type="text"]:focus,
.bm-field select:focus,
.bm-field textarea:focus { outline: 2px solid var(--bm-accent); outline-offset: 1px; }

.bm-field-foot { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.bm-idea-send {
  font-family: var(--bm-font);
  font-size: 0.9rem;
  font-weight: 700;
  height: 2.4rem;
  padding: 0 1.1rem;
  border: 1px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  background: var(--bm-accent);
  color: #ffffff;
  cursor: pointer;
}
.bm-idea-send:hover:not(:disabled) { background: var(--bm-accent-hover); border-color: var(--bm-accent-hover); }
.bm-idea-send:disabled { opacity: 0.6; cursor: not-allowed; }
.bm-field-foot .bm-idea-message { margin: 0; }

@media (max-width: 560px) {
  .bm-idea-head { flex-direction: column-reverse; align-items: flex-start; gap: 0.4rem; }
  .bm-idea-vote { align-self: flex-end; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bm-idea-tag.is-agent { background: #3b1f6b; color: #ddd6fe; }
  :root:not([data-theme="light"]) .bm-idea-message.is-bad { color: #fca5a5; }
  :root:not([data-theme="light"]) .bm-idea-message.is-good { color: #86efac; }
  :root:not([data-theme="light"]) .bm-idea-filter[aria-pressed="true"] { color: #0b1220; }
  :root:not([data-theme="light"]) .bm-idea-send { color: #0b1220; }
  :root:not([data-theme="light"]) .bm-dev-badge { background: #4a3410; color: #fde68a; border-color: #92400e; }
  :root:not([data-theme="light"]) .bm-idea-tag.is-status { background: #4a3410; color: #fde68a; }
  :root:not([data-theme="light"]) .bm-idea-page-btn.is-danger { color: #fca5a5; border-color: #7f1d1d; }
  :root:not([data-theme="light"]) .bm-idea-page-btn.is-danger:hover:not(:disabled) { background: #3b1414; }
}

/* The idea generator's ten gaps (idea-generator.html).
 *
 * One foldable row per gap. Closed it shows the gap's number, its title and
 * the outcomes it serves; open it shows what the budget cannot record, the
 * particulars, the opening, and that gap's own ideas. Only one is open at a
 * time, so the open one is allowed to be as long as it needs to be. */
.bm-gap-list { display: grid; gap: 0.6rem; margin: 1.4rem 0 0; }
.bm-gap {
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
  overflow: hidden;
}
.bm-gap.is-open { border-color: var(--bm-accent); }
.bm-gap-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: none;
  border: 0;
  font-family: var(--bm-font);
  font-size: 0.95rem;
  text-align: left;
  color: var(--bm-text);
  cursor: pointer;
}
.bm-gap-head:hover { background: var(--bm-subtle); }
.bm-gap.is-open .bm-gap-head { background: var(--bm-subtle); }
.bm-gap-number {
  flex: 0 0 auto;
  font-family: var(--bm-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bm-light);
}
.bm-gap-title { flex: 1 1 auto; font-weight: 600; min-width: 0; }
.bm-gap-tags { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bm-gap-tag {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--bm-subtle);
  border: 1px solid var(--bm-border);
  font-size: 0.72rem;
  color: var(--bm-muted);
  white-space: nowrap;
}
.bm-gap-mark {
  flex: 0 0 1.2rem;
  text-align: center;
  font-family: var(--bm-mono);
  font-size: 1.05rem;
  color: var(--bm-accent);
}
.bm-gap-body { padding: 1.1rem; border-top: 1px solid var(--bm-border); }
.bm-gap-question {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bm-text);
}
.bm-gap-subhead {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bm-light);
}
.bm-gap-subhead:first-of-type { margin-top: 0; }
.bm-gap-text { margin: 0 0 0.8rem; color: var(--bm-muted); }
.bm-gap-points { margin: 0 0 0.8rem; padding-left: 1.2rem; color: var(--bm-muted); }
.bm-gap-points li { margin-bottom: 0.4rem; }
.bm-gap-opening {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: var(--bm-radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.8rem;
}
.bm-gap-opening p { margin: 0; color: #14532d; }
.bm-gap-link { margin: 0.9rem 0 0; font-size: 0.9rem; }
.bm-gap-link a { color: var(--bm-accent); text-decoration: none; font-weight: 600; }
.bm-gap-link a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .bm-gap-head { flex-wrap: wrap; gap: 0.4rem 0.6rem; }
  .bm-gap-title { flex: 1 1 100%; order: 2; }
  .bm-gap-tags { order: 3; }
  .bm-gap-mark { order: 1; margin-left: auto; }
}

/* Gaps in the Budget (budget-gaps.html) and Budget Questions
 * (budget-questions.html), split out of the machine page on 2026-11-01. */
.bm-gap-summary { margin: 0 0 1.2rem; color: var(--bm-muted); font-size: 0.95rem; }
.bm-gapgroup { margin: 0 0 1.6rem; }
.bm-gapgroup h2 {
  font-family: var(--bm-mono); font-size: 0.86rem; text-transform: uppercase;
  letter-spacing: 0.05em; margin: 0 0 0.2rem; color: var(--bm-accent);
}
.bm-gapgroup h2 a { color: inherit; text-decoration: none; }
.bm-gapgroup h2 a:hover { text-decoration: underline; }
.bm-gapgroup-note { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--bm-light); }
.bm-gapcard {
  background: var(--bm-white); border: 1px solid var(--bm-border); border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow); margin: 0 0 0.6rem; overflow: hidden;
}
.bm-gapcard[open] { border-color: var(--bm-accent); }
.bm-gapcard summary {
  display: flex; gap: 0.8rem; align-items: flex-start; cursor: pointer; list-style: none;
  padding: 0.85rem 1.1rem;
}
.bm-gapcard summary::-webkit-details-marker { display: none; }
.bm-gapcard-num {
  flex: 0 0 auto; font-family: var(--bm-mono); font-weight: 700; color: var(--bm-accent);
  min-width: 1.6rem;
}
.bm-gapcard-head { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.bm-gapcard-title { font-weight: 700; color: var(--bm-text); }
.bm-gapcard-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bm-effect, .bm-outcome-tag {
  font-family: var(--bm-mono); font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.12rem 0.4rem; border-radius: 3px;
}
.bm-effect.is-adds { background: #fee2e2; color: #991b1b; }
.bm-effect.is-pays_down { background: #dcfce7; color: #166534; }
.bm-effect.is-both { background: #fef9c3; color: #854d0e; }
/* A gap that moves no debt: neither a warning nor a saving, so neither red
   nor green. */
.bm-effect.is-no_debt_change { background: #e2e8f0; color: #334155; }
.bm-outcome-tag { background: var(--bm-subtle); color: var(--bm-muted); }
.bm-goal-tag { font-family: var(--bm-mono); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.12rem 0.4rem; border-radius: 3px; background: #e0f2fe; color: #075985; }
.bm-gapcard-body { padding: 0 1.1rem 1rem 3.5rem; }
.bm-gapcard-body h3 {
  font-family: var(--bm-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--bm-light); margin: 0.9rem 0 0.35rem;
}
.bm-gapcard-body p, .bm-gapcard-body li { color: var(--bm-text); font-size: 0.94rem; line-height: 1.6; }
.bm-gapcard-body p { margin: 0; }
.bm-gapcard-body ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.bm-gap-sources a { color: var(--bm-accent); overflow-wrap: anywhere; }
.bm-gapcard-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0 !important; }
.bm-gap-btn {
  display: inline-flex; align-items: center; height: 2.4rem; padding: 0 0.95rem;
  border: 1px solid var(--bm-accent); border-radius: var(--bm-radius); background: var(--bm-accent);
  color: #ffffff; font-size: 0.86rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.bm-gap-btn.is-secondary { background: var(--bm-white); color: var(--bm-text); border-color: var(--bm-border-dark); }
.bm-gap-btn:hover { filter: brightness(0.95); }
@media (max-width: 560px) {
  .bm-gapcard-body { padding-left: 1.1rem; }
  .bm-gap-btn { white-space: normal; height: auto; min-height: 2.4rem; }
}

.bm-qlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.7rem; }
.bm-qcard {
  background: var(--bm-white); border: 1px solid var(--bm-border); border-left: 4px solid #6d28d9;
  border-radius: var(--bm-radius); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.bm-qcard-main { text-decoration: none; display: block; }
.bm-qcard-main:hover .bm-ask-title { color: var(--bm-accent); }
.bm-qcard-q { display: block; font-size: 0.88rem; color: var(--bm-muted); line-height: 1.45; }
.bm-qcard-gap { margin: 0; font-size: 0.82rem; color: var(--bm-light); }
.bm-qcard-gap a { color: var(--bm-accent); }

/* The two link cards on the machine page that lead to the pages above. */
.bm-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.7rem; margin: 1.5rem 0 0; }
.bm-hub a {
  display: block; text-decoration: none; background: var(--bm-white); border: 1px solid var(--bm-border);
  border-left: 4px solid #6d28d9; border-radius: var(--bm-radius); padding: 0.9rem 1.05rem;
}
.bm-hub a:hover { background: var(--bm-subtle); }
.bm-hub-title { display: block; font-weight: 700; color: var(--bm-text); margin-bottom: 0.25rem; }
.bm-hub-text { display: block; font-size: 0.86rem; color: var(--bm-muted); line-height: 1.45; }

/* Every budget question, at the bottom of the Budget Machine page. */
.bm-questions { margin: 2.5rem 0 0; }
.bm-questions:empty { display: none; }
.bm-questions-head { margin: 0 0 0.35rem; color: var(--bm-text); }
.bm-questions-lead { margin: 0; color: var(--bm-muted); }
.bm-questions .bm-hub { margin-top: 1rem; }
.bm-questions-all { margin: 1rem 0 0; }
.bm-questions-all a { color: var(--bm-accent); }

/* Gaps for one instrument, on that instrument's own page. */
.bm-instgaps { margin: 0 0 1.25rem; }
.bm-instgaps ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.bm-instgaps li { margin: 0.25rem 0; }
.bm-instgaps a { color: var(--bm-accent); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bm-effect.is-adds { background: #4c1414; color: #fecaca; }
  :root:not([data-theme="light"]) .bm-effect.is-pays_down { background: #12391f; color: #bbf7d0; }
  :root:not([data-theme="light"]) .bm-idea-tag.is-goal { background: #0c3550; color: #bae6fd; }
  :root:not([data-theme="light"]) .bm-goal-tag { background: #0c3550; color: #bae6fd; }
  :root:not([data-theme="light"]) .bm-effect.is-both { background: #4a3410; color: #fde68a; }
  :root:not([data-theme="light"]) .bm-effect.is-no_debt_change { background: #273344; color: #cbd5e1; }
  :root:not([data-theme="light"]) .bm-gap-btn:not(.is-secondary) { color: #0b1220; }
}

/* The Idea Generator: form first, the ideas in their own section under it. */
.bm-ideas-form.is-first { margin-top: 0.4rem; padding-top: 0; border-top: 0; }
.bm-ideas-listsection { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--bm-border); }
.bm-ideas-listhead {
  font-family: var(--bm-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bm-light); margin: 0 0 0.8rem;
}
.bm-idea-page-nums { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.bm-idea-page-num { min-width: 2.1rem; padding: 0 0.5rem; }
.bm-idea-page-num[aria-current="page"] { background: var(--bm-accent); border-color: var(--bm-accent); color: #ffffff; opacity: 1; cursor: default; }
.bm-idea-page-gap { color: var(--bm-light); padding: 0 0.15rem; }

/* The form's own Outcome, Instrument and Goal dropdowns, side by side. */
.bm-form-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 0.7rem; }
.bm-field select:disabled { opacity: 0.6; }
@media (max-width: 560px) { .bm-form-filters { grid-template-columns: 1fr; } }

/* Outcomes, Instruments and Goals defined above the machine's two tabs. */
.bm-terms {
  background: var(--bm-white); border: 1px solid var(--bm-border); border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius); padding: 0.95rem 1.15rem; margin: 0 0 1.2rem;
}
.bm-terms-list { margin: 0; display: grid; gap: 0.55rem; }
.bm-terms-list div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.8rem; }
.bm-terms-list dt { font-family: var(--bm-mono); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bm-accent); padding-top: 0.12rem; }
.bm-terms-list dd { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--bm-text); }
.bm-terms-post { margin: 0.8rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--bm-border); font-size: 0.93rem; line-height: 1.55; color: var(--bm-text); }
.bm-terms-post a { color: var(--bm-accent); font-weight: 600; }
@media (max-width: 560px) { .bm-terms-list div { grid-template-columns: 1fr; gap: 0.15rem; } }

/* Questions asked with an AI search answer (budget-questions.html#asked). */
.bm-asked { margin-top: 2rem; }
.bm-asked-head {
  font-family: var(--bm-mono); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 0.35rem; color: var(--bm-accent);
}
.bm-asked-about { margin: 0 0 0.8rem; color: var(--bm-muted); font-size: 0.92rem; }
.bm-askedcard .bm-gapcard-body { padding-left: 1.1rem; }
.bm-asked-source { margin: 0 0 0.5rem !important; font-size: 0.85rem !important; color: var(--bm-muted) !important; }
.bm-asked-answer { white-space: pre-line; color: var(--bm-text); font-size: 0.94rem; line-height: 1.6; overflow-wrap: anywhere; }
.bm-askedcard .bm-qcard-gap { margin-top: 0.9rem; }
.bm-asked-group { font-size: 0.95rem; margin: 1.1rem 0 0.5rem; color: var(--bm-text); }
.bm-asked-group a { color: var(--bm-accent); }

/* Gaps page: the definition at the top, the menu on the left, the chosen
   gap on the right (2026-11-01). */
.bm-gapdef {
  background: var(--bm-white); border: 1px solid var(--bm-border); border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem;
}
.bm-gapdef-head {
  font-family: var(--bm-mono); font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--bm-accent); margin: 0 0 0.35rem;
}
.bm-gapdef-text { margin: 0 0 0.5rem; font-size: 1.05rem; line-height: 1.55; color: var(--bm-text); font-weight: 600; }
.bm-gapdef-note { margin: 0; font-size: 0.92rem; line-height: 1.55; color: var(--bm-muted); }
/* The list inside this box is the shared side-list family, so it reads exactly
   like the price pages' menu and the account menu -- one implementation of
   that shape, not three.
   
   The BOX keeps its own behaviour, and that is deliberate rather than an
   oversight. The box was pinned with its own scroll area until 2026-11-11, on
   explicit instruction ("Change the gaps page side menu to run down the whole
   page like the Product Policies page"), and it now matches .ep-side in
   css/estate-policy.css exactly: in the normal flow of the page, no sticky
   behaviour, no scroll area of its own, so a longer list makes the page longer
   and the menu scrolls with it.

   What the pinned box was protecting against, written down so it is not
   rediscovered the hard way: made static the menu stands about two thousand
   three hundred pixels tall, because it has forty two rows where the price
   pages have nine, and test_budget_page_reader.py went from five passes out of
   five to three failures out of five -- a person reading along who picked
   another gap stopped having the reading carry on. That was measured, five
   runs each way. The same five runs were made again after this change and are
   reported with it; the phone still keeps its dropdown, which is a real
   difference from the price pages and is noted rather than swept in. */
.bm-gaplayout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  /* Room to scroll past the reading bar fixed to the bottom of the screen, the
     same reason and the same figure as .ep-layout's own padding. */
  padding-bottom: 6rem;
}
.bm-gapside { position: static; max-height: none; overflow: visible; }
/* The content column, the same min-width: 0 .ep-main carries: without it
   a grid column will not shrink below its content's own minimum width and
   a wide table or a long address pushes the whole page sideways. */
.bm-gapmain { min-width: 0; }
.bm-gapselect { display: none; }
.bm-gapmenu {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  background: var(--bm-white);
  font-size: 0.9rem;
}
/* The shared list marks a current row by colouring its text, and it does that
   for a span, because on the price pages a current row is not a link. Here it
   stays a link, so the same colour is asked for by this page instead of by
   changing the shared family another session owns. */
.bm-gapmenu .side-list-items li.is-here a[aria-current] {
  color: var(--bm-text);
  font-weight: 700;
}
@media (max-width: 760px) {
  /* minmax(0, 1fr), not 1fr. A 1fr column will not shrink below its content's
     own minimum width, and the dropdown in the side column is as wide as its
     longest option, so the whole page was 424px on a 390px phone and scrolled
     sideways. The desktop rule above already uses minmax(0, 1fr) for exactly
     this reason, and .bm-gapdetail already carries min-width: 0, which is why
     it was the side column that overflowed and not the detail. Found by the
     no-sideways-scroll check while working on this page; it reproduced on
     every gap, including ones nothing had been added to. */
  .bm-gaplayout { grid-template-columns: minmax(0, 1fr); }
  .bm-gapside { position: static; max-height: none; overflow: visible; min-width: 0; }
  .bm-gapselect select { max-width: 100%; }
  .bm-gapmenu { display: none; }
  .bm-gapselect { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 600; color: var(--bm-muted); }
  .bm-gapselect select {
    font-family: var(--bm-font); font-size: 0.95rem; padding: 0.45rem 0.5rem;
    border: 1px solid var(--bm-border); border-radius: var(--bm-radius);
    background: var(--bm-white); color: var(--bm-text);
  }
}
.bm-gapdetail {
  background: var(--bm-white); border: 1px solid var(--bm-border); border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow); padding: 1.1rem 1.3rem; min-width: 0;
}
.bm-gapdetail-head h2 { margin: 0.1rem 0 0.5rem; font-size: 1.35rem; color: var(--bm-text); }
.bm-gapdetail-num { margin: 0; font-family: var(--bm-mono); font-size: 0.74rem; text-transform: uppercase; color: var(--bm-light); }
.bm-gapdetail-inst { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--bm-muted); }
.bm-gapdetail-inst a { color: var(--bm-accent); }
.bm-gapdetail .bm-gapcard-body { padding: 0; }
.bm-gapdetail-body p + p { margin-top: 0.6rem; }
.bm-gapideas { margin: 0.4rem 0 0; padding-left: 1.3rem; }
.bm-gapidea { margin: 0 0 0.9rem; }
.bm-gapidea p { margin: 0.25rem 0 0; }
.bm-gapidea-title { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.bm-gapidea-catch { color: var(--bm-muted) !important; }
.bm-gapideas-note { font-style: italic; color: var(--bm-muted) !important; }

/* Where to check whether unclaimed money is yours, and the form that cuts the
   list down. The form sends nothing anywhere -- this page has no backend --
   so it is styled as a plain set of controls rather than as a submission. */
.bm-gapform {
  margin: 0.6rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--bm-line);
  border-left: 3px solid var(--bm-accent);
  border-radius: 4px;
  background: var(--bm-panel);
}
.bm-gapform-lead { margin: 0 0 0.7rem; }
.bm-gapform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.5rem;
}
/* Every control in one row is the same height, which this project checks on
   every page that carries a form. */
.bm-gapform-row select {
  height: 2.2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--bm-line);
  border-radius: 3px;
  background: var(--bm-bg);
  color: inherit;
  font: inherit;
  line-height: 2.2rem;
}
.bm-gapform-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex: none;
}
.bm-gapform-out { margin-top: 0.9rem; }
.bm-gapform-count { font-weight: 600; margin: 0 0 0.5rem; }
.bm-gapform-out h4 { margin: 0.9rem 0 0.3rem; }
.bm-gapplaces { margin: 0; padding-left: 1.3rem; }
.bm-gapplace { margin: 0 0 0.9rem; }
.bm-gapplace p { margin: 0.25rem 0 0; }
.bm-gapplace-title { font-weight: 600; }
.bm-gapplace-title a { color: var(--bm-accent); }
.bm-gapplace-who { color: var(--bm-muted) !important; }
.bm-gapplace-note { color: var(--bm-muted) !important; font-style: italic; }
/* A postal address is the one thing on this page somebody will copy out by
   hand, so it is set apart and allowed to break where it needs to. */
.bm-gapplace-post { word-break: break-word; }
@media (max-width: 760px) {
}
/* Long source addresses wrap instead of pushing a phone screen sideways. */
.bm-answer-list li, .bm-section p, .bm-rule-source { overflow-wrap: anywhere; }

/* The ideas themselves, in their own box lined up under the blue-barred one. */
.bm-ideas .bm-ideas-listsection {
  margin-top: 0.9rem; padding: 1.1rem 1.25rem; border-top: 0;
  background: var(--bm-white); border: 1px solid var(--bm-border); border-radius: var(--bm-radius);
}
.bm-ideas-top .bm-ideas-form.is-first:not([hidden]) { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--bm-border); }
.bm-ideas-top .bm-ideas-posthint { margin-top: 0.9rem; }

.bm-dev-badge.is-beta { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bm-dev-badge.is-beta { background: #0c3550; color: #bae6fd; border-color: #075985; }
}

/* The figure at the top of a gap: what it really adds to the debt every year,
   or a plain statement that no single published figure covers it. Every gap
   shows one or the other, so nobody reads a gap and is left asking how much. */
.bm-gapamount {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 4px solid var(--bm-accent);
  border-radius: var(--bm-radius);
  background: var(--bm-subtle);
}
.bm-gapamount.is-no_number { border-left-color: var(--bm-border-dark); }
.bm-gapamount p { margin: 0 0 0.3rem; }
.bm-gapamount p:last-child { margin-bottom: 0; }
.bm-gapamount-fig {
  font-family: var(--bm-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--bm-text);
}
.bm-gapamount.is-no_number .bm-gapamount-fig {
  font-size: 1.05rem;
  color: var(--bm-muted);
}
.bm-gapamount-words { font-size: 0.9rem; }
.bm-gapamount-note { font-size: 0.82rem; color: var(--bm-muted); }

/* A lever whose own page has not been published yet. It is still listed, since
   this page exists to gather every lever, but it carries no link because the
   address does not exist. */
.lv-unbuilt {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--bm-muted);
  white-space: nowrap;
}


/* A table with enough columns that a reader loses their place in it. Asked for
   directly: the heading row has to follow the rows down, and the year has to
   follow the columns across, or twenty columns of contributions cannot be
   cross-referenced at all.

   Why the box scrolls rather than the page: a sticky heading needs a scrolling
   ancestor to stick inside, and the page is not it -- the whole page scrolling
   would carry the heading away. So the box takes a height, scrolls in both
   directions, and the heading and the first column stick to its own edges. */
.bm-bigtable-wrap {
  max-height: 70vh;
  overflow: auto;
  /* The sticky cells need something opaque behind them or the rows show
     through as they pass underneath. */
  background: var(--bm-white);
}
.bm-bigtable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}
.bm-bigtable th,
.bm-bigtable td {
  border-bottom: 1px solid var(--bm-border);
  white-space: nowrap;
}
.bm-bigtable thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  vertical-align: top;
  /* Wide enough that the description beside each name reads as sentences
     rather than as a ribbon. At 7.5rem every heading cell was 508 pixels tall
     because the longest description wrapped into a column two words across,
     and every other heading had to match it. */
  min-width: 13rem;
  max-width: 15rem;
  white-space: normal;
  background: var(--bm-head-bg, var(--bm-white));
  box-shadow: inset 0 -1px 0 var(--bm-border-dark);
}
/* The year, which is what every other cell is read against. */
.bm-bigtable tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bm-white);
  box-shadow: inset -1px 0 0 var(--bm-border);
}
/* The corner belongs to both, so it outranks both. */
.bm-bigtable thead th:first-child {
  left: 0;
  z-index: 4;
}
.bm-th-name { display: block; font-weight: 700; }
/* The year, and under it the one comparison worth keeping on screen while the
   columns scroll past. */
.bm-rowhead-main { display: block; font-weight: 700; }
.bm-rowhead-sub {
  display: block;
  margin-top: 0.1rem;
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.2;
  opacity: 0.8;
  white-space: nowrap;
}
/* A label line that names what the line under it is, rather than describing
   it. Every other heading's reason is a sentence; the year column's are four
   short labels, two pairs, so the pairs need to read as pairs. */
.bm-th-why + .bm-th-why { margin-top: 0.05rem; }
.bm-bigtable thead th:first-child .bm-th-why:nth-of-type(2n + 1) {
  margin-top: 0.3rem;
  font-weight: 700;
  opacity: 1;
}
.bm-th-why {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.25;
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
}
@media (max-width: 700px) {
  .bm-bigtable-wrap { max-height: 60vh; }
  .bm-bigtable thead th { min-width: 11rem; max-width: 13rem; font-size: 0.8rem; }
  .bm-th-why { font-size: 0.74rem; }
}


/* Two tables copied onto this page from the answers they belong to. They sit
   above the questions, so they need the same breathing room a question card
   block has and a plain way back to the answer. */
.bm-tables { margin: 2rem 0 0; }
.bm-copied-table { margin: 0 0 2.5rem; }
.bm-copied-note { margin: 0 0 0.9rem; font-size: 0.95rem; opacity: 0.9; }
.bm-copied-after { margin: 1rem 0 0.6rem; }
.bm-copied-links { margin: 0 0 0.6rem 1.1rem; padding: 0; }
.bm-copied-links li { margin: 0 0 0.25rem; }
.bm-copied-more { margin: 0.6rem 0 0; }
.bm-copied-more a { font-weight: 600; }
