/*
  MO Bill Watch — venture layout CSS.
  Requires structure.css, theme-mo-bill-watch.css, components.css loaded
  first (in that order). This is the gazette execution layer: running
  header, front-page nameplate, ledger rows, the navy hearings-docket
  block, the legislative lifecycle rail, the bill fact strip, and the
  flagship fiscal-note panel. Every color/font/radius/space resolves
  through a var() from the theme + structure layers; the only literal
  values are alpha-over-navy rgba() rules (an on-navy tint has no token)
  and hairline pixel weights, both consistent with the shared components.
  Light-mode only; AA-checked; 390px-clean; prints as a clean document.
*/

/* Full-bleed sections (topbar, docket) need to escape the body's side
   padding; the shared .fds-body sets horizontal padding, so those blocks
   pull it back with negative margins matched to the two shell paddings. */

/* ============================================================
   RUNNING GAZETTE HEADER  (every page)
   ============================================================ */
.mbw-topbar {
  margin: calc(var(--space-6) * -1) calc(var(--space-3) * -1) var(--space-5);
  background: var(--mbw-parchment);
  border-bottom: 1px solid var(--hair-2);
}

.mbw-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-top: 3px solid var(--mbw-navy);
}

.mbw-runningplate {
  font-family: var(--font-serif);
  font-weight: 600;
  font-variant: all-small-caps;
  letter-spacing: 0.06em;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
}

.mbw-edition {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   NAV BAR — four primary destinations with an active state, the long
   tail in one Browse menu, utilities pinned right. Collapses to a
   drawer under 860px (nine flat links used to wrap to three rows).
   ============================================================ */
.mbw-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-3);
  border-top: 1px solid var(--hair-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.mbw-navmenu { display: flex; align-items: stretch; gap: var(--space-1); }

/* Link sits in a tall box so the active underline reads as a tab against
   the bar's bottom border rather than floating under the text. */
.mbw-navlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-2);
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.mbw-navlink::after {
  content: "";
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.15s ease;
}
.mbw-navlink:hover, .mbw-navlink:focus-visible { color: var(--accent); }
.mbw-navlink:hover::after { transform: scaleX(1); }
.mbw-navlink--on { color: var(--ink); font-weight: 600; }
.mbw-navlink--on::after { transform: scaleX(1); }

/* Browse dropdown */
.mbw-navdd { position: relative; display: flex; }
.mbw-navdd-caret { margin-left: 5px; font-size: 9px; opacity: 0.7; }
.mbw-navdd-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 130;
  min-width: 244px;
  background: var(--card);
  border: 1px solid var(--hair-2);
  border-radius: 6px;
  box-shadow: 0 8px 26px rgba(28, 43, 74, 0.16);
  padding: var(--space-1) 0;
}
.mbw-navdd-group + .mbw-navdd-group { border-top: 1px solid var(--hair); margin-top: var(--space-1); padding-top: var(--space-1); }
.mbw-navdd-panel a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.mbw-navdd-panel a:hover { background: var(--mbw-parchment); color: var(--accent); }

/* Utilities cluster */
.mbw-navutil { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

/* Drawer toggle — hidden on desktop */
.mbw-navtoggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  padding: 5px var(--space-3);
  margin: var(--space-2) 0;
  cursor: pointer;
}
.mbw-navtoggle-bars,
.mbw-navtoggle-bars::before,
.mbw-navtoggle-bars::after {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--ink);
  content: "";
}
.mbw-navtoggle-bars { position: relative; }
.mbw-navtoggle-bars::before { position: absolute; top: -4px; }
.mbw-navtoggle-bars::after { position: absolute; top: 4px; }

.mbw-auth { display: inline-flex; }
.mbw-auth:empty { display: none; }
.mbw-signin {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
}
.mbw-signin:hover { filter: brightness(0.95); }

@media (max-width: 860px) {
  .mbw-nav { flex-wrap: wrap; gap: var(--space-2); }
  .mbw-navtoggle { display: inline-flex; }
  .mbw-navmenu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex-basis: 100%;
    order: 3;
    gap: 0;
    border-top: 1px solid var(--hair);
    padding-bottom: var(--space-2);
  }
  .mbw-navmenu--open { display: flex; }
  .mbw-navlink { padding: var(--space-3) 0; }
  .mbw-navlink::after { left: 0; right: auto; width: 18px; }
  .mbw-navdd { display: block; }
  .mbw-navdd-btn { width: 100%; justify-content: space-between; }
  .mbw-navdd-panel {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--hair-2);
    border-radius: 0;
    min-width: 0;
    margin: 0 0 var(--space-2) var(--space-2);
  }
  .mbw-navutil { margin-left: auto; }
  #mbwGSearch { width: 128px; }
  #mbwGSearch:focus { width: 150px; }
}

/* Generic link color for prose/body/kicker context — everywhere except
   the ledger title link (bold, own color) and the nav (own color). */
.fds-row-body a,
.fds-eyebrow a,
.mbw-billhead-kicker a,
.mbw-fact dd a,
.mbw-digest-note a,
.mbw-prose a {
  color: var(--accent);
}

/* ============================================================
   FRONT-PAGE NAMEPLATE  (homepage)
   ============================================================ */
.mbw-mast {
  text-align: center;
  padding: var(--space-4) var(--space-3) var(--space-5);
}

.mbw-mast-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

/* Thin/thick broadsheet rule sets, mirrored above and below the plate. */
.mbw-rules {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 300px;
  margin: 0 auto;
}
.mbw-rules span { display: block; }
.mbw-rules span:first-child { height: 2px; background: var(--mbw-navy); }
.mbw-rules span:last-child { height: 1px; background: var(--accent); }
.mbw-rules--top { margin-bottom: var(--space-3); }
.mbw-rules--top span:first-child { order: 1; }
.mbw-rules--top span:last-child { order: 2; }
.mbw-rules--bottom { margin-top: var(--space-3); }

.mbw-wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(44px, 9vw, 68px);
  line-height: 1;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.015em;
}

.mbw-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: var(--text-md);
  color: var(--ink-soft);
  margin: var(--space-3) 0 0;
}

.mbw-mast-edition {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--space-3);
}

/* ============================================================
   STAT ROW  (homepage) — almanac-style, hairline-divided
   ============================================================ */
.mbw-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-4) 0 var(--space-2);
}

.mbw-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-5);
}
.mbw-stat + .mbw-stat {
  border-left: 1px solid var(--hair-2);
}

.mbw-stat-number {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--accent);
}

.mbw-stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   HEARINGS DOCKET  — the one deliberate navy block
   ============================================================ */
.mbw-docket {
  margin: var(--space-5) calc(var(--space-3) * -1);
  padding: var(--space-5) var(--space-3);
  background: var(--mbw-navy);
  color: var(--mbw-on-navy);
  border-top: 3px solid var(--accent);
}

.mbw-docket-head { color: var(--mbw-on-navy-soft); }
.mbw-docket .fds-row { border-bottom-color: rgba(250, 248, 243, 0.14); }
.mbw-docket .fds-row-key { color: var(--mbw-brass-on-navy); }
.mbw-docket .fds-row-body { color: var(--mbw-on-navy); }
.mbw-docket .fds-row-body small { color: var(--mbw-on-navy-soft); }
.mbw-docket-empty { color: var(--mbw-on-navy-soft); font-size: var(--text-sm); }

.mbw-docket-link {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--mbw-brass-on-navy);
  text-decoration: none;
}
.mbw-docket-link:hover { text-decoration: underline; }

/* ============================================================
   LEDGER ROWS  (bill lists everywhere)
   ============================================================ */
.mbw-ledger { display: flex; flex-direction: column; }

/* [hidden] loses to a same-specificity `display: flex` rule that comes
   later in the cascade unless given a matching, more specific override —
   without this, rows toggled via the `hidden` attribute (search filter,
   category chips, watchlist paint()) never actually disappear. */
.mbw-ledger-row[hidden] { display: none; }

.mbw-ledger-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--hair);
  border-left: 2px solid transparent;
  transition: background 0.12s, border-left-color 0.12s;
}
.mbw-ledger-row:last-child { border-bottom: none; }
.mbw-ledger-row:hover {
  background: var(--mbw-parchment);
  border-left-color: var(--accent);
}

.mbw-ledger-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  flex: 0 0 68px;
  font-variant-numeric: tabular-nums;
}

.mbw-ledger-body { flex: 1; min-width: 0; font-size: var(--text-sm); }
.mbw-ledger-body a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.mbw-ledger-body a:hover { color: var(--accent); }
.mbw-ledger-body small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}
.mbw-ledger-body small a { color: var(--muted); text-decoration: none; }
.mbw-ledger-body small a:hover { color: var(--accent); text-decoration: underline; }

/* one-line official description under a ledger row's title */
.mbw-ledger-overview {
  display: block;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 2px;
  font-weight: 400;
}

/* ALL-CAPS section headings inside a reproduced official summary */
.mbw-summary .mbw-sumhead {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: var(--space-4) 0 var(--space-2);
  font-weight: 600;
}
.mbw-summary p { margin: 0 0 var(--space-3); }
.mbw-summary-src {
  font-size: var(--text-xs);
  color: var(--muted);
  border-left: 2px solid var(--hair-2);
  padding-left: var(--space-3);
  margin-bottom: var(--space-4);
}
.mbw-summary-src a { color: var(--accent); }

/* status chip — always a short lifecycle label, safe to nowrap */
.mbw-chip {
  display: inline-block;
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
}
/* Chips carrying a status phrase rather than a one-word lifecycle stage:
   nowrap would push them past a 375px viewport, so allow wrapping and cap
   the width instead. */
.mbw-chip--wrap {
  white-space: normal;
  max-width: 15ch;
  text-align: center;
  line-height: 1.35;
}
@media (min-width: 481px) {
  .mbw-chip--wrap { max-width: 22ch; }
}

.mbw-chip--green { color: var(--green); background: var(--green-soft); }
.mbw-chip--red { color: var(--red); background: var(--red-soft); }
.mbw-chip--gray { color: var(--muted); background: var(--hair); }

/* ============================================================
   BILL DETAIL — header, lifecycle rail, fact strip
   ============================================================ */
.mbw-billhead {
  text-align: center;
  padding: var(--space-2) 0 var(--space-4);
  border-bottom: 1px solid var(--hair-2);
  margin-bottom: var(--space-4);
}

.mbw-billhead-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.mbw-billhead-kicker a { text-decoration: none; }

.mbw-billnum {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.mbw-billtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-md);
  color: var(--ink-soft);
  margin: var(--space-2) 0 var(--space-4);
}

/* --- the legislative lifecycle rail --- */
.mbw-lifecycle {
  list-style: none;
  margin: var(--space-4) auto var(--space-3);
  padding: 0;
  display: flex;
  max-width: 520px;
}
.mbw-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
/* connecting track: the segment entering each step (not the first) */
.mbw-step::before {
  content: "";
  position: absolute;
  top: 6px; /* dot vertical center (dot is 13px) */
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--hair-2);
  z-index: 0;
}
.mbw-step:first-child::before { display: none; }
.mbw-step--done::before,
.mbw-step--now::before { background: var(--accent); }

.mbw-step-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 2px solid var(--hair-2);
  box-sizing: border-box;
}
.mbw-step--done .mbw-step-dot { background: var(--accent); border-color: var(--accent); }
.mbw-step--now .mbw-step-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.mbw-step-label {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--muted);
  max-width: 9ch;
}
.mbw-step--done .mbw-step-label { color: var(--ink-soft); }
.mbw-step--now .mbw-step-label { color: var(--accent); font-weight: 600; }

.mbw-billstatus {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  margin: var(--space-3) 0 0;
}
.mbw-billstatus-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--space-2);
}

/* --- fact strip (byline-style metadata) --- */
.mbw-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-5);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hair-2);
  border-bottom: 1px solid var(--hair-2);
}
.mbw-fact { margin: 0; }
.mbw-fact dt {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-1);
}
.mbw-fact dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink);
}
.mbw-fact dd a { text-decoration: none; }
.mbw-fact dd a:hover { text-decoration: underline; }
.mbw-fact-note {
  display: block;
  font-size: var(--text-2xs);
  color: var(--muted);
  margin-top: var(--space-1);
  max-width: 44ch;
}

/* ============================================================
   PROSE + EDITORIAL SECTION HEADS
   ============================================================ */
.mbw-prose { margin: var(--space-5) 0; max-width: 64ch; }

.mbw-secthead {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--hair-2);
  margin-bottom: var(--space-3);
}

.mbw-prose p {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 var(--space-3);
}

/* lead paragraph (bill summary) with a modest broadsheet drop cap */
.mbw-lede {
  font-size: var(--text-md) !important;
  color: var(--ink) !important;
  line-height: 1.6 !important;
}
.mbw-lede::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.82;
  color: var(--accent);
  margin: 0.04em 0.08em 0 0;
}

/* ============================================================
   FISCAL NOTE PANEL — the flagship data module
   ============================================================ */
.mbw-fiscal {
  margin: var(--space-5) 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
}
.mbw-fiscal--found {
  background: var(--accent-soft);
  border: 1px solid var(--hair-2);
  border-left: 3px solid var(--accent);
}
.mbw-fiscal--none {
  background: var(--mbw-navy-wash);
  border: 1px solid var(--hair-2);
}

.mbw-fiscal-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.mbw-fiscal--none .mbw-fiscal-kicker { color: var(--ink-soft); }

.mbw-fiscal-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--card);
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-2);
}

.mbw-fiscal-body {
  font-size: var(--text-base);
  line-height: 1.62;
  color: var(--ink);
  margin: 0;
}
.mbw-fiscal--none .mbw-fiscal-body { color: var(--ink-soft); }

.mbw-fiscal-src,
.mbw-fiscal-note {
  font-size: var(--text-2xs);
  color: var(--ink-soft);
  margin: var(--space-3) 0 0;
  word-break: break-word;
}
.mbw-fiscal-note { color: var(--muted); }
.mbw-fiscal-src a { color: var(--accent); }

/* ============================================================
   INTERIOR PAGE HEADERS (index/list pages) — shared fds-header
   ============================================================ */
.mbw-subhead h1 { font-family: var(--font-serif); }

/* ============================================================
   SEARCH + CATEGORY FILTER  (bills index)
   ============================================================ */
.mbw-filterbar { margin: var(--space-3) 0 var(--space-4); }

.mbw-search {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--hair-2);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.mbw-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.mbw-chiprow { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mbw-catchip { border: none; cursor: pointer; font-family: var(--font-mono); }
.mbw-catchip[aria-pressed="true"] { background: var(--accent); color: var(--card); }
.mbw-filter-empty { color: var(--muted); font-size: var(--text-sm); padding: var(--space-3) 0; }

/* ============================================================
   THIS-WEEK DIGEST
   ============================================================ */
.mbw-digest-note {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  background: var(--mbw-navy-wash);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--mbw-navy);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

/* ============================================================
   MISC + FOOTER
   ============================================================ */
.mbw-more { margin: var(--space-4) 0; font-family: var(--font-mono); font-size: var(--text-xs); }
.mbw-more a, .mbw-source a { color: var(--accent); }
.mbw-source { font-size: var(--text-xs); color: var(--muted); word-break: break-word; margin-top: var(--space-4); }
.mbw-source span { color: var(--muted); }

.mbw-capture { margin: var(--space-6) 0; }
.mbw-faq { margin-top: var(--space-5); }
.mbw-faq-row .fds-row-body strong {
  display: block;
  font-family: var(--font-serif);
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.mbw-footer {
  max-width: 680px;
  margin: var(--space-7) auto 0;
  padding: var(--space-4) var(--space-3) 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1.9;
  color: var(--muted);
}
.mbw-footer-rule {
  height: 2px;
  width: 64px;
  background: var(--accent);
  margin: 0 auto var(--space-3);
}
.mbw-footer p { margin: 0; }

/* ============================================================
   WATCHLIST STAR (every ledger row; state painted client-side from
   localStorage — see WATCHLIST_SCRIPT in site/build.js)
   ============================================================ */
.mbw-star {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  margin: -4px -4px -4px -6px;
  border: none;
  background: none;
  padding: 0;
  font-size: var(--text-base);
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.mbw-star:hover { color: var(--accent); }
.mbw-star[aria-pressed="true"] { color: var(--accent); }
.mbw-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   STICKY COMPACT TOPBAR (class toggled by scroll listener in
   WATCHLIST_SCRIPT once the masthead is out of view)
   ============================================================ */
.mbw-topbar--stuck {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  box-shadow: 0 2px 14px rgba(28, 43, 74, 0.14);
  animation: mbwSlideDown 0.18s ease;
}
.mbw-topbar--stuck .mbw-edition { display: none; }
.mbw-topbar--stuck .mbw-topbar-inner { padding-top: var(--space-2); padding-bottom: 0; border-top-width: 2px; }
.mbw-topbar--stuck .mbw-runningplate { font-size: 17px; }
.mbw-topbar--stuck .mbw-nav { border-top: none; }
.mbw-topbar--stuck .mbw-navlink { padding-top: var(--space-2); padding-bottom: var(--space-2); }
@keyframes mbwSlideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* ============================================================
   SUMMARY TABLE OF CONTENTS (long official summaries)
   ============================================================ */
/* .mbw-prose caps at 64ch; the summary section needs full width for the
   grid, with the cap moved onto the text column. */
.mbw-summary { max-width: none; }
.mbw-sumbody { max-width: 64ch; min-width: 0; }
.mbw-sumgrid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.mbw-toc {
  position: sticky;
  top: 110px; /* clears the stuck topbar */
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  border-left: 2px solid var(--hair-2);
  padding-left: var(--space-3);
}
.mbw-toc-head {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.mbw-toc ol { list-style: none; margin: 0; padding: 0; }
.mbw-toc li { margin: 7px 0; line-height: 1.4; }
.mbw-toc a { color: var(--ink-soft); text-decoration: none; letter-spacing: 0.03em; }
.mbw-toc a:hover { color: var(--accent); }
.mbw-sumhead { scroll-margin-top: 120px; }
@media (max-width: 800px) {
  .mbw-sumgrid { display: block; }
  .mbw-toc {
    position: static;
    border: 1px solid var(--hair);
    border-radius: var(--radius, 4px);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    max-height: 40vh;
    overflow-y: auto;
  }
}

/* ============================================================
   PREV / NEXT BILL NAVIGATION
   ============================================================ */
.mbw-pn {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-2);
  border-top: 1px solid var(--hair);
  padding-top: var(--space-3);
}
.mbw-pn-a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  text-decoration: none;
  max-width: 46%;
  line-height: 1.5;
}
.mbw-pn-a small {
  display: block;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: var(--text-2xs);
}
.mbw-pn-a--next { text-align: right; margin-left: auto; }
.mbw-pn-a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE — 390px baseline
   ============================================================ */
@media (max-width: 480px) {
  .mbw-topbar { margin-left: calc(var(--space-2) * -1); margin-right: calc(var(--space-2) * -1); }
  .mbw-docket { margin-left: calc(var(--space-2) * -1); margin-right: calc(var(--space-2) * -1); padding-left: var(--space-2); padding-right: var(--space-2); }

  /* Stack the row: bill number and status share the top line, the title and
     byline take the full width below. Keeping all three on one line leaves
     the title in a ~10ch column once the status chip is a phrase rather than
     a single word. */
  .mbw-ledger-row { flex-wrap: wrap; align-items: center; row-gap: var(--space-1); }
  .mbw-star { order: 1; }
  .mbw-ledger-num { order: 2; flex: 0 0 auto; }
  .mbw-ledger-row .mbw-chip { order: 3; margin-left: auto; }
  .mbw-ledger-body { order: 4; flex: 1 0 100%; }

  .mbw-stat { padding: 0 var(--space-4); }

  .mbw-step-label { font-size: 8.5px; max-width: 8ch; }
}

/* ============================================================
   PRINT — a civic document should print like one
   ============================================================ */
@media print {
  .mbw-topbar, .mbw-nav, .mbw-more, .mbw-capture, .mbw-filterbar,
  .mbw-footer-rule, .mbw-docket-link, .mbw-star, #mbwWatchlistCopy, .mbw-auth,
  .mbw-toc, .mbw-pn, .mbw-printbtn, .mbw-gsearch, .mbw-pulse,
  .mbw-navtoggle, .mbw-navdd { display: none !important; }

  .fds-body { background: #fff; color: #000; padding: 0; }
  .mbw-mast-edition, .mbw-billhead-kicker, .mbw-secthead { color: #000; }

  /* navy blocks would print as light-text-on-nothing once the browser
     drops backgrounds — force them to ink-on-white for print. */
  .mbw-docket { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .mbw-docket .fds-row-key, .mbw-docket .fds-row-body,
  .mbw-docket .fds-row-body small, .mbw-docket-head { color: #000 !important; }

  .mbw-fiscal--found, .mbw-fiscal--none { background: #fff !important; border: 1px solid #000; }

  /* expose citation URLs in print so a printed page stays sourced */
  .mbw-source a::after, .mbw-fiscal-src a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }

  a { color: #000 !important; text-decoration: none; }
}

/* ============================================================
   UX ROUND 2 — pulse strip, global search, print button,
   fiscal scale badge, chip-row spacing
   ============================================================ */
.mbw-pulse {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-3);
  scrollbar-width: thin;
}
.mbw-pulse-item {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  white-space: nowrap;
}
.mbw-pulse-item strong { font-weight: 600; }
.mbw-pulse-item:hover { filter: brightness(0.95); }

.mbw-chiprow + .mbw-chiprow { margin-top: var(--space-2); }

.mbw-gsearch { position: relative; margin-left: auto; }
.mbw-auth { margin-left: var(--space-2); }
#mbwGSearch {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  padding: 3px var(--space-3);
  width: 150px;
}
#mbwGSearch:focus { outline: 2px solid var(--accent); outline-offset: 1px; width: 220px; }
.mbw-gresults {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 120;
  min-width: 320px;
  max-width: 90vw;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--hair-2);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(28, 43, 74, 0.14);
  padding: var(--space-1) 0;
}
.mbw-gresults a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.mbw-gresults a strong { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); margin-right: 6px; }
.mbw-gresults a:hover { background: var(--mbw-parchment); }
.mbw-gnone { display: block; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--muted); }

.mbw-printbtn {
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.mbw-fiscal-scale {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  color: var(--red);
  background: var(--red-soft);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-2);
  margin-left: var(--space-2);
}
