/* ───────────────────────────────────────────────────────────────────────────
   Finio. "Receipt" design system
   Warm paper, charcoal ink, monospace figures and dashed perforations, like a
   little till receipt for your money. Friendly and quirky, still clean. Fully
   themed (light + dark) via [data-theme] on <html>; every legacy class/id is
   preserved so the existing JS keeps working.
   ─────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Theme tokens ─────────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg: #efe7d6;
  --bg-2: #e7ddc8;
  --bg-card: #fffdf7;
  --bg-card-solid: #fffdf7;
  --bg-input: #f6f1e6;
  --bg-elev: #fffdf7;
  --border: #e0d5bf;
  --border-strong: #cdbf9f;
  --ink-line: #2b2620;

  --accent: #0e7c66;
  --text-on-accent: #fff;
  --accent-hover: #0a6253;
  --accent-2: #c98a1e;
  --accent-dim: rgba(14, 124, 102, 0.10);
  --accent-border: rgba(14, 124, 102, 0.30);
  --grad: linear-gradient(135deg, #0e7c66 0%, #14998a 100%);

  --coin-1: #f6cf6b;
  --coin-2: #d9a229;
  --coin-edge: #a9781a;

  --text: #2b2620;
  --muted: #71634c;

  --green: #2f8f4e;
  --yellow: #c9821a;
  --red: #cf4b3b;

  --shadow-sm: 0 1px 2px rgba(60, 47, 20, 0.10);
  --shadow: 0 14px 30px -18px rgba(60, 47, 20, 0.35);
  --shadow-lg: 0 28px 60px -24px rgba(60, 47, 20, 0.40);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --bg: #16140f;
  --bg-2: #1c1a13;
  --bg-card: #211e17;
  --bg-card-solid: #211e17;
  --bg-input: #1a1812;
  --bg-elev: #262218;
  --border: #38332708;
  --border: #3a3327;
  --border-strong: #524935;
  --ink-line: #f0e9d8;

  --accent: #2fb89c;
  --text-on-accent: #132b25;
  --accent-hover: #46cdb1;
  --accent-2: #e0b558;
  --accent-dim: rgba(47, 184, 156, 0.14);
  --accent-border: rgba(47, 184, 156, 0.34);
  --grad: linear-gradient(135deg, #2fb89c 0%, #38c7b4 100%);

  --coin-1: #f6cf6b;
  --coin-2: #d9a229;
  --coin-edge: #8a6014;

  --text: #f0e9d8;
  --muted: #a99b7d;

  --green: #4fc878;
  --yellow: #e0b558;
  --red: #f0796a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 28px 60px -22px rgba(0, 0, 0, 0.8);
}

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

html { -webkit-text-size-adjust: 100%; }

/* Tell the browser which palette to paint NATIVE controls in. Without this,
   checkboxes, search inputs, buttons, date pickers and scrollbars stay in
   light mode on the dark theme. the white boxes. */
:root, [data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Buttons carry no chrome unless a class gives them some, so a bare <button>
   never renders as a grey/white box on top of a card. */
/* `appearance: none` is the part that actually matters: WebKit keeps painting
   native button chrome (the grey rounded box) even when background and border
   are cleared, which is where the stray boxes came from. */
button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  border-radius: 0;
}

/* Checkboxes in the app's accent colour rather than the OS default. */
input[type="checkbox"] { accent-color: var(--accent); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Faint paper texture: a soft dotted grain behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(120, 100, 60, 0.06) 1px, transparent 0);
  background-size: 22px 22px;
}

h1, h2, h3, .nav-logo, .auth-logo, .personality-type, .split-pct, .verdict-label,
.metric-card .value, .figure {
  font-family: 'Space Mono', 'SFMono-Regular', ui-monospace, monospace;
}

::selection { background: var(--accent-dim); }

/* ── Wordmark ── the finio logo, set in the monospace receipt font ─────────── */
.brand {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: inherit;
}
.brand::after { content: "."; letter-spacing: 0; }

/* ── Nav ── */
nav {
  background: var(--bg-card);
  border-bottom: 1px dashed var(--border-strong);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}
@media (min-width: 900px) { nav { padding: 0 2rem; } }
@media (min-width: 1400px) { nav { padding: 0 2.5rem; } }

.nav-logo {
  font-weight: 700;
  font-size: 1.45rem;
  text-decoration: none;
  letter-spacing: -0.04em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 0.125rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: #fff; background: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }

.nav-right { display: flex; align-items: center; gap: 0.6rem; }

/* Icon button (theme toggle) */
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.icon-btn:active { transform: none; }
.theme-toggle-fixed { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 200; }

#nav-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
#nav-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Account menu (avatar → dropdown), top right ── */
.nav-profile { position: relative; }
.nav-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-avatar:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.nav-profile.active .nav-avatar { box-shadow: 0 0 0 2px var(--accent-border); }
.nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  z-index: 150;
}
.nav-profile.open .nav-menu { display: flex; }
.nav-menu-email {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.4rem 0.6rem 0.5rem;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 0.25rem;
  word-break: break-all;
}
.nav-menu a, .nav-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-menu a:hover { background: var(--bg-input); }
.nav-menu-item:hover { background: var(--bg-input); color: var(--red); }

/* ── Profile page ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
#profile-form .form-grid-2 { grid-template-columns: 1fr; }
@container page (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
}
/* Unusual transactions (anomaly card) */
.anomaly-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--border); }
.anomaly-row:last-child { border-bottom: none; }
.anomaly-merchant { font-weight: 600; font-size: 0.875rem; }
.anomaly-meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.anomaly-amount { font-family: 'Space Mono', monospace; font-weight: 700; color: var(--red); white-space: nowrap; }

.streak-stats { display: flex; gap: 1.5rem; }
.streak-stat { text-align: center; }
.streak-stat .figure { font-size: 2.2rem; color: var(--accent); }
.streak-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; display: block; }

@media (max-width: 680px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 1rem; right: 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    gap: 0.15rem;
    z-index: 99;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: var(--radius-sm); }
}

/* ── Layout ── */
/* Full-bleed app canvas: content uses the whole viewport width. Forms/chat keep
   their own inner max-widths so long lines stay readable. */
main { width: 100%; max-width: none; margin: 0; padding: 1.75rem 1.5rem 3.5rem; }
@media (min-width: 900px) { main { padding: 2rem 2rem 4rem; } }
@media (min-width: 1400px) { main { padding: 2.25rem 2.5rem 4rem; } }
@media (max-width: 640px) { main { padding: 1.25rem 1rem 3rem; } }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.95rem; font-weight: 700; letter-spacing: -0.03em; }
.page-header p { color: var(--muted); margin-top: 0.3rem; font-size: 0.95rem; }
.patterns-freshness { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: -0.5rem 0 1.5rem; }
.patterns-freshness > div { min-width: 0; }
.patterns-freshness > button { flex-shrink: 0; }
.patterns-freshness #patterns-data-through { font-size: 0.875rem; font-weight: 600; }
.patterns-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
@container page (max-width: 700px) {
  .patterns-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Cards (paper slips) ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
@media (max-width: 600px) { .cards-row { grid-template-columns: 1fr; } }

/* Metric cards get a perforated top edge, like a torn receipt */
.metric-card { position: relative; overflow: hidden; }
.metric-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background-image: radial-gradient(circle, var(--accent) 1.5px, transparent 1.6px);
  background-size: 9px 4px;
  opacity: 0.65;
}
.metric-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-weight: 600;
}
.metric-card .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; }
.metric-card .sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.5rem;
  border-radius: 99px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -6px var(--accent-border); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-hover); box-shadow: 0 12px 26px -8px var(--accent-border); }
.btn-primary:active { transform: none; }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.privacy-contact-fields { min-width: 0; padding: 0; margin: 1.5rem 0 0; border: 0; }
.privacy-contact-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#privacy-contact-challenge { margin: 0 0 1rem; }
#privacy-contact-status { overflow-wrap: anywhere; }

label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a7d63' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
input[type="file"] { padding: 0.6rem 1rem; cursor: pointer; }
input[type="file"]::-webkit-file-upload-button {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  margin-right: 0.75rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-grid-2 { grid-template-columns: 1fr; } }

.form-error {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

/* ── Period bar (the time window selector shared across pages) ── */
.period-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: 99px;
  padding: 0.3rem 0.4rem 0.3rem 0.9rem;
}
.period-bar .period-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.period-bar select {
  width: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.4rem 2.2rem 0.4rem 0.8rem;
  font-size: 0.8125rem;
  border-radius: 99px;
}
/* The bar now wraps the same segmented control the dashboard uses, so every
   page's period picker looks and behaves identically. */
.period-bar .segmented { background: transparent; border: none; padding: 0; }

/* ── Progress bars ── */
.progress-bar {
  background: var(--border);
  border-radius: 99px;
  height: 9px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.progress-fill.green { background: var(--green); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red { background: var(--red); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.badge-yellow { background: color-mix(in srgb, var(--yellow) 16%, transparent); color: var(--yellow); }
.badge-red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 32%, transparent);
  color: var(--yellow);
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── Verdict card ── */
.verdict-card {
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 2rem;
  animation: fadeUp 0.35s ease;
  box-shadow: var(--shadow);
}
.verdict-card.green { background: color-mix(in srgb, var(--green) 9%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--green) 32%, transparent); }
.verdict-card.yellow { background: color-mix(in srgb, var(--yellow) 9%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--yellow) 32%, transparent); }
.verdict-card.red { background: color-mix(in srgb, var(--red) 9%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--red) 32%, transparent); }
.verdict-card.unknown { background: var(--bg-card); border: 1px solid var(--border-strong); }
.verdict-icon { font-size: 3.5rem; margin-bottom: 0.75rem; display: block; }
.verdict-label { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.verdict-card.green .verdict-label { color: var(--green); }
.verdict-card.yellow .verdict-label { color: var(--yellow); }
.verdict-card.red .verdict-label { color: var(--red); }
.verdict-card.unknown .verdict-label { color: var(--text); }
.verdict-message { font-size: 1rem; color: var(--text); line-height: 1.6; max-width: 480px; margin: 0 auto; }
.verdict-meta { margin-top: 1.5rem; display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.verdict-meta-item .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.verdict-meta-item .val { font-size: 1.125rem; font-weight: 700; margin-top: 0.2rem; font-family: 'Space Mono', monospace; }

/* ── Chat ── */
.chat-window {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 440px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  scroll-behavior: smooth;
}

.chat-msg { max-width: 80%; animation: fadeUp 0.25s ease; }

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 18px 18px 4px 18px;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-sm);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 18px 18px 18px 4px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.chat-msg .ts { font-size: 0.6875rem; color: var(--muted); margin-top: 0.35rem; }

.chat-input-row { display: flex; gap: 0.75rem; }
.chat-input-row input { flex: 1; }
.chat-input-row .btn { white-space: nowrap; flex-shrink: 0; }

.quick-questions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.quick-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  padding: 0.42rem 0.95rem;
  border-radius: 99px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.quick-btn:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.typing-indicator { align-self: flex-start; background: var(--bg-card-solid); border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: 18px 18px 18px 4px; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; animation: bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ── Disclaimer ── */
.disclaimer {
  background: var(--accent-dim);
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-top: 2.5rem;
}

/* ── Section titles ── */
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--border-strong);
  opacity: 0.8;
}

/* ── Info rows ── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); }
.info-value { font-weight: 600; font-family: 'Space Mono', monospace; }

/* ── Bills list ── */
.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}
.bill-row:last-child { border-bottom: none; }
.bill-merchant { font-weight: 500; font-size: 0.9375rem; }
.bill-meta { font-size: 0.8125rem; color: var(--muted); }
.bill-amount { font-weight: 700; font-size: 0.9375rem; font-family: 'Space Mono', monospace; }
.bill-freq {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  margin-right: 0.4rem;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
}
.link-btn:hover { text-decoration: underline; }

/* ── Pattern card ── */
.pattern-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.pattern-card.severity-high { border-left-color: var(--red); }
.pattern-card.severity-medium { border-left-color: var(--yellow); }
.pattern-card.severity-low, .pattern-card.severity-good { border-left-color: var(--green); }
.pattern-message { font-size: 0.9375rem; line-height: 1.5; }
.pattern-type { font-size: 0.775rem; color: var(--muted); margin-top: 0.3rem; text-transform: capitalize; }

/* ── Invest option menu ── */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px dashed var(--border);
}
.option-card:last-child { border-bottom: none; }
.option-type {
  flex-shrink: 0;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  min-width: 64px;
  text-align: center;
}
.option-body { flex: 1; }
.option-name { font-weight: 600; font-size: 0.95rem; }
.option-note { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; line-height: 1.45; }
.risk-pill {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-radius: 99px;
  padding: 0.12rem 0.55rem;
  margin-top: 0.4rem;
}
.risk-low { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.risk-medium { background: color-mix(in srgb, var(--yellow) 16%, transparent); color: var(--yellow); }
.risk-high { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

/* ── Overrides editor (mark income / bills) ── */
.override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.875rem;
}
.override-row:last-child { border-bottom: none; }
.override-match { font-family: 'Space Mono', monospace; font-weight: 700; }
.override-flow { color: var(--muted); text-transform: capitalize; }

/* ── Upload zone ── */
.upload-zone {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.5rem;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.upload-zone .upload-icon { display: block; font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-zone #statement-file-status { display: block; color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.upload-zone:disabled { cursor: wait; opacity: 0.65; }

/* ── Auth page ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s ease;
  position: relative;
}
/* Perforated top edge on the login slip */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background-image: radial-gradient(circle, var(--bg) 3px, transparent 3.2px);
  background-size: 14px 6px;
  background-position: center -3px;
}
.auth-logo {
  font-size: 2.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.35rem;
  letter-spacing: -0.05em;
  color: var(--text);
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}
.auth-tagline { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: 99px;
  padding: 0.3rem;
  margin-bottom: 2rem;
  gap: 0.25rem;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
  border: none;
  background: none;
  font-family: inherit;
}
.auth-tab.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }

.auth-error { background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 32%, transparent); color: var(--red); padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; display: none; }
.auth-success { background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 32%, transparent); color: var(--green); padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; display: none; }

/* ── Personality card ── */
.personality-card {
  background:
    radial-gradient(60rem 30rem at 100% 0%, var(--accent-dim), transparent 60%),
    var(--bg-card);
  border: 1px solid var(--accent-border);
}
.personality-type {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.action-plan-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}
.action-plan-item:last-child { border-bottom: none; }
.action-bullet { color: var(--accent); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── Invest ── */
.split-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.split-item {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
  box-shadow: var(--shadow-sm);
}
.split-item:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.split-pct {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.split-name { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.split-amount { font-size: 1rem; font-weight: 700; margin-top: 0.5rem; font-family: 'Space Mono', monospace; }
@media (max-width: 500px) { .split-row { flex-direction: column; } }

.etf-highlight {
  background: color-mix(in srgb, var(--green) 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.etf-name { font-size: 1.3rem; font-weight: 700; color: var(--green); margin-bottom: 0.25rem; font-family: 'Space Mono', monospace; }

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--muted);
  gap: 0.75rem;
  font-size: 0.9375rem;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── No data state ── */
.no-data { text-align: center; padding: 3.5rem 1.5rem; }
.no-data .icon { font-size: 3rem; margin-bottom: 1rem; }
.no-data h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.no-data p { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9375rem; }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1.5rem;
  border-radius: 99px;
  font-size: 0.875rem;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Chart container ── */
.chart-container { position: relative; height: 280px; margin: 0; width: 100%; max-width: none; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeUp 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ───────────────────────────────────────────────────────────────────────────
   Landing page
   ─────────────────────────────────────────────────────────────────────────── */
.landing { overflow-x: hidden; }

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}
.landing-nav .nav-logo { font-size: 1.5rem; }
.landing-nav .actions { display: flex; align-items: center; gap: 0.6rem; }

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  min-height: 70vh;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; }
  .hero-art { order: -1; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px dashed var(--accent-border);
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}
.hero h1 .ink { color: var(--accent); }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 34rem; margin-bottom: 1.75rem; }
@media (max-width: 820px) { .hero p.lede { margin-left: auto; margin-right: auto; } }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }
@media (max-width: 820px) { .hero-cta { justify-content: center; } }
.hero-note { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }

/* ── The animated, self-printing receipt ── */
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 360px; }

.receipt {
  position: relative;
  width: 290px;
  background: var(--bg-card);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  padding: 1.6rem 1.5rem 1.9rem;
  box-shadow: 0 26px 50px -22px rgba(60, 47, 20, 0.55), 0 2px 0 rgba(0,0,0,0.04);
  transform: rotate(-2.2deg);
  animation: receipt-float 6s ease-in-out infinite;
  z-index: 2;
}
/* Torn paper teeth, top and bottom, in the paper colour */
.receipt::before, .receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 11px;
  background: var(--bg-card);
}
.receipt::before {
  top: -10px;
  clip-path: polygon(0 100%,2.5% 0,5% 100%,7.5% 0,10% 100%,12.5% 0,15% 100%,17.5% 0,20% 100%,22.5% 0,25% 100%,27.5% 0,30% 100%,32.5% 0,35% 100%,37.5% 0,40% 100%,42.5% 0,45% 100%,47.5% 0,50% 100%,52.5% 0,55% 100%,57.5% 0,60% 100%,62.5% 0,65% 100%,67.5% 0,70% 100%,72.5% 0,75% 100%,77.5% 0,80% 100%,82.5% 0,85% 100%,87.5% 0,90% 100%,92.5% 0,95% 100%,97.5% 0,100% 100%);
}
.receipt::after {
  bottom: -10px;
  clip-path: polygon(0 0,2.5% 100%,5% 0,7.5% 100%,10% 0,12.5% 100%,15% 0,17.5% 100%,20% 0,22.5% 100%,25% 0,27.5% 100%,30% 0,32.5% 100%,35% 0,37.5% 100%,40% 0,42.5% 100%,45% 0,47.5% 100%,50% 0,52.5% 100%,55% 0,57.5% 100%,60% 0,62.5% 100%,65% 0,67.5% 100%,70% 0,72.5% 100%,75% 0,77.5% 100%,80% 0,82.5% 100%,85% 0,87.5% 100%,90% 0,92.5% 100%,95% 0,97.5% 100%,100% 0);
}

.receipt .r-line,
.receipt .r-head, .receipt .r-sub, .receipt .r-rule,
.receipt .r-total, .receipt .r-barcode, .receipt .r-thanks {
  opacity: 0;
  transform: translateY(-7px);
  animation: print-in 0.5s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.16s + 0.2s);
}

.receipt .r-head {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
}
.receipt .r-head .coin { font-size: 1.15rem; transform: translateY(0.05em); }
.receipt .r-sub {
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 0.15rem;
  margin-bottom: 0.7rem;
}
.receipt .r-rule { border-top: 1.5px dashed var(--border-strong); margin: 0.55rem 0; }
.receipt .r-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.2rem 0;
  color: var(--muted);
}
.receipt .r-line span:last-child { color: var(--text); }
.receipt .r-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.receipt .r-total span:last-child { color: var(--accent); }
.receipt .r-barcode {
  height: 34px;
  margin: 0.9rem 0 0.5rem;
  background-image: repeating-linear-gradient(90deg,
    var(--text) 0 2px, transparent 2px 4px,
    var(--text) 4px 5px, transparent 5px 9px,
    var(--text) 9px 12px, transparent 12px 14px);
  opacity: 0.85;
}
.receipt .r-thanks {
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--muted);
}

/* A soft print light sweeping down the slip */
.receipt-scan {
  position: absolute;
  left: 6px; right: 6px;
  height: 40px;
  top: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0;
  animation: receipt-scan 5.5s ease-in-out 2.2s infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes print-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes receipt-float {
  0%, 100% { transform: rotate(-2.2deg) translateY(0); }
  50% { transform: rotate(-1.2deg) translateY(-12px); }
}
@keyframes receipt-scan {
  0% { top: -10%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .receipt { animation: none; }
  .receipt-scan { display: none; }
  .receipt .r-line, .receipt .r-head, .receipt .r-sub, .receipt .r-rule,
  .receipt .r-total, .receipt .r-barcode, .receipt .r-thanks { opacity: 1; transform: none; animation: none; }
}

/* ── Feature slips ── */
.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}
.features h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin-bottom: 0.4rem; text-align: center; }
.features .sub { text-align: center; color: var(--muted); margin-bottom: 2rem; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 820px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-slip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.feature-slip:hover { transform: translateY(-4px); border-color: var(--accent-border); }
.feature-slip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background-image: radial-gradient(circle, var(--accent) 1.5px, transparent 1.6px);
  background-size: 9px 4px;
  opacity: 0.6;
}
.feature-slip .emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.feature-slip h3 { font-size: 1.05rem; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.feature-slip p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.landing-foot {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.landing-foot .disclaimer { display: inline-block; margin-top: 0; }

/* Content is VISIBLE by default; the scroll-in animation is an enhancement
   that only engages when JS marks the page ready (html.js). If the observer or
   a transition ever fails, nothing disappears. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
/* Safety: if anything ever blocks the transition, force the final state cold. */
html.js .reveal.force { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; } }

/* ══ Dashboard redesign ══════════════════════════════════════════════════ */

.btn-sm { padding: 0.5rem 1.05rem; font-size: 0.8125rem; }

/* Header row: title left, period control + reupload right */
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-head h1 { font-size: 1.95rem; font-weight: 700; letter-spacing: -0.03em; }
.dash-sub { color: var(--muted); margin-top: 0.3rem; font-size: 0.95rem; }
.dash-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.dash-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.dash-more, .dash-actions-menu { display: contents; }
.dash-more-toggle { display: none; }
.dash-upload-icon { width: 17px; height: 17px; flex-shrink: 0; }
@container page (max-width: 700px) {
  .dashboard-view .dash-controls { width: 100%; align-items: stretch; gap: .65rem; }
  .dashboard-view .dash-controls > #period-mount { width: 100%; flex-basis: 100%; }
  .dashboard-view .dash-controls .period-bar { width: 100%; border-style: solid; border-radius: 12px; padding: .35rem .65rem; }
  .dashboard-view .dash-controls .period-bar select { flex: 1; min-width: 0; width: auto; min-height: 38px; border: 0; background-color: transparent; }
  .dash-action-row { width: 100%; flex-wrap: nowrap; gap: .65rem; }
  .dash-action-row > #reupload-btn { flex: 1; min-width: 0; min-height: 46px; border-radius: 12px; background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
  .dash-action-row > #reupload-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .dash-more { display: block; position: relative; flex: 0 0 auto; }
  .dash-more-toggle { display: inline-flex; min-height: 46px; gap: .4rem; border-radius: 12px; padding: .6rem .85rem; }
  .dash-more-toggle svg { width: 19px; height: 19px; }
  .dash-more-toggle[aria-expanded="true"] { background: var(--accent-dim); border-color: var(--accent-border); }
  .dash-actions-menu { display: none; }
  .dash-more.open .dash-actions-menu {
    display: grid; gap: .15rem; position: absolute; right: 0; top: calc(100% + .5rem);
    z-index: 40; width: 260px; max-width: calc(100cqw - 2rem); padding: .4rem;
    background: var(--bg-card-solid); border: 1px solid var(--border-strong);
    border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .dash-more.open .dash-actions-menu.above { top: auto; bottom: calc(100% + .5rem); }
  .dash-actions-menu > .btn { justify-content: flex-start; min-height: 46px; width: 100%; padding: .75rem .8rem; border: 0; border-radius: 8px; background: none; text-align: left; white-space: normal; font-size: .875rem; font-weight: 500; line-height: 1.4; }
  .dash-actions-menu > .btn:hover { background: var(--accent-dim); }
  .dash-actions-menu > .btn::before { width: 20px; flex-shrink: 0; font-size: 1.2rem; line-height: 1; color: var(--muted); }
  .dash-actions-menu > #undo-edit::before { content: '↶'; }
  .dash-actions-menu > #reanalyze-btn::before { content: '↻'; }
}

/* Themed period picker: segmented toggle + month dropdown */
.period-control { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.segmented {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.2rem;
}
.segmented button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.month-select { width: auto; min-width: 150px; padding: 0.45rem 2.2rem 0.45rem 0.85rem; font-size: 0.8125rem; }

/* Hero one-liner */
.hero-summary {
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin-bottom: 1.5rem;
}
.hero-summary b { font-weight: 700; }
.spend-outlook { font-size: 0.85rem; color: var(--muted); margin: -0.9rem 0 1.5rem; padding: 0 0.3rem; }
.insight-card { display: flex; gap: 0.7rem; align-items: flex-start; background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 1.5rem; }
.insight-card .insight-icon { color: var(--accent); font-size: 1.05rem; line-height: 1.4; }
.insight-card p { font-size: 0.9rem; line-height: 1.5; color: var(--text); margin: 0; }

/* Two-column row (goal + budgets) */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
  /* Stretch, not start. With align-items:start a shorter column simply ended
     where its content ran out, leaving a block of dead space beside the taller
     one. on a real dashboard that was ~280px of nothing under the goal and
     personality cards. Stretching makes both columns the same height so the
     row closes off flush. */
  align-items: stretch;
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}
/* The last card in a column absorbs whatever height is left over, so the two
   columns finish on the same line instead of one stopping short. */
.dash-col > .card:last-child { flex: 1 1 auto; }

/* Clickable budget category rows → jump to the editor */
.budget-row { margin-bottom: 1.1rem; padding: 0.3rem 0.5rem; margin-left: -0.5rem; margin-right: -0.5rem; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; }
.budget-row:hover { background: var(--bg-input); }
.budget-row:focus-visible { outline: 2px solid var(--accent-border); }
.budget-edit-hint { font-size: 0.72rem; color: var(--accent); opacity: 0; font-weight: 600; transition: opacity 0.15s; }
.budget-row:hover .budget-edit-hint { opacity: 1; }
.tx-group.flash { animation: txflash 1.6s ease; }
@keyframes txflash { 0%, 100% { background: transparent; } 25% { background: var(--accent-dim); } }
@media (max-width: 800px) { .dash-two-col { grid-template-columns: 1fr; } }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
#tx-card, #personality-card { margin-bottom: 1.5rem; }

/* Savings goal */
.goal-amount {
  font-family: 'Space Mono', monospace;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.goal-rationale { color: var(--muted); font-size: 0.875rem; margin: 0.35rem 0 1rem; line-height: 1.45; }
.goal-progress { margin-top: 0.5rem; }
.goal-form-actions { display: flex; gap: 0.6rem; }

/* Transaction editor */
.tx-help { color: var(--muted); font-size: 0.8125rem; margin-top: 0.35rem; line-height: 1.45; max-width: 60ch; }
.tx-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 0.75rem 0;
}
.add-category { display: flex; gap: 0.5rem; align-items: center; }
.add-category input { width: 200px; padding: 0.5rem 0.8rem; font-size: 0.8125rem; }

.bulk-bar {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}
.bulk-bar label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--muted); font-weight: 500; }
.bulk-bar select { width: auto; min-width: 120px; padding: 0.4rem 2rem 0.4rem 0.7rem; font-size: 0.8125rem; }
#bulk-count { font-weight: 700; color: var(--text); }

.tx-search { flex: 1; min-width: 160px; padding: 0.5rem 0.85rem; font-size: 0.8125rem; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.75rem; }
.cat-chips:empty { margin: 0; }
.cat-chips-label { font-size: 0.75rem; color: var(--muted); margin-right: 0.2rem; }
.cat-chip { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--text); border-radius: 99px; padding: 0.2rem 0.3rem 0.2rem 0.7rem; font-size: 0.75rem; }
.cat-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.25rem; border-radius: 50%; }
.cat-chip button:hover { color: var(--red); }
.tx-more { display: block; width: 100%; background: none; border: none; border-top: 1px dashed var(--border); color: var(--accent); font-family: inherit; font-size: 0.78rem; font-weight: 600; padding: 0.55rem; cursor: pointer; }
.tx-more:hover { background: var(--bg-input); }
.tx-scroll { max-height: 560px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tx-group { border-bottom: 1px dashed var(--border); }
.tx-group.muted { opacity: 0.7; }
.tx-group-head {
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0;
  background: var(--bg-input);
  padding: 0.5rem 0.9rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tx-group-total { letter-spacing: 0; text-transform: none; font-family: 'Space Mono', monospace; }

.tx-row {
  display: grid;
  grid-template-columns: 24px 92px 1fr 110px 116px 150px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
}
.tx-row:last-child { border-bottom: none; }
.tx-row.edited { background: var(--accent-dim); }
.tx-check { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.tx-date { color: var(--muted); font-size: 0.75rem; }
.tx-merchant { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amount { font-family: 'Space Mono', monospace; text-align: right; }
.tx-amount.neg { color: var(--red); }
.tx-amount.pos { color: var(--green); }
.tx-row select { padding: 0.35rem 1.8rem 0.35rem 0.6rem; font-size: 0.75rem; background-position: right 0.6rem center; }
.tx-row select:disabled { opacity: 0.4; }

@media (max-width: 640px) {
  .tx-row { grid-template-columns: 20px 1fr 90px; row-gap: 0.4rem; }
  .tx-row .tx-date { grid-column: 2; grid-row: 2; display: block; }
  .tx-row .tx-merchant { grid-column: 2; grid-row: 1; }
  .tx-row .tx-amount { grid-column: 3; grid-row: 1; }
  .tx-row select { grid-column: span 3; }
}

/* ══ Stale-snapshot banner ═══════════════════════════════════════════════ */
.stale-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* Neutral (no-budget-yet) bar */
.progress-fill.neutral { background: var(--border-strong); opacity: 0.5; }

/* Compact transactions link card on the dashboard */
.tx-link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  text-decoration: none; color: inherit;
  transition: transform 0.15s, border-color 0.15s;
  margin-bottom: 1.5rem;
}
.tx-link-card:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.tx-link-arrow { color: var(--accent); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

/* ══ Floating AI-coach widget ════════════════════════════════════════════ */
#coach-fab {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 300;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 1.5rem; cursor: grab;
  touch-action: none;
  transition: transform 0.18s;
}
#coach-fab:hover { transform: translateY(-2px); }
#coach-fab.dragging {
  cursor: grabbing;
  transform: scale(1.06);
  transition: none;
}
#coach-fab.hidden { display: none; }

#coach-panel {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 310;
  /* Roomier floating panel. 400x560 made long answers feel cramped. */
  width: min(520px, calc(100vw - 2rem));
  height: min(680px, calc(100vh - 4rem));
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: none; flex-direction: column; overflow: hidden;
}
#coach-panel.open { display: flex; }
/* Mobile / narrow: classic full-bleed overlay */
#coach-panel.full {
  inset: 0; width: 100vw; height: 100vh; border-radius: 0; border: none;
}
/* Desktop split. default docks right; .coach-side-left flips it */
#coach-panel.split {
  top: 0; bottom: 0;
  width: var(--coach-pane, 42%);
  height: 100vh;
  border-radius: 0;
  border: none;
}
body.coach-side-right #coach-panel.split,
body:not(.coach-side-left) #coach-panel.split {
  right: 0; left: auto;
  border-left: 1px solid var(--border);
  border-right: none;
}
body.coach-side-left #coach-panel.split {
  left: 0; right: auto;
  border-right: 1px solid var(--border);
  border-left: none;
}

body.coach-split {
  --coach-pane: 42%;
  --page-col: 440px;
  --coach-col: 340px;
  overflow-x: hidden;
}
/* Push mode: page shrinks with the coach */
body.coach-split:not(.coach-overlay):not(.coach-page-over) > nav,
body.coach-split:not(.coach-overlay):not(.coach-page-over) > main,
body.coach-split:not(.coach-overlay):not(.coach-page-over) > .disclaimer {
  width: calc(100% - var(--coach-pane));
  max-width: none;
  box-sizing: border-box;
}
body.coach-side-right.coach-split:not(.coach-overlay):not(.coach-page-over) > nav,
body.coach-side-right.coach-split:not(.coach-overlay):not(.coach-page-over) > main,
body.coach-side-right.coach-split:not(.coach-overlay):not(.coach-page-over) > .disclaimer,
body.coach-split:not(.coach-side-left):not(.coach-overlay):not(.coach-page-over) > nav,
body.coach-split:not(.coach-side-left):not(.coach-overlay):not(.coach-page-over) > main,
body.coach-split:not(.coach-side-left):not(.coach-overlay):not(.coach-page-over) > .disclaimer {
  margin-left: 0;
  margin-right: 0;
}
body.coach-side-left.coach-split:not(.coach-overlay):not(.coach-page-over) > nav,
body.coach-side-left.coach-split:not(.coach-overlay):not(.coach-page-over) > main,
body.coach-side-left.coach-split:not(.coach-overlay):not(.coach-page-over) > .disclaimer {
  margin-left: var(--coach-pane);
  margin-right: 0;
}
body.coach-split > .disclaimer { padding-left: inherit; }
body.coach-split:has(#coach-panel.split) > nav,
body.coach-split:has(#coach-panel.split) > main,
body.coach-split:has(#coach-panel.split) > .disclaimer {
  overflow-x: auto;
}

/* Coach growing: page freezes at min, coach slides over */
body.coach-split.coach-overlay > nav,
body.coach-split.coach-overlay > main,
body.coach-split.coach-overlay > .disclaimer {
  width: var(--page-col, 440px);
  max-width: var(--page-col, 440px);
  box-sizing: border-box;
}
body.coach-side-right.coach-overlay > nav,
body.coach-side-right.coach-overlay > main,
body.coach-side-right.coach-overlay > .disclaimer,
body.coach-overlay:not(.coach-side-left) > nav,
body.coach-overlay:not(.coach-side-left) > main,
body.coach-overlay:not(.coach-side-left) > .disclaimer {
  margin-left: 0;
  margin-right: auto;
}
body.coach-side-left.coach-overlay > nav,
body.coach-side-left.coach-overlay > main,
body.coach-side-left.coach-overlay > .disclaimer {
  margin-left: auto;
  margin-right: 0;
}
body.coach-split.coach-overlay #coach-panel.split {
  width: var(--coach-pane, 42%);
  border-color: var(--border-strong);
  background: var(--bg-card-solid);
}

/* Coach shrinking: coach freezes at min, page goes full (over the rest) */
body.coach-split.coach-page-over > nav,
body.coach-split.coach-page-over > main,
body.coach-split.coach-page-over > .disclaimer {
  width: 100%;
  max-width: none;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}
body.coach-split.coach-page-over #coach-panel.split {
  width: var(--coach-col, 340px);
  border-color: var(--border-strong);
  background: var(--bg-card-solid);
}
body.coach-side-right.coach-page-over .cw-splitter,
body.coach-page-over:not(.coach-side-left) .cw-splitter {
  right: var(--coach-col, 340px);
  left: auto;
}
body.coach-side-left.coach-page-over .cw-splitter {
  left: var(--coach-col, 340px);
  right: auto;
}

.cw-splitter {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 320;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
body.coach-side-right .cw-splitter,
body:not(.coach-side-left) .cw-splitter {
  right: var(--coach-pane, 42%);
  left: auto;
  margin-right: -4px;
  margin-left: 0;
}
body.coach-side-left .cw-splitter {
  left: var(--coach-pane, 42%);
  right: auto;
  margin-left: -4px;
  margin-right: 0;
}
.cw-splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: var(--border-strong);
}
.cw-splitter:hover::after,
.cw-splitter:focus-visible::after,
body.coach-splitting .cw-splitter::after {
  background: var(--accent);
}
.cw-splitter:focus-visible { outline: none; }
body.coach-splitting {
  cursor: col-resize;
  user-select: none;
}
body.coach-splitting iframe,
body.coach-splitting canvas {
  pointer-events: none;
}

.cw-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.cw-title { font-family: 'Space Mono', monospace; font-weight: 700; color: var(--accent); }
.cw-actions { display: flex; gap: 0.3rem; }
.cw-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 1rem; line-height: 1;
}
.cw-btn:hover { color: var(--text); border-color: var(--accent-border); }

/* Body: optional left chats rail + main conversation */
.cw-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.cw-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cw-messages {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  /* Cap the READING column and centre it. In split mode the panel can be
     1400px wide, and a line of text running the full width is genuinely hard
     to read. the eye loses its place on the return sweep. Growing the side
     padding (rather than shrinking the panel) keeps the scrollbar and the
     hover backgrounds full-bleed while the text sits in a comfortable column,
     and it leaves the existing left/right turn alignment working inside it. */
  padding: 1rem max(1rem, calc((100% - var(--cw-read, 46rem)) / 2));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.cw-turn {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 100%;
  min-width: 0;
}
.cw-turn.user {
  align-self: flex-end;
  align-items: flex-end;
  max-width: 88%;      /* safe here: .cw-messages has a definite width */
}
.cw-turn.assistant {
  align-self: stretch;
  align-items: flex-start;
}
.cw-msg {
  min-width: 0;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  box-sizing: border-box;
  /* break-word, NOT anywhere. `anywhere` also changes the MIN-CONTENT size to
     the width of a single character, and because a bubble is a shrink-to-fit
     flex item the browser then squeezes it right down: "hi finiooo" needs 60px
     and was being rendered in 53px, wrapping onto two lines in a 736px column.
     `break-word` leaves intrinsic sizing alone, so the bubble takes its natural
     width and only breaks a genuinely unbreakable string. */
  overflow-wrap: break-word;
  word-break: normal;
  position: relative;
}
.cw-msg-body { min-width: 0; }
.cw-msg-body strong { font-weight: 700; }
.cw-mode-notice {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
/* User bubble shrink-wraps to the text (actions sit underneath, outside) */
/* Tinted rather than filled: a translucent wash of the accent with a border in
   the same colour, so the bubble reads as "yours" without a heavy solid slab. */
.cw-msg.user {
  width: fit-content;
  /* Cap in ch, NEVER a percentage. A percentage max-width resolves against the
     parent, but .cw-turn is shrink-to-fit and therefore sized BY this element,
     a circular dependency the browser breaks by collapsing the bubble. That is
     why "hi finiooo" rendered 86px wide and wrapped onto two lines inside a
     736px column. With a ch cap it takes its natural width (98px) and only
     wraps once it reaches a comfortable line length.
     The percentage cap lives on .cw-turn instead, which has a real parent. */
  max-width: 46ch;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--text);
}
.cw-msg.assistant {
  max-width: 100%;
  width: 100%;
  background: none;
  border: none;
  padding: 0.35rem 0 0.15rem;
  color: var(--text);
}
.cw-turn.typing .cw-msg.assistant {
  width: auto;
  padding: 0.35rem 0;
}
.cw-msg.assistant.streaming .cw-msg-body::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.1em;
  background: var(--accent);
  animation: cw-caret 0.8s steps(1) infinite;
}
@keyframes cw-caret {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cw-msg-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0.65;
  transition: opacity 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .cw-msg-actions { opacity: 0; }
  .cw-turn:hover .cw-msg-actions,
  .cw-turn:focus-within .cw-msg-actions { opacity: 1; }
}
/* Icon-only actions: square, borderless until hovered, so they sit quietly
   under a message instead of reading as a row of labelled buttons. */
.cw-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.cw-act svg { width: 15px; height: 15px; display: block; }
.cw-act:hover {
  color: var(--text);
  background: var(--bg-input);
  border-color: var(--border);
}
.cw-act.copied { color: var(--accent); }

/* Thinking. simple accent coin */
.cw-coin {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.15rem;
  perspective: 60px;
}
.cw-coin-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  animation: cw-coin-spin 1s linear infinite;
}
.cw-coin-face::after { content: "$"; }
@keyframes cw-coin-spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cw-coin-face { animation: none; }
}

.cw-proposal {
  align-self: flex-start; max-width: min(92%, 100%); min-width: 0;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: var(--radius); padding: 0.7rem 0.9rem;
  display: flex; align-items: center; gap: 0.8rem; font-size: 0.8125rem;
  box-sizing: border-box; overflow-wrap: anywhere; word-break: break-word;
}
.cw-prop-text { min-width: 0; flex: 1; }
.cw-prop-count { display: block; margin-top: 0.2rem; color: var(--muted); }
.cw-proposal-batch { width: min(92%, 100%); flex-wrap: wrap; border-style: dashed; }
.cw-proposal-preview { margin-left: 0.65rem; background: transparent; }
.cw-proposal-applied { opacity: 0.72; }
.cw-apply, .cw-apply-all, .cw-refresh-budgets {
  background: var(--accent); color: #fff; border: none; border-radius: 99px;
  padding: 0.4rem 1rem; font-weight: 600; font-size: 0.8125rem; cursor: pointer;
  white-space: nowrap;
}
.cw-apply:disabled, .cw-apply-all:disabled, .cw-refresh-budgets:disabled { opacity: 0.6; cursor: default; }

.cw-form {
  display: flex; gap: 0.5rem;
  /* Same column as the messages, so the composer lines up with the text
     above it instead of stretching the whole width of the panel. The
     border-top still spans edge to edge. */
  padding: 0.8rem max(0.8rem, calc((100% - var(--cw-read, 46rem)) / 2));
  border-top: 1px solid var(--border);
  min-width: 0;
  flex-shrink: 0;
}
/* A composer you can actually write in, rather than a one-line slot. It grows
   with the text (capped in JS) and sits on the same reading column as the
   messages above it. */
.cw-form { align-items: flex-end; }        /* send button stays by the last line */
.cw-form textarea {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  min-height: 46px;
  max-height: 160px;
  resize: none;              /* height is driven by content, not a drag handle */
  overflow-y: hidden;
  font-family: inherit;
  border-radius: 14px;
}
.cw-send {
  background: var(--accent); color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer;
}

/* ══ Dashboard v3: chart row + top merchants ═════════════════════════════ */
.dash-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
  align-items: stretch;
  width: 100%;
}
@media (max-width: 900px) { .dash-chart-row { grid-template-columns: 1fr; } }
.chart-wrap { position: relative; height: 280px; width: 100%; }
.chart-note { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.merchant-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.8125rem;
}
.merchant-row:last-child { border-bottom: none; }
.merchant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.merchant-bar { background: var(--bg-input); border-radius: 99px; height: 8px; overflow: hidden; }
.merchant-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.merchant-amt { font-family: 'Space Mono', monospace; white-space: nowrap; }

/* ══ Coach widget: chats side rail ═══════════════════════════════════════ */
.cw-head-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cw-drawer {
  display: none;
  width: var(--cw-rail, 180px);
  flex: 0 0 var(--cw-rail, 180px);
  border-right: none;
  background: var(--bg-card);
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  min-width: 0;
}
.cw-drawer.open { display: flex; }
.cw-rail-splitter {
  flex: 0 0 8px;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  background: transparent;
  align-self: stretch;
}
.cw-rail-splitter::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--border);
}
.cw-rail-splitter:hover::after,
#coach-panel.cw-rail-dragging .cw-rail-splitter::after {
  background: var(--accent);
}
#coach-panel.cw-rail-dragging { cursor: col-resize; user-select: none; }
.cw-drawer-head {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 700; padding: 0.7rem 0.85rem 0.35rem;
  flex-shrink: 0;
}
.cw-chat-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  width: 100%; text-align: left; background: none; border: none;
  border-left: 2px solid transparent;
  font-family: inherit; font-size: 0.78rem; color: var(--text);
  padding: 0.55rem 0.85rem; cursor: pointer;
  line-height: 1.35;
  box-sizing: border-box;
  min-width: 0;
}
.cw-chat-item:hover { background: var(--bg-input); }
.cw-chat-item.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.cw-chat-item.muted { color: var(--muted); cursor: default; }
.cw-chat-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-weight: 500;
  width: 100%;
  max-width: 100%;
}
.cw-chat-count {
  font-size: 0.68rem; color: var(--muted);
}

/* Select-all controls (transactions editor) */
.select-all-label {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8125rem; color: var(--muted); font-weight: 500;
  white-space: nowrap; cursor: pointer; margin: 0;
}
.select-all-label input { width: 16px; height: 16px; cursor: pointer; }
.tx-group-left { display: inline-flex; align-items: center; gap: 0.5rem; }
.tx-group-check { width: 14px; height: 14px; cursor: pointer; }

/* ══ Categorisation quiz card ════════════════════════════════════════════ */
.quiz-card {
  margin-bottom: 1.5rem;
  border: 1px solid var(--accent-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-card)) 0%, var(--bg-card) 42%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.quiz-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-strong);
  flex-wrap: wrap;
}
.quiz-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.quiz-kicker-mark {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
}
.quiz-progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 7.5rem;
}
.quiz-progress-bar {
  flex: 1;
  height: 6px;
  min-width: 72px;
  border-radius: 99px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.quiz-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.25s ease;
}
.quiz-progress {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  white-space: nowrap;
}
.quiz-body { display: flex; flex-direction: column; gap: 0.35rem; }
.quiz-merchant {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-word;
}
.quiz-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}
.quiz-prompt {
  margin: 0.55rem 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}
.quiz-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}
.quiz-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.quiz-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.05rem;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.quiz-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.quiz-chip.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--accent-border);
}
.quiz-chip.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.quiz-chip:disabled, .quiz-select:disabled, .quiz-skip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.quiz-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 22rem;
}
.quiz-select-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.quiz-select {
  width: 100%;
  max-width: 22rem;
  padding: 0.65rem 2.4rem 0.65rem 0.9rem;
  font-size: 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
}
.quiz-skip {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0.15rem 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiz-skip:hover { color: var(--accent); }
@media (max-width: 560px) {
  .quiz-chip { flex: 1 1 calc(50% - 0.5rem); }
  .quiz-secondary, .quiz-select { max-width: none; }
}

/* ══ Consistent rhythm ═══════════════════════════════════════════════════
   Every card grid used its own gap and every card its own inline margin,
   which made the page look randomly spaced. One spacing scale, applied to
   the grids, keeps columns aligned and gaps even. */
:root { --gap: 1.25rem; --gap-lg: 1.5rem; }
.cards-row,
.dash-chart-row,
.dash-two-col,
.dash-col,
.profile-grid { gap: var(--gap); }
.cards-row, .dash-chart-row, .dash-two-col { margin-bottom: var(--gap); }
/* Cards inside a column are spaced by the column's gap, never their own
   margin. mixing the two was the source of the uneven gutters. */
.dash-col > .card { margin-bottom: 0 !important; }
/* Stretch, not start. With align-items:start a shorter column simply ended
   where its content ran out, leaving a block of nothing beside the taller one
  . measured at ~280px under the goal/personality column. Stretching makes
   both columns the same height so the row closes off flush.
   NOTE: an earlier .dash-two-col rule further up sets this too; this block is
   the one that wins, so they must agree. */
.dash-two-col { align-items: stretch; }
.dash-col { align-content: stretch; }
/* The last card in a column absorbs the leftover height, so both columns
   finish on the same line instead of one stopping short. */
.dash-col > .card:last-child { flex: 1 1 auto; }

/* ══ Editable budgets ════════════════════════════════════════════════════ */
.budget-row { cursor: default; }
.budget-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.4rem; font-size: 0.875rem;
}
/* The category reads as plain text; it only reveals itself as a link on hover,
   so the row stays calm instead of looking like a toolbar. */
.budget-name {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0; cursor: pointer; text-align: left;
  font-weight: 600; color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.budget-name:hover { color: var(--accent); border-bottom-color: var(--accent-border); }
.budget-amounts {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--muted); white-space: nowrap;
}
/* The limit is the one editable value, so it gets a soft chip that lifts on
   hover. obviously clickable, never a grey OS button. */
.budget-limit {
  padding: 0.15rem 0.5rem; border-radius: 99px; cursor: pointer;
  font-size: 0.8125rem; font-weight: 600; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.budget-limit:hover {
  background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent);
}
/* "Set limit". nothing set yet, so invite the click. */
.budget-limit.set {
  background: transparent; border-style: dashed; color: var(--accent);
  border-color: var(--accent-border);
}
.budget-limit.set:hover { background: var(--accent-dim); }
.budget-foot { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; text-align: right; }
.budget-editor {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.6rem; padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}
.budget-editor input { width: 130px; padding: 0.45rem 0.7rem; font-size: 0.8125rem; }

/* ══ Invest readiness journey ════════════════════════════════════════════ */
.readiness-card { margin-bottom: var(--gap); border: 1px solid var(--border-strong); }
.readiness-card.ready { border-color: var(--accent-border); background:
  linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-card)) 0%, var(--bg-card) 46%); }
.readiness-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.readiness-title { font-family: 'Space Mono', monospace; font-size: 1.15rem; font-weight: 700; }
.readiness-sub { color: var(--muted); font-size: 0.875rem; margin-top: 0.25rem; max-width: 52ch; }
.readiness-score { text-align: right; }
.readiness-score-num { font-family: 'Space Mono', monospace; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.readiness-score-num span { font-size: 0.95rem; color: var(--muted); }
.readiness-score-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.readiness-bar { margin-bottom: 1.1rem; }
.readiness-steps { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.readiness-step { display: flex; align-items: flex-start; gap: 0.7rem; }
.readiness-mark {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--muted);
}
.readiness-step.done .readiness-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.readiness-step.next .readiness-mark { border-color: var(--accent); color: var(--accent); }
.readiness-step-label { font-size: 0.875rem; font-weight: 600; }
.readiness-step.done .readiness-step-label { color: var(--muted); text-decoration: line-through; }
.readiness-step-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
.readiness-when {
  margin-top: 0.95rem; padding-top: 0.8rem; border-top: 1px dashed var(--border);
  font-size: 0.85rem; color: var(--accent); font-weight: 500;
}

/* ══ Savings-goal pace presets ═══════════════════════════════════════════ */
.goal-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.85rem 0 0.25rem; }
.goal-preset {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.7rem;
  cursor: pointer; font: inherit; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.goal-preset:hover { border-color: var(--accent); transform: translateY(-1px); }
.goal-preset.active { border-color: var(--accent); background: var(--accent-dim); }
.goal-preset-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 700;
}
.goal-preset-amount { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 0.95rem; }
.goal-preset-rate { font-size: 0.7rem; color: var(--muted); }
@media (max-width: 520px) { .goal-presets { grid-template-columns: 1fr; } }

/* ══ Landing: how it works ═══════════════════════════════════════════════ */
.how { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 1rem; text-align: center; }
.how h2 { font-size: 1.9rem; letter-spacing: -0.03em; }
.how .sub { color: var(--muted); margin: 0.4rem 0 2rem; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; text-align: left; }
.how-step {
  position: relative;
  background: var(--bg-card); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); padding: 1.5rem 1.4rem 1.3rem;
}
.how-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: 'Space Mono', monospace; font-weight: 700; font-size: 0.9rem;
  margin-bottom: 0.7rem;
}
.how-step h3 { font-size: 1.02rem; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.how-step p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
@media (max-width: 820px) { .how-grid { grid-template-columns: 1fr; } }

/* ══ Landing: trust ══════════════════════════════════════════════════════ */
.trust {
  max-width: 1100px; margin: 0 auto 4rem; padding: 2.4rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); text-align: center;
}
.trust h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin-bottom: 1.6rem; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; text-align: left; }
.trust-item { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
.trust-item b { color: var(--text); }
.trust-mark { color: var(--accent); flex-shrink: 0; font-size: 0.7rem; line-height: 1.7; }
.trust-cta { margin-top: 1.9rem; }
@media (max-width: 820px) { .trust-grid { grid-template-columns: 1fr; } }

/* ══ Signup: check-your-email panel ══════════════════════════════════════ */
.verify-panel {
  /* The auth card centres its own header, but form elements inside reset to
     left. so centre every child of the panel explicitly. */
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 1rem 0 0.25rem; gap: 0.55rem;
}
.verify-panel > * { width: 100%; }
.verify-title { font-size: 1.3rem; letter-spacing: -0.02em; }
.verify-text { color: var(--muted); font-size: 0.9rem; line-height: 1.6; max-width: 34ch; margin: 0 auto; }
.verify-text b { color: var(--text); word-break: break-word; }
.verify-hint { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.9rem; }

/* ══ Invest: first $1,000 plan ═══════════════════════════════════════════ */
.f1k-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.f1k-saved { font-family: 'Space Mono', monospace; font-size: 1.35rem; font-weight: 700; }
.f1k-of { color: var(--muted); font-size: 0.875rem; }
.f1k-remaining { font-size: 0.8125rem; color: var(--muted); margin-top: 0.4rem; }
.f1k-steps {
  margin: 1rem 0 0; padding-left: 1.15rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  font-size: 0.9rem; line-height: 1.55;
}
.f1k-steps li::marker { color: var(--accent); font-weight: 700; }

/* ══ Coach: empty-chat welcome ═══════════════════════════════════════════
   A blank thread looked broken. This fills it with a greeting and one-tap
   openers, and it is removed the moment a real message arrives. */
.cw-empty {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
  gap: 0.5rem;
}
.cw-empty-mark {
  width: 46px; height: 46px; margin-bottom: 0.25rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.25rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.cw-empty-title {
  font-family: 'Space Mono', monospace;
  font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em;
}
.cw-empty-sub {
  color: var(--muted); font-size: 0.85rem; line-height: 1.55;
  max-width: 34ch; margin-bottom: 0.4rem;
}
.cw-starters { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; max-width: 22rem; }
.cw-starter {
  text-align: left; cursor: pointer;
  padding: 0.55rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.8125rem; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.cw-starter:hover {
  border-color: var(--accent-border);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transform: translateY(-1px);
}

/* ── Re-classify confirmation panel ───────────────────────────────────────
   A proposal, not a change: it lists what the model would do and waits for
   the user to tick and confirm. Styled distinctly from the table so it never
   reads as "already applied". */
.reclass-panel {
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-card-solid));
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  margin: 0 0 1rem;
}
.reclass-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.875rem;
}
.reclass-head-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.reclass-title { font-weight: 650; letter-spacing: -0.01em; }
.reclass-sub { color: var(--muted); font-size: 0.8125rem; margin-top: 0.125rem; }

.reclass-list {
  display: flex; flex-direction: column; gap: 0.25rem;
  max-height: 22rem; overflow-y: auto; overflow-x: auto;
}
.reclass-row {
  display: grid;
  /* Merchant is capped so the old -> new move sits next to it instead of
     being pushed across the row; the meta column absorbs the slack and
     right-aligns, keeping amounts and confidence in a clean edge column. */
  grid-template-columns: auto minmax(8rem, 20rem) minmax(11rem, auto) 1fr auto;
  align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.625rem; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
}
.reclass-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.reclass-row:has(.reclass-check:checked) {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.reclass-merchant {
  font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reclass-move { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.reclass-from { color: var(--muted); text-decoration: line-through; }
.reclass-arrow { color: var(--accent); }
.reclass-to { color: var(--text); font-weight: 600; }
.reclass-meta {
  color: var(--muted); font-size: 0.75rem; white-space: nowrap;
  font-variant-numeric: tabular-nums; text-align: right;
}
.reclass-conf {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.125rem 0.4rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.reclass-conf-high {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
}
.reclass-conf-medium {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted) 35%, transparent);
}
.reclass-foot {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 0.875rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .reclass-row { grid-template-columns: auto 1fr; row-gap: 0.25rem; }
  .reclass-move, .reclass-meta, .reclass-conf { grid-column: 2; }
}

/* ── Layout that responds to the CONTENT column, not the window ───────────
   Every breakpoint above is a viewport media query. That silently breaks in
   split mode: opening the coach shrinks <main> to ~40% of the window, but the
   window itself is unchanged, so a 500px-wide column kept the full desktop
   layout and its contents spilled out of their cards. clipped figures,
   truncated budget amounts, preset cards cut in half.

   Container queries fix the actual problem: these components now react to the
   width they are really given, whether that is narrow because the window is
   small or because the coach is open. */
main {
  container-type: inline-size;
  container-name: page;
}

/* Grid and flex children default to min-width:auto, so they refuse to shrink
   below their content and push out of the box instead of wrapping. This is
   what let long money figures escape their cards. */
.dashboard-grid > *, .cards-row > *, .dash-two-col > *, .dash-chart-row > *,
.split-row > *, .goal-presets > *, .form-grid-2 > *, .metric-card, .card {
  min-width: 0;
}
.card, .metric-card, .budget-item, .goal-preset {
  overflow-wrap: anywhere;
}

@container page (max-width: 900px) {
  .dash-chart-row { grid-template-columns: 1fr; }
}
@container page (max-width: 800px) {
  .dash-two-col { grid-template-columns: 1fr; }
}
@container page (max-width: 640px) {
  .cards-row { grid-template-columns: 1fr; }
  .budget-row { grid-template-columns: 1fr; row-gap: 0.35rem; }
}
@container page (max-width: 560px) {
  .goal-presets { grid-template-columns: 1fr; }
  .split-row { flex-direction: column; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@container page (max-width: 520px) {
  /* The transaction table is the widest thing on the platform. drop to the
     compact three-column form rather than letting it overflow. */
  .tx-row, .tx-head { grid-template-columns: 20px 1fr 90px; row-gap: 0.4rem; }
  .tx-toolbar { flex-wrap: wrap; }
}

/* A preset the user cannot currently fund. The backend flags these
   (achievable:false); showing them identically to affordable ones presented an
   impossible savings plan as a normal choice. */
.goal-preset.stretch { border-style: dashed; opacity: 0.82; }
.goal-preset-flag {
  display: block; margin-top: 0.35rem; font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--yellow);
}
.goal-preset-note {
  grid-column: 1 / -1; margin: 0.5rem 0 0;
  font-size: 0.78rem; color: var(--muted); line-height: 1.45;
}

/* Drag handle for the floating coach panel. Split and full modes are docked,
   so the grab cursor only appears when there is somewhere to drag to. */
#coach-panel.open:not(.split):not(.full) .cw-head {
  cursor: grab;
  touch-action: none;          /* let pointermove drive it, not the scroller */
  user-select: none;
}
#coach-panel.open:not(.split):not(.full) .cw-head:active { cursor: grabbing; }
#coach-panel.dragging {
  transition: none;            /* follow the pointer exactly */
  box-shadow: var(--shadow-lg);
  opacity: 0.97;
}
/* Buttons inside the header keep their own cursor. */
#coach-panel .cw-head button { cursor: pointer; }

/* One quiet disclaimer under the thread, instead of the same sentence welded
   onto the end of every single reply. */
.cw-disclaimer {
  margin: 0;
  padding: 0.5rem max(0.8rem, calc((100% - var(--cw-read, 46rem)) / 2)) 0;
  font-size: 0.6875rem;
  color: var(--muted);
  opacity: 0.75;
  text-align: center;
  flex-shrink: 0;
}

/* ── Spend-check history ─────────────────────────────────────────────────
   Sits under the verdict, same column width as the form so the page reads as
   one stack rather than two unrelated blocks. */
.sc-history { max-width: 520px; margin: var(--gap) auto 0; }
.sc-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.sc-row:last-child { border-bottom: none; }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sc-dot.green  { background: var(--green); }
.sc-dot.yellow { background: var(--yellow); }
.sc-dot.red    { background: var(--red); }
.sc-merchant {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 550;
}
.sc-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-verdict {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.sc-verdict.green  { color: var(--green);  border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.sc-verdict.yellow { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.sc-verdict.red    { color: var(--red);    border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.sc-when {
  color: var(--muted); font-size: 0.75rem; white-space: nowrap;
  min-width: 4.5rem; text-align: right;
}
@container page (max-width: 460px) {
  .sc-row { grid-template-columns: 10px 1fr auto; row-gap: 0.2rem; }
  .sc-verdict, .sc-when { grid-column: 2 / -1; justify-self: start; text-align: left; }
}

/* Empty / not-yet-set-up state for the check history. The card stays on the
   page rather than disappearing. an invisible feature cannot be found. */
.sc-empty {
  margin: 0; padding: 0.75rem 0;
  color: var(--muted); font-size: 0.875rem; line-height: 1.5;
}
.sc-empty-hint { font-size: 0.8125rem; opacity: 0.85; }

/* Reset control inside the verdict card. starts a fresh check rather than
   leaving the previous merchant and amount sitting under a stale answer. */
.verdict-again {
  margin-top: 1rem;
  width: 100%;
}

/* Launch onboarding, privacy and account controls share the product palette. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }
.upload-privacy, .auth-footnote { color: var(--muted); font-size: 0.8rem; line-height: 1.65; }
.upload-privacy a, .auth-footnote a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.upload-preview { padding: 1rem; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--bg); line-height: 1.65; }
.confirm-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.8rem 0; font-size: 0.875rem; line-height: 1.5; }
.confirm-row input { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; }
.auth-recovery { margin: 0.85rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-data-card { grid-column: 1 / -1; }
.profile-export { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: .35rem 0 1.25rem; }
.profile-export > div { min-width: 0; }
.profile-export h3 { font-size: .95rem; font-weight: 600; }
.profile-export > .btn { flex-shrink: 0; min-height: 44px; border-radius: 10px; }
.profile-export svg { width: 18px; height: 18px; flex-shrink: 0; }
.data-feedback { margin: 0 0 1rem; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.data-feedback[data-tone="error"], #delete-error { color: var(--red); }
.data-delete { border: 1px solid color-mix(in srgb, var(--red) 32%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--red) 4%, var(--bg-card-solid)); }
.data-delete summary { display: flex; align-items: center; gap: .8rem; padding: 1rem; cursor: pointer; list-style: none; }
.data-delete summary::-webkit-details-marker { display: none; }
.data-delete summary::marker { content: ''; }
.data-delete summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 12px; }
.data-delete-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.data-delete-icon svg { width: 19px; height: 19px; }
.data-delete-heading { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.data-delete-title { font-size: .9rem; font-weight: 600; color: var(--red); }
.data-delete-subtitle { font-size: .8rem; line-height: 1.5; color: var(--muted); }
.data-delete-chevron { width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.data-delete[open] .data-delete-chevron { transform: rotate(180deg); }
.data-delete-body { border-top: 1px solid color-mix(in srgb, var(--red) 18%, var(--border)); padding: 1rem; }
.data-delete-body > p { max-width: 70ch; font-size: .875rem; line-height: 1.65; }
.data-delete-body > .tx-help { font-size: .8rem; margin-top: .45rem; }
.data-delete-body label { display: block; margin: 1.25rem 0 .5rem; font-size: .8125rem; font-weight: 500; }
.data-delete-body input { max-width: 22rem; min-height: 44px; font-family: 'Space Mono', monospace; letter-spacing: .06em; }
.data-delete-body input:focus { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent); }
.data-delete-body input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.data-delete-body .data-feedback { margin: .6rem 0 0; }
.data-delete-actions { display: flex; justify-content: flex-end; max-width: 22rem; gap: .65rem; margin-top: 1rem; }
.data-delete-actions > .btn { min-height: 44px; border-radius: 9px; }
.data-delete #delete-data { background: color-mix(in srgb, var(--red) 70%, #000); color: #fff; border: 1px solid transparent; }
.data-delete #delete-data:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 62%, #000); }
.profile-privacy { display: inline-block; margin-top: 1.1rem; color: var(--accent); font-size: .8125rem; line-height: 1.5; }
@container page (max-width: 560px) {
  .profile-export { flex-direction: column; align-items: stretch; gap: .9rem; }
  .profile-export > .btn { width: 100%; }
  .data-delete summary { gap: .65rem; padding: .9rem; }
  .data-delete-body { padding: .9rem; }
  .data-delete-actions > .btn { flex: 1; min-width: 0; padding: .6rem .65rem; }
}
.reading-page { max-width: 760px; line-height: 1.8; padding-bottom: 4rem; }
.reading-page h2 { margin-top: 2rem; }
.demo-category { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.7rem 0; margin: 0; border-bottom: 1px solid var(--border); }
.demo-category strong { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Narrow screens: a single unbreakable string (a long URL) is wider than the
   whole column, so it has to be allowed to break mid-word or it sticks out of
   the panel. `anywhere` is safe HERE because at this size bubbles are near
   full width anyway. the intrinsic-size collapse it causes (see .cw-msg.user)
   only shows up when there is lots of spare width to collapse into. */
@media (max-width: 560px) {
  .cw-msg { overflow-wrap: anywhere; }
}

/* ══ Landing: the scroll story ═══════════════════════════════════════════
   A receipt that prints itself as the steps scroll past. Everything is
   driven by one attribute. .story[data-active="N"]. set by an
   IntersectionObserver, so there is a single source of truth for "which
   step are we on" and no scroll-position maths to drift. */
.story { max-width: 1100px; margin: 0 auto; padding: 5rem 1.5rem 4rem; }
.story-head { text-align: center; margin-bottom: 3rem; }
.story-head .sub { color: var(--muted); margin-top: 0.5rem; }

.story-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  /* NOT align-items:start. That shrinks the paper's grid area to its own
     height, which leaves position:sticky with no range to travel in. the
     receipt stuck for a moment and then scrolled away, leaving an empty
     screen for the last two steps. Stretching gives the sticky column the
     full height of the row to move within. */
  align-items: stretch;
}

/* The paper stays in view while the steps move. */
/* The column stretches to the full height of the row; the RECEIPT is what
   sticks inside it. Making the column itself sticky looked right but centred
   the receipt in an 1,800px box, so it rendered far below the fold. */
.story-paper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}
.sreceipt {
  position: sticky;
  /* The receipt grows as it prints. tallest at the final step (~580px). A
     fixed offset pushed it off the bottom of a short laptop screen, so this
     centres it when there is room and hugs the top when there is not.
     --sreceipt-tall is its full height; keep them in step. */
  --sreceipt-tall: 600px;
  top: clamp(1rem, calc((100vh - var(--sreceipt-tall)) / 2), 18vh);
  width: 320px;
  max-width: 100%;
}

/* The hero receipt auto-prints on load via --i delays. This one is driven by
   scroll instead, so that animation must be switched off or both would run. */
.sreceipt .r-line, .sreceipt .r-head, .sreceipt .r-sub, .sreceipt .r-rule,
.sreceipt .r-total, .sreceipt .r-barcode, .sreceipt .r-thanks {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Anything with data-from appears only once the story reaches that step. */
.sreceipt [data-from] {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.story[data-active="1"] .sreceipt [data-from="1"],
.story[data-active="2"] .sreceipt [data-from="1"],
.story[data-active="2"] .sreceipt [data-from="2"],
.story[data-active="3"] .sreceipt [data-from="1"],
.story[data-active="3"] .sreceipt [data-from="2"],
.story[data-active="3"] .sreceipt [data-from="3"],
.story[data-active="4"] .sreceipt [data-from="1"],
.story[data-active="4"] .sreceipt [data-from="2"],
.story[data-active="4"] .sreceipt [data-from="3"],
.story[data-active="4"] .sreceipt [data-from="4"],
.story[data-active="5"] .sreceipt [data-from] {
  opacity: 1;
  transform: none;
}

/* Rows stagger in like a till printing, rather than appearing all at once. */
.srows { display: flex; flex-direction: column; gap: 0.1rem; }
.srow:nth-child(1) { transition-delay: 0.00s; }
.srow:nth-child(2) { transition-delay: 0.08s; }
.srow:nth-child(3) { transition-delay: 0.16s; }
.srow:nth-child(4) { transition-delay: 0.24s; }
.srow:nth-child(5) { transition-delay: 0.32s; }

/* The centrepiece: raw and clean occupy the SAME grid cell, so the row keeps
   its height and the two faces cross-fade in place instead of the receipt
   jumping as the text changes length. */
.srow { display: grid; font-size: 0.72rem; line-height: 1.5; padding: 0.22rem 0; }
.srow-raw, .srow-clean {
  grid-area: 1 / 1;
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}
.srow-raw {
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srow-clean {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(4px);
}
.srow-cat { color: var(--text); font-weight: 700; }
.srow-amt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* From step 2 the raw text gives way to the sorted line. */
.story[data-active="2"] .srow-raw,
.story[data-active="3"] .srow-raw,
.story[data-active="4"] .srow-raw,
.story[data-active="5"] .srow-raw {
  opacity: 0;
  transform: translateY(-4px);
  filter: blur(2px);
}
.story[data-active="2"] .srow-clean,
.story[data-active="3"] .srow-clean,
.story[data-active="4"] .srow-clean,
.story[data-active="5"] .srow-clean { opacity: 1; transform: none; }

/* The row Finio is unsure about gets marked while it asks. */
.story[data-active="3"] .srow-ask {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 3px;
}

.s-quiz {
  margin: 0.6rem 0 0.2rem;
  padding: 0.5rem 0.6rem;
  border: 1px dashed var(--accent-border);
  border-radius: 6px;
  font-size: 0.66rem;
}
.s-quiz-q { color: var(--muted); margin-bottom: 0.35rem; }
.s-quiz-opts { display: flex; gap: 0.35rem; }
.s-quiz-opts span {
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.s-quiz-opts .picked {
  background: var(--accent);
  border-color: var(--accent);
  color: #09261f;
  font-weight: 700;
}

.s-coach { margin-top: 0.7rem; font-size: 0.68rem; }
.s-coach-q { color: var(--muted); font-style: italic; }
.s-coach-a {
  margin-top: 0.3rem;
  padding: 0.4rem 0.55rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left: 2px solid var(--accent);
  border-radius: 0 5px 5px 0;
}

/* Steps: the inactive ones dim so the live one reads as "you are here". */
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-step {
  padding: 2.5rem 0 2.5rem 3.25rem;
  position: relative;
  min-height: 46vh;
  opacity: 0.38;
  transition: opacity 0.4s ease;
}
.story-step.active { opacity: 1; }
.story-step h3 { margin: 0 0 0.5rem; font-size: 1.12rem; letter-spacing: -0.01em; }
.story-step p { margin: 0; color: var(--muted); line-height: 1.65; }
.story-num {
  position: absolute;
  left: 0; top: 2.5rem;
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--muted);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.story-step.active .story-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #09261f;
  font-weight: 700;
}

@media (max-width: 860px) {
  .story-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  /* On a phone the paper sits above the text and stays pinned there, so the
     receipt is still visible while you read the step describing it. */
  .story-paper {
    position: sticky;
    top: 0.5rem;
    z-index: 2;
    padding: 0.75rem 0;
    background: linear-gradient(var(--bg) 72%, transparent);
  }
  .sreceipt { width: 260px; font-size: 0.92em; }
  .sreceipt .r-barcode { display: none; }   /* buy back height on a phone */

  /* The paper column gets a FIXED height. The receipt grows inside it as it
     prints, but the page below never moves.
     Letting it change the page height caused a feedback loop: growing the
     receipt pushed the steps down, a step that had crossed the trigger line
     slid back above it, the story stepped backwards, the receipt shrank, and
     it oscillated 4 -> 3 -> 4. Reserving the space removes the coupling. */
  .story-paper { height: 56vh; align-items: flex-start; }

  /* On desktop the unrevealed lines keep their space so the paper never jumps.
     On a phone that made the receipt ~1,100px tall. it swallowed the screen
     and the step text slid behind it. Here the paper GROWS as it prints
     instead, which is both compact and truer to the metaphor. */
  .sreceipt [data-from] { display: none; }
  .story[data-active="1"] .sreceipt [data-from="1"],
  .story[data-active="2"] .sreceipt [data-from="1"],
  .story[data-active="2"] .sreceipt [data-from="2"],
  .story[data-active="3"] .sreceipt [data-from="1"],
  .story[data-active="3"] .sreceipt [data-from="2"],
  .story[data-active="3"] .sreceipt [data-from="3"],
  .story[data-active="4"] .sreceipt [data-from="1"],
  .story[data-active="4"] .sreceipt [data-from="2"],
  .story[data-active="4"] .sreceipt [data-from="3"],
  .story[data-active="4"] .sreceipt [data-from="4"],
  .story[data-active="5"] .sreceipt [data-from] { display: block; }
  .story .sreceipt .srow[data-from] { display: grid; }
  .story[data-active="1"] .sreceipt .r-line[data-from],
  .story[data-active="5"] .sreceipt .r-line[data-from],
  .story[data-active="4"] .sreceipt .r-line[data-from] { display: flex; }

  /* Each step still needs its own stretch of scroll, or they all sit above the
     trigger line at once and the story jumps to the last one. */
  .story-step { min-height: 52vh; padding: 1.5rem 0 1.5rem 3rem; }
  .story-num { top: 1.5rem; }
}

/* Motion off: show the finished receipt and every step, no transitions. */
@media (prefers-reduced-motion: reduce) {
  .sreceipt [data-from],
  .srow-clean { opacity: 1 !important; transform: none !important; }
  .srow-raw { display: none; }
  .story-step { opacity: 1; }
  .sreceipt [data-from], .srow-raw, .srow-clean, .story-step, .story-num {
    transition: none;
  }
}

/* Landing nav: the buttons were wrapping onto two lines on a phone ("Log in"
   rendering 61px tall instead of 38px), because nothing stopped the labels
   breaking once the row got tight. They are two or three short words. they
   should shrink, never wrap. */
.landing-nav .btn,
.landing-nav a,
.landing-nav button { white-space: nowrap; }
@media (max-width: 420px) {
  .landing-nav { gap: 0.4rem; }
  .landing-nav .btn { padding-left: 0.75rem; padding-right: 0.75rem; font-size: 0.82rem; }
}

/* ══ Hero: the interactive decoder ═══════════════════════════════════════
   The visitor taps a messy statement line and watches Finio read it. Showing
   the product beats asserting it, and it gives the hero something to DO.
   Every merchant in the markup is invented. */
.decoder {
  width: min(430px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 26px 52px -28px rgba(0, 0, 0, 0.6);
  padding: 1.1rem 1.15rem 1.25rem;
}
.dec-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.dec-eyebrow {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
.dec-hint { font-size: 0.75rem; color: var(--muted); }

.dec-chips { display: flex; flex-direction: column; gap: 0.4rem; }
.dec-chip {
  width: 100%;
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 0.73rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dec-chip:hover { color: var(--text); border-color: var(--border-strong); }
.dec-chip.is-on {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.dec-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The answer. Arrow points from the taps above down into the result. */
.dec-out {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border);
}
html.js .dec-out { opacity: 0; transform: translateY(4px); }
html.js .dec-out.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.dec-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.4rem;
}
.dec-label {
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.dec-val { font-weight: 650; }
.dec-tag {
  font-size: 0.74rem; font-weight: 650;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  white-space: nowrap;
}
/* When Finio genuinely cannot tell, say so in a different colour. not
   knowing is a feature here, and it should not look like a category. */
.dec-tag[data-tone="ask"] {
  color: var(--yellow);
  border-color: color-mix(in srgb, var(--yellow) 45%, transparent);
}
.dec-why {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}
.dec-why b { color: var(--text); font-weight: 650; }

@media (prefers-reduced-motion: reduce) {
  html.js .dec-out, html.js .dec-out.is-in {
    opacity: 1; transform: none; transition: none;
  }
}
@media (max-width: 560px) {
  .dec-chip { font-size: 0.68rem; }
}

/* ══ Privacy page ════════════════════════════════════════════════════════
   A privacy disclosure only works if people actually read it, so the four
   things that matter are a scannable summary at the top and the full detail
   sits underneath for anyone who wants it. */
.reading-page { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.reading-page .lede { color: var(--muted); font-size: 1.02rem; margin-top: 0.4rem; }

.priv-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 2.5rem;
}
.priv-point {
  display: flex;
  gap: 0.7rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-card));
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  min-width: 0;
}
.priv-point b { color: var(--text); font-weight: 650; }
.priv-icon {
  flex-shrink: 0;
  width: 1.6rem; height: 1.6rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  font-size: 0.85rem;
}

/* A quiet divider so "In detail" reads as a second tier, not a new topic. */
.priv-rule {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin: 0 0 1.1rem;
}

.priv-card { margin-bottom: 1rem; }
.priv-card h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
.priv-card p { margin: 0 0 0.7rem; line-height: 1.65; color: var(--muted); }
.priv-card p:last-child { margin-bottom: 0; }
/* Caveats are the part people most need to notice, so they are set apart
   rather than buried as the third sentence of a paragraph. */
.priv-note {
  border-left: 2px solid var(--border-strong);
  padding-left: 0.8rem;
  font-size: 0.88rem;
}

.priv-actions {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin: 1.75rem 0 0.5rem;
}

@media (max-width: 620px) {
  .priv-summary { grid-template-columns: 1fr; }
}

/* Trust block: questions, not slogans. Someone deciding whether to hand over a
   bank statement is asking specific things, so the headings are those
   questions and the answer sits directly under each. */
.trust .sub { color: var(--muted); margin: 0.4rem 0 2rem; }
/* The original .trust-item was a flex row (icon beside text). These cards are
   a question ABOVE its answer, so the row direction has to be reset or the two
   end up side by side in a cramped column. */
.trust-item { display: block; text-align: left; }
.trust-q {
  font-weight: 650;
  margin-bottom: 0.45rem;
  color: var(--text);
}
.trust-q::before {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 1.35rem; height: 1.35rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: -0.2em;
}
.trust-item p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.92rem; }
.trust-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

/* ── Landing: upload security ───────────────────────────────────────────────
   Follows the uploaded file in order (1→4) rather than listing features,
   because the question being answered is "where does my statement go?".
   The numbered steps form a connected path; the refusals sit under it as a
   plain list, since they are limits rather than stages. */
.safety {
  max-width: 1100px; margin: 0 auto 4rem; padding: 2.4rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); text-align: center;
}
.safety h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin: 0; }
.safety .sub { color: var(--muted); margin: 0.4rem 0 2rem; }

.safe-path {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  text-align: left; counter-reset: none;
}
.safe-step {
  position: relative; display: flex; flex-direction: column;
  padding: 1.1rem 1rem 1rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* The connector that makes four cards read as one path. Drawn between cards,
   so it is suppressed on the last one and whenever the grid stacks. */
.safe-step::after {
  content: ''; position: absolute; top: 1.85rem; right: -1rem; width: 1rem;
  border-top: 1px dashed var(--border-strong);
}
.safe-step:last-child::after { content: none; }

/* Top-aligned, not centred: these headings wrap to two lines on some
   cards and one on others, and centring put the badges at different
   heights across the row. */
.safe-head { display: flex; align-items: flex-start; gap: 0.55rem; margin-bottom: 0.6rem; }
.safe-num {
  flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.8rem; font-weight: 700;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}
.safe-step h3 { margin: 0.1rem 0 0; font-size: 0.95rem; letter-spacing: -0.01em; line-height: 1.35; }
.safe-step p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.safe-chip {
  margin-top: auto; align-self: flex-start;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid var(--border-strong);
}

.safe-guards { text-align: left; border-top: 1px solid var(--border); padding-top: 1.6rem; }
.safe-guards h3 {
  margin: 0 0 1rem; font-size: 1.05rem; letter-spacing: -0.02em; text-align: center;
}
.safe-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem 1.4rem;
}
.safe-list li {
  position: relative; padding-left: 1.1rem;
  color: var(--muted); font-size: 0.87rem; line-height: 1.55;
}
.safe-list li::before {
  content: '•'; position: absolute; left: 0; color: var(--accent);
}
.safe-list b { color: var(--text); font-weight: 600; }

@media (max-width: 980px) {
  .safe-path { grid-template-columns: repeat(2, 1fr); }
  /* Only the connector that still points at a neighbour survives. */
  .safe-step:nth-child(2)::after { content: none; }
  .safe-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .safe-path, .safe-list { grid-template-columns: 1fr; }
  .safe-step::after { content: none; }
}

/* Scope and calculated evidence use the existing receipt palette. */
.period-bar { flex-wrap: wrap; border-radius: 18px; max-width: 100%; }
.period-bar select { width: auto; max-width: 13rem; font-size: .8125rem; padding: .45rem 2rem .45rem .6rem; }
.review-notice { margin: 1rem 0; padding: 1rem; border: 1px solid var(--yellow); border-radius: 10px; }
.review-notice a { display: inline-block; margin-top: .4rem; color: var(--accent); }
.usual-context { color: var(--muted); font-size: .8125rem; margin: .75rem 0 1.5rem; }
.cw-facts { font-size: .78rem; line-height: 1.55; border: 1px solid var(--border); border-radius: 8px; padding: .75rem; margin: .5rem 0 1rem; }
.cw-facts p { margin: .35rem 0 0; overflow-wrap: anywhere; }
.cw-facts-scope { color: var(--muted); font-size: .72rem; }

/* Dashboard: figures first, supporting context and actions below. */
.selected-range { margin-top: .55rem; font-weight: 600; font-size: 1rem; }
.dashboard-view .dash-sub { font-size: .875rem; line-height: 1.6; }
.dashboard-view .metric-card .label { font-size: .8125rem; }
.dashboard-view .metric-card .sub { font-size: .875rem; line-height: 1.5; }
.dashboard-view .cards-row { margin-bottom: .8rem; }
.dashboard-view .review-notice {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem 1.5rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .9rem 1rem;
  border-color: color-mix(in srgb, var(--yellow) 55%, var(--border));
  background: color-mix(in srgb, var(--yellow) 5%, var(--bg));
  font-size: .875rem;
}
.review-notice[hidden], .save-error[hidden], .personality-card[hidden] { display: none; }
.dashboard-view .review-notice p { margin-top: .3rem; color: var(--muted); line-height: 1.55; }
.dashboard-view .review-notice a { margin: 0; flex-shrink: 0; }
.dashboard-view .dash-maintenance {
  padding: .35rem 0; margin: 0 0 .75rem; border: 0; background: none;
  justify-content: flex-start; color: var(--muted); font-size: .8125rem;
}
.dashboard-view .dash-insight { padding: .7rem .9rem; margin-bottom: 1rem; }
.scope-badge { display: inline-block; color: var(--muted); font-size: .75rem; font-weight: 500; margin-left: .4rem; white-space: nowrap; }
.dashboard-view .card-head { flex-wrap: wrap; gap: .5rem; }
.dashboard-view .chart-note { white-space: normal; font-size: .8125rem; }
.dashboard-view .merchant-row { grid-template-columns: minmax(0, 2fr) minmax(25px, .7fr) auto; padding: .65rem 0; font-size: .875rem; }
.dashboard-view .merchant-name { white-space: normal; overflow-wrap: anywhere; }
.save-error { color: var(--red); border: 1px solid var(--red); border-radius: 8px; padding: .8rem; margin: .65rem 0; font-size: .875rem; line-height: 1.5; }
.save-error button { margin-top: .5rem; }
.budget-editor { flex-wrap: wrap; }
.budget-editor .save-error { flex-basis: 100%; }
.service-status { color: var(--muted); border-left: 3px solid var(--yellow); padding: .7rem 1rem; margin-bottom: 1rem; font-size: .875rem; }
.period-bar select { min-height: 36px; }
@container (max-width: 600px) {
  .dashboard-view .dash-controls { gap: .5rem; }
  .dashboard-view .dash-controls > #period-mount { flex-basis: 100%; }
  .dashboard-view .metric-card .value { font-size: 1.5rem; }
  .dashboard-view .review-notice a { width: 100%; text-align: center; }
  .scope-badge { display: block; margin: .25rem 0 0; }
}

/* A hidden attribute remains authoritative over component display rules. */
[hidden] { display: none !important; }
.nav-menu:not([hidden]) {
  display: flex; position: fixed; right: auto; z-index: 1000;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto;
}

/* Navigation follows its actual pane width when the coach takes space. */
nav { container-type: inline-size; container-name: navigation; }
body.coach-split:has(#coach-panel.split) > nav { overflow: visible; }
.nav-logo, .nav-right { flex-shrink: 0; }
@container navigation (max-width: 700px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none; flex-direction: column; position: absolute; top: 64px;
    left: 1rem; right: 1rem; background: var(--bg-card-solid);
    border-radius: var(--radius); padding: .5rem; gap: .15rem;
    z-index: 99; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: var(--radius-sm); }
}

.dashboard-widget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.dashboard-widget-grid.single-widget { grid-template-columns: minmax(0, 1fr); }
.dashboard-widget-grid > * { min-width: 0; margin: 0 !important; }
.dashboard-widget-grid > .tx-link-card { height: 100%; }
#metrics-grid[data-visible="1"] { grid-template-columns: minmax(0, 1fr); }
#metrics-grid[data-visible="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.merchants-more { margin-top: 1rem; }
#merchant-list.expanded { max-height: 30rem; overflow-y: auto; padding-right: .35rem; }
.widgets-empty { margin-top: 1rem; }
.widgets-empty p { margin-bottom: .75rem; }
.dashboard-widget-actions { display: flex; justify-content: center; margin-top: 1.5rem; }
.balance-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) auto; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.balance-card > * { min-width: 0; }
.balance-card .value { margin-bottom: .6rem; }
.balance-state { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .5rem; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); }
.balance-state[data-tone="green"] { color: var(--green); border-color: var(--green); }
.balance-state[data-tone="yellow"] { color: var(--yellow); border-color: var(--yellow); }
.balance-state[data-tone="red"] { color: var(--red); border-color: var(--red); }
.balance-copy { color: var(--muted); font-size: .8125rem; line-height: 1.55; margin-top: .5rem; }
.balance-card .link-btn { margin-top: .75rem; }
#balance-form { margin-top: 1rem; }
#balance-clear { margin-top: 1rem; }
@container (max-width: 1000px) {
  .balance-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); }
  .balance-card .link-btn { grid-column: 1 / -1; justify-self: start; margin: 0; }
}
@container (max-width: 600px) {
  .balance-card { grid-template-columns: minmax(0, 1fr); }
}
.widget-dialog {
  margin: auto; width: min(36rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  overflow-y: auto; padding: 1.5rem; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.widget-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.widget-dialog h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.widget-dialog > p { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.widget-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.widget-choices label { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .875rem; cursor: pointer; }
.widget-choices input { width: 1rem; height: 1rem; flex-shrink: 0; accent-color: var(--accent); }
.widget-dialog-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

.invest-view .invest-section { margin-bottom: var(--gap); }
.invest-view .section-title { font-family: inherit; font-size: 1.1rem; font-weight: 600; }
.invest-view label { margin: 1rem 0 .35rem; display: block; font-size: .875rem; }
.invest-view #plan-mode { max-width: 22rem; margin-bottom: .5rem; }
.budget-settings { grid-column: 1 / -1; }
.budget-settings label { margin: 1rem 0 .35rem; display: block; font-size: .875rem; }
.budget-settings #plan-mode { max-width: 22rem; margin-bottom: .5rem; }
.budget-settings .split-row { margin-top: 1rem; }
.foundation-list { list-style: disc; padding-left: 1.3rem; margin: 1.1rem 0; }
.foundation-list li { padding-left: .3rem; margin-bottom: 1rem; font-size: .9375rem; line-height: 1.6; }
.foundation-list li::marker { color: var(--accent); }
.foundation-list p { margin: .2rem 0 0; color: var(--muted); font-size: .875rem; }
.foundation-list a { color: var(--accent); }
.plan-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan-inputs > * { min-width: 0; }
.plan-inputs input { width: 100%; }
#plan-form > button { margin-top: .7rem; }
.plan-note { margin: 1rem 0; color: var(--muted); line-height: 1.6; font-size: .875rem; }
.plan-comparison { overflow-x: auto; margin-top: 1rem; font-size: .875rem; }
.plan-comparison > div { display: grid; grid-template-columns: minmax(9rem, 1fr) repeat(2, minmax(7rem, 1fr)); gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed var(--border); min-width: 26rem; }
.plan-comparison-head { color: var(--muted); font-weight: 600; }
.goal-totals { font-size: 1.05rem; line-height: 1.6; }
.invest-view #goal-content .progress-bar { margin: 1rem 0; }
.invest-details { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.invest-details summary { cursor: pointer; font-size: .9375rem; font-weight: 600; }
@container (max-width: 700px) {
  .dashboard-widget-grid { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 600px) {
  #metrics-grid[data-visible], .invest-overview { grid-template-columns: minmax(0, 1fr); }
  .plan-inputs { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .invest-overview .metric-card .value { font-size: 1.5rem; }
}

/* Data remains readable without canvas, colour or a pointer. */
.chart-data { width:100%; border-collapse:collapse; font-size:0.8rem; margin-top:1rem; }
.chart-data caption { text-align:left; color:var(--muted); margin-bottom:0.6rem; }
.chart-data th, .chart-data td { padding:0.55rem 0.25rem; border-bottom:1px solid var(--border); text-align:right; overflow-wrap:anywhere; }
.chart-data th:first-child { text-align:left; font-weight:500; }
.chart-key { display:inline-block; width:0.6rem; height:0.6rem; border-radius:50%; margin-right:0.4rem; }
#spend-chart-data { overflow-x:auto; margin-top:1rem; }
#review { scroll-margin-top:7rem; }

/* Phone app chrome. Its screen-wide container remains independent of split panes. */
.mobile-nav-shell {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 320;
  container: phone-navigation / inline-size;
  pointer-events: none;
}
.mobile-nav { display: none; }
@container phone-navigation (max-width: 700px) {
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(77px + env(safe-area-inset-bottom, 0px));
    padding: 0 max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
    background: var(--bg-card-solid); border-top: 1px solid var(--border-strong);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .10); pointer-events: auto;
  }
}
.mobile-nav-link, .mobile-coach {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-width: 0; min-height: 60px; height: 76px;
  color: var(--muted); text-decoration: none; font: 500 10px/1.2 'Inter', sans-serif;
  border: 0; background: none; padding: 7px 0 8px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-link span { white-space: nowrap; letter-spacing: -.015em; }
.mobile-nav-link svg { width: 23px; height: 23px; flex-shrink: 0; }
.mobile-nav-link.active { color: var(--accent); font-weight: 700; }
.mobile-nav-link.active svg { background: var(--accent-dim); border-radius: 8px; box-shadow: 0 0 0 6px var(--accent-dim); }
.mobile-nav-link:focus-visible, .mobile-coach:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 10px; }
.mobile-coach { height: 76px; margin-top: -10px; padding: 0; gap: 0; color: var(--text); font-weight: 700; }
.mobile-coach-disc {
  display: grid; place-items: center; width: 58px; height: 58px; flex-shrink: 0;
  border-radius: 50%; border: 4px solid var(--bg-card-solid);
  background: var(--accent); color: #fff; box-shadow: 0 4px 16px var(--accent-dim);
  transition: background .15s, box-shadow .15s;
}
.mobile-coach-disc svg { width: 25px; height: 25px; fill: currentColor; stroke-width: 1; }
.mobile-coach.active .mobile-coach-disc { background: var(--accent-hover); box-shadow: 0 0 0 2px var(--accent-border); }
body.phone-navigation {
  --phone-nav-space: calc(94px + env(safe-area-inset-bottom, 0px));
  --phone-nav-height: calc(77px + env(safe-area-inset-bottom, 0px));
  padding-bottom: var(--phone-nav-space);
  scroll-padding-bottom: var(--phone-nav-space);
}
.phone-navigation > nav .nav-links,
.phone-navigation > nav .nav-hamburger,
.phone-navigation #coach-fab { display: none !important; }
.phone-navigation #toast { bottom: calc(var(--phone-nav-space) + 12px); }
.phone-navigation #coach-panel.open {
  left: 0 !important; right: 0 !important;
  top: var(--phone-visible-top, 0px) !important; bottom: auto !important;
  width: 100%; height: calc(var(--phone-visible-height, 100dvh) - var(--phone-nav-height));
  max-height: none; border: none; border-radius: 0; z-index: 310;
}
.phone-navigation #coach-panel .cw-head { padding-top: max(12px, env(safe-area-inset-top, 0px)); }
.phone-navigation #coach-panel .cw-head { cursor: default; }
.phone-navigation #cw-expand { display: none; }
.phone-navigation.phone-keyboard-open { --phone-nav-height: 0px; }
.phone-keyboard-open .mobile-nav-shell { visibility: hidden; }

.phone-navigation:has(#coach-panel.open) { overflow: hidden; }

.phone-navigation > nav {
  height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
}
/* Account security and sensitive-action verification. */
.security-dialog { color:var(--text); background:var(--bg-card-solid); border:1px solid var(--border); border-radius:18px; padding:1.5rem; width:min(92vw,440px); max-height:90dvh; overflow:auto; margin:auto; }
.security-dialog::backdrop { background:rgba(0,0,0,.65); }
.security-dialog h2 { margin-bottom:.75rem; }
.security-factor-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:1rem 0; }
.security-qr { display:block; width:200px; max-width:100%; background:white; border-radius:8px; margin:1rem 0; }
.security-secret { display:block; overflow-wrap:anywhere; padding:.75rem 0; user-select:all; }
.ai-consent { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; padding: .75rem 0; }
.ai-consent input { width: 1.25rem; height: 1.25rem; flex: 0 0 1.25rem; margin: .15rem 0 0; accent-color: var(--accent); }
