/* ============================================================================
   CivicHold — State Property Claims Service
   Design system v2 — restrained institutional theme (light + dark)
   Tokens: neutral greys + single navy accent. Spacing on a 4/8px scale.
   Type: system stack, weights capped at 600. No gradients. No zebra tables.
   ========================================================================== */

:root {
  color-scheme: light;
  /* surfaces */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --line: #dfe5ec;
  --line-strong: #c8d2dd;
  /* text */
  --ink: #182430;
  --muted: #5c6b7a;
  /* single accent */
  --accent: #1d4e79;
  --accent-hover: #163c5e;
  --accent-soft: #e9eff6;
  --on-accent: #ffffff;
  --row-hover: #f2f6fa;
  /* semantic status only */
  --success: #1e6b3c;      --success-soft: #e3f0e8;
  --danger:  #a13a3a;      --danger-soft:  #f8eaea;
  --warn:    #8a5a12;      --warn-soft:    #f8f0dd;
  --neutral-soft: #e8edf2;
  /* chrome */
  --header-bg: #ffffff;
  --banner-bg: #0f2a4a;
  --banner-ink: #d5e1ee;
  --footer-bg: #0f1d2e;
  --footer-ink: #c4d1df;
  --flag-border: rgba(16, 29, 46, .16);
  --shadow: 0 1px 2px rgba(16, 29, 46, .05), 0 1px 3px rgba(16, 29, 46, .07);
  /* spacing scale (4/8) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 10px; --radius-sm: 7px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e141c;
  --surface: #151f2b;
  --surface-2: #1b2735;
  --line: #283545;
  --line-strong: #3b4b5f;
  --ink: #e6edf5;
  --muted: #9fadbd;
  --accent: #7fa9d1;
  --accent-hover: #93b7da;
  --accent-soft: rgba(127, 169, 209, .13);
  --on-accent: #0c141d;
  --row-hover: #1a2634;
  --success: #7cc39a;      --success-soft: rgba(60, 145, 95, .17);
  --danger:  #dba1a1;      --danger-soft:  rgba(178, 74, 74, .20);
  --warn:    #d9b878;      --warn-soft:    rgba(160, 112, 26, .18);
  --neutral-soft: #232f3e;
  --header-bg: #121b26;
  --banner-bg: #0a1420;
  --banner-ink: #b9c8d9;
  --footer-bg: #0a0f16;
  --footer-ink: #9dabb9;
  --flag-border: rgba(230, 237, 245, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.22; color: var(--ink); margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 16.5px; }
p { margin: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 300; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; text-decoration: none; }
.meta { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; margin-bottom: var(--s2); }

/* ---- Federal-style banner ---- */
.gov-banner { background: var(--banner-bg); color: var(--banner-ink); font-size: 13px; }
.gov-banner-inner { display: flex; align-items: center; gap: 10px; padding: 7px 0; flex-wrap: wrap; }
.gov-banner p { margin: 0; flex: 1; min-width: 240px; }
.gov-banner strong { color: var(--surface); font-weight: 600; }
.gov-banner a { color: var(--banner-ink); text-decoration: underline; }
.gov-seal { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px; background: var(--accent); border: 2px solid rgba(255, 255, 255, .55); }

/* ---- Header ---- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: var(--s3); min-height: 64px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; flex: 0 0 38px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.brand-text { line-height: 1.25; }
.brand-text strong { font-size: 16.5px; font-weight: 600; display: block; }
.brand-text small { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: var(--s4); font-size: 14px; }
.site-nav a { color: var(--muted); white-space: nowrap; font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.on { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 2px; }
.nav-cta { background: var(--accent); color: var(--on-accent) !important; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }
.theme-toggle, .menu-toggle {
  background: transparent; color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px;
}
.theme-toggle:hover, .menu-toggle:hover { color: var(--ink); border-color: var(--muted); }
.menu-toggle { display: none; border-radius: 8px; }
.drawer-close { display: none; }

/* ---- Hero ---- */
.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s6);
  padding: var(--s7) var(--s6); align-items: center; margin-top: var(--s5);
}
.hero .lead { color: var(--muted); font-size: 16.5px; margin: var(--s3) 0 var(--s5); max-width: 56ch; }
.hero-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero-media img { display: block; width: 100%; height: 300px; object-fit: cover; }
.hero.compact { grid-template-columns: auto 1fr; padding: var(--s5) var(--s5); gap: var(--s4); align-items: center; }
.hero.compact .hero-flag { width: 44px; height: auto; border-radius: 4px; outline: 1px solid var(--flag-border); }
.hero-search { display: flex; gap: var(--s2); }
.hero-search input {
  flex: 1; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 12px 14px; font: inherit; background: var(--bg); color: var(--ink);
}
.trust-row { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s4); color: var(--muted); font-size: 13px; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---- Buttons ---- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 10px 18px;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }

/* ---- Sections / cards ---- */
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 62ch; margin-top: var(--s1); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); margin-top: var(--s5); }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.metric-card strong { display: block; font-size: 27px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.metric-card span { color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- State grid ---- */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--s3); }
.state-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s4); display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 4px 12px; color: var(--ink);
}
.state-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.state-card .state-name { font-weight: 500; font-size: 14.5px; grid-column: 2; }
.state-card .state-code { grid-row: 1 / span 2; grid-column: 3; align-self: start; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 3px 7px; border-radius: 6px; }
.state-card .state-meta { grid-column: 2 / span 2; color: var(--muted); font-size: 12.5px; }

/* ---- Depth cards: livelier variant with a region accent + lift-on-hover ---- */
.depth-card {
  position: relative; overflow: hidden; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.depth-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--region-accent, var(--accent)); opacity: .85;
}
.depth-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(9, 20, 33, .14); }
.depth-card.region-northeast { --region-accent: #2f6fed; }
.depth-card.region-south { --region-accent: #d3862f; }
.depth-card.region-midwest { --region-accent: #2f9e6b; }
.depth-card.region-west { --region-accent: #a34fd6; }
.depth-card .state-code { transition: background .16s ease, color .16s ease; }
.depth-card:hover .state-code { background: var(--region-accent, var(--accent)); color: #fff; }
.state-count { margin: 4px 0 var(--s3); }
.region-filter { margin-bottom: var(--s3); }

.flag { width: 27px; height: auto; display: block; border-radius: 3px; outline: 1px solid var(--flag-border); }
.flag-fallback {
  width: 27px; height: 19px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  font-size: 8.5px; font-weight: 600; letter-spacing: .04em;
  border-radius: 3px; outline: 1px solid var(--flag-border);
}

/* ---- Toolbar / forms ---- */
.toolbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: var(--s5) 0 var(--s4); }
.toolbar input[type="search"], .toolbar select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px;
}
.toolbar input[type="search"] { flex: 1; min-width: 220px; }
label.field { display: block; }
label.field span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
label.field input, label.field select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px;
}

/* ---- Tables ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14.5px; }
thead th {
  position: sticky; top: 0; z-index: 2; text-align: left;
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  padding: 11px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink); }
thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
td.num, .amount-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-name { font-weight: 500; }
.cell-state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cell-state .flag { width: 22px; }
.cell-state .flag-fallback { width: 22px; height: 15px; font-size: 7.5px; }
td.actions { text-align: right; white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: var(--s6) var(--s4); }

/* ---- Badges / chips / pagination ---- */
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--neutral-soft); color: var(--ink);
}
.badge.submitted { background: var(--accent-soft); color: var(--accent); }
.badge.under_review, .badge.identity_pending, .badge.additional_info_requested, .badge.appealed { background: var(--warn-soft); color: var(--warn); }
.badge.approved, .badge.disbursed, .badge.matched { background: var(--success-soft); color: var(--success); }
.badge.denied { background: var(--danger-soft); color: var(--danger); }
.badge.closed, .badge.unclaimed { background: var(--neutral-soft); color: var(--muted); }
.chip-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s4) 0; }
.chip {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px;
  font-size: 13px; color: var(--muted); background: var(--surface);
}
.chip:hover { color: var(--ink); text-decoration: none; border-color: var(--muted); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.pagination { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s5) 0 var(--s3); }
.page-link {
  min-width: 34px; text-align: center; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 13.5px; background: var(--surface);
}
.page-link:hover { border-color: var(--accent); text-decoration: none; }
.page-link.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---- Timeline (claim status) ---- */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s3); margin: var(--s5) 0 var(--s2); }
.t-step { position: relative; padding-top: 26px; }
.t-step::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
.t-step:first-child::before { left: 12px; }
.t-step:last-child::before { right: auto; width: 24px; }
.t-step::after {
  content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong);
}
.t-step.done::before, .t-step.current::before { background: var(--accent); }
.t-step.done::after { background: var(--accent); border-color: var(--accent); }
.t-step.current::after { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--accent); }
.t-step strong { display: block; font-size: 13.5px; font-weight: 500; }
.t-step .meta { font-size: 12px; }

/* ---- Checklist ---- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-list li:last-child { border-bottom: 0; }
.check-list .ok { color: var(--success); font-weight: 600; }
.check-list .no { color: var(--danger); font-weight: 600; }

/* ---- Activity feed ---- */
.feed { list-style: none; margin: 0; padding: var(--s2) 0; }
.feed li { display: flex; gap: 12px; padding: 11px var(--s4); border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 7px; align-self: center; }
.feed .when { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---- Split feature ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center; }
.split .card img { width: 100%; height: 320px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.split .card figcaption { padding: var(--s4) var(--s5); color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); }

/* ---- Admin shell ---- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 0; flex: 1; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: var(--s5) var(--s4); }
.admin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s6); color: var(--ink); }
.admin-brand:hover { text-decoration: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: var(--muted); padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; }
.side-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.side-nav a.on { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.side-user { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.admin-main { padding: var(--s5) var(--s6) var(--s7); min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.admin-top input[type="search"] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; width: 280px; max-width: 100%; }

/* ---- Footer ---- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: var(--s8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s6); padding: var(--s7) 0 var(--s5); }
.site-footer h3 { color: var(--surface); font-size: 13px; letter-spacing: .07em; text-transform: uppercase; margin-bottom: var(--s3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--surface); }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .14); padding: var(--s4) 0 var(--s6); font-size: 12.5px; color: var(--footer-ink); }
.state-links { display: grid !important; grid-template-columns: repeat(6, auto); gap: 6px 12px !important; justify-content: start; }

/* ---- Chat widget ---- */
/* ---- Assistance desk chat widget (professional floating widget) ---- */
.agent-chat { position: fixed; right: 20px; bottom: 20px; z-index: 90; }
.agent-toggle {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 28px rgba(9, 20, 33, .28);
  display: grid; place-items: center; transition: transform .18s ease, background .18s ease;
}
.agent-toggle:hover { background: var(--accent-hover); transform: translateY(-2px); }
.agent-toggle-icon { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .18s ease, transform .18s ease; }
.agent-toggle-icon svg { width: 25px; height: 25px; }
.agent-icon-close { opacity: 0; transform: scale(.6) rotate(-45deg); }
.agent-chat.open .agent-icon-chat { opacity: 0; transform: scale(.6) rotate(45deg); }
.agent-chat.open .agent-icon-close { opacity: 1; transform: scale(1) rotate(0); }
.agent-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1;
}
.agent-panel {
  position: absolute; right: 0; bottom: 76px; width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 130px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(9, 20, 33, .28); overflow: hidden;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px) scale(.96); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  transform-origin: bottom right;
}
.agent-chat.open .agent-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.agent-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: var(--on-accent);
}
.agent-head .agent-avatar { background: rgba(255,255,255,.2); color: #fff; }
.agent-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.agent-head-text strong { font-size: 14.5px; }
.agent-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; opacity: .92; }
.agent-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #57d18a; box-shadow: 0 0 0 2px rgba(255,255,255,.25); flex: 0 0 7px; }
.agent-close {
  flex: 0 0 auto; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 50%;
  width: 28px; height: 28px; font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.agent-close:hover { background: rgba(255,255,255,.28); }
.agent-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 34px; letter-spacing: .02em;
}
.agent-log { flex: 1 1 auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; background: var(--bg); }
.agent-bubble { display: flex; gap: 8px; max-width: 92%; align-items: flex-end; }
.agent-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.agent-bubble-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.agent-bubble.user .agent-bubble-avatar { background: var(--accent); color: var(--on-accent); }
.agent-bubble.bot .agent-bubble-avatar { background: var(--accent-soft); color: var(--accent); }
.agent-bubble-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.agent-bubble-body p {
  margin: 0; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; border-radius: 14px 14px 14px 4px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.agent-bubble.user .agent-bubble-body p { background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.agent-bubble.bot .agent-bubble-body p { background: var(--accent-soft); border-color: transparent; }
.agent-bubble-note { font-size: 11.5px !important; color: var(--muted) !important; background: transparent !important; border: 0 !important; padding: 0 !important; margin-top: 2px !important; }
.agent-bubble-time { font-size: 10.5px; color: var(--muted); padding: 0 4px; }
.agent-bubble.user .agent-bubble-time { text-align: right; }
.agent-typing { flex: 0 0 auto; display: none; align-items: center; gap: 4px; padding: 0 16px 8px; }
.agent-typing[hidden] { display: none; }
.agent-typing:not([hidden]) { display: flex; }
.agent-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: agent-typing-bounce 1.1s infinite ease-in-out; }
.agent-typing span:nth-child(2) { animation-delay: .15s; }
.agent-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes agent-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
#agent-form { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); }
.agent-name-input {
  width: 100%; font: inherit; font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 10px; background: var(--bg); color: var(--ink); margin-bottom: 8px;
}
.agent-input-row { display: flex; align-items: flex-end; gap: 8px; }
.agent-input-row textarea {
  flex: 1; resize: none; font: inherit; font-size: 13.5px; line-height: 1.4; max-height: 96px;
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 9px 14px; background: var(--bg); color: var(--ink);
}
.agent-input-row textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.agent-send {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent);
  color: var(--on-accent); cursor: pointer; display: grid; place-items: center; transition: background .15s ease, transform .1s ease;
}
.agent-send svg { width: 17px; height: 17px; }
.agent-send:hover { background: var(--accent-hover); }
.agent-send:active { transform: scale(.92); }
.agent-send:disabled { opacity: .5; cursor: not-allowed; }
.agent-foot { flex: 0 0 auto; text-align: center; font-size: 10.5px; color: var(--muted); padding: 6px 0 10px; }
@media (max-width: 480px) {
  .agent-chat { right: 12px; bottom: 12px; }
  .agent-toggle { width: 54px; height: 54px; }
  .agent-panel { right: -8px; width: calc(100vw - 24px); height: min(70vh, 560px); bottom: 66px; }
}

/* ---- Admin live desk: professional inbox layout ---- */
.desk-threads { padding: 0 !important; display: flex; flex-direction: column; min-height: 0; }
.desk-threads-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.desk-count { background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.desk-thread-list { overflow-y: auto; flex: 1; }
.desk-empty { padding: 16px; }
.thread-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; font: inherit; border-radius: 0; color: var(--ink); }
.thread-btn:hover { background: var(--row-hover); }
.thread-btn.is-active { background: var(--accent-soft); }
.thread-btn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-btn-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread-btn-top strong { font-size: 13.5px; font-weight: 600; }
.thread-btn-top small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.thread-btn-preview { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-unread { flex: 0 0 auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center; padding: 0 5px; }
.desk-conversation { padding: 0 !important; display: flex; flex-direction: column; min-height: 560px; }
.desk-conv-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.desk-conv-who { display: flex; align-items: center; gap: 10px; }
.desk-conv-who strong { display: block; font-size: 14.5px; }
.desk-log { flex: 1; background: var(--bg); }
#desk-form { border-top: 1px solid var(--line); padding: 10px 12px; }

/* ---- Live suggest dropdown ---- */
.suggest-box { position: relative; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(9, 20, 33, .16); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggest-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; color: var(--ink); font-size: 14px; border-bottom: 1px solid var(--line);
}
.suggest-list a:last-child { border-bottom: 0; }
.suggest-list a:hover, .suggest-list a.is-active { background: var(--row-hover); text-decoration: none; }
.suggest-list small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; flex: 0 0 auto; }
.suggest-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- Mobile menu toggle (animated hamburger) ---- */
.menu-toggle { align-items: center; gap: 8px; }
.menu-toggle-bars { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.menu-toggle-bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(9, 20, 33, .45); z-index: 45; }

/* ---- Notice ---- */
.notice { background: var(--warn-soft); color: var(--warn); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; margin: var(--s4) 0; }

/* ---- Responsive ---- */
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; padding: var(--s6) var(--s5); }
  .hero-media { order: -1; }
  .hero-media img { height: 220px; }
  .split { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { border-left: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; white-space: nowrap; }
  .side-nav a.on { border-bottom-color: var(--accent); }
  .side-user { display: none; }
  .admin-main { padding: var(--s4); }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  h1 { font-size: 27px; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: calc(-1 * var(--s3)); right: calc(-1 * var(--s3));
    background: var(--header-bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s2) var(--s4) var(--s4);
    box-shadow: 0 12px 24px rgba(9, 20, 33, .12);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); }
  .site-nav a.on { box-shadow: none; }
  .site-nav .nav-cta { border-bottom: 0; margin-top: var(--s2); text-align: center; }
  .drawer-close { display: block; align-self: flex-end; background: transparent; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
  .brand-text small { display: none; }
  .timeline { grid-template-columns: 1fr; gap: var(--s4); }
  .t-step { padding: 0 0 0 28px; }
  .t-step::before { top: 14px; left: 5px; right: auto; width: 2px; height: 100%; }
  .t-step:first-child::before { top: 8px; height: calc(100% - 8px); }
  .t-step:last-child::before { display: none; }
  .t-step::after { top: 4px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s5) var(--s4); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-states { grid-column: 1 / -1; }
  .state-links { grid-template-columns: repeat(6, auto); }
  .hero-search { flex-direction: column; }
  .section { margin-top: var(--s7); }
  .gov-banner { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================================
   Extended design system — v3 additions
   Covers: header marquee, breadcrumbs, form system, claim wizard/status,
   record page, FAQ, methods, admin grids, and mobile card-tables.
   ========================================================================== */

/* ---- Header marquee (right-to-left moving announcement) ---- */
.gov-banner-inner { display: flex; align-items: center; gap: 12px; padding: 7px 0; flex-wrap: nowrap; }
.gov-marquee { flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.gov-marquee-track { display: inline-flex; white-space: nowrap; animation: gov-marquee-scroll 24s linear infinite; will-change: transform; }
.gov-marquee-item { padding-right: 90px; color: var(--banner-ink); }
.gov-marquee:hover .gov-marquee-track, .gov-marquee:focus-within .gov-marquee-track { animation-play-state: paused; }
@keyframes gov-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .gov-marquee-track { animation: none; }
  .gov-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin: var(--s4) 0 var(--s3); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--ink); }

/* ---- Default padded content card (bare .card used as a content wrapper) ---- */
.card { padding: var(--s5) var(--s6); }
.split .card { padding: 0; }
.metric-card.card, .state-card.card { padding: var(--s3) var(--s4); }

/* ---- Form system (public + admin) ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s5); }
.form-grid .span-2, .form-grid .span-all { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--s2); }
label.field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; resize: vertical;
}
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin-top: var(--s4); line-height: 1.5; }
.check-field input { margin-top: 3px; flex: 0 0 auto; }
.form-card, .record-panel, .prose-card, .method-card.card { padding: var(--s6) var(--s6) var(--s7); }
.form-card .eyebrow, .record-panel .eyebrow, .prose-card .eyebrow { margin-bottom: var(--s2); }
.form-card h1, .record-panel h1 { margin-bottom: var(--s2); }
.form-card .lead { color: var(--muted); margin: var(--s2) 0 var(--s2); max-width: 62ch; }
.btn.gold { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.gold:hover { background: var(--accent-hover); }

/* ---- Claim stepper ---- */
.claim-stepper { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s5) 0 var(--s6); }
.cs-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.cs-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); flex: 0 0 22px; }
.cs-step.current { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.cs-step.current .cs-dot { background: var(--accent); color: var(--on-accent); }
.cs-step.done { color: var(--ink); }
.cs-step.done .cs-dot { background: var(--success); color: #fff; }

/* ---- Claim status timeline ---- */
.status-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s3); margin: var(--s5) 0 var(--s6); }
.st-step { position: relative; padding-top: 26px; font-size: 13.5px; color: var(--muted); }
.st-step::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
.st-step:first-child::before { left: 12px; }
.st-step:last-child::before { right: auto; width: 24px; }
.st-dot { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: block; }
.st-step.done::before, .st-step.current::before { background: var(--accent); }
.st-step.done .st-dot { background: var(--accent); border-color: var(--accent); }
.st-step.current .st-dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--accent); }
.st-step.done, .st-step.current { color: var(--ink); font-weight: 500; }
.claim-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.badge.lg { font-size: 13px; padding: 6px 14px; }
.status-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s5); align-items: start; margin-bottom: var(--s6); }
.status-grid h2 { margin-top: var(--s6); margin-bottom: var(--s3); font-size: 17px; }
.status-grid h2:first-child { margin-top: 0; }

/* ---- Record facts / detail panel ---- */
.record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.record-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3) var(--s6); margin: var(--s5) 0; padding: var(--s4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.record-facts div { display: flex; flex-direction: column; gap: 2px; }
.record-facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 0; }
.record-facts dd { margin: 0; font-size: 14.5px; color: var(--ink); }
.record-note { color: var(--muted); font-size: 13px; margin-top: var(--s4); }

/* ---- Event / document lists ---- */
.doc-list, .event-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 10px; }
.doc-list li, .event-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; background: var(--surface-2); }
.event-list li strong { display: block; font-size: 14px; }
.event-list li .meta { display: block; margin: 2px 0 4px; }
.event-list li p { margin-top: 4px; color: var(--ink); font-size: 13.5px; }
.doc-heading { margin-top: var(--s5); margin-bottom: var(--s2); font-size: 14.5px; font-weight: 600; }

/* ---- Disbursement methods ---- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.method-card { display: block; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: var(--s4) var(--s5); cursor: pointer; }
.method-card input { margin-bottom: 8px; }
.method-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.method-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow); }
.span-all { grid-column: 1 / -1; }

/* ---- Prose (about / privacy) ---- */
.prose h2 { margin-top: var(--s6); margin-bottom: var(--s2); font-size: 19px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.prose ul { margin: var(--s2) 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---- FAQ accordion ---- */
.faq-list { display: grid; gap: 10px; margin-top: var(--s5); }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.6; }

/* ---- Admin dashboard grids ---- */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: var(--s5); align-items: start; }
.admin-metrics { grid-template-columns: repeat(5, 1fr); }
.publish-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.publish-row input { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); width: 90px; }
.thread-btn:first-child { margin-top: 4px; }

/* ---- Activity filter chips reuse .chip-row; keep aligned on the section head ---- */
.activity-filter { margin: 0; }

/* ============================================================================
   Responsive — extended
   ========================================================================== */
@media (max-width: 1020px) {
  .status-grid { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .card { padding: var(--s4) var(--s5); }
  .split .card { padding: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .record-facts { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .claim-status-head { flex-direction: column; align-items: flex-start; }
  .record-head { flex-direction: column; }
  .method-grid { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .state-card { padding: 10px 12px; grid-template-columns: 22px 1fr auto; gap: 2px 8px; }
  .state-card .state-name { font-size: 13px; }
  .state-card .state-meta { display: none; }
  .state-card .flag, .state-card .flag-fallback { width: 20px; }
  .gov-marquee-item { padding-right: 56px; font-size: 12.5px; }

  /* Mobile card-table: every data table becomes a stacked grid of cards */
  .table-wrap { border: 0; box-shadow: none; background: transparent; overflow: visible; border-radius: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: var(--s3); padding: var(--s3) var(--s4); display: grid; gap: 8px;
  }
  .table-wrap tbody tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover td { background: transparent; }
  .table-wrap td {
    border-bottom: 0; padding: 2px 0; display: flex; justify-content: space-between; align-items: center;
    gap: var(--s3); text-align: right; white-space: normal;
  }
  .table-wrap td[data-label]::before {
    content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; text-align: left; flex: 0 0 auto;
  }
  .table-wrap td:not([data-label]) { text-align: left; }
  .table-wrap td.actions { justify-content: flex-end; }
  .table-wrap .empty-cell { display: block; text-align: center; padding: var(--s5) var(--s3); }
}

/* ---- Hero carousel: multi-image, crystal-facet reveal transitions ---- */
.hero-carousel { position: relative; height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); }
.hc-slide {
  position: absolute; inset: 0; opacity: 0; background-size: cover; background-position: center;
  display: grid; place-items: center; pointer-events: none;
  clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
  transform: scale(1.1) rotate(-4deg);
  filter: brightness(1.3) saturate(1.25);
}
.hc-slide-illustration { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.hc-slide-illustration svg { width: 58%; height: auto; }
.hc-slide.is-active {
  z-index: 2;
  animation: hc-crystal-in 1.3s cubic-bezier(.22, .9, .3, 1) forwards;
}
@keyframes hc-crystal-in {
  0%   { opacity: 0; clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%); transform: scale(1.12) rotate(-6deg); filter: brightness(1.45) saturate(1.35); }
  30%  { opacity: 1; clip-path: polygon(25% 5%, 78% 12%, 100% 55%, 64% 100%, 12% 92%, 0% 38%); transform: scale(1.05) rotate(2deg); filter: brightness(1.15) saturate(1.15); }
  62%  { clip-path: polygon(0% 0%, 100% 0%, 100% 32%, 72% 100%, 22% 100%, 0% 58%); transform: scale(1.015) rotate(-1deg); }
  100% { opacity: 1; clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); transform: scale(1) rotate(0deg); filter: brightness(1) saturate(1); }
}
.hc-dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 5; display: flex; justify-content: center; gap: 7px; }
.hc-dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: width .2s ease, background .2s ease; }
.hc-dots button.is-active { background: #fff; width: 22px; }
.hc-slide-illustration ~ .hc-dots button, .hero-carousel[data-illustration-active] .hc-dots button { background: rgba(9,20,33,.28); }
@media (max-width: 1020px) {
  .hero-carousel { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .hc-slide { animation: none !important; clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%) !important; transform: none !important; filter: none !important; transition: opacity .4s ease; }
  .hc-slide.is-active { opacity: 1; }
}

/* ---- PWA settings toggle (admin brand page) ---- */
.pwa-toggle-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin-top: var(--s2);
}
.pwa-toggle-text strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.pwa-toggle-text p { max-width: 56ch; margin: 0; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 0 0 auto; }
.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 .18s ease; flex: 0 0 auto; }
.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,.3); transition: transform .18s ease; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 56px; }
@media (max-width: 640px) {
  .pwa-toggle-card { flex-direction: column; align-items: flex-start; }
}

/* ---- PWA "install app" banner ---- */
.pwa-install {
  position: fixed; left: 20px; bottom: 20px; z-index: 70; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(9,20,33,.22);
  padding: 12px 14px; max-width: calc(100vw - 40px); width: 360px;
  animation: pwa-install-in .35s ease;
}
@keyframes pwa-install-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.pwa-install-icon img { width: 40px; height: 40px; border-radius: 10px; display: block; }
.pwa-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pwa-install-text strong { font-size: 13.5px; }
.pwa-install-text span { font-size: 12px; color: var(--muted); }
.pwa-install-dismiss { flex: 0 0 auto; background: transparent; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 4px; }
@media (max-width: 640px) {
  .pwa-install { left: 12px; right: 12px; width: auto; bottom: 82px; }
}

/* ---- Admin: hero image manager ---- */
.hero-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.hero-image-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.hero-image-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.hero-image-item .meta { display: block; padding: 6px 10px 0; }
.hero-image-item form { padding: 8px 10px 10px; }
.hero-image-item .btn { width: 100%; }

/* ---- Admin: verification procedure editor ---- */
.verification-steps-editor { display: grid; gap: 10px; }
.verification-step-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: center; }
.payout-method-row { grid-template-columns: 0.8fr 1fr 1.4fr auto; }
.verification-step-row input {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px;
}
@media (max-width: 640px) {
  .verification-step-row, .payout-method-row { grid-template-columns: 1fr; }
}

/* ---- Public: in-page verification stepper ---- */
.verify-stepper { margin-bottom: var(--s5); }
.verify-stepper-track { display: flex; gap: 6px; margin-bottom: var(--s4); }
.verify-stepper-track span { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.verify-stepper-track span.done, .verify-stepper-track span.current { background: var(--accent); }
.verify-panel { display: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); margin-bottom: var(--s4); }
.verify-panel.is-active { display: block; }
.verify-panel .step-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 700; margin-bottom: 10px;
}
.verify-panel h3 { margin-bottom: 4px; }
.verify-panel p { color: var(--muted); font-size: 14px; }
.verify-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: var(--s5); }

/* ---- Admin: claim detail verification photo + documents ---- */
.verify-photo-link { display: block; margin-bottom: 8px; }
.verify-photo-preview {
  width: 100%; max-width: 260px; border-radius: var(--radius); border: 1px solid var(--line);
  display: block; object-fit: cover; aspect-ratio: 4/3;
}
.doc-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---- Ledger listing: lively card grid (replaces the old plain table) ---- */
.ledger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.ledger-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s4); color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ledger-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(9, 20, 33, .14); border-color: var(--accent); text-decoration: none; }
.ledger-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: 0 0 48px; background: var(--surface-2); border: 1px solid var(--line); }
.ledger-card-body { flex: 1; min-width: 0; }
.ledger-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ledger-card-top strong { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.ledger-card-body .meta { margin: 3px 0 6px; font-size: 12.5px; }
.ledger-amount { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.ledger-cat-tag {
  position: absolute; top: 0; right: 0; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px 3px 14px; border-radius: 0 0 0 12px; color: #fff; background: var(--cat-color, var(--muted)); opacity: .92;
}
.ledger-card.cat-utility { --cat-color: #2f6fed; }
.ledger-card.cat-payroll { --cat-color: #2f9e6b; }
.ledger-card.cat-refund { --cat-color: #d3862f; }
.ledger-card.cat-insurance { --cat-color: #a34fd6; }
.ledger-card.cat-court { --cat-color: #d6455a; }
.ledger-card.cat-other { --cat-color: #6b7684; }

/* ---- Claim dashboard ---- */
.dashboard-privacy-notice { border-left: 4px solid var(--accent); margin-bottom: var(--s4); }
.claim-status-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.dashboard-who { display: flex; align-items: center; gap: 16px; }
.dashboard-avatar-wrap { position: relative; flex: 0 0 auto; }
.dashboard-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 700; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.dashboard-avatar-form { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: max-content; }
.dashboard-avatar-btn { font-size: 10.5px; padding: 3px 9px; white-space: nowrap; cursor: pointer; }
.dashboard-messages { margin-bottom: var(--s4); }

/* ---- Success modal (shown right after claim submission) ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 20, 33, .55); z-index: 100;
  display: grid; place-items: center; padding: var(--s4); animation: modal-fade-in .2s ease;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface); border-radius: 18px; padding: var(--s6) var(--s6) var(--s5); max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 30px 70px rgba(9, 20, 33, .35); animation: modal-pop-in .25s cubic-bezier(.2,.9,.3,1);
}
@keyframes modal-pop-in { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-check {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin: 0 auto var(--s3);
  background: var(--success); color: #fff; font-size: 26px; font-weight: 700;
}
.modal-card h2 { font-size: 19px; margin-bottom: 4px; }
.modal-card p { color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.modal-ref {
  font-size: 22px; font-weight: 700; letter-spacing: .03em; color: var(--accent) !important;
  background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 10px 0 !important;
}
.modal-actions { margin-top: var(--s4); }

/* ---- Claim dashboard: mobile polish ---- */
@media (max-width: 640px) {
  .claim-status-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .claim-status-head .badge.lg { align-self: flex-start; }
  .dashboard-who { align-items: flex-start; }
  .dashboard-avatar-wrap { margin-bottom: 4px; }
  .dashboard-avatar-form { position: static; transform: none; margin-top: 6px; }
  .status-timeline { grid-template-columns: repeat(2, 1fr); row-gap: var(--s4); }
}

/* ---- Ledger listing: explicit mobile grid (avoid jam-packed single-column overflow) ---- */
@media (max-width: 640px) {
  .ledger-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ledger-card { flex-direction: column; align-items: center; text-align: center; padding: 14px 10px; gap: 8px; }
  .ledger-avatar { width: 56px; height: 56px; flex: 0 0 56px; }
  .ledger-card-top { flex-direction: column; align-items: center; gap: 6px; }
  .ledger-card-top strong { font-size: 13px; line-height: 1.25; }
  .ledger-card-body .meta { font-size: 11px; }
  .ledger-amount { font-size: 14.5px; }
  .ledger-cat-tag { position: static; display: inline-block; margin-top: 2px; border-radius: 999px; padding: 2px 9px; }
}
@media (max-width: 400px) {
  .ledger-grid { grid-template-columns: 1fr; }
  .ledger-card { flex-direction: row; align-items: flex-start; text-align: left; padding: var(--s3) var(--s4); }
  .ledger-card-top { flex-direction: row; align-items: flex-start; }
}

/* ---- Track-a-claim lookup page ---- */
.track-forgot { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.track-forgot h2 { font-size: 16px; margin-bottom: 4px; }
.track-forgot .meta { margin-bottom: var(--s3); }

/* ---- Admin: FAQ manager ---- */
.faq-admin-list { display: grid; gap: 10px; }
.faq-admin-item { padding: var(--s4) var(--s5) !important; }
.faq-admin-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.faq-admin-item summary::-webkit-details-marker { display: none; }
.faq-admin-item summary::after { content: "Edit ▾"; margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.faq-admin-item[open] summary::after { content: "Close ▴"; }
.faq-admin-order { flex: 0 0 auto; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* ---- Admin: staff & email templates ---- */
.staff-role-row select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.email-templates { display: grid; gap: var(--s3); }
.email-template-card h2 { font-size: 14.5px; margin-bottom: 8px; }

/* ---- Admin: staff role badge in sidebar ---- */
.side-role-badge { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* ---- Masked claim reference on public listings (intentionally not a link) ---- */
.masked-ref { color: var(--ink); font-weight: 600; cursor: default; letter-spacing: .02em; }

/* ---- Admin: placeholder-avatar warning (never present a fallback as real evidence) ---- */
.verify-photo-placeholder { display: flex; align-items: flex-start; gap: 12px; }
.verify-photo-placeholder .verify-photo-preview { width: 72px; max-width: 72px; aspect-ratio: 1; filter: grayscale(1); opacity: .55; }
.verify-photo-placeholder .notice { flex: 1; margin: 0; }
