/* BondsAtWork prototype — palette follows the WowDash/shadcn tokens (primary oklch(0.63 0.2 264)). WCAG AA: light primary darkened from #487fff (3.6:1) to #2f5fdb (5.5:1 on white, 4.8:1 on primary-soft). */
:root {
  --bg: #f6f7fb; --card: #ffffff; --fg: #111827; --muted: #4b5563; --line: #e5e7eb;
  --primary: #2f5fdb; --primary-ink: #ffffff; --primary-soft: #e8efff;
  --ok: #047857; --ok-soft: #d1fae5; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --bar2: #9db8ff; --focus: #1d4ed8;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --card: #141a2e; --fg: #e5e7eb; --muted: #a3acc2; --line: #273049;
    --primary: #7aa2ff; --primary-ink: #0b1020; --primary-soft: #1d2a4d;
    --ok: #34d399; --ok-soft: #0f2e25; --warn: #fbbf24; --warn-soft: #3a2c0a; --bad: #f87171; --bad-soft: #3b1414;
    --bar2: #3b5bab; --focus: #93c5fd;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --card: #141a2e; --fg: #e5e7eb; --muted: #a3acc2; --line: #273049;
  --primary: #7aa2ff; --primary-ink: #0b1020; --primary-soft: #1d2a4d;
  --ok: #34d399; --ok-soft: #0f2e25; --warn: #fbbf24; --warn-soft: #3a2c0a; --bad: #f87171; --bad-soft: #3b1414;
  --bar2: #3b5bab; --focus: #93c5fd;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-size: 16px; line-height: 1.5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.theme-toggle { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 16px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.hero h1 { margin: 8px 0 4px; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
.lede { color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 { margin-bottom: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } main { padding: 16px; } .topbar { padding: 12px 16px; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 13px; }

.filters fieldset { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.filters legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.filter-row .grow { flex: 1 1 220px; }
select, input[type=search] { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); min-width: 180px; }
.btn, .btn-ghost { font: inherit; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn { background: var(--primary); color: var(--primary-ink); border: 0; }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn[hidden] { display: none; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; gap: 10px; align-items: center; background: none; border: 0; padding: 4px; border-radius: 6px; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.bar-row[disabled] { cursor: default; }
.bar-row:hover:not([disabled]) { background: var(--bg); }
.bar-row.active .bar-fill { background: var(--focus); }
.bar-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 7px; }
.bar-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 70px; text-align: right; }

.journey { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.journey li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; }
.journey li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: grid; place-items: center; }
.journey span { color: var(--muted); font-size: 14px; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { color: var(--muted); font-size: 14px; }
.cards { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.card .amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .what { font-size: 15px; }
.card .who { color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--fg); }
.tag.place { background: var(--ok-soft); }
.card button { align-self: flex-start; margin-top: 4px; }

.tbl-wrap { overflow-x: auto; position: relative; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.pass { background: var(--ok-soft); color: var(--ok); }
.badge.fail { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }

.bd { display: grid; gap: 14px; }
.bd-row { display: grid; gap: 4px; }
.bd-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.bd-head .t { font-weight: 600; }
.bd-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.bd-prev { background: var(--bar2); }
.bd-this { background: var(--primary); }
.bd-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; margin: 8px 0 16px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
a { color: var(--primary); }

details summary { cursor: pointer; color: var(--primary); font-size: 14px; margin-top: 12px; }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 40; }
.drawer[hidden] { display: none; }
.drawer-card { background: var(--card); color: var(--fg); border-radius: var(--radius); max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }

.foot { max-width: 1200px; margin: 0 auto; padding: 0 24px 32px; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: no-preference) { .bar-fill, .bd-bar > div { transition: width .3s ease; } }

/* ---------- national overview + navigation ---------- */
a.brand { color: inherit; text-decoration: none; }
.switcher select { min-width: 220px; }
.crumbs { background: var(--card); border-bottom: 1px solid var(--line); }
.crumbs ol { list-style: none; margin: 0 auto; max-width: 1200px; padding: 10px 24px; display: flex; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.crumbs a { font-weight: 600; text-decoration: none; }
.crumbs [aria-current] { font-weight: 700; }
.subtabs { display: inline-flex; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.nat-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 860px) { .nat-grid { grid-template-columns: 1fr; } .switcher select { min-width: 0; max-width: 46vw; } .crumbs ol { padding: 10px 16px; } }

:root { --st-live: #1e7a3c; --st-live-ink: #ffffff; --st-pilot: #f59e0b; --st-pilot-ink: #1f2937; --st-queued: #e2e8f0; --st-queued-ink: #334155; }
:root[data-theme="dark"] { --st-live: #10b981; --st-live-ink: #04130d; --st-pilot: #fbbf24; --st-pilot-ink: #1f2937; --st-queued: #2a3350; --st-queued-ink: #cbd5e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-live: #10b981; --st-live-ink: #04130d; --st-pilot: #fbbf24; --st-pilot-ink: #1f2937; --st-queued: #2a3350; --st-queued-ink: #cbd5e1; } }
.sw.st-live { background: var(--st-live); } .sw.st-pilot { background: var(--st-pilot); } .sw.st-queued { background: var(--st-queued); border: 1px solid var(--line); }

.usmap { width: 100%; height: auto; display: block; }
.tile { cursor: pointer; outline: none; }
.tile rect { stroke: var(--card); stroke-width: 2; transition: transform .15s ease; }
.tile.st-live rect { fill: var(--st-live); } .tile.st-live text { fill: var(--st-live-ink); }
.tile.st-pilot rect { fill: var(--st-pilot); } .tile.st-pilot text { fill: var(--st-pilot-ink); }
.tile.st-queued rect { fill: var(--st-queued); } .tile.st-queued text { fill: var(--st-queued-ink); }
.tile:hover rect, .tile:focus-visible rect { stroke: var(--focus); stroke-width: 4; }
.t-code { font-size: 15px; font-weight: 700; text-anchor: middle; }
.t-score { font-size: 11px; text-anchor: middle; opacity: .85; }
.tile .pulse { fill: var(--st-pilot-ink); }
.tile .tick { stroke: var(--st-live-ink); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .tile .pulse { animation: pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.6); } }
}
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.status.st-live { background: var(--st-live); color: var(--st-live-ink); }
.status.st-pilot { background: var(--st-pilot); color: var(--st-pilot-ink); }
.status.st-queued { background: var(--st-queued); color: var(--st-queued-ink); }
#scTable th[scope=row] { font-weight: 600; }
#scTable .btn, #scTable .btn-ghost { display: inline-block; text-decoration: none; white-space: nowrap; font-size: 14px; }

/* District Bond Profile (specs/004) */
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary); text-decoration: underline; cursor: pointer; }
.linkish[aria-expanded="true"] { color: var(--fg); }
.panel.inset { box-shadow: none; background: var(--bg); margin-top: 12px; }
.panel.inset h3 { font-size: 16px; margin: 12px 0 4px; }
#view-district .filter-row select:disabled { opacity: .7; }
textarea.mono { font: 13px ui-monospace, Consolas, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
#view-district a, #view-people a, .linkish { color: var(--focus); }
#view-district .filter-row label { min-width: 0; max-width: 100%; }
#view-district select { max-width: 100%; }
#view-district .btn, #view-people .btn { background: var(--focus); }
#view-people .filter-row label { min-width: 0; max-width: 100%; }
#view-district summary { color: var(--focus); cursor: pointer; }

/* ---- access (specs/005) ---- */
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account a { text-decoration: none; }
.acct-name { color: var(--fg); font-size: 14px; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.locked { border-style: dashed; }
.locked h2::before { content: "🔒 "; }
.locked .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.locked .actions a { text-decoration: none; }
.operator-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); vertical-align: middle; margin-left: 6px; }
.narrow { max-width: 460px; margin: 32px auto; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.form input[type=email], .form input[type=password], .form input[type=text], .form input[type=number], .form input[type=date], .form textarea, .form select {
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); min-width: 0; width: 100%; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; text-decoration: none; background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.btn-passkey { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.msg { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg:empty { display: none; }
.linkbtn { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan .price { font-size: 26px; font-weight: 700; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.plan ul { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; }
.plan .seg { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.plan.current { outline: 2px solid var(--primary); }
.plan .spacer { flex: 1; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; }
.feat-grid label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.check { display: flex !important; gap: 8px; align-items: center; font-weight: 400 !important; grid-template-columns: none !important; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
code { font: 13px ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
/* account page: sign-in methods (spec 005, FR-13/14) */
.h2 { font-size: 18px; margin: 28px 0 6px; }
ul.list { list-style: none; padding: 0; margin: 8px 0 12px; }
ul.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
ul.list li .linkbtn { margin-left: auto; }

/* National map progress states (contrast, light/dark: pilot-ok 5.47/7.77, blocked 6.92/6.92; found dot 4.44/6.68, non-text). */
:root { --st-pilotok: #0f766e; --st-pilotok-ink: #ffffff; --st-blocked: #fed7aa; --st-blocked-ink: #7c2d12; --st-found: #0f766e; }
:root[data-theme="dark"] { --st-pilotok: #2dd4bf; --st-pilotok-ink: #042f2e; --st-blocked: #7c2d12; --st-blocked-ink: #fed7aa; --st-found: #2dd4bf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-pilotok: #2dd4bf; --st-pilotok-ink: #042f2e; --st-blocked: #7c2d12; --st-blocked-ink: #fed7aa; --st-found: #2dd4bf; } }
.sw.st-pilotok { background: var(--st-pilotok); }
.sw.st-blocked { background: repeating-linear-gradient(45deg, var(--st-blocked), var(--st-blocked) 4px, color-mix(in srgb, var(--st-blocked-ink) 18%, var(--st-blocked)) 4px, color-mix(in srgb, var(--st-blocked-ink) 18%, var(--st-blocked)) 6px); }
.sw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-found); margin-right: 6px; vertical-align: middle; }
.tile.st-pilotok rect { fill: var(--st-pilotok); } .tile.st-pilotok text { fill: var(--st-pilotok-ink); }
.tile.st-blocked rect { fill: var(--st-blocked); } .tile.st-blocked text { fill: var(--st-blocked-ink); }
.tile rect.hatch { stroke: none; pointer-events: none; }
.hatch-line { stroke: var(--st-blocked-ink); stroke-width: 2; opacity: .18; }
.tile .t-stage { font-size: 8.5px; font-weight: 700; text-anchor: middle; }
.tile .found { fill: var(--st-found); }
.stepbar { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.stepbar i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; background: var(--line, #e2e8f0); }
.stepbar i.on { background: var(--st-pilotok); }
.status.st-pilotok { background: var(--st-pilotok); color: var(--st-pilotok-ink); }
.status.st-blocked { background: var(--st-blocked); color: var(--st-blocked-ink); }
