/* Visual language follows soycheckoff.org: warm off-white canvas, "grass" greens,
   uppercase condensed headlines, near-square buttons.
   Fonts are free stand-ins for the site's Typekit faces:
   Barlow Condensed ≈ FF DIN Paneuropean Condensed, Inter ≈ Neue Haas Unica. */
:root {
  --grass-100: #b0d8c4;
  --grass-500: #008242;
  --grass-600: #00763c;
  --grass-700: #005c2f;
  --grass-800: #004824;
  --grass-900: #00371c;
  --seedling: #7eb85b;
  --gold: #f5ae2a;

  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #242826;
  --muted: #646a66;
  --heading: var(--grass-700);
  --line: #e4e1da;
  --line-strong: #cfcbc2;
  --accent: var(--grass-600);
  --accent-hover: var(--grass-900);
  --accent-ink: #ffffff;
  --accent-soft: #e7f3ec;
  --hero-from: var(--grass-900);
  --hero-to: var(--grass-700);
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 24, 0.06);
  --shadow: 0 1px 2px rgba(16, 32, 24, 0.05), 0 8px 24px -6px rgba(16, 40, 24, 0.1);
  --shadow-lg: 0 2px 4px rgba(16, 32, 24, 0.06), 0 22px 48px -12px rgba(16, 40, 24, 0.22);
  --font-title: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif;
  --font-sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --group: var(--accent);
  --ok: #11663a; --ok-soft: #e3f3e9; --warn: #8a5a00; --warn-soft: #fdf1d8; --bad: #9b2218; --bad-soft: #fbe8e6;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1511; --surface: #16201a; --surface-2: #1a251e; --ink: #e8ece9; --muted: #a0aba4; --heading: #8fd3ad;
    --line: #26322a; --line-strong: #33433a; --accent: #3fae73; --accent-hover: #63c48f; --accent-ink: #04140a; --accent-soft: #1a2d22;
    --ok: #7fd6a4; --ok-soft: #173826; --warn: #f2c46b; --warn-soft: #3a2e12; --bad: #f19a90; --bad-soft: #3d1c19;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -6px rgba(0,0,0,.4); --shadow-lg: 0 22px 48px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1511; --surface: #16201a; --surface-2: #1a251e; --ink: #e8ece9; --muted: #a0aba4; --heading: #8fd3ad;
  --line: #26322a; --line-strong: #33433a; --accent: #3fae73; --accent-hover: #63c48f; --accent-ink: #04140a; --accent-soft: #1a2d22;
    --ok: #7fd6a4; --ok-soft: #173826; --warn: #f2c46b; --warn-soft: #3a2e12; --bad: #f19a90; --bad-soft: #3d1c19;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.15; color: var(--heading); }
h1, h2 { font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: .005em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: .98; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.02; }
h3 { font-size: 1.06rem; font-weight: 600; color: var(--ink); }
h4 { font-size: .98rem; font-weight: 600; color: var(--ink); }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.plain { list-style: none; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack { display: grid; gap: 16px; }
.mt { margin-top: 36px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.eyebrow { font-size: .78rem; font-weight: 700; color: var(--heading); letter-spacing: .01em; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.row-between { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between .news-actions { margin-left: auto; }
.lead { font-size: 1.1rem; line-height: 1.65; color: var(--ink); margin: 0; }
.lead.narrow { max-width: 760px; color: var(--muted); }
.source { font-size: .76rem; color: var(--muted); margin: 14px 0 0; }
.rise { animation: rise .45s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } * { transition: none !important; } }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius); border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.block-btn { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--accent-hover); text-decoration: underline; }
.link-btn.subtle { color: var(--muted); font-weight: 500; }
.link-btn.sm { font-size: .84rem; }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; min-height: 48px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
label { display: grid; gap: 7px; font-weight: 600; font-size: .9rem; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.field { position: relative; display: block; font-weight: 400; }
.field > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input { padding-left: 44px; }
.field.big input { min-height: 54px; font-size: 1.02rem; }
.field-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius); }
.field-btn:hover { color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: .88rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- brand ---------- */
.logo { display: block; height: 44px; width: auto; flex: 0 0 auto; }
.logo-white { display: none; }
.brand-div { width: 1px; height: 32px; background: var(--line-strong); flex: 0 0 auto; }
.wordmark { font: 700 1.05rem/0.92 var(--font-title); text-transform: uppercase; color: var(--ink); letter-spacing: .03em; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand.light .wordmark { color: #fff; }
.brand.light .brand-div { background: rgba(255, 255, 255, .35); }
/* The reversed (white) logo on the dark footer and in dark mode. */
.brand.light .logo-color { display: none; }
.brand.light .logo-white { display: block; }
:root[data-theme="dark"] .logo-color { display: none; }
:root[data-theme="dark"] .logo-white { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-color { display: none; }
  :root:not([data-theme="light"]) .logo-white { display: block; }
}
@media (max-width: 520px) { .logo { height: 36px; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; border-top: 6px solid var(--accent); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow); }
.auth-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.auth-logo .logo { height: 84px; }
.auth-logo .brand-div { display: none; }
.auth-card h1 { font-size: 2.2rem; margin-bottom: 18px; }
.auth-card > p { margin: -8px 0 20px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 18px; font-size: .92rem; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes input { text-align: center; font: 700 1.5rem var(--font-title); padding: 0; min-height: 58px; }

/* ---------- top bar ---------- */
.topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 18px; }
@media (min-width: 768px) { .topbar-inner { padding-left: 32px; padding-right: 32px; } }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; }
.avatar.sm { width: 28px; height: 28px; font-size: .75rem; border: 0; box-shadow: none; }
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .switch-label { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #eaf5ee; background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); }
.hero-group { background: linear-gradient(120deg, color-mix(in srgb, var(--group) 62%, #0b1a12), var(--group) 75%, color-mix(in srgb, var(--group) 85%, #fff)); }
.hero-inner { position: relative; padding-top: 30px; padding-bottom: 34px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: rgba(255,255,255,.72); margin-bottom: 18px; }
.crumbs a { color: rgba(255,255,255,.85); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .ico { width: 13px; height: 13px; opacity: .6; }
.hero-title { display: flex; align-items: center; gap: 18px; }
.hero .eyebrow { color: var(--seedling); }
.hero-group .eyebrow { color: rgba(255,255,255,.8); }
.hero h1 { color: #fff; margin: 0; }
.hero-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); flex: 0 0 auto; }
.hero-badge .ico { width: 30px; height: 30px; color: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 28px 0 0; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg); overflow: hidden; }
.hero-stat { display: grid; gap: 2px; background: rgba(0, 20, 10, .28); padding: 14px 18px; backdrop-filter: blur(2px); color: #fff; text-decoration: none; transition: background .15s; }
.hero-stat:hover { background: rgba(0, 20, 10, .44); }
.hero-stat .k { font-size: .78rem; color: rgba(255,255,255,.72); }
.hero-stat .v { font: 700 2.1rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.hero-stat .go { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.85); }
.hero-stat .go .ico { width: 13px; height: 13px; transition: transform .2s var(--ease); }
.hero-stat:hover .go .ico { transform: translateX(3px); }
/* Health: three fiscal years in one tile, each a link to that year's investments. */
.hero-stat.hero-health { grid-column: span 2; padding-bottom: 12px; }
.hero-stat.hero-health:hover { background: rgba(0, 20, 10, .28); }
.hh-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.hh-year { display: grid; gap: 3px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; color: #fff; text-decoration: none; transition: background .15s; }
.hh-year:hover, .hh-year:focus-visible { background: rgba(255,255,255,.12); }
.hh-fy { font-size: .74rem; font-weight: 600; color: rgba(255,255,255,.8); }
.hh-year .v { font-size: 1.8rem; }
.hh-counts { display: flex; gap: 8px; font-size: .74rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.85); }
.hh-counts b { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.hh-counts b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.hh-counts .g::before { background: #4ade80; }
.hh-counts .y::before { background: #facc15; }
.hh-counts .r::before { background: #f87171; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px 24px; }
.hero-head .dd { width: 300px; }
@media (max-width: 640px) { .hero-head .dd { width: 100%; } }

/* ---------- tab bar ---------- */
.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 67px; z-index: 20; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 0 16px; min-height: 56px; display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s;
}
.tab .ico { width: 17px; height: 17px; }
@media (max-width: 1000px) { .tab { padding: 0 12px; } .tab .ico { display: none; } }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--group); font-weight: 600; border-bottom-color: var(--group); }

/* ---------- content ---------- */
.content { padding-top: 36px; padding-bottom: 72px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.sec-head h2 { margin: 0 0 4px; }
.sec-head p { margin: 0; font-size: .92rem; }
.grid-2, .grid-2-1 { display: grid; gap: 22px; }
.grid-2 > *, .grid-2-1 > * { min-width: 0; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2-1 { grid-template-columns: 1.7fr 1fr; align-items: start; }
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0 0 2px; }
.card-head p { margin: 0; }
.admin-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 26px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); font-size: .9rem; }
.admin-banner .ico { color: #a06d00; }
.empty { display: grid; place-items: center; gap: 8px; padding: 36px; color: var(--muted); text-align: center; }
.empty .ico { width: 32px; height: 32px; }

/* editable blocks */
.block { min-width: 0; }
.editable { position: relative; border: 2px dashed var(--gold); border-radius: var(--radius-lg); padding: 0 14px 14px; background: color-mix(in srgb, var(--gold) 6%, transparent); }
.edit-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .76rem; font-weight: 700; color: #a06d00; padding: 8px 0; }
.edit-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.edit-bar .ico { width: 14px; height: 14px; }
.edit-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.edit-bar .muted { font-weight: 500; }
.edit-area { outline: none; min-height: 40px; border-radius: var(--radius); }
.edit-area:focus { box-shadow: 0 0 0 2px var(--gold); }

/* deltas */
.delta { display: inline-flex; align-items: center; gap: 4px; font: 600 .76rem var(--font-sans); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.delta.up { color: #11663a; background: #e3f3e9; }
.delta.down { color: #9b2218; background: #fbe8e6; }
.delta.flat { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.delta.up::before { content: "▲"; font-size: .6rem; } .delta.down::before { content: "▼"; font-size: .6rem; }

/* ---------- overview ---------- */
.ov-top { display: grid; gap: 22px; margin-bottom: 22px; }
@media (min-width: 700px) { .ov-top { grid-template-columns: 1.6fr 1fr; align-items: center; gap: 40px; } }
.ov-intro { display: flex; flex-direction: column; justify-content: center; }
.ov-intro .lead { font-size: 1.25rem; }
.ov-photo { display: grid; place-items: center; }
/* The photo keeps its own shape: never cropped, only scaled down to fit. */
.ov-figure { width: 100%; margin: 0; }
.ov-figure img { display: block; width: auto; max-width: 100%; max-height: 300px; margin: 0 auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ov-figure.empty-photo { display: grid; place-items: center; align-content: center; gap: 6px; aspect-ratio: 4 / 3; max-width: 340px; margin: 0 auto; border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-strong); background: var(--accent-soft); color: var(--accent); font-size: .82rem; font-weight: 600; }
.ov-figure.empty-photo .ico { width: 32px; height: 32px; }

.colchart { width: 100%; height: auto; display: block; overflow: visible; }
.colchart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.colchart .col path { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); transition: fill .15s; }
.colchart .col.is-last path { fill: var(--accent); }
.colchart .col:hover path { fill: var(--accent-hover); }
.colchart .val { font: 600 12px var(--font-sans); fill: var(--ink); }
.colchart .lbl { font: 500 12px var(--font-sans); fill: var(--muted); }
.splitbar { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; margin: 8px 0 20px; }
.splitbar .seg { transition: opacity .15s, filter .15s; cursor: default; }
.splitbar .seg:first-child { border-radius: 4px 0 0 4px; } .splitbar .seg:last-child { border-radius: 0 4px 4px 0; }
.splitbar .seg.dim { opacity: .28; }
.splitbar .seg:hover { filter: brightness(1.12); }
.legend { display: grid; gap: 2px; }
.legend li { display: grid; grid-template-columns: 12px 1fr 48px 64px; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius); font-size: .9rem; }
.legend li:nth-child(odd) { background: var(--surface-2); }
.legend li.is-current { font-weight: 700; background: var(--accent-soft); }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.lg-val, .lg-amt { text-align: right; font-variant-numeric: tabular-nums; }
.lg-amt { color: var(--muted); }

/* ---------- strategy ---------- */
.doc-grid { display: grid; gap: 18px; }
@media (min-width: 600px) { .doc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .doc-grid { grid-template-columns: repeat(3, 1fr); } }
.doc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s var(--ease); }
.doc-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-thumb { position: relative; display: grid; align-content: start; gap: 10px; width: 100%; height: 170px; padding: 0 22% 0; border: 0; cursor: pointer; text-align: left; text-decoration: none;
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--accent-soft) 60%, var(--surface-2))); }
.doc-thumb::before { content: ""; position: absolute; left: 22%; right: 22%; top: 18px; bottom: -6px; background: #fff; border-radius: 3px 3px 0 0; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.doc-thumb > * { position: relative; }
.thumb-band { height: 8px; margin-top: 18px; background: var(--grass-700); border-radius: 3px 3px 0 0; }
.thumb-title { padding: 0 12px; font: 700 .82rem/1.05 var(--font-title); text-transform: uppercase; color: var(--grass-700); }
.thumb-lines { display: grid; gap: 6px; padding: 0 12px; }
.thumb-lines i { height: 5px; border-radius: 2px; background: #e6e6e1; } .thumb-lines i:nth-child(2n) { width: 75%; }
.thumb-tag { position: absolute !important; right: calc(22% - 10px); top: 26px; background: #b3261e; color: #fff; font: 700 .62rem var(--font-sans); padding: 3px 6px; border-radius: 3px; }
.doc-body { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.doc-body h4 { margin-bottom: 2px; }
.doc-body p { margin-bottom: 12px; }
.doc-actions { display: flex; gap: 8px; }

/* ---------- market ---------- */
/* The board view's report picker: Older · date menu · Newer. Phones keep just the arrows. */
.ver-bar.mi-picker { flex-wrap: nowrap; }
.ver-bar.mi-picker .dd { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) { .ver-bar.mi-picker .dd { width: auto; } }
.mi-step .ico { width: 14px; height: 14px; }
.mi-step.older .ico { transform: rotate(180deg); }
.mi-step:disabled { opacity: .4; cursor: default; }
@media (max-width: 480px) { .mi-step span { display: none; } }
.mi-flag .ico { color: var(--c); }
.mi-notes { display: block; margin-top: 4px; color: var(--muted); }
.mi-waiting { color: #a06d00; font-weight: 600; }
.issues { display: grid; gap: 10px; }
.issue { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, transform .15s; }
.issue:hover { border-color: var(--accent); transform: translateX(2px); }
.issue > span:nth-child(2) { display: grid; flex: 1; }
.issue > .ico { color: var(--accent); }
.issue-cover { width: 46px; height: 58px; border-radius: 3px; display: grid; place-items: end start; padding: 5px; background: linear-gradient(160deg, var(--grass-600), var(--grass-900)); color: #fff; font: 700 .9rem var(--font-title); text-transform: uppercase; box-shadow: 0 3px 8px rgba(0,0,0,.15); }

/* ---------- news ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; font-size: .88rem; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--accent); }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip.sm { min-height: 34px; padding: 0 12px; font-size: .82rem; }
.news-layout { display: grid; gap: 22px; }
@media (min-width: 900px) { .news-layout { grid-template-columns: 1fr 1.15fr; align-items: start; } .lead-story { position: sticky; top: 140px; } }
.lead-story { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.lead-img { position: relative; overflow: hidden; height: 230px; display: grid; place-items: center; color: rgba(255,255,255,.9);
  background: linear-gradient(150deg, color-mix(in srgb, var(--group) 80%, #fff), color-mix(in srgb, var(--group) 60%, #06120b)); }
.lead-img > .ico { width: 84px; height: 84px; stroke-width: 1.2; position: relative; }
.pinned { position: absolute; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.35); color: #fff; font-size: .76rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.pinned .ico { width: 13px; height: 13px; }
.lead-body { padding: 20px 22px 22px; display: grid; gap: 12px; }
.lead-title { font: 700 1.7rem/1.08 var(--font-title); text-transform: uppercase; color: var(--heading); text-decoration: none; }
.lead-title:hover { color: var(--accent); }
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.tag i { width: 8px; height: 8px; border-radius: 50%; }
.news-list-card { padding: 6px 22px; }
.news { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news:last-child { border-bottom: 0; }
.news-main { flex: 1; display: grid; gap: 6px; min-width: 0; }
.news-title { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.35; }
.news-title:hover { color: var(--accent); text-decoration: underline; }
.news.is-hidden, .lead-story.is-hidden { opacity: .42; }
.news.is-hidden .news-title { text-decoration: line-through; }
.pinned-inline { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: #a06d00; }
.pinned-inline .ico { width: 12px; height: 12px; }
.news-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* ---------- portfolio ---------- */
.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; margin-bottom: 36px; }
@media (max-width: 420px) { .wg-grid { grid-template-columns: 1fr; } }
.wg-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.wg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.wg-tile { position: relative; overflow: hidden; height: 156px; display: flex; align-items: flex-end; padding: 20px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.5)), linear-gradient(140deg, color-mix(in srgb, var(--group) 85%, #fff), var(--group) 55%, color-mix(in srgb, var(--group) 70%, #000)); }
.wg-mark { position: absolute; right: -12px; top: -14px; width: 150px; height: 150px; color: #fff; opacity: .2; transition: transform .4s var(--ease), opacity .3s; }
.wg-mark .ico { width: 100%; height: 100%; stroke-width: 1.1; }
.wg-mark { transform: rotate(-6deg) scale(1.06); opacity: .28; }
.wg-tile h3 { position: relative; margin: 0; color: #fff; font: 700 1.9rem/1 var(--font-title); text-transform: uppercase; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.wg-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 20px; flex: 1; }
.wg-body p { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wg-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.wg-meta { display: grid; line-height: 1.3; }
.round-go { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--accent); transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.wg-card:hover .round-go, .committee:hover .round-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateX(3px); }

.search-card { display: grid; gap: 14px 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
@media (min-width: 900px) { .search-card { grid-template-columns: 1fr 1.5fr; } .search-card .quick { grid-column: 2; } }
.search-card h3 { margin: 0; }
.search { display: flex; gap: 10px; }
.search .field { flex: 1; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.committee { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 60%); text-decoration: none; color: var(--ink); transition: box-shadow .2s; }
.committee:hover { box-shadow: var(--shadow); }
.committee h3 { margin: 2px 0; }
.committee p { margin: 0; }
.committee-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); flex: 0 0 auto; }
.committee-ico .ico { width: 24px; height: 24px; }

.fy-grid { display: grid; gap: 20px; margin-bottom: 36px; }
@media (min-width: 900px) { .fy-grid { grid-template-columns: repeat(3, 1fr); } }
.fy-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: left; padding: 24px; min-height: 260px;
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.fy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--group); }
.fy-card.is-current { border: 2px solid var(--group); box-shadow: var(--shadow); }
.fy-top { display: flex; justify-content: space-between; align-items: center; }
.fy-top .eyebrow { color: var(--muted); }
.now { font-size: .72rem; font-weight: 700; color: #fff; background: var(--group); padding: 4px 9px; border-radius: 999px; }
.fy-card .fy { font: 700 3.6rem/.9 var(--font-title); color: var(--group); }
.fy-budget { font: 700 1.6rem/1 var(--font-title); color: var(--ink); font-variant-numeric: tabular-nums; }
.fy-budget small { margin-left: 6px; font: 500 .84rem var(--font-sans); color: var(--muted); }
.fy-count { font-size: .88rem; color: var(--muted); }
.fy-count strong { color: var(--ink); }
.fy-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); font-size: .92rem; padding-top: 12px; border-top: 1px solid var(--line); }
.fy-card .go .ico { width: 15px; height: 15px; }

/* ---------- A&E timeline ---------- */
.timeline { position: relative; display: grid; gap: 16px; }
.timeline::before { content: ""; position: absolute; left: 63px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); }
.tl-item { display: grid; grid-template-columns: 48px 32px minmax(0, 1fr); align-items: center; }
.tl-year { font: 700 1.25rem var(--font-title); color: var(--heading); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--tl-mark, var(--muted)); position: relative; z-index: 1; margin-left: 9px; }
.tl-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.tl-card > div { flex: 1 1 200px; min-width: 0; }
.tl-card h3, .tl-card p { margin: 0; }
/* Report types are told apart by the timeline dot and the type label, not the card. */
:root { --type-adhoc: #3f8f4a; --type-roi: #2f6db5; --type-strategic: #9a5b13; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --type-adhoc: #7fcf8a; --type-roi: #86b6ef; --type-strategic: #e8b06a; } }
:root[data-theme="dark"] { --type-adhoc: #7fcf8a; --type-roi: #86b6ef; --type-strategic: #e8b06a; }
.is-adhoc { --tl-mark: var(--type-adhoc); }
.is-roi { --tl-mark: var(--type-roi); }
.is-strategic { --tl-mark: var(--type-strategic); }
.field-quick { display: grid; gap: 8px; }
.field-quick .chips { margin: 0; gap: 6px; }
.field-quick .field-title { font-weight: 600; font-size: .9rem; }
/* A&E: program areas link to their pages; USB ID numbers open the investment search. */
.ae-area { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
.ae-area:hover { text-decoration-color: currentColor; }
.ae-ids { display: grid; gap: 6px; margin: 10px 0 4px; }
.ae-ids .chips { margin: 0; gap: 6px; }
.tl-type { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tl-mark, var(--muted)); }
/* A&E tabs: one per report type, in its color. */
.ae-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ae-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.ae-tab i { width: 9px; height: 9px; border-radius: 50%; background: var(--tl-mark); }
.ae-tab:hover { color: var(--ink); }
.ae-tab.on { color: var(--ink); border-bottom-color: var(--tl-mark); }
.ae-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.ae-title:hover h3 { color: var(--accent); text-decoration: underline; }
.ae-latest { display: block; max-width: 100%; margin-top: 6px; padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: .86rem; color: var(--muted); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-latest:hover { color: var(--accent); text-decoration: underline; }
.ae-latest strong { color: var(--ink); font-weight: 600; margin-right: 4px; }
.ae-pending { align-self: center; font-size: .76rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 640px) { .ae-tab { padding: 10px 10px; font-size: .86rem; } .tl-card h3 { overflow-wrap: anywhere; } }
.drawer.ae-drawer { width: min(960px, 100vw); }
@media (min-width: 761px) { .drawer.ae-drawer { width: min(960px, 72vw); } }
.ae-detail { display: grid; gap: 10px; justify-items: start; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.ae-detail h2 { margin: 0; font: 700 1.5rem/1.1 var(--font-title); text-transform: uppercase; color: var(--heading); }
.ae-detail p { margin: 0; }
.ae-updates-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0 6px; }
.ae-updates-head h3 { margin: 0; font: 700 .74rem var(--font-sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ae-updates { position: relative; display: grid; gap: 0; }
.ae-updates li { position: relative; padding: 10px 0 14px 20px; border-left: 2px solid var(--line-strong); margin-left: 5px; }
.ae-updates li::before { content: ""; position: absolute; left: -7px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--tl-mark, var(--muted)); }
.ae-updates li p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.5; color: var(--ink); }
.ae-updates summary { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; list-style: none; border-radius: 6px; }
.ae-updates summary::-webkit-details-marker { display: none; }
.ae-updates summary:hover .ae-update-title { color: var(--accent); text-decoration: underline; }
.ae-updates summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ae-update-head { display: flex; gap: 8px; }
.ae-update-date { flex: none; font-weight: 700; font-size: .86rem; min-width: 92px; padding-top: 1px; }
.ae-update-title { flex: 1; font-weight: 600; line-height: 1.4; }
.ae-update-chev { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); transition: transform .15s; }
.ae-updates details[open] .ae-update-chev { transform: rotate(180deg); }
@media (max-width: 480px) { .ae-updates summary, .ae-update-head { flex-wrap: wrap; } .ae-update-date { min-width: 0; width: 100%; } }
.ae-updates .btn-row { margin-top: 6px; }
.recs { font-size: .76rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.side-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.editable .side-card { background: transparent; border: 0; padding: 0; }
.side-card h3, .side-card p { margin: 0 0 2px; }

/* ---------- footer ---------- */
.foot { background: var(--grass-900); color: #d7ebdf; padding: 26px 0; }

/* ---------- agent ---------- */
.agent { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.agent-fab { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--ink); color: var(--surface); font: 600 .95rem var(--font-sans); cursor: pointer; box-shadow: var(--shadow-lg); }
.agent-fab .ico { color: var(--gold); }
.agent-body { display: none; width: min(360px, calc(100vw - 36px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-lg); }
.agent.open .agent-body { display: grid; gap: 14px; animation: rise .25s var(--ease); }
.agent-head { display: flex; gap: 12px; align-items: center; }
.agent-head > div { display: grid; }
.agent-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: #a06d00; }
.agent-msg { font-size: .86rem; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px 12px 12px 4px; color: var(--muted); }
.agent form { display: grid; gap: 10px; }

/* ---------- modal, tooltip, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 20, 10, .55); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-body { padding: 20px; background: var(--surface-2); }
.dash-ph { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.dash-ph div { height: 80px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.dash-ph .wide { grid-column: 1 / -1; height: 150px; }
.tip { position: fixed; z-index: 80; pointer-events: none; transform: translate(-50%, -100%); background: var(--ink); color: var(--surface); font: 600 .78rem var(--font-sans); padding: 6px 10px; border-radius: 6px; white-space: nowrap; opacity: 0; transition: opacity .1s; box-shadow: var(--shadow); }
.tip.show { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; background: var(--grass-900); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: .9rem; font-weight: 500; transition: .25s var(--ease); z-index: 90; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
#toast .ico { color: var(--seedling); }
#toast.error { background: #5a1a14; }
#toast.error .ico { color: #f6b1a8; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.chart-card { display: flex; flex-direction: column; }
.chart-card .source { margin-top: auto; padding-top: 14px; }
.ov-photo.editable { display: block; }
.ov-photo .edit-bar { width: 100%; }
@media (max-width: 640px) { .tabbar { position: static; } }

/* Strategic priorities (published HTML, or the editor in edit mode), set apart from the documents below. */
.strat-sec { margin: 0 0 48px; }
/* The economist's published HTML; the frame grows to fit it. */
.strat-html { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }

/* chart / table switch + table */
.seg-ctl { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); flex: 0 0 auto; }
.seg-ctl button { border: 0; background: none; font: 600 .82rem var(--font-sans); color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; min-height: 32px; }
.seg-ctl button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table .num { text-align: right; }
.table tbody tr:first-child td { font-weight: 700; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.link-btn.light { color: var(--grass-100); font-weight: 500; }
.auth-error { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius); background: #fbe8e6; color: #9b2218; font-size: .9rem; border: 1px solid #f3c7c2; }

/* ---------- project list ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 8px; font-weight: 600; font-size: .9rem; color: var(--accent); text-decoration: none; }
.back-link:hover { color: var(--accent-hover); }
.back-link .ico { width: 16px; height: 16px; transform: rotate(180deg); }
a.chip { text-decoration: none; }
.chip-n { font-variant-numeric: tabular-nums; opacity: .7; }
.proj-list { padding: 4px 0; overflow: hidden; }
.proj-list li + li { border-top: 1px solid var(--line); }
.proj { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 14px 20px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.proj:hover { background: var(--surface-2); }
.proj-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.proj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .8rem; color: var(--muted); }
.status { flex: 0 0 auto; font-size: .76rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.on { color: var(--ok); background: var(--ok-soft); }
.status.risk { color: var(--warn); background: var(--warn-soft); }
.status.off { color: var(--bad); background: var(--bad-soft); }
.more { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }

/* ---------- pipeline image ---------- */
.pipeline-sec { margin-bottom: 36px; }
.pipeline { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); cursor: zoom-in; }
.pipeline img { display: block; width: 100%; height: auto; }
.pipeline-zoom { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: 600; }
.pipeline-zoom .ico { width: 14px; height: 14px; }
.pipeline-empty { display: grid; place-items: center; gap: 8px; padding: 36px; text-align: center; color: var(--muted); border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); }
.pipeline-empty .ico { width: 32px; height: 32px; }
.pipeline-empty p { margin: 0; }
.modal.wide { width: min(1200px, 100%); }
.pipeline-full { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pipeline-full img { display: block; width: 100%; min-width: 900px; height: auto; }

/* ---------- events ---------- */
.ev-month { margin-bottom: 28px; }
.ev-month > h3 { margin: 0 0 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ev-list { display: grid; gap: 12px; }
.ev { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; padding: 16px 18px; }
.ev-date { flex: 0 0 auto; width: 62px; display: grid; place-items: center; padding: 8px 0; line-height: 1; border-radius: var(--radius); color: var(--group); background: color-mix(in srgb, var(--group) 12%, var(--surface)); }
.ev-date span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ev-date strong { margin-top: 3px; font: 700 1.9rem/1 var(--font-title); }
.ev-meta { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.ev-meta .ico { width: 15px; height: 15px; flex: 0 0 auto; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-main { flex: 1; min-width: 200px; display: grid; gap: 6px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ev-main:hover .ev-title { color: var(--accent); text-decoration: underline; }
.ev-meta > span { min-width: 0; }
.ev-actions { display: flex; align-items: center; gap: 8px; }
.ev.is-past .ev-date { --group: var(--muted); }
.tag .ico { width: 12px; height: 12px; }
@media (max-width: 640px) { .ev-actions { width: 100%; } .ev-actions .btn { flex: 1; } }

/* ---------- documents ---------- */
.file-list { display: grid; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.file-row:first-child { border-top: 0; }
.file-ico { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.file-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.file-text > a { font-weight: 600; overflow-wrap: anywhere; }
.file-edit input, .file-edit select { min-height: 40px; padding: 6px 10px; }
.file-edit select { flex: 0 0 150px; width: 150px; }
@media (max-width: 560px) { .file-edit { flex-wrap: wrap; } .file-edit .file-text { flex-basis: calc(100% - 50px); } .file-edit select { flex: 1; margin-left: 50px; } }
.files-field { display: grid; gap: 8px; }
.files-field .file-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 14px; }
.files-field .file-list:empty { display: none; }
.files-field > .btn { justify-self: start; }
.doc-file { display: grid; gap: 10px; justify-items: start; }
.doc-file > * { width: 100%; }
.doc-file > .btn { width: auto; }
.form-row { display: grid; gap: 14px; align-items: end; }
@media (min-width: 520px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 1fr 1fr 1.3fr; } }
.field-note { margin: 8px 0 0; }
.seg-check .ico { width: 16px; height: 16px; }
.audience-wrap[hidden], .linked-note[hidden] { display: none; }
.linked-note { margin: 0; }
.doc-body p.doc-event { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; color: var(--muted); }
.doc-event .ico { width: 14px; height: 14px; }
.doc-event .link-btn { padding: 0; text-align: left; }
.doc-tags { margin-bottom: 12px; }
.more-row { justify-content: center; margin-top: 18px; }
.doc-card { display: flex; flex-direction: column; }
.doc-body { flex: 1; display: flex; flex-direction: column; }
.doc-actions { margin-top: auto; }
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-stat { padding: 12px; }
  .hero-stats:has(.hero-health) { grid-template-columns: repeat(2, 1fr); }
  .hero-stat.hero-health { grid-column: 1 / -1; }
  .hero-stat .v { font-size: 1.6rem; }
  .hero-stat .k, .hero-stat .go { font-size: .72rem; }
}

/* ---------- dropdown (shared) ---------- */
.dd { position: relative; }
.dd-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px 8px 9px;
  font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dd-trigger:hover { border-color: var(--accent); }
.dd.open .dd-trigger { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dd-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.2; }
.dd-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.dd-value { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); transition: transform .25s var(--ease); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-mark { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, var(--accent)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.dd-mark .ico { width: 18px; height: 18px; }

.dd-dark .dd-trigger {
  color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 24px -12px rgba(0,0,0,.45); backdrop-filter: blur(10px);
}
.dd-dark .dd-trigger:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }
.dd-dark.open .dd-trigger { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.7); box-shadow: 0 0 0 4px rgba(255,255,255,.16); }
.dd-dark .dd-label, .dd-dark .dd-chev { color: rgba(255,255,255,.72); }
.dd-dark .dd-trigger .dd-mark { box-shadow: 0 0 0 2px rgba(255,255,255,.55); }

.dd-menu {
  position: fixed; z-index: 70; padding: 6px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform-origin: top center; animation: dd-in .18s var(--ease);
}
.dd-menu.up { transform-origin: bottom center; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dd-head { display: none; }
.dd-opt { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 10px; border-radius: 10px; color: var(--ink); cursor: pointer; outline: none; transition: background .12s; }
.dd-opt:hover, .dd-opt:focus { background: var(--surface-2); }
.dd-opt:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.dd-opt[aria-selected="true"] { background: var(--accent-soft); }
.dd-opt .dd-mark { width: 34px; height: 34px; }
.dd-opt .dd-mark .ico { width: 16px; height: 16px; }
.dd-opt-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }
.dd-opt-text > span { font-weight: 600; }
.dd-opt-text small { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dd-check { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent); opacity: 0; }
.dd-opt[aria-selected="true"] .dd-check { opacity: 1; }
.dd-sep { height: 1px; margin: 6px 10px; background: var(--line); }
.dd-group { padding: 8px 10px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* phones: the menu becomes a bottom sheet */
.dd-backdrop { position: fixed; inset: 0; z-index: 69; background: rgba(0, 20, 10, .5); animation: fade .2s; }
.dd-menu.sheet {
  left: 0; right: 0; bottom: 0; max-height: 78vh; padding: 6px 12px calc(16px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; border-bottom: 0; animation: dd-sheet .28s var(--ease);
}
.dd-menu.sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 6px auto 4px; border-radius: 2px; background: var(--line-strong); }
.dd-menu.sheet .dd-head { display: block; padding: 10px 10px 8px; font: 700 1.3rem/1 var(--font-title); text-transform: uppercase; color: var(--heading); }
.dd-menu.sheet .dd-opt { min-height: 58px; }
@keyframes dd-sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .dd-menu, .dd-menu.sheet { animation: none; } }

/* ---------- top bar link ---------- */
.top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; font-weight: 600; font-size: .9rem; color: var(--ink); text-decoration: none; }
.top-link:hover { color: var(--accent); }
.top-link .ico { width: 16px; height: 16px; }
@media (max-width: 640px) { .top-link span { display: none; } }

/* ---------- market intelligence report ---------- */
.mi-report { padding: 0; overflow: hidden; }
.mi-report-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mi-report-head h3, .mi-report-head p { margin: 0; }
.mi-frame { display: block; width: 100%; height: min(78vh, 900px); border: 0; background: #fff; }
.mi-frame.full { height: 82vh; }
/* A report built around the screen (one-screen steps): fixed height, scrolls inside, as in full screen. */
.mi-frame.fixed-box { height: min(85vh, 1000px); height: min(85dvh, 1000px); }
.draft-flag { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius-lg); font-size: .9rem;
  background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.draft-flag > span { flex: 1; min-width: 200px; }
.draft-flag .ico { color: #a06d00; }

/* ---------- market intelligence edit mode ---------- */
.mi-editbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 14px 18px; margin-bottom: 28px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); }
.mi-editbar > div { display: grid; gap: 2px; }
.mi-editbar .btn .ico:last-child { opacity: .7; }
.ver-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ver-bar .dd { width: 260px; }
.ver-bar .dd-trigger { min-height: 48px; padding: 6px 12px; }
@media (max-width: 640px) { .ver-bar, .ver-bar .dd { width: 100%; } }

/* ---------- connect your agent ---------- */
.agent-connect { display: grid; gap: 14px; }
.agent-connect p { margin: 0; }
.agent-prompt { font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; min-height: 220px; }
.agent-h { margin: 8px 0 0; }
/* Key lifetime: a full-width choice of 7 / 30 / 90 / 180 days, with the expiry date beside its label. */
.key-life { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.key-life-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.key-life-label { font-weight: 600; }
.key-life-ctl { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); }
.key-life-ctl button { min-height: 40px; padding: 6px 4px; white-space: nowrap; }
.key-life-ctl button.on { background: var(--accent); color: var(--accent-ink); }
.agent-keys { display: grid; }
.agent-keys li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.agent-keys li span { flex: 1; }
.agent-keys code { font-size: .85rem; }

/* ---------- quick links ---------- */
.ql-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ql { display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s var(--ease); }
.ql:hover { border-color: var(--accent); transform: translateY(-2px); }
.ql-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.ql-ico .ico { width: 18px; height: 18px; }
.ql-text { display: grid; gap: 2px; min-width: 0; }
.ql-rows { display: grid; gap: 10px; }
.ql-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 8px; align-items: center; }
.ql-tools { display: flex; gap: 2px; }
.ql-up .ico { transform: rotate(180deg); }
.ql-row:first-child .ql-up, .ql-row:last-child [data-ql-move="1"] { opacity: .35; }
@media (max-width: 640px) { .ql-row { grid-template-columns: 1fr auto; padding-bottom: 10px; border-bottom: 1px solid var(--line); } .ql-row input[name=url], .ql-row input[name=note] { grid-column: 1; } .ql-tools { grid-row: 1; grid-column: 2; } }

/* ---------- full-screen modal for embedded dashboards ---------- */
.modal.full { width: min(1600px, 100%); height: calc(100vh - 32px); max-height: none; display: flex; flex-direction: column; }
.modal.full .modal-body { flex: 1; padding: 0; overflow: hidden; }
.dash-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
.mi-report-head .btn { flex: 0 0 auto; white-space: nowrap; }

/* ---------- news ---------- */
.lead-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lead-img .pinned { z-index: 1; }
.news-summary { margin: 0; color: var(--muted); font-size: .95rem; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.news-form-row { display: grid; gap: 14px; }
.news-kind { justify-self: start; }
.news-form[data-kind="link"] .kind-html, .news-form[data-kind="html"] .kind-link { display: none; }
button.news-read { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
button.news-title { font: inherit; font-weight: 600; }
@media (min-width: 520px) { .news-form-row { grid-template-columns: 1.4fr 1fr; } }
.photo-field { display: grid; gap: 8px; justify-items: start; }
.photo-field > *:not(.photo-link-toggle) { width: 100%; }
.photo-field [hidden] { display: none; }
.photo-label { display: grid; gap: 7px; font-weight: 600; font-size: .9rem; }
.photo-box .btn-row { margin-top: 10px; }
.photo-drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; font-weight: 400;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.photo-drop:hover, .photo-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.photo-drop:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.photo-drop > .ico { width: 30px; height: 30px; color: var(--accent); }
.photo-drop strong { font-size: 1.02rem; color: var(--accent); }
.photo-drop.busy { cursor: progress; border-style: solid; }
.btn:has(.sr-only:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Same height and crop as the top story's photo, so staff see what board members will see. */
.photo-preview { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.photo-preview img { display: block; width: 100%; height: 230px; object-fit: cover; }
.photo-preview.broken img { display: none; }
.photo-preview.broken::after { content: "This photo couldn't be loaded. Check the link, or upload a photo instead."; display: block; padding: 28px 16px; text-align: center; color: var(--bad); font-size: .9rem; }
.news-thumb { flex: 0 0 auto; width: 96px; height: 64px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
@media (max-width: 520px) { .news-thumb { width: 72px; height: 52px; } }
.seg-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg-field legend { font-weight: 600; font-size: .9rem; margin-bottom: 7px; padding: 0; }
.seg-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 500; font-size: .88rem; cursor: pointer; background: var(--surface); }
.seg-check input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.seg-check i { width: 9px; height: 9px; border-radius: 50%; }
.seg-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mi-editbar .btn-row { margin-top: 0; }

/* ---------- budget charts ---------- */
.stackchart .stack-seg { transition: opacity .15s; cursor: default; }
.stackchart .stack-col:hover .stack-seg { opacity: .55; }
.stackchart .stack-col:hover .stack-seg:hover { opacity: 1; }
.chip-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.chip-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chip-legend .swatch { width: 10px; height: 10px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table th, .table-wrap .table td { white-space: nowrap; }
/* Program budget: long work group names wrap onto two lines instead of widening their columns. */
.table-wrap .budget-table th { white-space: normal; vertical-align: bottom; min-width: 72px; max-width: 120px; line-height: 1.3; }
.donut-wrap { display: grid; gap: 16px; align-items: center; }
@media (min-width: 560px) { .donut-wrap { grid-template-columns: 200px 1fr; } }
.donut { width: 200px; height: 200px; margin: 0 auto; display: block; overflow: visible; }
.donut-seg { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; }
.donut-seg.dim { opacity: .28; }
.donut-seg:hover { opacity: 1; filter: brightness(1.08); }
.donut-total { font: 700 26px var(--font-title); fill: var(--ink); }
.donut-sub { font: 500 11px var(--font-sans); fill: var(--muted); }
.donut-wrap .legend li { grid-template-columns: 12px 1fr 40px 62px; }

/* ---------- investment list ---------- */
/* The list uses the full width of the screen, with its own toolbar above a scrolling table. */
.wrap.wide { max-width: none; }
.content.wide { padding-top: 16px; }
.plist-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0 16px; margin-bottom: 8px; }
.plist-head .back-link { margin: 0; }
.plist-head h2 { margin: 0; }
.plist-head-actions { display: flex; gap: 8px; margin-left: auto; }
.plist-head-actions .ico { width: 16px; height: 16px; }
/* Full screen: the page itself doesn't scroll. The toolbar stays at the top, the pager at the
   bottom, and only the table (or list) scrolls in between. */
.content.full { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-top: 12px; padding-bottom: 12px; overflow: hidden; }
.content.full > * { flex: 0 0 auto; }
.content.full .plist-head { margin-bottom: 6px; }
.content.full .plist-bar { margin-bottom: 10px; }
.content.full .plist-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.content.full .plist-body > .inv-table-wrap, .content.full .plist-body > .proj-list { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.content.full .pager { margin-top: 10px; }
.content.full .source { display: none; }
.plist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.plist-bar .list-search { flex: 1 1 360px; margin: 0; }
.list-search .field input { min-height: 48px; }
.list-search .field.has-btn input { padding-right: 48px; }
.list-search input::-webkit-search-cancel-button { display: none; }
.plist-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.plist-actions .dd { width: 230px; min-width: 0; }
.plist-actions .seg-ctl { align-self: stretch; }
.plist-actions .seg-ctl button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.plist-actions .seg-ctl .ico { width: 15px; height: 15px; }
.plist-btn { padding: 0 16px; }
.plist-btn .ico { width: 17px; height: 17px; }
.plist-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .plist-actions { width: 100%; } .plist-actions > * { flex: 1; } .plist-actions .dd { width: auto; } }
.dd-sm .dd-trigger { min-height: 46px; padding: 5px 10px 5px 12px; gap: 8px; border-radius: 10px; }
.dd-sm .dd-opt { min-height: 46px; }
.plist-count { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .92rem; }
.plist-count > strong { margin-right: 4px; font-variant-numeric: tabular-nums; }
.plist-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.plist-note .ico { width: 16px; height: 16px; flex: 0 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--ink); font: 500 .82rem var(--font-sans); cursor: pointer; }
.pill:hover { border-color: var(--accent); }
.pill .ico { width: 14px; height: 14px; color: var(--muted); }
.plist-body { transition: opacity .15s; }
.plist-body.busy { opacity: .5; pointer-events: none; }
.pg-info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }

/* Filter panel: slides in from the right; full width on phones. */
body.no-scroll { overflow: hidden; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0, 20, 10, .4); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 56; display: flex; flex-direction: column; width: min(380px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); }
.drawer.enter { animation: slide-in .22s var(--ease); }
.drawer-backdrop.enter { animation: fade .2s; }
@keyframes slide-in { from { opacity: 0; transform: translateX(32px); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 4px 20px 16px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.fp-sec { padding: 14px 0 8px; border-bottom: 1px solid var(--line); }
.fp-sec:last-child { border-bottom: 0; }
.fp-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.fp-title h3 { margin: 0; font: 700 .74rem var(--font-sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fp-opt { min-height: 40px; font-weight: 400; font-size: .92rem; cursor: pointer; }
.fp-opt input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; }
.fp-opt span { flex: 1; min-width: 0; }
.fp-opt small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Column picker */
.col-pick { position: relative; }
.col-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; max-height: min(480px, 70vh); overflow: auto; padding: 8px 14px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.col-menu .fp-opt { min-height: 36px; }
@media (max-width: 640px) { .col-menu { right: auto; left: 0; } }

/* Table: scrolls inside its own box, with the header and the investment column kept in view. */
/* Shorter than the window, with a strip on the right on wider screens, so the page can still be
   scrolled past the list (Full screen gives it the whole window). */
.inv-table-wrap { overflow: auto; max-height: calc(100vh - 220px); padding: 0; }
@media (min-width: 900px) { .content:not(.full) .plist-body > .inv-table-wrap { margin-right: 48px; } }
.health-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; font-size: .78rem; color: var(--muted); }
.health-legend span { display: inline-flex; align-items: center; gap: 5px; }
.health-legend b { color: var(--ink, inherit); font-weight: 600; }
.hl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.hl-dot.on { background: #16a34a; } .hl-dot.risk { background: #eab308; } .hl-dot.off { background: #dc2626; } .hl-dot.gray { background: #9ca3af; }
.hh-info { display: inline-flex; vertical-align: middle; margin-left: 4px; cursor: help; opacity: .8; }
.hh-info .ico { width: 13px; height: 13px; }
.inv-table-wrap:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.inv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.inv-table th { position: sticky; top: 0; z-index: 2; padding: 0; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.inv-table th button, .inv-table .th-label { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 42px; padding: 0 12px; background: none; border: 0; font: 700 .72rem var(--font-sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: pointer; }
.inv-table .th-label { cursor: default; }
.inv-table th button:hover, .inv-table th[aria-sort] button { color: var(--ink); }
.inv-table th.num button { justify-content: flex-end; }
.sort-ico { width: 14px; height: 14px; opacity: .45; }
.sort-ico.asc, .sort-ico.desc { opacity: 1; color: var(--accent); }
.sort-ico.asc { transform: rotate(180deg); }
.inv-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; background: var(--surface); }
.inv-table tbody tr:last-child td { border-bottom: 0; }
.inv-table tbody tr { cursor: pointer; }
.inv-table tbody tr:hover td { background: var(--surface-2); }
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table .c-title { position: sticky; left: 0; z-index: 1; min-width: 240px; max-width: 340px; white-space: normal; box-shadow: inset -1px 0 0 var(--line); }
.inv-table th.c-title { z-index: 3; }
@media (max-width: 640px) { .inv-table .c-title { position: static; } }
.inv-table .c-work_group .tag { white-space: nowrap; }
.inv-table .clip { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.inv-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0; background: none; border: 0; font: 600 .9rem/1.35 var(--font-sans); color: var(--ink); text-align: left; cursor: pointer; }
.inv-title:hover { color: var(--accent); text-decoration: underline; }
.dash-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.dash-link:hover { color: var(--accent-hover); text-decoration: underline; }
.dash-link .ico { width: 13px; height: 13px; }
.proj-list li { display: flex; align-items: center; }
.proj-list li .proj { flex: 1; min-width: 0; }
.proj-list li > .dash-link { min-height: 44px; padding: 0 20px 0 4px; }
.status.none { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.pg-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.pg:hover { border-color: var(--accent); color: var(--accent); }
.pg.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pg .ico { width: 14px; height: 14px; }
.pg.prev .ico { transform: rotate(180deg); }
.pg-gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 480px) { .pg.prev span, .pg.next span { display: none; } }
.inv-detail { display: grid; gap: 0; margin: 0; }
.inv-detail > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.inv-detail > div:first-child { border-top: 0; }
.inv-detail dt { color: var(--muted); font-size: .86rem; }
.inv-detail dd { margin: 0; }
@media (max-width: 480px) { .inv-detail > div { grid-template-columns: 1fr; gap: 2px; } }
.status.gray { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, var(--surface)); }

/* ---------- investment detail ---------- */
.inv-view { display: grid; gap: 18px; }
.inv-summary { margin: 0; line-height: 1.6; white-space: pre-line; }
.inv-sec h4 { margin: 0 0 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.inv-text { margin: 0; white-space: pre-line; line-height: 1.55; }
.inv-text.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.modal.results-modal { width: min(980px, 100%); }
.res-status { margin: 0 0 14px; }
.results { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.res-main, .res-docs { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.res-block { padding: 14px 16px; min-width: 0; }
.res-block + .res-block { border-top: 1px solid var(--line); }
.res-block h4 { margin: 0 0 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.res-empty { margin: 0; color: var(--muted); font-size: .9rem; font-style: italic; }
@media (max-width: 720px) { .results { grid-template-columns: 1fr; } }
.inv-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-link { display: inline-flex; align-items: flex-start; gap: 8px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-align: left; text-decoration: none; cursor: pointer; overflow-wrap: anywhere; }
.doc-link .ico { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.doc-link:hover span { text-decoration: underline; }
button.dash-link { background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.spend-bar { display: block; height: 6px; margin-top: 6px; max-width: 260px; border-radius: 3px; background: var(--line); overflow: hidden; }
.spend-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.inv-deliverables { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.inv-deliverables li { padding-left: 4px; }
.inv-deliverables li span + span { margin-left: 8px; font-size: .86rem; }

/* Strategy tab: nothing published yet. */
.plan-soon { padding: 40px 16px; }
.plan-soon p { margin: 2px 0; }

/* A work group's A&E ad-hoc evaluations, below its search. */
.ae-mini-list { display: grid; gap: 10px; margin: 0 0 28px; }

/* MarketView dashboards under the market reports. */
.mv-sec { margin-top: 28px; }
.mv-sec:first-child { margin-top: 0; }
.mv-sec + .mi-after { margin-top: 36px; }
.mv-card { margin-bottom: 18px; }
.mv-frame { display: block; width: 100%; height: min(80vh, 780px); border: 0; background: #fff; }
.mv-row { grid-template-columns: 1fr 1.6fr auto; }
@media (max-width: 640px) { .mv-row { grid-template-columns: 1fr auto; } .mv-row input[name=url] { grid-column: 1; } }

/* ---------- work group contacts ---------- */
.contacts-card { margin-top: 22px; }
.contacts-card h3 { margin-bottom: 12px; }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.contact { display: grid; gap: 2px; }
.contact strong { font-size: 1.05rem; }
.contact a { overflow-wrap: anywhere; }

/* ---------- QSSB research database (#/qssb) ---------- */
/* Laid out like the investment list; these are the few things it adds. */
.qssb .plist-bar { margin-top: 4px; }
.qssb-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.qssb-list-rows .proj-main { display: grid; gap: 6px; }
.qssb-list-rows .proj-meta .status { padding: 2px 8px; }
.tag.usb { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.qssb .inv-table-wrap { width: 100%; max-width: none; }
.qssb-table { width: 100%; }
.qssb-table .c-title { min-width: 220px; max-width: 320px; }
/* Names wrap rather than clip, so the table fits beside the title without sideways scrolling. */
.qssb-table td.c-funder, .qssb-table td.c-organization, .qssb-table td.c-priority_area { white-space: normal; min-width: 130px; max-width: 180px; }
.qssb-table td.c-funder .clip, .qssb-table td.c-organization .clip, .qssb-table td.c-priority_area .clip { white-space: normal; overflow: visible; display: inline; }
.qssb-table .c-docs { white-space: nowrap; }
.qssb-table .c-docs .ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.qssb-fy .fp-rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.hero h1.qssb-h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.qssb-step { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: -6px 0 6px; }
.qssb-step .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.icon-btn .ico.back { transform: rotate(180deg); }
