/*
 * GLORi design system — extracted from docs/design/experiences-mockup.html
 * (founder-approved) per docs/design/design-tokens.md.
 *
 * This is the CANONICAL, organized build of that mockup's inline <style>
 * block. When this file and the mockup disagree on a value, the mockup's
 * <style> block wins — this file should be re-synced from it, not guessed.
 *
 * No CSS framework, no build step (matches the "no SPA/build" stack
 * decision). Served by FastAPI StaticFiles at /static/glori.css on both the
 * public and operator apps.
 *
 * Sections:
 *   1. Tokens (light + dark themes, three resolution layers)
 *   2. Base / reset
 *   3. Watermark (g -> G)
 *   4. Top bar + brand + segmented control
 *   5. Verse strip
 *   6. Shell layout (sidebar + main)
 *   7. Sidebar nav
 *   8. Page head / views
 *   9. Grid utilities
 *  10. Card + stat
 *  11. Section title
 *  12. Chips
 *  13. Table
 *  14. Pledged/Funded bar
 *  15. Fund tag
 *  16. Buttons
 *  17. Approval step tracker
 *  18. Forms (incl. attestation + commitment readout)
 *  19. Banner / callout
 *  20. Export bar / impact report headers
 *  21. Global-impact hero
 *  22. Help launcher
 *  23. Toast
 *  24. Responsive rules
 *  25. Accessibility (focus, reduced motion)
 */

/* =========================================================================
   1. Tokens
   ========================================================================= */

:root {
  /* -- surfaces / text / lines (light, default) -- */
  --paper: #F5F2EA;
  --surface: #FFFFFF;
  --surface-2: #FBF9F3;
  --ink: #1B2530;
  --ink-soft: #4E5866;
  --ink-faint: #8A92A0;
  --line: #E7E2D6;
  --line-strong: #D6CFC0;

  /* -- brand -- */
  --navy: #26333E;
  --navy-soft: #3A4A58;
  --navy-tint: #EAEDF0;
  --gold: #C4922E;
  --gold-bright: #E0B24E;
  --gold-tint: #F6EDD7;

  /* -- semantic state colors -- */
  --good: #2C6E4E;
  --good-tint: #E2EFE7;
  --pending: #9A6410;
  --pending-tint: #F6ECD8;
  --blocked: #A5303F;
  --blocked-tint: #F6E1E1;
  --draft: #6A7180;
  --draft-tint: #EDEBE4;

  /* -- shape -- */
  --radius: 12px;
  --radius-sm: 8px;

  /* -- type -- */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* -- elevation -- */
  --shadow: 0 1px 2px rgba(27, 37, 48, .05), 0 10px 26px -14px rgba(27, 37, 48, .16);
}

/* OS-default dark theme (no explicit choice stored) */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F141B;
    --surface: #161C25;
    --surface-2: #1B222C;
    --ink: #ECEAE2;
    --ink-soft: #A6ADBB;
    --ink-faint: #727A88;
    --line: #28303B;
    --line-strong: #343D49;
    --navy: #AFC0D0;
    --navy-soft: #8B9DAE;
    --navy-tint: #1A222C;
    --gold: #E0B24E;
    --gold-bright: #EFC66E;
    --gold-tint: #2A2413;
    --good: #5CBA8B;
    --good-tint: #15271E;
    --pending: #D6A44A;
    --pending-tint: #2A2312;
    --blocked: #E0798A;
    --blocked-tint: #2C1820;
    --draft: #9AA2B0;
    --draft-tint: #20262F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -16px rgba(0, 0, 0, .65);
  }
}

/* Explicit theme-toggle overrides (persisted; base.html sets data-theme
   before first paint to avoid a flash). Highest-priority resolution layer. */
:root[data-theme="light"] {
  --paper: #F5F2EA;
  --surface: #FFFFFF;
  --surface-2: #FBF9F3;
  --ink: #1B2530;
  --ink-soft: #4E5866;
  --ink-faint: #8A92A0;
  --line: #E7E2D6;
  --line-strong: #D6CFC0;
  --navy: #26333E;
  --navy-soft: #3A4A58;
  --navy-tint: #EAEDF0;
  --gold: #C4922E;
  --gold-bright: #E0B24E;
  --gold-tint: #F6EDD7;
  --good: #2C6E4E;
  --good-tint: #E2EFE7;
  --pending: #9A6410;
  --pending-tint: #F6ECD8;
  --blocked: #A5303F;
  --blocked-tint: #F6E1E1;
  --draft: #6A7180;
  --draft-tint: #EDEBE4;
  --shadow: 0 1px 2px rgba(27, 37, 48, .05), 0 10px 26px -14px rgba(27, 37, 48, .16);
}

:root[data-theme="dark"] {
  --paper: #0F141B;
  --surface: #161C25;
  --surface-2: #1B222C;
  --ink: #ECEAE2;
  --ink-soft: #A6ADBB;
  --ink-faint: #727A88;
  --line: #28303B;
  --line-strong: #343D49;
  --navy: #AFC0D0;
  --navy-soft: #8B9DAE;
  --navy-tint: #1A222C;
  --gold: #E0B24E;
  --gold-bright: #EFC66E;
  --gold-tint: #2A2413;
  --good: #5CBA8B;
  --good-tint: #15271E;
  --pending: #D6A44A;
  --pending-tint: #2A2312;
  --blocked: #E0798A;
  --blocked-tint: #2C1820;
  --draft: #9AA2B0;
  --draft-tint: #20262F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -16px rgba(0, 0, 0, .65);
}

/* =========================================================================
   2. Base / reset
   ========================================================================= */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

/* money / unit figures are always tabular monospace */
.mono, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* =========================================================================
   3. Watermark (faint g -> G mission mark, behind all content)
   ========================================================================= */

body::before {
  content: "g \2192 G";
  position: fixed;
  right: -2vw;
  bottom: -4vh;
  font-family: var(--serif);
  font-size: 44vh;
  line-height: 1;
  color: var(--navy);
  opacity: .028;
  pointer-events: none;
  z-index: 0;
  font-style: italic;
}

:root[data-theme="dark"] body::before { opacity: .045; }
@media (prefers-color-scheme: dark) { body::before { opacity: .045; } }

/* =========================================================================
   4. Top bar + brand + segmented control
   ========================================================================= */

/* The GLORi brand bar is ALWAYS navy in both themes (a constant brand surface),
   carrying the white "GLOR" + gold "i"-with-sun logo on a transparent ground. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  height: 66px;
  background: #1E2A38;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand { display: flex; align-items: center; gap: 16px; }
/* White GLOR + gold i show directly on the navy bar — larger, no plate, no filter. */
.brand img { height: 36px; display: block; }

.brand .tag {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, .18);
  font-style: italic;
}

/* Experience segmented control (Ministry Portal / Foundation Console) */
.seg {
  display: flex;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 3px;
  margin: 0 auto;
}

.seg button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
}

.seg button[aria-selected="true"] { background: var(--gold-bright); color: #26333E; }

.userchip { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.env-note { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }

/* Portal identity label — clear "which side am I on" header mark, shown in
   the top bar on both the Ministry Portal and the Foundation Portal. */
.portal-label {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-bright, #E9C46A);
}

/* Logged-in staff identity chip (Foundation Portal top bar). */
.userinfo { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.userinfo .uname { font-weight: 600; color: rgba(255, 255, 255, .9); }
.userinfo .uemail { font-size: 11px; color: rgba(255, 255, 255, .55); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--serif);
}

/* =========================================================================
   5. Verse strip
   ========================================================================= */

.verse {
  background: var(--navy);
  color: #EDE7D6;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  font-style: italic;
  font-family: var(--serif);
  letter-spacing: .2px;
}

.verse b {
  color: var(--gold-bright);
  font-style: normal;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-left: 8px;
}

:root[data-theme="dark"] .verse { background: #0B0F16; }
@media (prefers-color-scheme: dark) { .verse { background: #0B0F16; } }

/* =========================================================================
   6. Shell layout
   ========================================================================= */

.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 104px);
  position: relative;
  z-index: 1;
}

main { padding: 30px 34px 80px; max-width: 1080px; }

/* The My Needs management table needs more room than main's default
   reading-width cap (8 columns + the Edit/Pause/Retire row actions). Widen
   only the page that actually carries it (via :has), so every action button
   shows in full on a normal desktop without horizontal scrolling; the
   `.tbl-wrap` overflow-x below stays the graceful narrow-viewport fallback. */
main:has(#needs-table-wrap) { max-width: 1320px; }

/* =========================================================================
   7. Sidebar nav
   ========================================================================= */

.side { border-right: 1px solid var(--line); padding: 20px 14px; background: var(--surface-2); }

.who { padding: 4px 10px 15px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.who .role { font-size: 11px; letter-spacing: .11em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.who .name { font-family: var(--serif); font-size: 17px; margin-top: 3px; line-height: 1.2; }
.who .sub { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }

.nav button, .nav a {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav button:hover, .nav a:hover { background: var(--navy-tint); color: var(--ink); }
.nav button[aria-current="true"], .nav a[aria-current="true"] { background: var(--navy-tint); color: var(--ink); font-weight: 600; }
.nav button[aria-current="true"] .dot, .nav a[aria-current="true"] .dot { background: var(--gold); }

.nav .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); flex: none; }

.nav .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--blocked);
  color: #fff;
  padding: 1px 7px;
  border-radius: 999px;
}

.side .foot {
  margin-top: 22px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
}

/* =========================================================================
   8. Page head / views
   ========================================================================= */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.page-head h1 { font-family: var(--serif); font-size: 27px; margin-top: 5px; letter-spacing: .2px; }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 58ch; }

.view { display: none; }
.view.active { display: block; animation: glori-fade .24s ease; }

@keyframes glori-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

/* =========================================================================
   9. Grid utilities
   ========================================================================= */

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 2fr 1fr; }

/* =========================================================================
   10. Card + stat
   ========================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad { padding: 18px 20px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat .k { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.stat .v { font-family: var(--serif); font-size: 29px; margin-top: 8px; letter-spacing: .3px; }
.stat .v small { font-size: 14px; color: var(--ink-faint); font-family: var(--sans); }
.stat .foot { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }

.stat.accent { background: linear-gradient(155deg, var(--navy), var(--navy-soft)); color: #fff; border-color: transparent; }
.stat.accent .k, .stat.accent .foot { color: rgba(255, 255, 255, .78); }
.stat.accent .v small { color: rgba(255, 255, 255, .72); }

.stat.gold { background: linear-gradient(155deg, var(--gold), var(--gold-bright)); color: #3a2b08; border-color: transparent; }
.stat.gold .k, .stat.gold .foot { color: rgba(58, 43, 8, .72); }

.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* =========================================================================
   11. Section title
   ========================================================================= */

.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 13px; }
.sec-title h2 { font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }

/* =========================================================================
   12. Chips
   ========================================================================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
}

.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }

.chip.good { color: var(--good); background: var(--good-tint); }
.chip.pending { color: var(--pending); background: var(--pending-tint); }
.chip.blocked { color: var(--blocked); background: var(--blocked-tint); }
.chip.neutral { color: var(--ink-soft); background: var(--navy-tint); }
.chip.gold { color: var(--gold); background: var(--gold-tint); }
.chip.draft { color: var(--draft); background: var(--draft-tint); }
.chip.plain::before { display: none; }

/* =========================================================================
   13. Table
   ========================================================================= */

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 660px; }

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

.drilldown { display: none; }
.drilldown.open { display: table-row; }
.drilldown td { font-size: 13px; color: var(--ink-soft); }
.drilldown:hover { background: var(--surface-2); }

/* Need-title cell — a sensible minimum so the title sits on 1–2 lines
   instead of wrapping to three narrow lines when the numeric/action columns
   crowd it. */
.m-name { font-weight: 600; min-width: 140px; }
.m-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

/* Numeric columns (Unit / Cap / Commitment) shrink to their content and
   never wrap, freeing horizontal room for the title + action columns. */
td.mono { white-space: nowrap; width: 1%; }

/* Row actions never wrap and never shrink their buttons (so "Retire" is
   shown in full); when space is truly tight, `.tbl-wrap` scrolls instead. */
.rowacts { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.rowacts > * { flex: none; }

/* The My Needs management table carries the most columns (numeric + a wide
   actions column); give it enough room that `.tbl-wrap` scrolls cleanly on
   narrow viewports rather than clipping the last action button. */
#needs-table-wrap table { min-width: 820px; }

/* =========================================================================
   14. Pledged / Funded bar (two-tone, never blended)
   ========================================================================= */

.pf { min-width: 158px; }
.pf .bar { height: 8px; border-radius: 6px; background: var(--navy-tint); overflow: hidden; display: flex; }
.pf .funded { background: var(--good); }
.pf .pledged { background: var(--gold); }
.pf .lg { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); margin-top: 5px; }
.pf .lg b { color: var(--ink); font-weight: 600; }

/* =========================================================================
   15. Fund tag
   ========================================================================= */

.fund { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.fund .fd { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* =========================================================================
   16. Buttons
   ========================================================================= */

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.btn:hover { border-color: var(--navy-soft); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-soft); }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.gold:hover { background: var(--gold-bright); color: #3a2b08; }
.btn.danger { color: var(--blocked); border-color: var(--blocked); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Google Sign-In (M7 Phase 3, WS-G): a full-width "Continue with Google"
   button + an "or" divider under the password form on auth/login.html. */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-google {
  justify-content: center;
  width: 100%;
}

/* =========================================================================
   17. Approval step tracker
   ========================================================================= */

.apr {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.apr .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.apr .top h4 { font-size: 15.5px; }
.apr .top .meta { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

.steps { display: flex; align-items: flex-start; gap: 0; }
.steps .st { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--ink-faint); }
.steps .st::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.steps .st:first-child::before { display: none; }

.steps .st .node {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  font-size: 11px;
  position: relative;
  z-index: 1;
  color: var(--ink-faint);
}

.steps .st.done .node { background: var(--good); border-color: var(--good); color: #fff; }
.steps .st.done::before { background: var(--good); }
.steps .st.now .node { border-color: var(--gold); color: var(--gold); background: var(--gold-tint); }
.steps .st.done, .steps .st.now { color: var(--ink); }
.steps .st.stuck .node { border-color: var(--blocked); color: var(--blocked); background: var(--blocked-tint); }
.steps .st.stuck { color: var(--blocked); }

.apr .help { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line-strong); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.apr .help .lbl { font-size: 12.5px; color: var(--ink-soft); margin-right: auto; }

/* =========================================================================
   18. Forms
   ========================================================================= */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
/* `display:flex` above otherwise overrides the `hidden` attribute — restore
   it so JS-toggled fields (e.g. the disbursements period sub-pickers) hide. */
.field[hidden] { display: none; }

label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
label .req { color: var(--blocked); }

/* Standalone field label (a radiogroup caption, not a real <label for>). */
.field .lab { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

/* Inline radio group (e.g. the disbursements period-mode picker). */
.radio-row { display: flex; gap: 14px; align-items: center; padding: 9px 0; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.radio-row input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  accent-color: var(--gold);
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 0;
  border-color: var(--gold);
}

.hint { font-size: 12px; color: var(--ink-faint); }

/* raw-cost attestation checkbox */
.attest {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}

.attest input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--gold); }
.attest label { font-weight: 500; color: var(--ink); font-size: 13.5px; }

/* live capped-commitment readout (qty x unit cost) */
.commit {
  background: var(--gold-tint);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.commit .lab { font-size: 12.5px; color: var(--gold); font-weight: 700; }
.commit .amt { font-family: var(--serif); font-size: 22px; }

/* =========================================================================
   19. Banner / callout
   ========================================================================= */

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.banner.warn { background: var(--blocked-tint); border: 1px solid var(--blocked); }
.banner .bi { font-size: 18px; }
.banner h4 { font-size: 14px; color: var(--blocked); }
.banner p { margin: 3px 0 0; font-size: 13px; color: var(--ink-soft); }

.callout { font-size: 12.5px; color: var(--ink-faint); border-top: 1px dashed var(--line-strong); margin-top: 34px; padding-top: 16px; }
.callout b { color: var(--ink-soft); }

/* =========================================================================
   20. Export bar / impact report headers
   ========================================================================= */

.exportbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 15px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.exportbar .lbl { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-right: auto; }

.yr { font-family: var(--serif); font-size: 20px; margin: 22px 0 10px; display: flex; align-items: center; gap: 12px; }
.yr .tot { font-size: 13px; color: var(--ink-faint); font-family: var(--sans); }

/* =========================================================================
   21. Global-impact hero
   ========================================================================= */

.impact-hero {
  background: linear-gradient(155deg, var(--navy), #1a2530);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.impact-hero .sun {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright), transparent 65%);
  opacity: .5;
}

.impact-hero .eye { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); font-weight: 700; }
.impact-hero h2 { font-family: var(--serif); font-size: 24px; margin: 6px 0 3px; position: relative; }
.impact-hero p { color: rgba(255, 255, 255, .72); font-size: 13.5px; max-width: 52ch; position: relative; }

.impact-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 22px; position: relative; }
.impact-nums .n { border-left: 2px solid var(--gold); padding-left: 12px; }
.impact-nums .n .big { font-family: var(--serif); font-size: 26px; }
.impact-nums .n .lab { font-size: 12px; color: rgba(255, 255, 255, .7); margin-top: 2px; }

/* =========================================================================
   22. Help launcher (+ request-a-call)
   ========================================================================= */

.help-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  background: var(--gold);
  color: #3a2b08;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 24px -8px rgba(196, 146, 46, .6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-fab:hover { background: var(--gold-bright); }

.help-panel {
  position: fixed;
  right: 22px;
  bottom: 74px;
  z-index: 41;
  width: 320px;
  max-width: calc(100vw - 44px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .4);
  overflow: hidden;
  display: none;
}

.help-panel.open { display: block; }
.help-panel .hh { background: var(--navy); color: #fff; padding: 14px 16px; }
.help-panel .hh .t { font-family: var(--serif); font-size: 16px; }
.help-panel .hh .s { font-size: 12px; color: rgba(255, 255, 255, .7); margin-top: 2px; }
.help-panel .hb { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.help-panel .msg { background: var(--navy-tint); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink); }

.help-panel .opt {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  gap: 9px;
  align-items: center;
}

.help-panel .opt:hover { border-color: var(--gold); background: var(--gold-tint); }

/* =========================================================================
   23. Toast
   ========================================================================= */

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #F5F2EA;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  z-index: 60;
  display: flex;
  gap: 9px;
  align-items: center;
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast .tk { color: var(--gold-bright); font-weight: 800; font-style: italic; font-family: var(--serif); }

/* Idle-session near-expiry warning (partials/session_timeout.html) — an
   unobtrusive corner banner shared by both authenticated portals. */
#session-timeout-warn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}
#session-timeout-warn[hidden] { display: none; }
#session-timeout-warn .stw-body { display: flex; flex-direction: column; gap: 3px; }
#session-timeout-warn .stw-body span { color: var(--ink-soft); }
#session-timeout-warn .stw-acts { display: flex; gap: 8px; }

/* flash-message region (server-rendered, session-backed one-shot messages) */
.flash-region { padding: 0; }
.flash {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  margin: 14px 34px 0;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.flash.info { background: var(--navy-tint); color: var(--ink); border: 1px solid var(--line-strong); }
.flash.success { background: var(--good-tint); color: var(--good); border: 1px solid var(--good); }
.flash.warn, .flash.error { background: var(--blocked-tint); color: var(--blocked); border: 1px solid var(--blocked); }

/* =========================================================================
   24. Responsive rules
   ========================================================================= */

@media (max-width: 860px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
}

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .impact-nums { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   25. Accessibility
   ========================================================================= */

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
