/* Cairys, style C: "Calm" (D-046). A pale sage-grey ground, white surfaces in
   large rounded cards, one deep green accent, a warm sand for "waiting" and
   "Synthetic data". Manrope is bundled in this folder (SIL Open Font
   Licence, Manrope-OFL.txt), so the portal makes no third-party request and
   looks the same offline. Dark mode is drawn from the same colours.
   Motion lives only inside prefers-reduced-motion: no-preference. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/static/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/static/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #edf1ef;
  --surface: #ffffff;
  --inset: #f3f6f5;
  --ink: #1e2a27;
  --soft: #3e4b47;
  --muted: #56635f;
  --line: #e3e9e7;
  --track: #d5deda;
  --accent: #1f6b5c;
  --accent-ink: #ffffff;
  --accent-hover: #154a40;
  --accent-soft: #dcebe5;
  --accent-soft-ink: #154a40;
  --link: #1f6b5c;
  --hero: #1f6b5c;
  --hero-ink: #ffffff;
  --sand: #fbf3e4;
  --sand-ink: #6a4a12;
  --sand-line: #ecd9b0;
  --danger: #9b2f28;
  --danger-soft: #f8e4e1;
  --income: #3e8c7a;
  --spend: #e3a25a;
  --spend-soft: #f6dfc4;
  --shadow: 0 1px 2px rgba(30, 42, 39, 0.04), 0 8px 24px rgba(30, 42, 39, 0.05);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
  --r-card: 22px;
  --r-big: 26px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}
:root[data-scheme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #0f1513;
    --surface: #18211e;
    --inset: #0f1513;
    --ink: #e4ece8;
    --soft: #c2d0cb;
    --muted: #9cb0a9;
    --line: #25302c;
    --track: #2d3a36;
    --accent: #7cc7b2;
    --accent-ink: #0f1513;
    --accent-hover: #a9ddcd;
    --accent-soft: #1f3530;
    --accent-soft-ink: #a9ddcd;
    --link: #7cc7b2;
    --hero: #1f6b5c;
    --hero-ink: #ffffff;
    --sand: #3b2e14;
    --sand-ink: #f3cf8c;
    --sand-line: #5a4520;
    --danger: #f0a29b;
    --danger-soft: #3a1f1c;
    --income: #5fb39f;
    --spend: #e3a25a;
    --spend-soft: #4a3720;
    --shadow: none;
  }
}
:root[data-scheme="dark"] {
  --bg: #0f1513;
  --surface: #18211e;
  --inset: #0f1513;
  --ink: #e4ece8;
  --soft: #c2d0cb;
  --muted: #9cb0a9;
  --line: #25302c;
  --track: #2d3a36;
  --accent: #7cc7b2;
  --accent-ink: #0f1513;
  --accent-hover: #a9ddcd;
  --accent-soft: #1f3530;
  --accent-soft-ink: #a9ddcd;
  --link: #7cc7b2;
  --hero: #1f6b5c;
  --hero-ink: #ffffff;
  --sand: #3b2e14;
  --sand-ink: #f3cf8c;
  --sand-line: #5a4520;
  --danger: #f0a29b;
  --danger-soft: #3a1f1c;
  --income: #5fb39f;
  --spend: #e3a25a;
  --spend-soft: #4a3720;
  --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--inset); padding: 2px 6px; border-radius: 6px; }
code.wrap { word-break: break-all; }
small, .muted { color: var(--muted); }
h1, h2, h3 { font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 4vw, 2rem); line-height: 1.2; margin: 0.1em 0 0.35em; letter-spacing: -0.02em; }
h1 small { font-size: 0.9rem; font-weight: 500; margin-left: 10px; letter-spacing: 0; }
h2 { font-size: 1.3rem; margin: 0 0 0.6em; }
h2 small, h3 small { font-weight: 500; color: var(--muted); font-size: 0.82rem; margin-left: 8px; letter-spacing: 0; }
h3 { font-size: 1.05rem; margin: 1.3em 0 0.4em; }
p { margin: 0 0 0.9em; }

/* ---- the frame ---------------------------------------------------------- */
.synthetic { align-self: center; margin: 12px 16px 0; padding: 7px 16px; border-radius: 999px; background: var(--sand); color: var(--sand-ink); font-size: 0.8rem; text-align: center; border: 1px solid var(--sand-line); }
.app { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; flex: 1; align-items: flex-start; }
.side { flex: 1 1 220px; max-width: 260px; position: sticky; top: 16px; background: var(--surface); border-radius: var(--r-card); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.menu { display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; }
.menu a { padding: 11px 14px; border-radius: 14px; color: var(--soft); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--inset); color: var(--ink); }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 700; }
.who { padding: 0 14px; font-size: 0.85rem; color: var(--muted); margin: 0; }
.side-note { margin-top: 4px; background: var(--sand); color: var(--sand-ink); border-radius: 16px; padding: 14px; font-size: 0.82rem; line-height: 1.5; }
.side form { margin: 0; }
main { flex: 999 1 560px; min-width: 0; max-width: 1120px; width: 100%; padding: 18px 20px 48px; margin: 0 auto; }
.app > main { margin: 0; }
.solo main { max-width: 720px; padding: 20px 16px 56px; }
.solo.wide main { max-width: 1120px; }
.solo-top { width: 100%; max-width: 720px; margin: 0 auto; padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--muted); }
.solo.wide .solo-top { max-width: 1120px; }
.solo-top .brand { padding: 0; font-size: 1.05rem; }
footer { width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 24px 28px; color: var(--muted); font-size: 0.8rem; text-align: center; }
footer p { margin: 0; }

/* ---- buttons, pills ----------------------------------------------------- */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.2; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--inset); color: var(--ink); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--accent-soft); color: var(--accent-soft-ink); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
button.danger { background: var(--danger-soft); color: var(--danger); }
button.danger:hover { background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); color: var(--danger); }
button.big { min-height: 54px; font-size: 1.05rem; padding: 0 30px; }
button.link { background: none; min-height: 0; padding: 0; font-weight: 500; font-size: 0.9rem; text-decoration: underline; color: var(--muted); }
button.link:hover { background: none; color: var(--ink); }
button[disabled] { opacity: 0.7; cursor: progress; }
form.inline { display: inline; }
.card > form, .card > p + form { margin: 0 0 12px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--inset); color: var(--soft); white-space: nowrap; }
.pill.go { background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill.wait { background: var(--sand); color: var(--sand-ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.status { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--inset); color: var(--soft); }
.s-reviewed { background: var(--accent-soft); color: var(--accent-soft-ink); }
.s-invited, .s-connected, .s-changed, .s-opened { background: var(--sand); color: var(--sand-ink); }
.s-issued { background: var(--inset); color: var(--soft); }
.s-withdrawn { background: var(--danger-soft); color: var(--danger); }

/* ---- cards -------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.hero-card { background: var(--hero); color: var(--hero-ink); box-shadow: none; }
.card.hero-card h2, .card.hero-card h3 { color: var(--hero-ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.heading-row h1 { margin: 0; }
.lede-line { margin: 4px 0 0; color: var(--muted); }
.crumbs { margin: 0 0 6px; font-size: 0.88rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.hint { color: var(--muted); font-size: 0.88rem; }
.empty { color: var(--muted); }
.warn { background: var(--sand); color: var(--sand-ink); padding: 12px 16px; border-radius: 16px; }
/* P2.16: the other side has acted. Sticky, so it is seen on a long report; hidden until the page polls a change. */
.live-banner { position: sticky; top: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--sand); color: var(--sand-ink); padding: 12px 16px; border-radius: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.live-banner p { margin: 0; }
.live-held { opacity: 0.55; cursor: wait; }
.live-banner[data-live-narrow] { max-width: 720px; margin-left: auto; margin-right: auto; }
.live-banner[hidden], .live-banner [hidden] { display: none; }
.eyebrow { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; font-size: 0.95rem; }

/* the cases page */
.deck { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.ready { flex: 2 1 340px; display: flex; flex-direction: column; gap: 14px; background: var(--hero); color: var(--hero-ink); border-radius: var(--r-card); padding: 22px 24px; text-decoration: none; }
.ready:hover { color: var(--hero-ink); filter: brightness(1.06); }
.ready .pill { align-self: flex-start; background: rgba(255, 255, 255, 0.16); color: #fff; }
.ready .name { font-size: 1.4rem; font-weight: 800; }
.ready .name small { color: inherit; opacity: 0.8; font-size: 0.95rem; font-weight: 500; margin-left: 4px; }
.ready .more { font-size: 0.9rem; opacity: 0.92; }
.stat { flex: 1 1 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: var(--r-card); padding: 22px 24px; box-shadow: var(--shadow); }
.stat .label { font-size: 0.9rem; color: var(--muted); }
.stat .big-number { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.stat .detail { font-size: 0.82rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; font-size: 0.78rem; flex-wrap: wrap; }
.timeline li { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.timeline li.arrow { padding: 0; background: none; opacity: 0.6; }
.timeline li.now { background: #fff; color: #154a40; font-weight: 800; }

/* ---- progress: the case track, and the client's steps ------------------- */
.steps { display: flex; list-style: none; padding: 0; margin: 4px 0 20px; gap: 8px; flex-wrap: wrap; }
.steps li { flex: 1 1 130px; padding: 9px 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--track); flex: none; }
.steps li.done { color: var(--accent-soft-ink); background: var(--accent-soft); }
.steps li.done::before { background: var(--accent); }
.steps li.now { background: var(--accent); color: var(--accent-ink); }
.steps li.now::before { background: var(--accent-ink); }
.history { list-style: none; padding: 0 0 0 18px; margin: 0; font-size: 0.9rem; border-left: 2px solid var(--track); }
.history li { padding: 0 0 14px 16px; position: relative; }
.history li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.history time { display: block; color: var(--muted); font-size: 0.8rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.facts dd code { word-break: break-all; }
.invite-link { word-break: break-all; background: var(--inset); padding: 12px 16px; border-radius: 16px; font-family: var(--mono); font-size: 0.85rem; }
.client-email { background: var(--inset); padding: 12px 16px; border-radius: 16px; margin: 0 0 12px; }
.client-email .email-head { margin: 0 0 8px; }
.client-email .email-body { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.9rem; }
.client-email .email-body a { word-break: break-all; }
.seal { display: block; width: 72px; height: 72px; margin-bottom: 12px; }
.seal circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 3; }
.seal path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the client's steps (phone first) ----------------------------------- */
.progress { margin: 4px 0 20px; }
.progress-row { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); margin-bottom: 8px; }
.progress-row strong { color: var(--ink); }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.client-card h1 { font-size: clamp(1.6rem, 6vw, 1.9rem); }
.readers { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.readers li { background: var(--inset); padding: 12px 16px; border-radius: 16px; font-weight: 600; }
.choice { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; margin: 8px 0; background: var(--inset); cursor: pointer; box-shadow: inset 0 0 0 2px transparent; }
.choice:hover { box-shadow: inset 0 0 0 2px var(--track); }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.choice input { width: 22px; height: 22px; flex: none; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.consent-box { align-items: flex-start; background: var(--sand); color: var(--sand-ink); }
.consent-box:has(input:checked) { background: var(--accent-soft); color: var(--ink); }
.consent-box input { margin-top: 3px; }
.plain-list { padding-left: 20px; margin: 0 0 1em; }
.bank-list { border: 0; padding: 0; margin: 0; }
.bank-sim { box-shadow: inset 0 0 0 2px var(--track), var(--shadow); }
.sim-flag { background: var(--sand); color: var(--sand-ink); padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; margin: 0 0 16px; }
.readers.linked li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plain-list li { margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 20px; max-width: 340px; font-weight: 600; }
.field small { font-weight: 400; }
input[type=date], input[type=text], input[type=password], select { font: inherit; padding: 11px 14px; border: 2px solid var(--track); border-radius: 14px; background: var(--surface); color: var(--ink); min-height: 46px; }
input[type=date]:focus, input[type=text]:focus, input[type=password]:focus, select:focus { border-color: var(--accent); outline: none; }
.form fieldset { border: none; padding: 0; margin: 0 0 18px; }
.form legend { font-weight: 700; margin-bottom: 6px; font-size: 1.05rem; }
.connecting { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: none; align-items: center; justify-content: center; padding: 24px; }
.connecting.on { display: flex; }
.connecting .panel { background: var(--surface); border-radius: var(--r-big); padding: 28px; width: min(100%, 420px); box-shadow: var(--shadow); }
.connecting ul { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.connecting li { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.ring { width: 28px; height: 28px; flex: none; }
.ring circle { fill: none; stroke-width: 3; }
.ring .t { stroke: var(--track); }
.ring .a { stroke: var(--accent); stroke-linecap: round; }

/* ---- tables ------------------------------------------------------------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; border-top: 0; }
tbody tr:hover td { background: var(--inset); }
.num { text-align: right; }
table.list { min-width: 640px; }
table.list a { font-weight: 700; color: var(--ink); text-decoration: none; }
table.list a:hover { color: var(--accent); }
.table-card { background: var(--surface); border-radius: var(--r-card); padding: 8px; box-shadow: var(--shadow); overflow-x: auto; margin-bottom: 16px; }
table.compact th, table.compact td { border: none; padding: 3px 12px 3px 0; }
table.compact tr:hover td { background: none; }
tr.sep td, tbody tr.sep:hover td { background: var(--sand); }
tr.sub td { color: var(--muted); }
.fig { display: inline-flex; flex-direction: column; align-items: flex-end; }
.ids summary { cursor: pointer; font-size: 0.75rem; color: var(--muted); }
.ids summary:hover, .ids[open] summary { color: var(--accent); }
.ids code { display: block; max-width: 420px; white-space: normal; text-align: left; word-break: break-all; font-size: 0.72rem; margin-top: 4px; }

/* ---- the report --------------------------------------------------------- */
.report { display: flex; flex-direction: column; gap: 18px; }
.report-head { background: var(--surface); border-radius: var(--r-big); padding: 26px 30px; box-shadow: var(--shadow); }
.report-head h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); margin: 0 0 6px; }
.report .meta { color: var(--soft); margin: 0; font-size: 0.95rem; }
.report section { background: var(--surface); border-radius: var(--r-big); padding: 24px 28px; box-shadow: var(--shadow); }
.report section > h2 { font-size: 1.25rem; }
.cover { display: flex; flex-wrap: wrap; gap: 16px; }
.cover .lead-claim { flex: 2 1 420px; background: var(--hero); color: var(--hero-ink); border-radius: var(--r-big); padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.cover .lead-claim h2 { margin: 0; font-size: 0.9rem; font-weight: 600; opacity: 0.88; letter-spacing: 0; color: inherit; }
.cover .lead-claim .headline { margin: 0; font-size: 1.3rem; line-height: 1.4; font-weight: 700; }
.cover .lead-claim .claim { margin: 0; font-size: 0.9rem; line-height: 1.55; opacity: 0.92; }
.cover .never-box { flex: 1 1 260px; background: var(--surface); border-radius: var(--r-big); padding: 24px 28px; box-shadow: var(--shadow); }
.cover .never-box h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.never { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--soft); }
.chart-key { display: flex; gap: 8px; font-size: 0.8rem; flex-wrap: wrap; }
.chart-key span { padding: 5px 12px; border-radius: 999px; font-weight: 700; }
.key-in { background: var(--accent-soft); color: var(--accent-soft-ink); }
.key-out { background: var(--spend-soft); color: var(--sand-ink); }
.chart-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: baseline; margin-bottom: 16px; }
.chart-head h2 { margin: 0; }
.chart { overflow-x: auto; }
.chart-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: 10px; min-width: 520px; }
.chart-grid.bars { height: 200px; align-items: stretch; }
.chart-grid.labels { padding-top: 8px; font-size: 0.8rem; color: var(--muted); text-align: center; }
.col { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-radius: 14px; padding: 0 4px; }
.col.before { background: var(--sand); }
.col .b { width: 12px; border-radius: 999px; min-height: 2px; }
.col .in { background: var(--income); }
.col .out { background: var(--spend); }
.col .flag { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.chart-note { margin: 14px 0 0; font-size: 0.9rem; color: var(--soft); }

/* leads, as cards that open to their transactions */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.lead { background: var(--inset); border-radius: var(--r-card); padding: 0; }
.lead > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; border-radius: var(--r-card); }
.lead > summary::-webkit-details-marker { display: none; }
.lead > summary:hover { background: var(--accent-soft); }
.lead[open] > summary { padding-bottom: 8px; }
.lead-title { font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
.lead-sum { font-size: 0.88rem; color: var(--muted); }
.lead-body { padding: 0 22px 20px; }
.lead-body p { font-size: 0.93rem; }
.lead .pill.wait { align-self: flex-start; }
.lead .pill.go { align-self: flex-start; }
.note { background: var(--accent-soft); color: var(--ink); padding: 12px 16px; border-radius: 16px; font-size: 0.92rem; }
.note .by { font-size: 0.82rem; color: var(--muted); }
.note .new { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; }
.resolve { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.resolve input[type=text] { flex: 1; min-width: 200px; }
.review-bar { border-left: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.footnote { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 6px 0 0; }
.issued { color: var(--muted); }
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.report-bar .acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* landing */
.hero { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.12; letter-spacing: -0.025em; }
.lede { font-size: 1.1rem; color: var(--soft); line-height: 1.65; }
.hero .brand-mark { display: block; margin: 0 auto 18px; }
.sign-in { max-width: 400px; margin: 28px auto 0; text-align: left; }
.sign-in h2 { margin-top: 0; }
.sign-in .field { max-width: none; }
.sign-in-error { color: var(--danger); background: var(--danger-soft); border-radius: 14px; padding: 10px 14px; }

@media (max-width: 720px) {
  .app { padding: 10px; }
  .side { max-width: none; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; gap: 8px 14px; }
  .side-note { display: none; }
  .menu { flex-direction: row; flex-wrap: wrap; }
  .who { display: none; }
  main { padding: 14px 6px 40px; }
  .card, .report section, .report-head { padding: 20px 18px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dt { margin-top: 8px; }
}

/* ---- motion: only where it carries meaning ------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  /* the report assembling */
  .report > * { animation: rise 0.5s ease-out both; }
  .report > :nth-child(2) { animation-delay: 0.08s; }
  .report > :nth-child(3) { animation-delay: 0.16s; }
  .report > :nth-child(4) { animation-delay: 0.24s; }
  .report > :nth-child(5) { animation-delay: 0.32s; }
  .report > :nth-child(n+6) { animation-delay: 0.4s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .col .b { transform-origin: bottom; animation: grow 0.7s ease-out both; }
  @keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  /* a bank connecting */
  .ring .a { transform-origin: center; animation: spin 0.9s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  /* a new lead */
  .note .new { animation: pulse 1.8s ease-out 2; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(124, 199, 178, 0.7); } 100% { box-shadow: 0 0 0 12px rgba(124, 199, 178, 0); } }
  /* the issue seal */
  .seal circle { transform-origin: center; animation: pop 0.5s ease-out both; }
  .seal path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.5s ease-out 0.35s forwards; }
  @keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  .bar > span { transition: width 0.3s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .seal path { stroke-dasharray: none; }
}

@page { size: A4; margin: 18mm 16mm; }
@media print {
  body { background: #fff; color: #000; display: block; }
  .side, footer, .resolve, .report-bar, .review-bar, .crumbs, .back { display: none; }
  .app { display: block; padding: 0; }
  .ids code { display: block; }
  .report > *, .report section, .report-head { box-shadow: none; animation: none; }
  .lead, table { break-inside: avoid; }
  h2 { break-after: avoid; }
}
