/* ================================================================
   Solo — Components (Cream redesign, v2.0.0)
   Calm tempo. Pill buttons. Ink primary. Coral accents.
   ================================================================ */

/* ── Tap feedback (universal) ───────────────────────────────── */
.tap {
  transition: transform var(--duration-fast) var(--ease-tap),
              opacity   var(--duration-fast) var(--ease-tap);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.tap:active { transform: scale(0.98); opacity: 0.92; }

/* ── Top Bar (sticky header above app shell) ───────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: max(12px, env(safe-area-inset-top, 12px)) var(--content-pad) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max-w);
  margin: 0 auto;
}

.top-bar-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin: 0;
  line-height: 1;
}

/* Lockup variant — brand mark + non-italic "Solo Switch" wordmark, used on Home. */
.top-bar-title--lockup {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.top-bar-title--lockup .brand-mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--ink);
}
.top-bar-title--lockup .brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.top-bar-title--lockup .brand-wordmark {
  letter-spacing: -0.012em;
  white-space: nowrap;
}

.top-bar-add {
  width: 44px; height: 44px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}

/* ── Tab Bar (floating pill, cream surface) ─────────────────── */
.tab-bar {
  position: fixed;
  bottom: 12px; left: 50%; transform: translateX(-50%);
  width: auto;
  min-width: 280px; max-width: 360px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: var(--shadow-tab);
}

@supports (padding: env(safe-area-inset-bottom)) {
  .tab-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

.tab-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 20px;
  transition: color var(--duration-fast) var(--ease-tap);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tab-item.active { color: var(--accent); }
.tab-item:active { transform: scale(0.97); transition: transform 80ms var(--ease-tap); }

.tab-icon { width: 22px; height: 22px; stroke-width: 1.7; }
.tab-item.active .tab-icon { stroke-width: 2; }
.tab-label { font-size: 10.5px; font-weight: 500; letter-spacing: -0.05px; }
.tab-item.active .tab-label { font-weight: 600; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) ease,
              border-color var(--duration) ease;
}

.card + .card { margin-top: 14px; }
.card-sm { padding: 14px 16px; border-radius: var(--radius); }

/* Status glow modifiers (runtime sets these from getBillStatus) */
.card--switch    { border-color: rgba(224, 120, 86, 0.55); box-shadow: var(--glow-switch); }
.card--progress  { border-color: rgba(127, 166, 140, 0.45); box-shadow: var(--glow-progress); animation: pulse-glow-good 3s ease-in-out infinite; }
.card--optimised { border-color: rgba(127, 166, 140, 0.45); box-shadow: var(--glow-optimised); }
.card--issue     { border-color: rgba(201, 82,  74, 0.45);  box-shadow: var(--glow-issue); }
.card--neutral   { box-shadow: var(--glow-neutral); }

@keyframes pulse-glow-good {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(127, 166, 140, 0.35), 0 2px 8px rgba(127, 166, 140, 0.06); }
  50%      { box-shadow: 0 0 0 1.5px rgba(127, 166, 140, 0.55), 0 2px 14px rgba(127, 166, 140, 0.10); }
}
/* Legacy keyframes used elsewhere */
@keyframes pulse-glow      { 0%, 100% { box-shadow: var(--glow-progress); } 50% { box-shadow: 0 0 0 1.5px rgba(217, 164, 65, 0.4), 0 2px 16px rgba(217, 164, 65, 0.10); } }
@keyframes pulse-glow-blue { 0%, 100% { box-shadow: 0 0 0 1.5px rgba(127, 166, 140, 0.30), 0 2px 8px rgba(127, 166, 140, 0.05); } 50% { box-shadow: 0 0 0 1.5px rgba(127, 166, 140, 0.45), 0 2px 14px rgba(127, 166, 140, 0.10); } }

/* ── Live dot (pulsing, used in status pills + progress) ────── */
.live-dot {
  display: inline-block;
  position: relative;
  width: 8px; height: 8px;
  color: var(--accent); /* current color drives core + sonar */
  vertical-align: middle;
  /* core "breath" — subtle scale on the solid centre */
  animation: live-dot-core 2.2s ease-in-out infinite;
}
.live-dot::before, .live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}
/* solid centre */
.live-dot::after {
  inset: 22%;
  background: currentColor;
}
/* sonar ring — expands outward + fades, calling out "scanning" */
.live-dot::before {
  border: 1.5px solid currentColor;
  opacity: 0;
  animation: live-dot-sonar 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
@keyframes live-dot-core {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(0.88); opacity: 0.5; }
}
@keyframes live-dot-sonar {
  0%   { transform: scale(0.7); opacity: 0.6; }
  70%  { opacity: 0.08; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .live-dot::before { animation: none; }
  .live-dot::before { opacity: 0.35; transform: scale(1.4); }
  .shimmer, .breathe, .progress-dot { animation: none; }
  .tap:active { transform: none; }
}

/* ── Breathe (CTA halo on RecCard awaiting approval) ───────── */
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 120, 86, 0.25); }
  50%      { box-shadow: 0 0 0 8px rgba(224, 120, 86, 0);    }
}
.breathe { animation: breathe 2.8s ease-in-out infinite; }

/* ── Profile (You tab) ──────────────────────────────────────── */
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 30px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 500;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.profile-name {
  font-size: 22px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.profile-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}
.profile-stats {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
}
.profile-stat { flex: 1; min-width: 0; }
.profile-stat--right { text-align: right; }
.profile-stat-value {
  font-size: 22px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.profile-stat-label {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.profile-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* ── Source icon (provenance glyph for monetary figures) ───── */
.source-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2px;
  vertical-align: baseline;
}
.source-icon-glyph { font-size: 12px; line-height: 1; }
.source-icon--bank     { color: var(--good); }
.source-icon--email    { color: var(--accent); }
.source-icon--photo    { color: var(--ink-2); }
.source-icon--estimate { color: var(--ink-3); }
.source-icon--stale    { color: var(--warn); }

/* ── Total Spend Card (household 14-month trajectory) ───────── */
.total-spend-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 18px;
  margin-top: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(31,27,22,0.04), 0 8px 24px rgba(31,27,22,0.03);
}
.tsc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.tsc-head-left { min-width: 0; flex: 1; }
.tsc-eyebrow {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.tsc-figure {
  display: flex; align-items: baseline; gap: 4px;
  margin-top: 6px;
}
.tsc-figure-unit {
  font-size: 12px;
  color: var(--ink-3);
}
.tsc-pill {
  padding: 7px 10px;
  border-radius: 12px;
  background: var(--good-soft);
  text-align: right;
  flex-shrink: 0;
}
.tsc-pill-eyebrow {
  font-size: 9.5px;
  color: var(--good-ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tsc-pill-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--good-ink);
  letter-spacing: -0.3px;
  margin-top: 2px;
  white-space: nowrap;
}
.tsc-pill-pct {
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 4px;
}
.tsc-chart {
  display: block;
  width: 100%;
  height: 130px;
  margin-top: 14px;
}
.tsc-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
  flex-wrap: wrap;
}
.tsc-legend-items {
  display: flex; gap: 12px;
  font-size: 10.5px;
  flex-wrap: wrap;
}
.tsc-legend-item {
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0.9;
}
.tsc-legend-item--actual   { color: var(--good); }
.tsc-legend-item--baseline { color: var(--ink-3); }
.tsc-footer {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}
.tsc-footer-cell { min-width: 0; }
.tsc-footer-cell--right { text-align: right; }
.tsc-footer-label {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tsc-footer-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-top: 2px;
}
.tsc-footer-value--good { color: var(--good); }

/* Legacy progress-dot (used in some chips) — recolor */
.progress-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
  animation: dot-pulse 1.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ── Shimmer (used by progress rail fill, savings hero hint) ── */
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Progress rail ──────────────────────────────────────────── */
.progress-rail {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.progress-rail-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 600ms ease;
  overflow: hidden;
}
.progress-rail-labels {
  display: flex; justify-content: space-between;
  margin-top: 10px;
  gap: 4px;
}
.progress-rail-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--ink-3);
  text-transform: uppercase;
}
.progress-rail-label.done,
.progress-rail-label.active { color: var(--ink); }

/* ── Money Big (Instrument Serif italic) ────────────────────── */
.money-big {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.money-big-prefix {
  font-style: normal;
  opacity: 0.7;
  font-size: 50%;
  margin-right: clamp(6px, 18%, 16px);
}
.money-big--xs { font-size: 22px; }
.money-big--sm { font-size: 28px; }
.money-big--md { font-size: 46px; }
.money-big--lg { font-size: 54px; }
.money-big--xl { font-size: 88px; }
.money-big--accent  { color: var(--accent); }
.money-big--good    { color: var(--good); }
.money-big--good-ink { color: var(--good-ink); }
.money-big--ink-3   { color: var(--ink-3); }

/* ── Section label (uppercase eyebrow) ─────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px;
  height: 56px;
  min-height: 56px;
  border-radius: 999px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.2px;
  font-family: var(--font);
  border: 0; cursor: pointer; white-space: nowrap;
  transition: background var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-tap),
              opacity var(--duration-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn:disabled { opacity: 0.45; pointer-events: none; background: #C9C2B4 !important; color: white !important; }

.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); color: white; }

.btn-coral {
  background: var(--accent);
  color: white;
}
.btn-coral:hover { background: var(--cta-hover); }

.btn-secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  height: 48px; min-height: 48px;
  padding: 0 18px;
  border: 1.5px solid currentColor;
  font-weight: 500;
  font-size: 15px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(201, 82, 74, 0.2);
}
.btn-danger:hover { background: rgba(201, 82, 74, 0.18); }

.btn-sm { height: 40px; min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn-md { height: 48px; min-height: 48px; padding: 0 20px; font-size: 15px; }
.btn-lg { height: 56px; min-height: 56px; padding: 0 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ── Tags / Chips ───────────────────────────────────────────── */
.tag, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: -0.05px;
}
.tag-green,  .chip-green   { background: var(--good-soft);   color: var(--good-ink); }
.tag-red,    .chip-red     { background: var(--red-soft);    color: var(--red); }
.tag-orange, .chip-amber   { background: var(--warn-soft);   color: #8B6420; }
.tag-blue,   .chip-blue,
.tag-coral,  .chip-coral   { background: var(--accent-soft); color: var(--accent-ink); }
.tag-purple, .chip-purple  { background: var(--purple-soft); color: var(--purple); }
.tag-dim                   { background: var(--surface-2);   color: var(--ink-3); }
.chip-muted                { background: var(--surface-2);   color: var(--text-muted); font-weight: 500; }

/* Sub-line under bill-card provider name for linked watch-cellular companions
   (Number Share / Number Sync / OneNumber). Small, muted, tight line-height. */
.bill-card-linked-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.2;
}

/* ── Status Pill (per design) ───────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: -0.05px;
  white-space: nowrap; flex-shrink: 0;
  font-family: var(--font);
}
.status-pill--compact { height: 22px; padding: 0 8px; font-size: 11px; }

.status-pill--recommended { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill--in-progress { background: var(--accent-soft); color: var(--accent-ink); }
.status-pill--checking    { background: var(--surface-2);  color: var(--ink-2); }
.status-pill--switched    { background: var(--good-soft);  color: var(--good-ink); }
.status-pill--watch       { background: var(--surface-2);  color: var(--ink-2); }
.status-pill--issue       { background: var(--red-soft);   color: var(--red); }

.status-pill .live-dot { width: 6px; height: 6px; }
.status-pill svg { width: 11px; height: 11px; stroke-width: 2.4; }

/* ── Inputs ─────────────────────────────────────────────────── */
.input-group { margin-bottom: 14px; }
.input-group label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 6px;
  padding-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 16px;
  font-family: var(--font);
  transition: border-color var(--duration-fast) ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
}
.input::placeholder { color: var(--ink-3); }

/* ── Modal (legacy modal preserved; swipe-handle styled) ────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(31, 27, 22, 0.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 260ms ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--duration) var(--ease-sheet);
  padding: 22px 22px;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Exit animation — applied by hideModal before display:none */
.modal-overlay.closing { animation: fadeOut 200ms ease forwards; }
.modal-overlay.closing .modal { animation: slideDown 200ms var(--ease-sheet) forwards; }
@keyframes fadeOut  { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }

/* Body scroll lock when a modal is open — prevents background bleed-scroll */
body.modal-open { overflow: hidden; touch-action: none; }
body.modal-open .modal,
body.modal-open .sheet { touch-action: auto; }

.modal-top {
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-bottom: 16px;
}
.modal-handle {
  width: 36px; height: 5px;
  background: var(--line);
  border-radius: 3px;
}
.modal-close-btn {
  position: absolute; right: -8px; top: -8px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-2);
  cursor: pointer; transition: color var(--duration-fast) ease;
}
.modal-close-btn:hover { color: var(--ink); }
.modal-close-btn .sf-icon svg { width: 14px; height: 14px; }

.modal--swiping {
  animation: none !important;
  will-change: transform;
  transition: none !important;
}
.modal--spring-back {
  animation: none !important;
  transition: transform 0.35s var(--ease-sheet), opacity 0.35s var(--ease-sheet) !important;
}

/* ── Sheet (bottom-anchored, used for activity feed) ────────── */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; justify-content: flex-end;
  pointer-events: auto;
}
.sheet-overlay.hidden { display: none; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 27, 22, 0.35);
  animation: fadeIn 260ms ease;
}
.sheet {
  position: relative;
  background: var(--bg);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  height: 86vh;
  max-height: 86vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  animation: sheetSlideUp 360ms var(--ease-sheet);
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 5px;
  background: var(--line);
  border-radius: 3px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px var(--content-pad) 40px;
  -webkit-overflow-scrolling: touch;
}
.sheet-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.5px;
  margin: 6px 0 4px;
}
.sheet-subtitle {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 18px;
}

/* ── Toast (calmer; no spring overshoot) ────────────────────── */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
  width: calc(100% - 32px); max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 200ms var(--ease-tap), transform 200ms var(--ease-tap);
}
.toast.toast-visible { opacity: 1; transform: translateY(0); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success { border-color: var(--good); }
.toast-success .toast-icon { color: var(--good); }
.toast-error { border-color: var(--red); }
.toast-error .toast-icon { color: var(--red); }
.toast-info { border-color: var(--accent); }
.toast-info .toast-icon { color: var(--accent); }

/* ── Inline Field Errors ───────────────────────────────────── */
.field-error {
  border-color: var(--red) !important;
  transition: border-color 200ms ease;
}
.field-error-msg {
  display: block;
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
  padding-left: 4px;
  line-height: 1.3;
}
@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.btn-shake { animation: btnShake 0.35s ease; }

/* ── Notification Banner ───────────────────────────────────── */
.notification-banner-container {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  padding: calc(env(safe-area-inset-top, 8px) + 8px) 16px 0;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.notification-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0; transform: translateY(-40px);
  transition: opacity 300ms var(--ease-sheet), transform 300ms var(--ease-sheet);
  -webkit-tap-highlight-color: transparent;
}
.notification-banner.visible {
  opacity: 1; transform: translateY(0);
}
.notification-banner-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.notification-banner-body { flex: 1; min-width: 0; }
.notification-banner-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.notification-banner-text { font-size: 11px; color: var(--ink-2); margin-top: 1px; }
.notification-banner-dismiss {
  background: none; border: none; color: var(--ink-3);
  cursor: pointer; padding: 4px; flex-shrink: 0;
}
.notification-banner--deal     .notification-banner-icon { background: var(--good-soft);   color: var(--good-ink); }
.notification-banner--deal                                { border-color: rgba(127, 166, 140, 0.25); }
.notification-banner--status   .notification-banner-icon { background: var(--accent-soft); color: var(--accent-ink); }
.notification-banner--status                              { border-color: rgba(224, 120, 86, 0.20); }
.notification-banner--complete .notification-banner-icon { background: var(--good-soft);   color: var(--good-ink); }
.notification-banner--complete                            { border-color: rgba(127, 166, 140, 0.30); }

/* ── Skeleton Loading ───────────────────────────────────────── */
.skeleton-bar {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* ── Onboarding Overlay shell ───────────────────────────────── */
.onboarding-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 150; overflow-y: auto; }
.onboarding-overlay.hidden { display: none; }

/* ── Icon helper sizes ──────────────────────────────────────── */
.sf-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sf-icon svg { width: 20px; height: 20px; }
.sf-icon-sm svg { width: 16px; height: 16px; }
.sf-icon-lg svg { width: 24px; height: 24px; }
.sf-icon-xl svg { width: 28px; height: 28px; }
.sf-icon-xs svg { width: 12px; height: 12px; }

/* ── Divider ────────────────────────────────────────────────── */
.divider, hr.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* ── Section header (legacy used in some screens) ───────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 11px; font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 36px 20px; }
.empty-state-icon { margin-bottom: var(--space-4); }
.empty-state-icon .sf-icon svg { width: 48px; height: 48px; color: var(--accent); opacity: 0.6; }
.empty-state-title { font-size: 21px; font-weight: 600; color: var(--ink); margin-bottom: var(--space-2); }
.empty-state-desc {
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
  max-width: 280px; margin: 0 auto var(--space-6);
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero entrance (kept for the homepage fade-up) ──────────── */
.hero-entrance { animation: heroEnter 0.5s var(--ease); }
.hero-entrance.no-entrance { animation: none; }
@keyframes heroEnter {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Saving amounts (legacy classes kept) ───────────────────── */
.saving-positive { color: var(--good); font-weight: 600; }
.saving-none     { color: var(--ink-3); }

/* ── Kind icon (rounded-square category avatar) ─────────────── */
.kind-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 14px;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--ink);
  overflow: hidden;
}
.kind-icon .sf-icon { width: 50%; height: 50%; display: inline-flex; align-items: center; justify-content: center; }
.kind-icon .sf-icon svg,
.kind-icon > svg {
  width: 100% !important;
  height: 100% !important;
  stroke-width: 1.8;
}
.kind-icon--34 { width: 34px; height: 34px; border-radius: 12px; }
.kind-icon--52 { width: 52px; height: 52px; border-radius: 18px; }
.kind-icon--soft   { background: var(--surface-2);  color: var(--ink); }
.kind-icon--accent { background: var(--accent-soft); color: var(--accent-ink); }
.kind-icon--good   { background: var(--good-soft);   color: var(--good-ink); }

/* ── RecCard (Home recommendation tile) ─────────────────────── */
.rec-card {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 22px;
  box-shadow: 0 0 0 6px rgba(245, 217, 206, 0.45), 0 8px 24px rgba(224, 120, 86, 0.12);
  padding: 18px 18px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-tap);
}
.rec-card + .rec-card { margin-top: 10px; }
.rec-card:active { transform: scale(0.98); }

.rec-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.rec-card-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.rec-card-tag svg { width: 14px; height: 14px; stroke-width: 2; }
.rec-card-kind {
  font-size: 12px; color: var(--ink-3);
  text-transform: capitalize;
}
.rec-card-title {
  font-size: 22px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.4px;
  line-height: 1.15;
}
.rec-card-row {
  margin-top: 12px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
}
.rec-card-saving { display: flex; flex-direction: column; min-width: 0; }
.rec-card-caption {
  font-size: 12px; color: var(--ink-3);
  margin-top: 2px;
}
.rec-card-cta {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent); color: white;
  font-size: 13px; font-weight: 600;
  border: 0; cursor: pointer; font-family: inherit;
  transition: background var(--duration-fast) ease;
}
.rec-card-cta:hover { background: var(--cta-hover); }
.rec-card-cta svg { width: 14px; height: 14px; stroke-width: 2.2; }
.rec-card-reason {
  margin-top: 12px;
  font-size: 13px; color: var(--ink-2);
  letter-spacing: -0.05px;
  line-height: 1.4;
}

/* ── QuietRow (compact bill row in "In the background") ─────── */
.quiet-list {
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.quiet-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
  border-bottom: 0.5px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.quiet-row:last-child { border-bottom: none; }
.quiet-row:active { transform: scale(0.99); }

.quiet-row-body { flex: 1; min-width: 0; }
.quiet-row-title {
  font-size: 15px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.2px;
  text-transform: capitalize;
}
.quiet-row-meta {
  font-size: 12px; color: var(--ink-3);
  margin-top: 1px;
  display: flex; align-items: center; gap: 5px;
  text-transform: none;
}

/* ── Activity Row (Latest section + activity sheet) ─────────── */
.activity-row {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  align-items: flex-start;
}
.activity-row-dot { padding-top: 6px; }
.activity-row-body { flex: 1; min-width: 0; }
.activity-row-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.1px;
}
.activity-row-when {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ── Feedback ───────────────────────────────────────────────── */
.feedback-card { background: var(--surface); }
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 2px;
}
.feedback-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
}
.feedback-when {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.feedback-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}
.feedback-pending {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 8px;
  font-style: italic;
}
.feedback-reply {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--good-soft);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}
.feedback-reply.unseen::before {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,120,86,0.18);
}
.feedback-reply-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--good-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.feedback-reply-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.45;
}

/* ── Submitted view (replaces confetti celebration) ─────────── */
.submitted-view {
  padding: 24px 20px;
  text-align: center;
}
.submitted-check {
  width: 88px; height: 88px;
  border-radius: 44px;
  background: var(--good-soft);
  color: var(--good-ink);
  display: flex; align-items: center; justify-content: center;
  margin: 20px auto 24px;
  border: 2px solid var(--good);
  animation: submittedCheckIn 360ms var(--ease-sheet) both;
}
.submitted-check svg { width: 44px; height: 44px; stroke-width: 2.4; }
@keyframes submittedCheckIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.submitted-headline {
  font-size: 26px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.6px;
  text-align: center;
  padding: 0 12px;
  margin: 0;
}
.submitted-sub {
  margin: 10px auto 0;
  font-size: 14px; color: var(--ink-2);
  padding: 0 12px;
  line-height: 1.45;
  max-width: 320px;
}
.submitted-next {
  margin-top: 26px;
  padding: 18px;
  text-align: left;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.submitted-next .section-label { display: block; margin-bottom: 14px; }
.submitted-saving-pill {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--good-soft);
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.submitted-saving-pill .money-big {
  color: var(--good-ink);
}
.submitted-saving-pill-text {
  flex: 1;
  font-size: 13px; color: var(--good-ink);
  min-width: 140px;
}
.submitted-cta { margin-top: 28px; }
