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

/* ── Tap feedback (universal, springy) ──────────────────────── */
.tap {
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity   var(--duration-fast) var(--ease-tap);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.tap:active { transform: scale(0.97); 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;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-bell {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.top-bar-bell svg {
  width: 22px;
  height: 22px;
}
.top-bar-bell-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  /* accent-ink, not accent: white 10px text on coral is 3.0:1 contrast */
  background: var(--accent-ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  transition: opacity 160ms ease, transform 200ms ease;
}
.top-bar-bell-badge--hidden {
  opacity: 0;
  transform: scale(0.5);
}

/* ── 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, .progress-dot { animation: none; }
  .tap:active { transform: none; }
}

/* ── Profile (You tab) ──────────────────────────────────────── */
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 30px;
  background: var(--accent);
  color: #FFFBF4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px; font-weight: 400;
  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--center { text-align: center; }
.profile-stat--right { text-align: right; }
.profile-stat-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 30px; font-weight: 400;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.profile-stat-value--neg { color: var(--red); }
.profile-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 6px;
}
.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); }

/* ── Household breakdown card (Home) ────────────────────────── */
.household-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);
}
.hh-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.hh-figure {
  display: flex; align-items: baseline; gap: 4px;
  margin-top: 6px;
}
.hh-figure-unit {
  font-size: 12px;
  color: var(--ink-3);
}
.hh-bar {
  display: flex;
  gap: 2px;               /* surface gap between segments */
  height: 12px;
  margin-top: 14px;
  border-radius: 5px;
  overflow: hidden;
}
.hh-bar-seg { display: block; min-width: 3px; }
.hh-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 16px;
  margin-top: 13px;
}
.hh-legend-item {
  display: flex; align-items: center; gap: 7px;
  min-width: 0;
  font-size: var(--text-sm);
}
.hh-legend-dot {
  width: 8px; height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.hh-legend-name {
  color: var(--ink-2);
  text-transform: capitalize;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.hh-legend-amount {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
}
.hh-footer {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--good-soft);
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-sm);
  color: var(--good-ink);
}
.hh-footer-icon { display: inline-flex; flex-shrink: 0; }
.hh-footer-label { flex: 1; min-width: 0; }
.hh-footer-value { font-weight: 600; white-space: nowrap; }

/* 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;
}

/* Ruled variant: hairline running to the right edge (ship blend) */
.section-label--ruled {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 8px;
  padding-left: 4px;
  white-space: nowrap;
}
.section-label--ruled::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.home-section .section-label--ruled { margin: 0 0 10px; }
.home-section-headrow .section-label--ruled { flex: 1; margin: 0; }

/* ── 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:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--text-inverse); }

.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;
}

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

.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.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  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 var(--content-pad);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Phone-width bottom-sheet presentation lives in responsive.css (single
   source of truth) - these keyframes back it. */
@keyframes modalSheetUp {
  from { transform: translateY(48%); opacity: 0.6; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes modalSheetDown {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(30%); opacity: 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; }

/* Sheet titles: every top-level modal heading reads serif italic (ship
   blend). Nested headings (inside cards, error blocks) stay sans. */
.modal > h2, .modal > h3,
.deal-modal-header h3,
.deal-modal-header .font-semibold {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
  line-height: 1.15;
}
/* Titles sit beside the absolute-positioned close button - keep clear of it */
.modal > h2, .modal > h3 { padding-right: 52px; }

/* Screen-level titles (non-modal sub-screens like manual add) */
.screen-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.modal-close-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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: 48px; height: 48px;
  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-family: var(--font-serif);
  font-style: italic;
  font-size: 23px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
  margin: 6px 0 4px;
}
.sheet-subtitle {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 18px;
}

/* ── Toast (warm cream glass) ───────────────────────────────── */
.toast-container {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
  width: calc(100% - 32px); max-width: 320px;
}
.toast {
  --toast-accent: var(--accent);
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px 11px 12px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  letter-spacing: -0.005em;
  background: rgba(255, 253, 249, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
          backdrop-filter: blur(24px) saturate(140%);
  border: 0.5px solid rgba(31, 27, 22, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 1px 2px rgba(31, 27, 22, 0.04),
    0 8px 24px -6px rgba(31, 27, 22, 0.14),
    0 16px 40px -10px rgba(31, 27, 22, 0.08);
  pointer-events: auto;
  opacity: 0; transform: translateY(-12px) scale(0.94);
  transition:
    opacity 260ms var(--ease-sheet),
    transform 260ms var(--ease-sheet);
  overflow: hidden;
}
.toast::before {
  content: ''; position: absolute;
  top: 0; left: 14px; right: 14px; height: 1px;
  background: var(--toast-accent);
  opacity: 0.4;
  pointer-events: none;
}
.toast.toast-visible { opacity: 1; transform: translateY(0) scale(1); }
.toast-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--toast-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--toast-accent) 30%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.toast-text {
  flex: 1; min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-success { --toast-accent: var(--good-ink); }
.toast-error   { --toast-accent: var(--red); }
.toast-info    { --toast-accent: 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 (warm cream glass) ────────────────── */
.notification-banner-container {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  padding: calc(env(safe-area-inset-top, 8px) + 12px) 16px 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.notification-banner {
  --banner-accent: var(--accent);
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px;
  background: rgba(255, 253, 249, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
          backdrop-filter: blur(24px) saturate(140%);
  border: 0.5px solid rgba(31, 27, 22, 0.08);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 1px 2px rgba(31, 27, 22, 0.04),
    0 12px 40px -8px rgba(31, 27, 22, 0.18),
    0 24px 60px -12px rgba(31, 27, 22, 0.10);
  pointer-events: auto;
  opacity: 0; transform: translateY(-16px) scale(0.97);
  transition:
    opacity 380ms var(--ease-sheet),
    transform 380ms var(--ease-sheet),
    box-shadow 220ms var(--ease-tap);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.notification-banner::before {
  content: ''; position: absolute;
  top: 0; left: 18px; right: 18px; height: 1px;
  background: var(--banner-accent);
  opacity: 0.4;
  pointer-events: none;
}
.notification-banner.visible {
  opacity: 1; transform: translateY(0) scale(1);
}
.notification-banner[data-notify-action] { cursor: pointer; }
.notification-banner[data-notify-action].visible:hover {
  transform: translateY(-1px) scale(1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(31, 27, 22, 0.05),
    0 16px 48px -8px rgba(31, 27, 22, 0.22),
    0 28px 70px -12px rgba(31, 27, 22, 0.12);
}
.notification-banner-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--banner-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--banner-accent) 32%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 1px rgba(31, 27, 22, 0.04);
}
.notification-banner-body { flex: 1; min-width: 0; }
.notification-banner-title {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.notification-banner-text {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.notification-banner-chevron {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 220ms var(--ease-tap), transform 220ms var(--ease-tap);
  pointer-events: none;
}
.notification-banner[data-notify-action]:hover .notification-banner-chevron {
  opacity: 0.75;
  transform: translateX(2px);
}
.notification-banner-dismiss {
  position: relative;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 0.5px solid rgba(31, 27, 22, 0.06);
  border-radius: 50%;
  color: var(--ink);
  opacity: 0.55;
  cursor: pointer;
  padding: 0;
  transition:
    opacity 160ms var(--ease-tap),
    background-color 160ms var(--ease-tap),
    border-color 160ms var(--ease-tap),
    transform 120ms var(--ease-tap);
}
.notification-banner-dismiss::before {
  content: '';
  position: absolute;
  inset: -9px;
}
.notification-banner-dismiss:hover,
.notification-banner-dismiss:focus-visible {
  opacity: 1;
  background: var(--surface-2);
  border-color: rgba(31, 27, 22, 0.12);
  outline: none;
}
.notification-banner-dismiss:active { transform: scale(0.92); }

.notification-banner--deal     { --banner-accent: var(--good-ink); }
.notification-banner--status   { --banner-accent: var(--accent); }
.notification-banner--complete { --banner-accent: var(--good-ink); }
.notification-banner--error    { --banner-accent: var(--red); }
.notification-banner--warning  { --banner-accent: #B07A1F; }

/* Reduced motion - keep the fade, drop the spring/shift */
@media (prefers-reduced-motion: reduce) {
  .toast,
  .notification-banner {
    transition: opacity 160ms linear !important;
  }
  .toast,
  .toast.toast-visible,
  .notification-banner,
  .notification-banner.visible {
    transform: none !important;
  }
  .notification-banner[data-notify-action].visible:hover {
    transform: none !important;
  }
}

/* ── 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); } }

/* ── Entrance choreography (plays ONCE, at app open) ─────────
   app.js adds body.ss-intro at boot and removes it after 2.4s.
   Screens re-render via innerHTML on every route change, so the
   stagger is gated behind .ss-intro - without the class, sections
   render settled. */
@media (prefers-reduced-motion: no-preference) {
  body.ss-intro .anim-in {
    animation: ssUp 560ms var(--ease-sheet) both;
    animation-delay: calc(var(--i, 0) * 75ms);
  }
}
@keyframes ssUp {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroEnter {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Grain (fine noise on hero surfaces, ship blend) ────────── */
.ss-grain { position: relative; }
.ss-grain::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 160px;
  opacity: 0.05;
  mix-blend-mode: multiply;
  border-radius: inherit;
}
html[data-theme="dark"] .ss-grain::after { opacity: 0.07; mix-blend-mode: overlay; }

/* ── 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-header-right { display: inline-flex; align-items: center; gap: 6px; }
.rec-card-dismiss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  margin: -8px -8px -8px 0;   /* bigger tap target without moving the layout */
  padding: 0;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.rec-card-dismiss:active { background: var(--bg); color: var(--ink-2); }
.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;
}

/* ── Rowgroup (contained card list - Home, Bills, You, history) ── */
.quiet-list {
  padding: 2px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.quiet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.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;
}
.quiet-row-right { text-align: right; flex-shrink: 0; }
.quiet-row-amount {
  font-size: 14.5px; font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.quiet-row-amount-unit { font-size: 11px; font-weight: 400; color: var(--ink-3); }

/* Activity rows shown inside a rowgroup lose their own card chrome */
.quiet-list--activity .activity-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 0;
  padding: 13px 2px;
}
.quiet-list--activity .activity-row:last-child { border-bottom: none; }

/* ── Row status vocabulary (one quiet line under the amount) ── */
.row-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  margin-top: 2px; white-space: nowrap;
}
.row-status--save     { color: var(--good-ink); }
.row-status--progress { color: var(--good); }
.row-status--accent   { color: var(--accent-ink); }
.row-status--issue    { color: var(--red); }
.row-status--tracked  { color: var(--ink-3); font-weight: 500; }
/* A second status line under the first (Better value → "Or save $X/mo"). */
.row-status--sub      { display: flex; justify-content: flex-end; font-weight: 500; }

/* ── Pills (history + statuses, ship blend) ─────────────────── */
.npill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.npill svg { width: 11px; height: 11px; }
.npill .sf-icon svg { width: 11px; height: 11px; }
.npill--progress { background: var(--accent-soft); color: var(--accent-ink); }
.npill--good     { background: var(--good-soft);   color: var(--good-ink); }
.npill--loss     { background: var(--red-soft);    color: var(--red); }
.npill--muted    { background: var(--surface-2);   color: var(--ink-3); }

/* ── Segmented control (Appearance, deal sorting) ───────────── */
.seg {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg-btn {
  padding: 6px 12px; border-radius: 999px;
  border: none; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  font-family: inherit; white-space: nowrap; cursor: pointer;
}
.seg-btn.active { background: var(--primary); color: var(--text-inverse); }

/* ── Page sub-line (mono, under the sticky title) ───────────── */
.page-sub {
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding-left: 4px;
  white-space: nowrap;
}

.setting-row-label { font-size: var(--text-sm); color: var(--text-dim); }

/* ── 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);
}

/* ── Notifications inbox (sheet opened from the top-bar bell) ── */
.inbox-tabs {
  display: flex;
  gap: 18px;
  margin: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}
.inbox-tab {
  padding: 8px 2px 10px;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
}
.inbox-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.inbox-item { cursor: pointer; }
/* Actionable rows render as real <button>s - reset button chrome so they
   inherit the .activity-row card look. */
button.inbox-item {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  appearance: none;
}
/* Inbox dots are records, not live states - the sonar ring means
   "happening now" and would pulse on forty read messages at once.
   Same static treatment the reduced-motion media query uses. */
.inbox-item .live-dot,
.inbox-item .live-dot::before { animation: none; }
.inbox-item .live-dot::before { opacity: 0.35; transform: scale(1.4); }
.inbox-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.1px;
}
.inbox-item .activity-row-text {
  color: var(--ink-2, var(--ink));
  margin-top: 2px;
}
.inbox-item--unread {
  border-color: var(--accent-soft);
  background: var(--surface);
}
.inbox-item--unread .inbox-item-title { font-weight: 700; }
.inbox-item-chevron {
  align-self: center;
  color: var(--ink-3);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.inbox-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ── Nudges: install card (Home) + notification ask (celebration) ── */
.install-nudge-card {
  position: relative;
  padding: 16px;
  padding-right: 48px; /* clear the dismiss button */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px; /* sits with .quiet-list on Home */
}
.install-nudge-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.install-nudge-text {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.install-nudge-steps {
  list-style: none;
  counter-reset: install-step;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}
.install-nudge-steps li { counter-increment: install-step; }
.install-nudge-steps li::before {
  content: counter(install-step) '. ';
  color: var(--ink-3);
}
.install-nudge-card .btn { margin-bottom: 0; }
.nudge-dismiss {
  position: absolute;
  top: 2px; right: 2px;
  background: none;
  border: none;
  padding: 14px; /* 12px icon + 14px padding = 40px target */
  color: var(--ink-3);
  cursor: pointer;
  line-height: 0;
}
.submitted-notif-nudge {
  margin-top: 14px;
  padding: 14px 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg); /* matches the celebration timeline card */
}
.submitted-notif-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.submitted-notif-text {
  font-size: var(--text-sm); /* body copy, not the label token */
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.submitted-notif-actions {
  display: flex;
  gap: 8px;
}
.submitted-notif-actions .btn { flex: 1; }
.submitted-notif-done {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--good-ink);
}

/* ── 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 var(--content-pad);
  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-family: var(--font-serif);
  font-style: italic;
  font-size: 30px; font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
  line-height: 1.1;
  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; }

/* ── Offline Banner ── */
.offline-banner {
  padding: 10px 16px;
  background: var(--warn-soft);
  color: var(--ink-2);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4;
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}

/* ================================================================
   DARK MODE AUDIT - rules whose light values are literals that the
   token flip can't reach (glass surfaces, ink-shadow tints, halos).
   Keep every selector here in sync with its light rule above.
   ================================================================ */
html[data-theme="dark"] .toast,
html[data-theme="dark"] .notification-banner {
  background: rgba(42, 35, 27, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 12px 40px -8px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .toast-icon,
html[data-theme="dark"] .notification-banner-icon {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .sheet-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .btn:disabled {
  background: #3A3226 !important;
  color: rgba(244, 236, 224, 0.45) !important;
}
html[data-theme="dark"] .rec-card {
  box-shadow: 0 0 0 6px rgba(224, 120, 86, 0.14), 0 24px 56px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .quiet-row:hover,
html[data-theme="dark"] .bill-card:hover {
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .notification-banner-dismiss {
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .notification-banner-dismiss:hover,
html[data-theme="dark"] .notification-banner-dismiss:focus-visible {
  border-color: rgba(255, 255, 255, 0.2);
}
/* Skeleton shimmer sweep is a white flash tuned for cream - soften it */
html[data-theme="dark"] .shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  background-size: 200% 100%;
}

/* ── Fresh-bill re-scan chip (bill cards) ───────────────────────
   A quiet one-line ask under the provider name: tap to re-scan, ✕
   to snooze. Sits inside the tappable card, so it must read as its
   own control (accent ink, hairline top rule). */
.bill-card--nudge { flex-wrap: wrap; }
.rescan-chip {
  flex-basis: 100%;
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px; font-weight: 600;
  color: var(--accent);
}
.rescan-chip .sf-icon-xs { flex-shrink: 0; }
.rescan-chip-text { flex: 1; min-width: 0; }
.rescan-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: -4px -4px -4px 0;
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); border-radius: 50%;
}
.rescan-chip-x:active { background: var(--surface-2); }
