/* ============================================================
   Credmetry — design system v3
   Light, calm, editorial. Navy + teal + warm neutrals (per PDD §15).
   Principles: generous whitespace, hairline borders, one soft shadow,
   restrained colour (semantics used sparingly), Inter at human weights.
   ============================================================ */
:root {
  /* surfaces */
  --bg:        #f3f6f9;
  --bg-tint:   #eaeff4;
  --surface:   #ffffff;
  --surface-2: #fbfcfe;
  --line:      #e7ecf2;
  --line-2:    #dce3ec;
  --hairline:  #f0f3f7;

  /* ink */
  --ink:        #1c2c3e;
  --ink-strong: #0e2138;
  --muted:      #5d6b7c;
  --faint:      #8b98a7;

  /* brand */
  --navy:      #0d2b4e;
  --teal:      #0e7c86;
  --teal-d:    #0a5f67;
  --teal-soft: #e2f1f2;
  --teal-ink:  #ffffff;

  /* semantics — muted, never neon */
  --risk:   #c0485a;  --risk-d: #a13848;  --risk-soft:   #fbedef;
  --review: #b06b08;  --review-d: #8d5506; --review-soft: #fbf2e1;
  --ok:     #1f7a52;  --ok-d: #166243;     --ok-soft:     #e6f3ec;

  /* chart palette (harmonious, sits on white) */
  --c-1: #0e7c86; --c-2: #3a6ea5; --c-3: #b06b08; --c-4: #7a5ea8;
  --c-5: #1f8a6d; --c-6: #c0485a; --c-7: #4a90b8; --c-8: #b5567f;
  --track: #eef2f6;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-xs: 0 1px 2px rgba(18,42,74,.05);
  --shadow:    0 1px 2px rgba(18,42,74,.05), 0 12px 30px -20px rgba(18,42,74,.22);
  --shadow-pop:0 28px 70px -28px rgba(14,33,56,.34);
  --maxw:      1140px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -8%, #e8f1f2 0%, transparent 58%),
    radial-gradient(720px 380px at -6% -4%, #eef1f6 0%, transparent 52%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0; color: var(--ink-strong); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #0e7c8622; }

* { scrollbar-width: thin; scrollbar-color: #cdd7e2 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cdd7e2; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #b6c3d2; background-clip: padding-box; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 13px clamp(14px, 4vw, 36px);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: var(--teal-ink); letter-spacing: .3px;
  background: var(--navy);
  box-shadow: inset 0 0 0 1px #ffffff14;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-name { font-weight: 680; font-size: 15.5px; color: var(--ink-strong); }
.brand-name .ca { color: var(--teal); font-weight: 600; }
.brand-tag { font-size: 11.5px; color: var(--faint); }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.conn { font-size: 12px; color: var(--muted); white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.conn.live { color: var(--ok-d); border-color: #bfe0cd; background: var(--ok-soft); }
.topbar .conn + .btn { margin-left: 2px; }
@media (max-width: 980px){ .conn { display: none; } }

/* ---------------- Buttons ---------------- */
.btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 560;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-2); border-color: #c8d2de; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-primary {
  background: var(--teal); border-color: transparent; color: var(--teal-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(14,124,134,.25), 0 8px 18px -10px rgba(14,124,134,.5);
}
.btn-primary:hover { background: var(--teal-d); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-tint); }
.btn-danger { background: var(--surface); border-color: #e7c2c8; color: var(--risk-d); }
.btn-danger:hover { background: var(--risk-soft); border-color: #dca7af; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

/* ---------------- Layout ---------------- */
.app { max-width: none; margin: 0; padding: clamp(18px, 2vw, 30px) clamp(18px, 2.4vw, 40px); }
.view-head { margin-bottom: 22px; }
.view-head h1 { font-size: 27px; font-weight: 660; }
.view-head p { color: var(--muted); margin: 7px 0 0; max-width: 70ch; font-size: 14.5px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 640; margin: 30px 0 14px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px){ .cols-3, .cols-2 { grid-template-columns: 1fr; } .nav { display:none; } }

/* ---------------- Cards / panels ---------------- */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 14.5px; font-weight: 640; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }

/* KPI stat cards */
.stat { position: relative; overflow: hidden; }
.stat .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 520; }
.stat .label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; }
.stat.risk .label::before   { background: var(--risk); }
.stat.ok .label::before     { background: var(--ok); }
.stat.review .label::before { background: var(--review); }
.stat .value { font-size: 29px; font-weight: 660; margin-top: 9px; letter-spacing: 0; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.stat.risk .value { color: var(--risk-d); }
.stat.ok .value { color: var(--ok-d); }
.stat .accent { display: none; }
.stat-value { font-weight: 660; letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.ok     { color: var(--ok-d);     background: var(--ok-soft);     border-color: #c3e3d1; }
.badge.review { color: var(--review-d); background: var(--review-soft); border-color: #ecdab0; }
.badge.risk   { color: var(--risk-d);   background: var(--risk-soft);   border-color: #ebc3ca; }
.badge.ok .dot     { background: var(--ok); }
.badge.review .dot { background: var(--review); }
.badge.risk .dot   { background: var(--risk); }
.badge.neutral { color: var(--muted); background: var(--bg-tint); border-color: var(--line-2); }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 10px; border-bottom: 1px solid var(--line-2); }
td { padding: 11px 10px; border-bottom: 1px solid var(--hairline); color: var(--ink); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-hover tbody tr { transition: background .12s; }
.row-hover tbody tr:hover { background: var(--surface-2); }

/* ---------------- Bars / legend ---------------- */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.barlist { display: flex; flex-direction: column; gap: 12px; }
.barlist .row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; color: var(--ink); }
.barlist .track { background: var(--track); border-radius: 6px; height: 9px; overflow: hidden; }
.barlist .fill { height: 100%; border-radius: 6px; }
.barlist .amt { font-variant-numeric: tabular-nums; color: var(--ink-strong); font-weight: 600; min-width: 78px; text-align: right; }
@media (max-width:520px){ .barlist .row { grid-template-columns: 96px 1fr auto; } }

/* ---------------- Card list (statements) ---------------- */
.cardrow {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); align-items: center;
  transition: border-color .15s, box-shadow .15s, transform .06s; cursor: pointer;
}
.cardrow:hover { border-color: #cdd9e6; box-shadow: var(--shadow); transform: translateY(-1px); }
.cardrow + .cardrow { margin-top: 10px; }
.cardrow .meta { display: flex; flex-direction: column; gap: 3px; }
.cardrow .name { font-weight: 620; font-size: 15px; color: var(--ink-strong); }
.cardrow .issuer { color: var(--faint); font-size: 12.5px; }
.cardrow .tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.cardrow .right { text-align: right; }
.cardrow .bal { font-size: 18px; font-weight: 660; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.cardrow .apr { color: var(--muted); font-size: 12.5px; }

.fact { display: inline-flex; align-items: baseline; gap: 6px; }
.editable { border-bottom: 1px dashed var(--review); cursor: pointer; color: var(--review-d); }
.editable:hover { color: var(--review); }

/* ---------------- Forms ---------------- */
label.field { display: block; font-size: 13px; color: var(--muted); margin: 13px 0 6px; font-weight: 520; }
input, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #9aa7b6; }
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #0e7c8622; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow { flex: 1; min-width: 180px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-tint); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 15px; border-radius: 7px; font-weight: 560; font-size: 13px; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--ink-strong); }
.seg button.active { background: var(--surface); color: var(--teal-d); box-shadow: var(--shadow-xs); }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: #d2dae4; border: 0; position: relative; transition: background .18s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(17px); }

/* callouts */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; align-items: flex-start; border: 1px solid; }
.callout .ico { font-size: 16px; line-height: 1.3; }
.callout.risk   { background: var(--risk-soft);   border-color: #ebc3ca; color: var(--risk-d); }
.callout.review { background: var(--review-soft); border-color: #ecdab0; color: var(--review-d); }
.callout.ok     { background: var(--ok-soft);     border-color: #c3e3d1; color: var(--ok-d); }
.callout.info   { background: var(--teal-soft);   border-color: #bfe0e2; color: var(--teal-d); }

/* paywall */
.paywall { text-align: center; padding: 34px 24px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.paywall .paywall-lock { font-size: 28px; color: var(--review); }
.paywall h3 { margin: 12px 0 4px; font-size: 17px; }

/* hero / upload */
.hero { text-align: center; padding: 40px 16px 10px; }
.hero h1 { font-size: 40px; color: var(--navy); font-weight: 680; letter-spacing: 0; }
.hero p { color: var(--muted); max-width: 58ch; margin: 14px auto 0; font-size: 16px; }
.pill-row { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.pill { font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; }

.dropzone {
  border: 1.5px dashed #c2d0df; border-radius: var(--radius);
  padding: 38px; text-align: center; background: var(--surface-2); transition: .18s;
}
.dropzone.drag { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 4px #0e7c8618; }
.dropzone .big { font-size: 16px; font-weight: 600; color: var(--ink-strong); }
.dropzone .small { color: var(--faint); font-size: 13px; margin-top: 6px; }

/* progress pipeline */
.pipeline { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.pipe-step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); transition: .2s; }
.pipe-step .n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg-tint); color: var(--muted); }
.pipe-step.done { color: var(--ok-d); border-color: #c3e3d1; background: var(--ok-soft); }
.pipe-step.done .n { background: var(--ok); color: #fff; }
.pipe-step.active { color: var(--teal-d); border-color: #bfe0e2; background: var(--teal-soft); }

/* onboarding checklist */
.panel.onboard { background: linear-gradient(180deg, var(--teal-soft), var(--surface) 70%); border-color: #cfe6e8; margin-bottom: 18px; }
.onboard .progress { height: 6px; border-radius: 999px; background: #d7e6e7; overflow: hidden; margin: 4px 0 14px; }
.onboard .progress span { display: block; height: 100%; background: var(--teal); transition: width .4s ease; }
.checklist { list-style: none; display: grid; gap: 9px; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.checklist li.done { color: var(--ink-strong); }
.checklist .tick { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px;
  border: 1px solid var(--line-2); color: var(--ok-d); background: var(--surface); flex: none; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }

/* social proof */
.social-proof { margin-top: 16px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.social-proof:empty { display: none; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------------- Modal ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(14,33,56,.28); backdrop-filter: blur(3px); padding: 20px; animation: fade .15s ease; }
.modal-root[hidden] { display: none; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 460px; width: 100%; padding: 26px; box-shadow: var(--shadow-pop); animation: pop .18s ease; }
.modal h3 { margin-bottom: 6px; }
.modal .src { font-size: 12.5px; color: var(--faint); margin: 10px 0 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------------- Statement detail view (§10/§11) ---------------- */
/* Wider than the single-field modal: this one carries summary, reconciliation,
   per-field provenance and the transaction list. */
.modal-wide { max-width: 860px; max-height: 86vh; overflow-y: auto; }
/* A fact the parser never found. Never styled as an amount — it is not one. */
.missing { color: var(--faint); font-style: italic; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--teal-d); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.detail-head { font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint); font-weight: 640; margin: 22px 0 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; font-size: 13.5px; margin-top: 12px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.detail-table th { text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); font-weight: 640;
  padding: 6px 8px; border-bottom: 1px solid var(--line); }
.detail-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail-table .prov { font-size: 12px; color: var(--muted); }
.detail-table .row-review { background: var(--review-soft); }
.mfa-enroll { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 14px; }
.mfa-qr { width: 132px; height: 132px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; place-items: center; }
.mfa-qr svg { width: 100%; height: 100%; display: block; }
.mfa-enroll-side { min-width: 0; }
.mfa-steps { margin: 0 0 12px 18px; padding: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.mfa-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg-tint); margin-bottom: 14px; }
.mfa-key span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px;
  letter-spacing: .06em; color: var(--ink-strong); word-break: break-all; }
.captcha-slot { margin: 12px 0 2px; min-height: 66px; }

/* ---- view-change enter fade (only on real navigations) ---- */
@keyframes cc-view-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.app.view-enter { animation: cc-view-enter .26s ease both; }

/* ---- boot splash while signing in ---- */
.auth-splash { min-height: 62vh; display: grid; place-items: center; gap: 16px; color: var(--muted); }
.auth-splash p { font-size: 14px; margin: 0; }
.cc-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line-2);
  border-top-color: var(--teal); animation: cc-spin .8s linear infinite; }
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ---- email-confirmed screen ---- */
.auth-confirm { min-height: 66vh; display: grid; place-items: center; padding: 24px; }
.ac-card { max-width: 440px; width: 100%; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 40px 34px 32px;
  box-shadow: 0 30px 60px -34px rgba(20, 50, 74, .4); }
.ac-ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; }
.ac-ico svg { width: 32px; height: 32px; }
.ac-ico.ok { background: var(--ok-soft); color: var(--ok-d); }
.ac-ico.bad { background: var(--risk-soft); color: var(--risk-d); }
.ac-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--ink-strong); }
.ac-card p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
.ac-count { margin: 16px 0 0 !important; font-size: 12.5px; color: var(--faint); }

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

/* ---- toasts (Google-link notice, OAuth errors) ---- */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; width: 100%; padding: 13px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.45;
  color: #fff; box-shadow: 0 16px 40px -16px rgba(20, 40, 60, .5); opacity: 0; transform: translateY(10px);
  transition: opacity .28s ease, transform .28s ease; }
.toast.in { opacity: 1; transform: none; }
.toast-ok { background: linear-gradient(180deg, #14919c, #0e7c86); }
.toast-bad { background: linear-gradient(180deg, #d0555f, #b8323d); }

/* ---- unknown-card (not-in-catalog) rewards panel ---- */
.reward-unknown { border-style: dashed; border-color: var(--line-2); background: linear-gradient(180deg, #fbfcfd, #fff); }
.ru-earned { font-size: 13px; color: var(--ink); background: var(--bg-tint); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.ru-earned strong { color: var(--ink-strong); }
.ru-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* auto-sourced (web-enriched, unverified) rewards provenance badge */
.cc-prov:empty { display: none; }
.prov-badge { display: flex; align-items: flex-start; gap: 7px; margin-top: 8px;
  font-size: 11.5px; line-height: 1.45; color: var(--review-d);
  background: var(--review-bg, #fff8ec); border: 1px solid var(--review-b, #f0dcae);
  border-radius: 10px; padding: 7px 10px; }
.prov-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--review-d); flex: none; margin-top: 5px; }
.prov-badge a { color: inherit; text-decoration: underline; }

/* --- signup / auth form extras --- */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 60px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--teal-d); font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.pw-meter { height: 6px; border-radius: 999px; background: var(--bg-tint); margin: 8px 0 4px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s, background .2s; background: var(--risk-d); }
.pw-meter.s2 span { background: #e0a63a; }
.pw-meter.s3 span { background: #86b93f; }
.pw-meter.s4 span { background: var(--ok-d); }
.pw-hint { font-size: 11.5px; margin-bottom: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted);
  margin: 10px 0 0; cursor: pointer; line-height: 1.45; }
.check input { margin-top: 2px; flex: none; width: 15px; height: 15px; }
.login-aux { margin-top: 8px; text-align: right; font-size: 12.5px; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.email-row #setEmail { font-size: 13.5px; color: var(--ink); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; color: var(--faint); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-social { display: flex; flex-direction: column; gap: 8px; }
.auth-social .btn { width: 100%; justify-content: center; }
.btn-social { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; }
.captcha-slot { margin: 12px 0 4px; min-height: 32px; display: flex; justify-content: center; }
.legal-body { font-size: 13px; color: var(--muted); line-height: 1.6; max-height: 300px; overflow: auto; }
.legal-body p { margin: 0 0 10px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 4px 0 6px; }
.recovery-grid code { background: var(--bg-tint); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; text-align: center;
  letter-spacing: .04em; color: var(--ink-strong); }
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 14px 20px 0; padding: 11px 16px; border-radius: 10px; background: var(--review-soft);
  border: 1px solid #ecdab0; color: var(--review-d); font-size: 13px; font-weight: 500; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.kvs { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kvs dt { color: var(--faint); }
.kvs dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* footer */
.footer { max-width: none; margin: 30px 0 40px; padding: 0 clamp(18px,2.4vw,40px); }
.disclaimer { font-size: 12px; color: var(--faint); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 18px; }
.disclaimer.subtle { border: 0; padding-top: 6px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.risk-text { color: var(--risk-d); }
.ok-text { color: var(--ok-d); }
.review-text { color: var(--review-d); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 26px; }
.spacer { height: 8px; }

/* Honesty labels (§12): mark any value that is estimated, illustrative, or
   sample data rather than a fact read from the user's statement. */
.est-badge { font-weight: 600; letter-spacing: .01em; vertical-align: middle; }
.est-note { font-size: 11.5px; line-height: 1.5; margin: 8px 0 0; }
.est-inline {
  font-size: .5em; font-weight: 600; color: var(--faint);
  letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
}
code { background: var(--bg-tint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; color: var(--ink); }

/* print / report */
@media print {
  .topbar, .footer, #exportReport, .nav, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #d8dee6; break-inside: avoid; }
}

/* ============================================================
   Command-center shell (v4): sidebar + content + assistant rail
   ============================================================ */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; min-width: 0; }

/* ---- sidebar ---- */
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 6px 8px 16px; gap: 11px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 540; text-align: left;
  transition: background .15s, color .15s;
}
.side-link svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-link:hover { color: var(--ink-strong); background: var(--bg-tint); }
.side-link.active { color: var(--teal-d); background: var(--teal-soft); font-weight: 600; }
.side-link.active svg { opacity: 1; }
.side-foot { margin-top: auto; }
.side-logout { width: 100%; margin-bottom: 8px; }
.side-logout:hover { color: var(--risk-d); background: var(--risk-soft); }
.side-logout:hover svg { opacity: 1; }
.side-help {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  background: var(--bg-tint); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.side-help .dot-ok { width: 9px; height: 9px; }

.content { min-width: 0; display: flex; flex-direction: column; }

/* ---- appbar ---- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(18px, 2.4vw, 40px);
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar .spacer-grow { flex: 1; }
.appbar .selectish {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  font-size: 13px; color: var(--ink); font-weight: 540; box-shadow: var(--shadow-xs);
}
.appbar .selectish select { width: auto; border: 0; padding: 0; background: transparent; box-shadow: none; font-weight: 560; }
.appbar .selectish select:focus { box-shadow: none; }

/* ---- dashboard grid + assistant rail ---- */
.dash { display: grid; grid-template-columns: minmax(0,1fr) 326px; gap: 18px; align-items: start; }
.dash-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.assistant { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1240px){ .dash { grid-template-columns: 1fr; } .assistant { position: static; } }

/* ---- KPI cards (uniform, stacked) ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: stretch; min-width: 0; text-align: left; transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { transform: translateY(-2px); border-color: #cdd9e6; box-shadow: 0 6px 18px #1a2b3d14; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 540; display: flex; align-items: center; gap: 7px; min-width: 0; }
.kpi-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; }
.kpi-card.risk .kpi-label::before { background: var(--risk); }
.kpi-card.ok .kpi-label::before { background: var(--ok); }
.kpi-card.review .kpi-label::before { background: var(--review); }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-tint); color: var(--muted); font-size: 14px; flex: none; }
.kpi-ico svg { width: 16px; height: 16px; }
.ih-cal svg { width: 24px; height: 24px; }
.if-ico svg { width: 22px; height: 22px; }
.kpi-val { font-size: 26px; font-weight: 680; letter-spacing: 0; margin-top: 12px; color: var(--ink-strong); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; text-align: left; }
.kpi-card.risk .kpi-val { color: var(--risk-d); }
.kpi-card.ok .kpi-val { color: var(--ok-d); }
.kpi-meta { margin-top: 8px; min-height: 18px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; text-align: left; }
.kpi-sub { font-size: 12px; color: var(--faint); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 640; padding: 2px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.delta.up   { color: var(--risk-d); background: var(--risk-soft); }   /* debt up = bad */
.delta.down { color: var(--ok-d);   background: var(--ok-soft); }
.delta.flat { color: var(--muted);  background: var(--bg-tint); }

/* ---- action center (task list) ---- */
.tasklist { display: flex; flex-direction: column; gap: 0; }
.task {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center;
  padding: 13px 4px; border-bottom: 1px solid var(--hairline);
}
.task:last-child { border-bottom: 0; }
.task .tico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.task.risk .tico   { background: var(--risk-soft); color: var(--risk-d); }
.task.review .tico { background: var(--review-soft); color: var(--review-d); }
.task.ok .tico     { background: var(--ok-soft); color: var(--ok-d); }
.task .t-title { font-weight: 580; font-size: 13.5px; color: var(--ink-strong); }
.task .t-sub { font-size: 12px; color: var(--faint); }
.task-more {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.task-more:hover,
.task-more:focus-visible {
  background: var(--bg-tint);
  outline: none;
}
.task-more .tico {
  background: var(--bg-tint);
  color: var(--teal-d);
  font-size: 12px;
  font-weight: 700;
}
.task-more-link {
  color: var(--teal-d);
  font-size: 12.5px;
  font-weight: 650;
}

/* ---- assistant cards ---- */
.assistant .panel { padding: 16px; }
.rec { display: grid; grid-template-columns: 30px 1fr 14px; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.rec:last-child { border-bottom: 0; }
.rec .rico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-d); font-size: 14px; }
.rec .r-title { font-weight: 580; font-size: 13px; color: var(--ink-strong); }
.rec .r-sub { font-size: 11.5px; color: var(--faint); }
.rec .chev { color: var(--faint); }
.assistant .ask { margin-top: 12px; display: flex; gap: 8px; }
.assistant .ask input { font-size: 13px; }
.ask-out:empty { display: none; }
.ask-out { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ask-out .ask-q { align-self: flex-end; background: var(--teal-soft); color: var(--teal-d); font-size: 12.5px; font-weight: 560; padding: 7px 11px; border-radius: 12px 12px 2px 12px; max-width: 90%; }
.ask-out .ask-a { align-self: flex-start; background: var(--bg-tint); color: var(--ink-strong); font-size: 12.5px; line-height: 1.5; padding: 9px 12px; border-radius: 12px 12px 12px 2px; max-width: 95%; }
.ask-hints { font-size: 11px; margin-top: 8px; }
.savings-hero { text-align: left; }
.savings-hero .big { font-size: 26px; font-weight: 680; color: var(--ok-d); letter-spacing: 0; }

.tf-seg { flex-wrap: wrap; }
.i-tip { font-size: 11px; color: var(--faint); cursor: help; }

/* ---- 3-up + mini card grids ---- */
.grid.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 16px; align-items: stretch; }
.grid.mini > .panel { display: flex; flex-direction: column; }
.grid.mini > .panel .link { margin-top: auto; padding-top: 12px; }   /* links flush to card bottom */
/* a lone trailing card (odd count) spans the full row instead of sitting orphaned */
.grid.mini > .panel:last-child:nth-child(odd):not(:only-child) { grid-column: 1 / -1; }
.grid.mini .row-hover td { padding: 9px 2px; font-size: 13px; }
.grid.mini .row-hover thead th { font-size: 11px; }
/* rewards optimization rows — card name never wraps */
.ro-list { display: flex; flex-direction: column; }
.ro-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.ro-row:last-child { border-bottom: 0; }
.ro-cat { color: var(--muted); }
.ro-card { white-space: normal; font-weight: 560; }

/* ---- local brand marks + dashboard decision-card bento ---- */
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center; flex: none;
  color: #fff; background: var(--teal); border: 1px solid #ffffff40;
  font-size: 10px; font-weight: 760; line-height: 1; letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), var(--shadow-xs);
  vertical-align: middle;
}
.brand-mark-sm { width: 22px; height: 22px; border-radius: 7px; font-size: 8.5px; margin-right: 7px; }
.brand-bestbuy { background: #f6cf24; color: #171717; border-color: #d8b300; }
.brand-costco { background: linear-gradient(135deg, #d8202a 0 50%, #1d5aa6 50%); }
.brand-aircanada { background: #e31b23; }
.brand-amazon { background: #232f3e; color: #ffb000; font-size: 14px; }
.brand-installment { background: #eef2f6; color: var(--muted); border-color: var(--line-2); }
.brand-rogers, .brand-netflix { background: #d71920; }
.brand-bell, .brand-visa { background: #00549f; }
.brand-goodlife { background: #c41230; }
.brand-spotify { background: #1db954; color: #102216; }
.brand-amex { background: #2e77bc; }
.brand-neo { background: #101820; color: #9ff2d0; }
.brand-cibc { width: 34px; background: #8f1733; color: #ffd24d; font-size: 8px; }
.brand-mbna { background: #b1081f; }
.brand-mastercard { background: linear-gradient(135deg, #eb001b 0 50%, #f79e1b 50%); color: #fff; }
.brand-generic { background: var(--teal-soft); color: var(--teal-d); border-color: #c7e5e7; }

.brand-cell { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.brand-cell > span:last-child { min-width: 0; }
.brand-table td:first-child { min-width: 0; }
.brand-table .badge { margin-left: 6px; }
.ro-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(108px, auto); }
.ro-card { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex-wrap: wrap; text-align: right; }
.ro-card .brand-mark { margin-right: 2px; }
.ro-card .faint { white-space: nowrap; }

.dashboard-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.dashboard-bento .insight-card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  padding: 22px;
}
.dashboard-bento .insight-card .link { margin-top: auto; padding-top: 14px; }
.dashboard-bento .row-hover td { padding: 9px 2px; font-size: 13px; }
.mom-card { min-height: 218px; }
.mom-card { grid-column: span 2; }

/* ===== Insights summary view ===== */
.insights-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ih-left { display: flex; gap: 14px; align-items: center; }
.ih-cal { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-d); font-size: 20px; flex: none; }
.insights-head h1 { font-size: 30px; }
.sum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 1100px){ .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px){ .sum-grid { grid-template-columns: 1fr; } }
.sum-card { display: flex; flex-direction: column; }
.sum-card .link { margin-top: auto; padding-top: 12px; }   /* pin link to card bottom */
.sum-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sum-label { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.sum-val { font-size: 24px; font-weight: 720; letter-spacing: 0; margin: 8px 0; color: var(--ink-strong); }
.sum-sub2 { font-weight: 620; color: var(--ink-strong); margin: 4px 0 10px; }
.mom-list { display: flex; flex-direction: column; gap: 8px; }
.mom-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.sum-card .badge { max-width: max-content; }

.next-panel { margin-top: 18px; }
.next-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.prio-table { display: flex; flex-direction: column; }
/* fixed number/impact/button columns + minmax(0,fr) so every row (incl. header)
   resolves to identical column widths — no per-row drift (align across rows). */
.prio-row { display: grid; grid-template-columns: 56px minmax(0, 1.5fr) minmax(0, 1.7fr) 150px 184px; column-gap: 20px; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--hairline); }
.prio-row:last-child { border-bottom: 0; }
.prio-row .num, .prio-save { text-align: right; }
.prio-row > span:last-child { justify-self: end; }
.prio-row .btn { white-space: nowrap; }
.prio-th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 6px 2px; }
.prio-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; font-weight: 700; font-size: 13px; }
.prio-n.muted-n { background: var(--line); color: var(--muted); }
.prio-act { display: flex; gap: 10px; align-items: center; }
.prio-why { font-size: 13px; color: var(--muted); }
.prio-save b { font-size: 16px; }
@media (max-width: 980px){
  .prio-th { display: none; }
  .prio-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "num act  act"
      "num why  why"
      "num save cta";
    row-gap: 8px; column-gap: 12px; align-items: start; padding: 16px 2px;
  }
  .prio-row .prio-n    { grid-area: num; align-self: start; }
  .prio-row .prio-act  { grid-area: act; }
  .prio-row .prio-why  { grid-area: why; display: block; }
  .prio-row .prio-save { grid-area: save; align-self: center; text-align: left; }
  .prio-row > span:last-child { grid-area: cta; align-self: center; justify-self: end; }
  .prio-row .btn { white-space: nowrap; }
}

.insights-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px;
  background: linear-gradient(150deg, var(--teal-soft), var(--surface)); flex-wrap: wrap; }
.if-left { display: flex; gap: 14px; align-items: center; }
.if-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok-d); flex: none; }
/* equal-height bottom cards with links aligned to the bottom edge */
.insights-bottom .panel { display: flex; flex-direction: column; }
.insights-bottom .panel .link { margin-top: auto; padding-top: 12px; }
.insights-bottom .panel table { margin-bottom: 4px; }
@media (max-width: 1080px){
  .grid.cols-3 { grid-template-columns: 1fr; }
  .exposure-panel { grid-column: auto; }
}
.link { display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--teal-d); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---- cards at a glance ---- */
.g-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.g-id.with-mark { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; }
.g-name-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.g-id .badge { max-width: max-content; }
.g-name { font-weight: 580; font-size: 13.5px; color: var(--ink-strong); }
.g-util { width: 92px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.ubar { height: 6px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.ubar span { display: block; height: 100%; border-radius: 999px; }
.ubar .hi { background: var(--risk); } .ubar .mid { background: var(--review); } .ubar .lo { background: var(--ok); }

/* ---- quick payoff simulator ---- */
.sim { display: grid; grid-template-columns: 1.1fr 1.4fr 1.3fr; gap: 22px; align-items: center; }
.sim-chips { flex-wrap: wrap; margin-bottom: 12px; }
.sim-control input[type=range] { width: 100%; accent-color: var(--teal); }
.sim-stats { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.sim-stats .sim-val { font-size: 18px; font-weight: 680; color: var(--ink-strong); margin-top: 2px; }
@media (max-width: 980px){ .sim { grid-template-columns: 1fr; gap: 16px; } }

/* ---- responsive sidebar ---- */
@media (max-width: 880px){
  .shell { display: block; width: 100%; max-width: 100vw; overflow-x: hidden; }
  .shell, .content { max-width: 100vw; overflow-x: hidden; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 4px;
             overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .sidebar .brand { padding: 6px 8px; }
  .side-nav { flex-direction: row; margin: 0; min-width: 0; flex: 1 1 auto; overflow-x: auto; }
  .side-link { padding: 8px 11px; white-space: nowrap; }
  .side-link span { display: none; }
  .side-foot { display: none; }
}

@media (max-width: 760px){
  html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .shell, .content, .sidebar, .appbar, .app { width: 100%; max-width: 100vw; }
  .view-head h1, .insights-head h1 { font-size: 24px; }
  .hero h1 { font-size: 30px; }
  .stat .value { font-size: 25px; }
  .app { padding: 18px; overflow-x: hidden; }
  .appbar { flex-wrap: wrap; align-items: stretch; gap: 8px; }
  .appbar .spacer-grow { display: none; }
  .appbar .selectish { flex: 1 1 100%; justify-content: center; }
  .appbar .btn { flex: 1 1 100%; min-width: 0; }
  .appbar #uploadBtn { white-space: normal; }
  .appbar #exportReport { flex-basis: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .dashboard-bento { grid-template-columns: 1fr; }
  .dashboard-bento .insight-card { min-height: auto; }
  .dashboard-bento table { table-layout: fixed; }
  .dashboard-bento td:first-child { width: 68%; }
  .dashboard-bento td.num { width: 32%; white-space: nowrap; }
  .dashboard-bento .brand-cell { width: 100%; }
  .dashboard-bento .brand-cell > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .dashboard-bento .ro-row { grid-template-columns: 1fr; gap: 5px; justify-items: start; }
  .dashboard-bento .ro-card { justify-content: flex-start; text-align: left; }
  .mom-card { grid-column: auto; }
  .g-util { width: 100%; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Public homepage
   ============================================================ */
.public-mode {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fa 48%, #f8fbfd 100%);
  overflow-x: hidden;
}
.public-mode .shell { display: block; min-height: 100vh; }
.public-mode .sidebar,
.public-mode .appbar { display: none; }
.public-mode .content { display: block; }
.public-mode .app { padding: 0; }
.public-mode .footer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 34px max(20px, calc((100vw - 1240px) / 2)) 42px;
  background: #f8fbfd;
}

.public-home {
  --home-max: 1240px;
  --home-pad: clamp(20px, 3.4vw, 44px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.public-home, .public-home * { min-width: 0; }
.public-home section { scroll-margin-top: 92px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.home-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(360px, 1fr) auto;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-height: 70px;
  padding: 14px max(var(--home-pad), calc((100vw - var(--home-max)) / 2));
  background: rgba(251, 253, 255, .88);
  border-bottom: 1px solid rgba(220, 227, 236, .72);
  backdrop-filter: blur(16px);
}
.home-brand {
  display: inline-flex; align-items: center; gap: 12px; min-width: 220px;
  background: transparent; border: 0; padding: 4px 0; color: var(--ink-strong); text-align: left;
  border-radius: 8px;
}
.home-brand strong { display: block; font-size: 18px; line-height: 1.1; }
.home-brand small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.home-brand:focus-visible,
.home-links a:focus-visible,
.home-menu-toggle:focus-visible,
.link-btn:focus-visible,
.faq-item summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.home-links {
  display: flex; align-items: center; justify-content: center; gap: clamp(16px, 2.7vw, 34px);
  flex: 1; font-size: 14px; font-weight: 560;
}
.home-links a {
  color: var(--ink-strong);
  border-radius: 8px;
  padding: 7px 3px;
  border-bottom: 2px solid transparent;
}
.home-links a:hover,
.home-links a.active {
  color: var(--teal-d);
  text-decoration: none;
  border-bottom-color: var(--teal);
}
.home-actions { display: flex; gap: 12px; align-items: center; }
.home-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  place-items: center;
  gap: 4px;
}
.home-menu-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink-strong);
}

.home-hero {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(500px, 1.26fr);
  gap: clamp(34px, 5vw, 72px); align-items: center;
  width: 100%;
  padding: clamp(54px, 5.5vw, 82px) max(var(--home-pad), calc((100vw - var(--home-max)) / 2)) clamp(50px, 5vw, 70px);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: clip; pointer-events: none; }
.hero-glow {
  position: absolute; top: -24%; right: -6%; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(14,124,134,.20), rgba(14,124,134,.06) 55%, transparent 72%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(20,60,80,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 74% 32%, #000, transparent 60%);
  mask-image: radial-gradient(circle at 74% 32%, #000, transparent 60%);
}
.home-copy, .home-preview { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  padding: 7px 15px 7px 11px; border-radius: 999px;
  background: rgba(14,124,134,.09); border: 1px solid rgba(14,124,134,.18);
  color: var(--teal-d); font-size: 12.5px; font-weight: 640;
}
.hero-eyebrow svg { width: 15px; height: 15px; }
.home-copy h1 {
  max-width: 560px; font-size: clamp(42px, 4.5vw, 58px); line-height: 1.08;
  font-weight: 720; color: var(--ink-strong);
}
.home-copy p {
  max-width: 560px; margin: 22px 0 0; color: var(--muted);
  font-size: 17px; line-height: 1.7;
}
.home-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.btn-home-main { min-width: 142px; justify-content: center; min-height: 52px; display: inline-flex; align-items: center; gap: 9px; }
.home-proof {
  display: flex; flex-wrap: wrap; gap: 14px 26px;
  margin-top: 34px; max-width: 680px; font-size: 12.5px; color: var(--ink);
}
.home-proof span { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.35; }
.home-proof svg { width: 18px; height: 18px; color: var(--teal-d); }
.public-home .btn:hover,
.home-feature:hover,
.pricing-card:hover,
.faq-item:hover,
.preview-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.home-preview {
  position: relative;
  border-radius: 16px; padding: 0; overflow: visible;
  background: var(--surface);
  box-shadow: 0 40px 96px -46px rgba(14,33,56,.5);
  border: 1px solid rgba(220,227,236,.85);
}
/* browser-window chrome — reframes the live demo as the real product */
.browser-chrome {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfe, #f1f6f9); border-radius: 16px 16px 0 0;
}
.bc-dots { display: inline-flex; gap: 6px; }
.bc-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.bc-dots i:nth-child(1) { background: #f0a49f; }
.bc-dots i:nth-child(2) { background: #f2cf98; }
.bc-dots i:nth-child(3) { background: #a7d9bf; }
.bc-url {
  display: inline-flex; align-items: center; gap: 7px; justify-self: center; min-width: 0; max-width: 320px;
  padding: 5px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-url svg { width: 12px; height: 12px; color: var(--ok-d); flex: none; }
.bc-live { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-d); font-size: 11.5px; font-weight: 640; }
.bc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,134,.15); }
.home-preview .preview-shell { border: 0; border-radius: 0 0 16px 16px; box-shadow: none; }
.preview-float {
  position: absolute; left: -18px; bottom: 30px; z-index: 3;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 9px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgba(14,33,56,.42);
}
.pf-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ok-soft); color: var(--ok-d); font-weight: 800; }
.pf-body { display: flex; flex-direction: column; line-height: 1.22; }
.pf-body strong { font-size: 12.5px; color: var(--ink-strong); }
.pf-body span { font-size: 11px; color: var(--muted); }
.preview-shell {
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; box-shadow: 0 1px 2px rgba(18,42,74,.04), 0 22px 56px -44px rgba(14,33,56,.32);
}
.preview-head, .preview-kpis, .preview-grid, .preview-spend, .preview-payoff-stats {
  display: grid; gap: 14px;
}
.preview-head {
  grid-template-columns: 1fr auto; align-items: center; margin-bottom: 18px;
}
.preview-head strong { display: block; color: var(--ink-strong); }
.preview-head span { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.preview-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.preview-kpis div, .preview-card {
  border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-xs);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.preview-kpis div { min-height: 74px; padding: 12px 10px; overflow: hidden; }
.preview-kpis span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.preview-kpis strong { font-size: clamp(13px, 1.08vw, 16px); color: var(--ink-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.preview-grid { grid-template-columns: 1.2fr .9fr; margin-top: 14px; }
.preview-card { padding: 16px; min-width: 0; }
.preview-card h3 { font-size: 13px; margin-bottom: 12px; }
.preview-spend { grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 10px; }
.home-cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 11.5px; padding: 4px 0; }
.home-cat-row span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-cat-row i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.home-cat-row strong { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.link-btn {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--teal-d);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  padding: 3px 0;
  border-radius: 6px;
}
.link-btn:hover { color: var(--ink-strong); text-decoration: underline; }
.preview-payoff { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; align-items: center; }
.preview-payoff h3 { margin: 0; }
.preview-payoff .seg button { padding: 6px 10px; font-size: 12px; }
.preview-range { height: 8px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.preview-range span { display: block; width: 36%; height: 100%; background: var(--teal); border-radius: inherit; }
.preview-payoff-stats { grid-template-columns: repeat(2, 1fr); margin: 0; }
.preview-payoff-stats dt { color: var(--faint); font-size: 11px; }
.preview-payoff-stats dd { margin: 2px 0 0; font-weight: 680; color: var(--ink-strong); }

.issuer-strip {
  width: 100%;
  text-align: center;
  padding: 18px max(var(--home-pad), calc((100vw - var(--home-max)) / 2)) 38px;
}
.issuer-strip p { margin: 0 0 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }
.issuer-strip h2 { font-size: 18px; font-weight: 560; margin-bottom: 24px; }
.issuer-strip div { display: flex; justify-content: center; align-items: center; gap: clamp(12px, 2.8vw, 36px); flex-wrap: wrap; }
.issuer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 6px;
  filter: saturate(1.02);
  transition: transform .16s ease, opacity .16s ease;
}
.issuer-logo img {
  height: clamp(22px, 2.3vw, 30px);
  width: auto;
  display: block;
}
.issuer-strip:hover .issuer-logo:not(:hover) { opacity: .78; }
.issuer-logo:hover { transform: translateY(-1px); }
.issuer-more {
  color: var(--teal-d);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 800;
  font-size: 14px;
}

.home-section {
  width: 100%;
  padding: 56px max(var(--home-pad), calc((100vw - var(--home-max)) / 2));
}
.section-kicker {
  margin: 0 0 10px;
  color: var(--teal-d);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  font-weight: 760;
}
.home-section > h2 {
  text-align: center; font-size: clamp(28px, 3vw, 38px); margin-bottom: 32px;
}
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 4vw, 54px); }
.how-step {
  text-align: left;
  padding: 18px 0;
}
.home-icon {
  width: 62px; height: 62px; display: grid; place-items: center; border-radius: 16px;
  background: var(--teal-soft); color: var(--teal-d); font-weight: 760;
  border: 1px solid #cbe5e7; margin-bottom: 14px;
}
.home-icon svg { width: 30px; height: 30px; }
.how-step h3, .home-feature h3, .home-faq h3 { font-size: 15px; margin-bottom: 7px; }
.how-step p, .home-feature p, .home-final p, .home-faq p {
  margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55;
}

/* Section rhythm — break the uniform centred-band cadence. */
#how { background: linear-gradient(180deg, #f5fafb, #ffffff); border-top: 1px solid var(--line); }
#how .section-kicker, #how > h2,
#pricing .section-kicker, #pricing > h2 { text-align: left; }
#how > h2, #pricing > h2 { max-width: 620px; }
.how-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.how-step-head .home-icon { margin-bottom: 0; }
.how-num { font-size: 15px; font-weight: 800; letter-spacing: .05em; color: var(--teal-d); opacity: .5; }
.how-step h3 { margin-top: 14px; }

.feature-panel {
  background: rgba(255,255,255,.8);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.home-feature {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 18px; border-radius: 8px; background: var(--surface); border: 1px solid var(--hairline);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.home-feature .home-icon { width: 46px; height: 46px; border-radius: 8px; margin: 0; font-size: 13px; }
.home-feature .home-icon svg { width: 24px; height: 24px; }
.tone-1 { background: var(--teal-soft); color: var(--teal-d); }
.tone-2 { background: var(--review-soft); color: var(--review-d); border-color: #ecdab0; }
.tone-3 { background: #e6eef8; color: #315f97; border-color: #cad9ed; }
.tone-4 { background: #f4eafa; color: #70549a; border-color: #e3d4ef; }

.about-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
  background: #f7fafc;
}
.about-section .section-kicker,
.about-section h2 { text-align: left; }
.about-section h2 { font-size: clamp(28px, 3.4vw, 44px); margin: 0; }
.about-copy {
  display: grid;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.about-copy p { margin: 0; }

.security-band {
  display: grid; grid-template-columns: 190px 1fr 240px; gap: 28px; align-items: center;
  width: min(calc(100% - 40px), var(--home-max));
  margin: 34px auto 36px;
  padding: 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #075c62, #0d7b84);
  box-shadow: 0 26px 60px -36px rgba(7,92,98,.7);
}
.security-band h2 { color: #fff; font-size: 25px; margin-bottom: 18px; }
.security-visual {
  width: 150px; height: 150px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
}
.security-visual svg { width: 78px; height: 78px; color: #d7f1f2; }
.security-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.security-list span { position: relative; padding-left: 22px; font-size: 14px; color: #e7fbfc; }
.security-list span::before { content: "✓"; position: absolute; left: 0; color: #baf2d2; }
.security-band aside {
  background: rgba(3,45,50,.28); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 20px; color: #e9fbfc;
}
.security-band aside strong { display: block; color: #fff; font-size: 15px; margin-bottom: 10px; }
.security-band aside p { margin: 0; font-size: 13px; line-height: 1.6; }

.pricing-section {
  background: #fbfdff;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pricing-card.featured {
  border-color: #b6dce0;
  box-shadow: 0 14px 38px -30px rgba(14,124,134,.55);
}
.pricing-card h3 { font-size: 18px; margin-bottom: 8px; }
.pricing-card strong { display: block; color: var(--ink-strong); font-size: 24px; margin-bottom: 10px; }
.pricing-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.pricing-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 13.5px;
}
.pricing-card li { position: relative; padding-left: 20px; }
.pricing-card li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 999px; background: var(--teal); }
.pricing-card .btn,
.pricing-note { margin-top: auto; width: max-content; max-width: 100%; }
.pricing-note {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--bg-tint);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 650;
}

.home-final {
  display: grid; grid-template-columns: 1fr 420px; gap: 34px; align-items: center;
  width: 100%;
  padding: 56px max(var(--home-pad), calc((100vw - var(--home-max)) / 2));
  border-radius: 0;
  background: linear-gradient(135deg, #fbfdff, #eef8f9);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.home-final h2 { font-size: clamp(26px, 3vw, 34px); max-width: 520px; }
.home-final p { max-width: 520px; margin-top: 12px; }
/* Final CTA: a real "Cards at a glance" product snapshot in a browser frame. */
.final-visual {
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface);
  box-shadow: 0 22px 48px -26px rgba(20, 40, 60, .4); overflow: hidden;
  display: flex; flex-direction: column;
}
.fm-shell { padding: 15px 16px 18px; display: flex; flex-direction: column; gap: 11px; }
.fm-title { font-size: 12.5px; font-weight: 700; color: var(--ink-strong); }
.fm-card { border: 1px solid var(--hairline); border-radius: 11px; padding: 11px 13px; background: var(--surface); box-shadow: var(--shadow-xs); }
.fm-card-top { display: flex; justify-content: space-between; align-items: center; }
.fm-card-top span { font-size: 12.5px; font-weight: 600; color: var(--ink-strong); }
.fm-card-top strong { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.fm-track { height: 6px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; margin: 9px 0 6px; }
.fm-track span { display: block; height: 100%; border-radius: inherit; }
.fm-track span.ok { background: var(--ok-d); }
.fm-track span.review { background: var(--review-d); }
.fm-track span.risk { background: var(--risk-d); }
.fm-card-sub { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.home-faq {
  background: #f8fbfd;
}
/* FAQ — single-column accordion, centered, with a rotating chevron. */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 10px auto 0;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s, background .18s;
}
.faq-item[open] {
  border-color: var(--teal);
  box-shadow: 0 14px 30px -18px rgba(14, 124, 134, .45);
}
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q {
  flex: 1;
  color: var(--ink-strong);
  font-weight: 650;
  font-size: 15px;
}
.faq-chev {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-d);
  transition: transform .22s ease, background .18s;
}
.faq-chev svg { width: 16px; height: 16px; }
.faq-item[open] .faq-chev { transform: rotate(180deg); }
.faq-a {
  padding: 0 20px 18px 20px;
  border-top: 1px solid var(--line);
  margin-top: -1px;
}
.faq-a p {
  margin: 0;
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 1060px) {
  .home-nav {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 64px;
  }
  .home-menu-toggle { display: grid; }
  .home-links {
    display: none;
    position: absolute;
    left: max(var(--home-pad), calc((100vw - var(--home-max)) / 2));
    right: max(var(--home-pad), calc((100vw - var(--home-max)) / 2));
    top: calc(100% - 1px);
    padding: 10px;
    background: rgba(255,255,255,.98);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-pop);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .home-links.open { display: grid; }
  .home-links a {
    padding: 10px 12px;
    border-bottom: 0;
    background: transparent;
  }
  .home-links a:hover,
  .home-links a.active {
    background: var(--teal-soft);
    border-bottom-color: transparent;
  }
  .home-actions { grid-column: 1 / -1; justify-self: start; }
  .home-hero { grid-template-columns: 1fr; }
  .home-preview { max-width: 860px; }
  .home-proof { max-width: 860px; }
  .how-grid, .feature-grid, .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-section { grid-template-columns: 1fr; }
  .security-band { grid-template-columns: 1fr; }
  .security-visual { display: none; }
  .home-final { grid-template-columns: 1fr; }
  .final-visual { display: none; }
}

@media (max-width: 760px) {
  .public-home { --home-pad: 16px; }
  .public-home section { scroll-margin-top: 78px; }
  .public-mode .footer { padding-left: 16px; padding-right: 16px; }
  .home-nav {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .home-brand { min-width: 0; }
  .home-brand strong { font-size: 16px; }
  .home-brand small { font-size: 11px; }
  .home-links {
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
  }
  .home-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-actions .btn { width: 100%; }
  .home-hero { padding-top: 38px; padding-bottom: 44px; gap: 28px; }
  .home-copy, .home-preview, .preview-shell, .home-cta { width: 100%; max-width: none; }
  .home-copy h1 { width: 100%; max-width: none; font-size: 34px; overflow-wrap: break-word; }
  .home-copy p { width: 100%; max-width: none; font-size: 15.5px; line-height: 1.6; overflow-wrap: break-word; }
  .home-proof { grid-template-columns: 1fr; gap: 10px; }
  .home-cta .btn { width: 100%; }
  .home-preview { padding: 0; border-radius: 14px; }
  .preview-float { display: none; }
  .browser-chrome { border-radius: 14px 14px 0 0; }
  .home-preview .preview-shell { padding: 12px; border-radius: 0 0 14px 14px; }
  .preview-head, .preview-payoff { grid-template-columns: 1fr; }
  .preview-kpis, .preview-grid, .preview-spend, .preview-payoff-stats { grid-template-columns: 1fr; }
  .preview-kpis div { min-height: auto; }
  .preview-card table { table-layout: fixed; }
  .issuer-strip { padding-bottom: 30px; }
  .issuer-strip h2 { font-size: 16px; }
  .issuer-strip span { font-size: 16px; }
  .home-section { padding-top: 46px; padding-bottom: 46px; }
  .how-grid, .feature-grid, .security-list, .pricing-grid { grid-template-columns: 1fr; }
  .security-band { padding-top: 34px; padding-bottom: 34px; }
  .home-final { padding-top: 38px; padding-bottom: 38px; }
  .pricing-card .btn,
  .pricing-note { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .public-home .btn,
  .home-feature,
  .pricing-card,
  .faq-item,
  .preview-card {
    transition: none;
  }
}

/* ============================================================
   Mobile app redesign layer
   ============================================================ */
@media (max-width: 760px) {
  :root {
    --radius: 12px;
    --radius-sm: 9px;
  }

  body {
    background: var(--bg);
    font-size: 14px;
    line-height: 1.45;
  }

  .shell,
  .content,
  .app,
  .footer {
    min-width: 0;
    max-width: 100vw;
  }

  .app > *,
  .footer > *,
  .view-head,
  .panel,
  .cardrow,
  .callout {
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 8px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    overflow: hidden;
  }

  .sidebar .brand {
    width: 100%;
    padding: 0;
    min-width: 0;
  }

  .logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
  }

  .brand-name {
    font-size: 14.5px;
  }

  .brand-tag {
    display: none;
  }

  .side-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, 44px);
    justify-content: space-between;
    gap: 4px;
    overflow: visible;
  }

  .side-link {
    justify-content: center;
    width: 44px;
    min-width: 0;
    min-height: 42px;
    padding: 9px 0;
    border-radius: 11px;
  }

  .side-link svg {
    width: 19px;
    height: 19px;
  }

  .appbar {
    position: static;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px 14px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
  }

  .conn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
  }

  .appbar .selectish,
  .appbar .btn,
  .appbar .selectish select {
    width: 100%;
  }

  .appbar .btn {
    min-height: 38px;
    justify-content: center;
  }

  .app {
    width: 100vw !important;
    padding: 20px 14px 28px;
  }

  .app > *,
  .footer > * {
    width: 100%;
    max-width: calc(100vw - 28px) !important;
  }

  .view-head {
    margin-bottom: 16px;
  }

  .view-head h1,
  .insights-head h1 {
    font-size: 24px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .view-head p,
  .hero p {
    font-size: 13.5px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .app p,
  .app h2,
  .app h3,
  .muted,
  .faint {
    overflow-wrap: anywhere;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
  }

  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .panel-head h3 {
    font-size: 14px;
  }

  .grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.mini,
  .sum-grid,
  .insights-bottom {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .grid.mini > .panel:last-child:nth-child(odd):not(:only-child) {
    grid-column: auto;
  }

  .kpi-card {
    padding: 15px 16px;
    min-height: 122px;
  }

  .kpi-val,
  .stat .value {
    font-size: 25px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .stat .value {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .kpi-top,
  .sum-top {
    align-items: flex-start;
  }

  .dash {
    display: block;
  }

  .dash-main,
  .assistant {
    gap: 12px;
  }

  .assistant {
    margin-top: 12px;
  }

  .seg {
    width: 100%;
    overflow-x: auto;
  }

  .seg button {
    flex: 1 0 auto;
    min-height: 36px;
    padding: 7px 12px;
  }

  #methodSeg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  #methodSeg button {
    min-width: 0;
    padding-inline: 8px;
  }

  .dashboard-bento {
    gap: 12px;
  }

  .dashboard-bento .insight-card {
    padding: 16px;
  }

  .dashboard-bento .panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-bento .panel-head .faint,
  .dashboard-bento .panel-head .badge {
    justify-self: start;
  }

  .brand-cell,
  .ro-card {
    min-width: 0;
  }

  .brand-cell > span:last-child,
  .ro-card span {
    min-width: 0;
  }

  .row-hover td,
  .row-hover th,
  td,
  th {
    padding: 9px 6px;
    font-size: 12.5px;
  }

  .panel > table,
  .panel table.row-hover:not(.brand-table) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel > table:not(.brand-table),
  .panel table.row-hover:not(.brand-table) {
    white-space: nowrap;
  }

  .panel table.strategy-table {
    display: table;
    white-space: normal;
  }

  .strategy-table thead {
    display: none;
  }

  .strategy-table tbody,
  .strategy-table tr,
  .strategy-table td {
    display: block;
    width: 100%;
  }

  .strategy-table tr {
    padding: 13px 0;
    border-bottom: 1px solid var(--hairline);
  }

  .strategy-table tr:last-child {
    border-bottom: 0;
  }

  .strategy-table td {
    border: 0;
    padding: 3px 0;
    text-align: left !important;
    white-space: normal;
  }

  .strategy-table td:nth-child(2)::before {
    content: "Priority: ";
    color: var(--faint);
    font-weight: 600;
  }

  .strategy-table td:nth-child(3)::before {
    content: "Months: ";
    color: var(--faint);
    font-weight: 600;
  }

  .strategy-table td:nth-child(4)::before {
    content: "Interest: ";
    color: var(--faint);
    font-weight: 600;
  }

  .strategy-table td:nth-child(5):empty {
    display: none;
  }

  .brand-table {
    table-layout: fixed;
  }

  .brand-table td:first-child {
    width: 68%;
  }

  .brand-table td.num {
    width: 32%;
    white-space: nowrap;
  }

  .g-id.with-mark {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .g-util {
    width: 100%;
  }

  .task {
    grid-template-columns: 30px 1fr;
    align-items: start;
  }

  .task .btn {
    grid-column: 2;
    width: 100%;
  }

  .rec {
    grid-template-columns: 30px minmax(0, 1fr) 14px;
  }

  .assistant .ask {
    display: grid;
    grid-template-columns: 1fr 44px;
  }

  .sim {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sim-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sim-stats .btn {
    width: 100%;
  }

  .inline-form,
  .actions,
  .no-print {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .inline-form .grow,
  .inline-form > div,
  .actions .btn,
  .no-print .btn {
    width: 100%;
    min-width: 0;
  }

  input,
  select,
  .btn {
    min-height: 40px;
  }

  .cardrow {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .cardrow .name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
  }

  .cardrow .right {
    text-align: left;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
    min-width: 0;
  }

  .cardrow .tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
    max-width: 100%;
  }

  .badge {
    justify-content: center;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .callout {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 13px;
  }

  .hero {
    text-align: left;
    padding: 24px 0 4px;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  .pill-row {
    justify-content: flex-start;
  }

  .dropzone {
    padding: 24px 16px;
  }

  .pipeline {
    display: grid;
    grid-template-columns: 1fr;
  }

  #cardRequestBoard > div[style],
  #webhookBody > div[style] {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  #crIssuer,
  #crProduct,
  #whUrl {
    min-width: 0 !important;
  }

  .insights-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ih-left,
  .if-left {
    align-items: flex-start;
  }

  .sum-card {
    min-height: auto;
  }

  .next-head,
  .insights-foot {
    display: grid;
    grid-template-columns: 1fr;
  }

  .prio-table {
    gap: 0;
  }

  .prio-row {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-areas:
      "num act"
      "num why"
      "num save"
      "num cta";
    row-gap: 8px; column-gap: 10px;
    align-items: start;
    padding: 16px 0;
  }

  .prio-row.prio-th {
    display: none;
  }

  .prio-row .prio-n    { grid-area: num; }
  .prio-row .prio-act  { grid-area: act; align-items: flex-start; }
  .prio-row .prio-why  { grid-area: why; display: block; }
  .prio-row .prio-save { grid-area: save; text-align: left; }
  .prio-row > span:last-child { grid-area: cta; justify-self: stretch; }

  .prio-row .btn {
    width: 100%;
    white-space: nowrap;
  }

  .insights-foot .btn {
    width: 100%;
  }

  .barlist .row {
    grid-template-columns: minmax(76px, .9fr) minmax(72px, 1fr);
    gap: 8px;
  }

  .barlist .amt {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
  }

  .kvs {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .kvs dd {
    text-align: left;
    padding-bottom: 8px;
  }

  .switch {
    align-items: flex-start;
  }

  .modal-root {
    align-items: end;
    padding: 12px;
  }

  .modal {
    max-width: none;
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 20px;
    border-radius: 16px;
  }

  .modal .actions {
    justify-content: stretch;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-table {
    font-size: 12.5px;
  }

  .footer {
    margin: 20px 0 28px;
    padding: 0 14px;
  }

  .disclaimer {
    font-size: 11.5px;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .kpi-val,
  .stat .value {
    font-size: 23px;
  }

  .dashboard-bento td:first-child,
  .brand-table td:first-child {
    width: 64%;
  }

  .dashboard-bento td.num,
  .brand-table td.num {
    width: 36%;
  }
}

/* ============================================================
   Dashboard cleanup: focused cards, contextual trends, floating chat
   ============================================================ */
.dash {
  display: block;
}

.next-actions-panel .panel-head {
  align-items: flex-start;
}

.next-actions-panel .panel-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.subcard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px;
  min-width: 0;
}

.subcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.subcard-head h4 {
  font-size: 13.5px;
}

.opportunity-list {
  display: grid;
  gap: 8px;
}

.opportunity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 11px;
  text-align: left;
  color: var(--ink);
}

.opportunity-row:hover {
  border-color: #cdd9e6;
  box-shadow: var(--shadow-xs);
}

.opportunity-row .faint {
  display: block;
  font-size: 12px;
}

.empty-row {
  color: var(--faint);
  font-size: 13px;
  padding: 12px 0;
}

.dashboard-bento .mom-card {
  grid-column: 1 / -1;
  min-height: auto;
}

.trend-head {
  align-items: flex-start;
}

.trend-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.trend-controls {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: min(360px, 100%);
}

.trend-controls > span {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.change-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.change-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.change-row strong,
.change-row .faint {
  display: block;
}

.change-now {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.change-now span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 650;
}

.change-row.risk .change-now span { color: var(--risk-d); }
.change-row.ok .change-now span { color: var(--ok-d); }
.change-row.neutral .change-now span { color: var(--faint); }

.spend-panel {
  grid-column: span 1;
}

.spend-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  justify-items: center;
}

.spend-chart > svg {
  max-width: 100%;
  height: auto;
}

.category-list {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.cat-row {
  display: grid;
  grid-template-columns: minmax(90px, .85fr) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 7px 8px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.cat-row:hover,
.cat-row:focus-visible {
  background: var(--bg-tint);
  border-color: var(--line);
  outline: none;
}

.cat-row:active {
  transform: translateY(1px);
}

.cat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.cat-label .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.cat-track {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.cat-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.cat-amt {
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
}

.exposure-panel {
  grid-column: span 2;
}

.exposure-head {
  align-items: flex-start;
}

.exposure-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.exposure-totals {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 18px;
  text-align: right;
}

.exposure-totals > span {
  display: grid;
  gap: 2px;
  color: var(--faint);
  font-size: 11.5px;
}

.exposure-totals strong {
  color: var(--ink-strong);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.exposure-totals > span:last-child strong {
  color: var(--risk-d);
}

.exposure-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.exposure-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exposure-legend i {
  width: 18px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.exposure-legend i.balance {
  background: var(--teal);
}

.exposure-legend i.interest {
  background: var(--risk);
  height: 4px;
}

.card-metric-list {
  display: grid;
  gap: 8px;
}

.card-metric-row {
  display: grid;
  grid-template-columns: minmax(154px, .86fr) minmax(170px, 1.45fr) minmax(118px, auto);
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.card-metric-row:hover,
.card-metric-row:focus-visible {
  background: var(--bg-tint);
  border-color: var(--line);
  outline: none;
}

.card-metric-row:active {
  transform: translateY(1px);
}

.cm-card {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cm-card > span:last-child,
.cm-values {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cm-card strong {
  color: var(--ink-strong);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-bars {
  min-width: 0;
}

.cm-track {
  position: relative;
  display: block;
  height: 16px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.cm-fill {
  position: absolute;
  left: 0;
  border-radius: 999px;
}

.cm-fill.balance {
  top: 5px;
  height: 8px;
  background: var(--teal);
}

.cm-fill.interest {
  top: 0;
  height: 4px;
  background: var(--risk);
}

.cm-values {
  text-align: right;
  font-size: 12px;
}

.cm-values strong {
  color: var(--ink-strong);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.exposure-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.card-identity-head {
  align-items: flex-start;
}

.card-identity-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card-glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.glance-card {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .06s;
}

.glance-card:hover {
  border-color: #cdd9e6;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.glance-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.glance-card-head .badge,
.glance-facts .badge {
  max-width: max-content;
  white-space: nowrap;
}

.glance-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.glance-facts > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.glance-facts > div:last-child {
  grid-column: 1 / -1;
}

.glance-facts strong {
  font-size: 14px;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}

.chat-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  width: auto;
  margin: 0;
}

.chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 15px 10px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 14px 32px rgba(11, 31, 55, .22);
}

.chat-fab span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  font-weight: 800;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(370px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 112px));
  overflow: auto;
}

.chat-panel[hidden] {
  display: none;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.quick-prompts button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 600;
}

.quick-prompts button:hover {
  color: var(--teal-d);
  border-color: #bddde1;
  background: var(--teal-soft);
}

@media (max-width: 980px) {
  .subcard-grid,
  .change-list,
  .spend-chart {
    grid-template-columns: 1fr;
  }

  .trend-controls {
    justify-items: start;
    width: 100%;
  }

  .trend-controls .seg {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app {
    padding-bottom: 92px;
  }

  .dash-main {
    gap: 12px;
  }

  .dashboard-bento .mom-card {
    grid-column: auto;
  }

  .subcard {
    padding: 12px;
  }

  .cat-row {
    grid-template-columns: minmax(0, 1fr) minmax(72px, .8fr);
  }

  .cat-amt {
    grid-column: 1 / -1;
  }

  .exposure-head,
  .exposure-totals,
  .exposure-links {
    justify-content: flex-start;
    text-align: left;
  }

  .exposure-totals {
    width: 100%;
  }

  .card-metric-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 11px 10px;
  }

  .cm-values {
    text-align: left;
  }

  .card-identity-head,
  .glance-card-head,
  .subcard-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .head-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .glance-facts {
    grid-template-columns: 1fr;
  }

  .chat-assistant {
    right: 14px;
    bottom: 14px;
  }

  .chat-fab {
    width: 54px;
    height: 54px;
    min-height: 54px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .chat-fab strong {
    display: none;
  }

  .chat-fab span {
    width: auto;
    height: auto;
    background: transparent;
    font-size: 18px;
  }

  .chat-panel {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 92px);
    bottom: 60px;
  }
}

/* Public homepage must not inherit dashboard mobile shell constraints. */
@media (max-width: 760px) {
  .public-mode .app {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow-x: hidden;
  }

  .public-mode .app > .public-home {
    width: 100% !important;
    max-width: none !important;
  }

  .public-mode .app > .public-home > * {
    max-width: 100% !important;
  }

  .public-mode .home-nav,
  .public-mode .home-hero,
  .public-mode .issuer-strip,
  .public-mode .home-section,
  .public-mode .security-band,
  .public-mode .home-final {
    width: 100%;
    max-width: 390px !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .public-mode .home-nav {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    position: sticky;
  }

  .public-mode .home-brand {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    padding-right: 0;
  }

  .public-mode .home-menu-toggle {
    display: inline-flex !important;
    position: static;
    flex: 1 1 100%;
    width: 100%;
    max-width: 358px;
    height: 40px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    border-color: var(--navy);
  }

  .public-mode .home-menu-toggle span:not(.sr-only) {
    display: none;
  }

  .public-mode .home-menu-toggle::before {
    content: "";
    width: 18px;
    height: 12px;
    background:
      linear-gradient(#fff, #fff) 0 0 / 18px 2px no-repeat,
      linear-gradient(#fff, #fff) 0 5px / 18px 2px no-repeat,
      linear-gradient(#fff, #fff) 0 10px / 18px 2px no-repeat;
    border-radius: 2px;
  }

  .public-mode .home-menu-toggle::after {
    content: "Menu";
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }

  .public-mode .home-menu-toggle.open::after {
    content: "Close menu";
  }

  .public-mode .home-links {
    order: 3;
  }

  .public-mode .home-actions {
    display: none;
  }

  .public-mode .home-hero {
    display: block;
  }

  .public-mode .home-copy,
  .public-mode .home-preview,
  .public-mode .preview-shell,
  .public-mode .home-cta,
  .public-mode .home-proof {
    max-width: 358px !important;
  }

  .public-mode .home-preview {
    margin-top: 28px;
  }

  .public-mode .home-copy h1 {
    font-size: 31px;
    line-height: 1.16;
    overflow-wrap: anywhere;
  }

  .public-mode .home-copy p {
    overflow-wrap: anywhere;
  }
}
