/* Bank Statement Genie — light airy pastel UI */

:root {
  --fg:           #0f172a;   /* slate-900 */
  --fg-soft:      #334155;   /* slate-700 */
  --muted:        #64748b;   /* slate-500 */
  --line:         #ede9fe;   /* violet-100 */
  --line-strong:  #ddd6fe;   /* violet-200 */
  --card:         #ffffff;
  --bg:           #faf5ff;   /* violet-50 */

  --primary:        #8b5cf6; /* violet-500 */
  --primary-hover:  #7c3aed; /* violet-600 */
  --primary-soft:   #ede9fe; /* violet-100 */
  --primary-softer: #f5f3ff; /* violet-50 */

  --pink:    #fb7185;  /* rose-400 */
  --pink-soft: #ffe4e6;
  --mint:    #34d399;  /* emerald-400 */
  --mint-soft: #d1fae5;
  --sky:     #38bdf8;  /* sky-400 */
  --sky-soft: #e0f2fe;
  --peach:   #fdba74;  /* orange-300 */
  --peach-soft: #fed7aa;

  --ok-bg: #d1fae5; --ok-fg: #065f46;
  --warn-bg: #fef3c7; --warn-fg: #92400e;
  --err-bg: #fee2e2; --err-fg: #991b1b;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 4px 16px rgba(139,92,246,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg: 0 20px 50px rgba(139,92,246,0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(at 80% -10%, #fce7f3 0px, transparent 50%),
    radial-gradient(at 0% 0%, #ddd6fe 0px, transparent 50%),
    radial-gradient(at 100% 100%, #cffafe 0px, transparent 40%);
  background-attachment: fixed;
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv11';
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 28px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 28px; }

/* ---- top bar ---- */
.topbar {
  background: rgba(255,255,255,0.7);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 16px; color: var(--fg);
}
.brand:hover { text-decoration: none; color: var(--fg); }
.brand-mark {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: inline-block;
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(139,92,246,0.25);
}
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--fg-soft); font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--fg); text-decoration: none; }
.topnav a.btn-primary { color: white; }

/* ---- buttons ---- */
.btn-primary, button.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  font-family: inherit; line-height: 1;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(139,92,246,0.3), 0 4px 12px rgba(139,92,246,0.15);
}
.btn-primary:hover, button.btn-primary:hover {
  background: var(--primary-hover); text-decoration: none; color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(139,92,246,0.35), 0 8px 20px rgba(139,92,246,0.2);
}
.btn-primary:disabled, button.btn-primary:disabled {
  opacity: 0.5; cursor: default; transform: none;
}
.btn-primary.lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }

.btn-ghost, button.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  font-family: inherit; line-height: 1;
  background: white; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-ghost:hover, button.btn-ghost:hover {
  background: var(--primary-softer); border-color: var(--primary);
  text-decoration: none; color: var(--fg);
}

.btn-secondary, button.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  font-family: inherit;
  background: var(--primary-soft); color: var(--primary-hover);
  border: none; border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-secondary:hover, button.btn-secondary:hover {
  background: var(--line-strong); color: var(--primary-hover);
  text-decoration: none;
}
.btn-secondary:disabled, button.btn-secondary:disabled { opacity: 0.5; cursor: default; }

/* ---- typography ---- */
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 14px; }
h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
p  { color: var(--muted); margin: 8px 0; }
p.lead { font-size: 18px; color: var(--fg-soft); }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.92em; background: var(--primary-soft); padding: 1px 6px; border-radius: 5px; }

.eyebrow {
  display: inline-block; padding: 6px 12px;
  background: white; border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: 12px; font-weight: 500;
  color: var(--primary-hover); letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

/* ---- hero (two-column) ---- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px;
  padding: 64px 28px 48px;
  max-width: 1180px; margin: 0 auto;
  align-items: center;
}
.hero-text { text-align: left; }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 52px 24px 32px; text-align: center; }
  .hero-text { text-align: center; }
}
.hero-title { font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; margin: 18px 0 16px; }
.hero-title em { font-style: normal; background: linear-gradient(135deg, #8b5cf6 0%, #fb7185 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 600px) { .hero-title { font-size: 38px; } }
.hero-sub { font-size: 18px; color: var(--fg-soft); max-width: 540px; margin: 0 0 26px; }
@media (max-width: 960px) { .hero-sub { margin: 0 auto 24px; } }
.hero-cta { display: inline-flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 960px) { .hero-cta { justify-content: center; } }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---- hero diagram (animated) ---- */
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-diagram { width: 100%; max-width: 540px; height: auto; }
.hero-diagram .flow-line {
  stroke-dasharray: 2 6;
  animation: marchAnts 0.7s linear infinite;
}
@keyframes marchAnts { to { stroke-dashoffset: -8; } }
.hero-diagram .node-card {
  filter: drop-shadow(0 8px 18px rgba(139,92,246,0.12));
}
.hero-diagram .node-bank-glow {
  animation: bankPulse 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes bankPulse { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.35; } }

/* ---- privacy banner (above-the-fold trust hit) ---- */
.privacy-banner {
  background: linear-gradient(135deg, var(--primary-softer) 0%, #ffe4e6 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 24px;
}
.privacy-banner-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.privacy-banner .pb-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 12px rgba(139,92,246,0.15);
  font-size: 26px;
  flex-shrink: 0;
}
.privacy-banner .pb-text { flex: 1; min-width: 280px; }
.privacy-banner h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.privacy-banner p { color: var(--fg-soft); margin: 0; font-size: 14.5px; }
.privacy-banner .pb-pills { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.privacy-banner .pb-pills .pill {
  background: white; border: 1px solid var(--line-strong);
  color: var(--fg-soft); font-weight: 500;
}

/* ---- "Why BSG" before/after ---- */
.before-after {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch;
  margin-top: 16px;
}
.before-after .arrow {
  display: grid; place-items: center;
  color: var(--primary);
  font-size: 26px;
  width: 50px;
}
@media (max-width: 800px) {
  .before-after { grid-template-columns: 1fr; }
  .before-after .arrow { transform: rotate(90deg); height: 30px; width: auto; }
}
.before, .after {
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.before {
  background: #fafafa;
  border: 1px solid #e5e7eb;
}
.before h3 { color: #64748b; margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; }
.before ul, .after ul { list-style: none; padding: 0; margin: 0; }
.before li {
  color: #94a3b8;
  padding: 6px 0 6px 28px;
  position: relative;
  text-decoration: line-through;
  font-size: 14.5px;
}
.before li::before {
  content: '✗'; position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: #f1f5f9; color: #94a3b8;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-decoration: none;
}
.after {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-softer) 100%);
  border: 1px solid var(--line-strong);
}
.after h3 { color: var(--primary-hover); margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; }
.after li {
  color: var(--fg);
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 14.5px;
}
.after li::before {
  content: '✓'; position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: var(--mint-soft); color: var(--ok-fg);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

/* ---- personas grid ---- */
.personas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.persona {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.persona:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.persona .p-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 20px;
  margin-bottom: 10px;
}
.persona.violet .p-icon { background: var(--primary-soft); }
.persona.pink   .p-icon { background: var(--pink-soft); }
.persona.mint   .p-icon { background: var(--mint-soft); }
.persona.sky    .p-icon { background: var(--sky-soft); }
.persona h3 { margin: 0 0 4px; font-size: 15.5px; }
.persona p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ---- privacy "can / cannot" cards ---- */
.cando-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 18px;
}
@media (max-width: 700px) { .cando-grid { grid-template-columns: 1fr; } }
.cando-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.cando-card.can    { border-top: 4px solid var(--mint); }
.cando-card.cannot { border-top: 4px solid var(--pink); }
.cando-card .cando-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.cando-card .cando-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
}
.cando-card.can .cando-icon    { background: var(--mint-soft); color: var(--ok-fg); }
.cando-card.cannot .cando-icon { background: var(--pink-soft); color: #be123c; }
.cando-card .cando-head h3 { margin: 0; font-size: 16px; }
.cando-card ul { list-style: none; padding: 0; margin: 0; }
.cando-card li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--fg-soft);
  font-size: 14px;
  line-height: 1.5;
}
.cando-card.can li::before {
  content: '✓'; position: absolute; left: 0; top: 6px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: var(--mint-soft); color: var(--ok-fg);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.cando-card.cannot li::before {
  content: '✗'; position: absolute; left: 0; top: 6px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: var(--pink-soft); color: #be123c;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

/* ---- FAQ accordion ---- */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.faq-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.2s ease;
  overflow: hidden;
}
.faq-item[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.faq-item summary {
  padding: 18px 22px;
  font-weight: 500; font-size: 15.5px; color: var(--fg);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  transition: background 0.15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--primary-softer); }
.faq-item summary::after {
  content: '+';
  font-size: 22px; font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0; line-height: 1;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--primary);
}
.faq-body {
  padding: 0 22px 20px;
  color: var(--fg-soft);
  font-size: 14.5px; line-height: 1.65;
}
.faq-body p { margin: 0; color: inherit; }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

/* ---- feature grid ---- */
.features {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin: 32px auto;
  padding: 0 28px;
  max-width: 1080px;
}
@media (max-width: 800px) { .features { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card .feature-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  font-size: 22px;
  margin-bottom: 14px;
}
.feature-card .feature-icon svg { width: 22px; height: 22px; }
.feature-card.violet .feature-icon svg { stroke: var(--primary-hover); }
.feature-card.pink   .feature-icon svg { stroke: #be123c; }
.feature-card.mint   .feature-icon svg { stroke: var(--ok-fg); }
.feature-card.sky    .feature-icon svg { stroke: #075985; }
.persona .p-icon svg { width: 20px; height: 20px; }
.persona.violet .p-icon svg { stroke: var(--primary-hover); }
.persona.pink   .p-icon svg { stroke: #be123c; }
.persona.mint   .p-icon svg { stroke: var(--ok-fg); }
.persona.sky    .p-icon svg { stroke: #075985; }
.privacy-banner .pb-icon svg { width: 26px; height: 26px; stroke: var(--primary-hover); }
.privacy-banner .pb-pills .pill svg { width: 13px; height: 13px; stroke: var(--primary-hover); vertical-align: -2px; margin-right: 4px; }
.empty .feather-empty svg { width: 36px; height: 36px; stroke: var(--muted); display: block; margin: 0 auto 10px; }
.item-row .inst-mark svg { width: 18px; height: 18px; stroke: var(--primary-hover); }
.cando-card .cando-icon svg { width: 18px; height: 18px; }
.cando-card.can .cando-icon svg { stroke: var(--ok-fg); }
.cando-card.cannot .cando-icon svg { stroke: #be123c; }
.dash-stat .label svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; opacity: 0.7; }
.pill-btn svg { width: 13px; height: 13px; stroke-width: 2.4; }
.feature-card.violet .feature-icon { background: var(--primary-soft); }
.feature-card.pink   .feature-icon { background: var(--pink-soft); }
.feature-card.mint   .feature-icon { background: var(--mint-soft); }
.feature-card.sky    .feature-icon { background: var(--sky-soft); }
.feature-card h3 { color: var(--fg); margin-bottom: 6px; }
.feature-card p  { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---- pricing ---- */
.pricing-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(2, 1fr);
  margin: 24px 0;
}
@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow);
}
.plan.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}
.plan.featured::before {
  content: 'Most popular';
  position: absolute; top: -10px; right: 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #fb7185 100%);
  color: white;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(139,92,246,0.25);
}
.plan h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.plan .price { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 16px; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 16px 0 0; }
.plan li { padding: 7px 0 7px 28px; position: relative; color: var(--fg-soft); font-size: 14.5px; }
.plan li::before {
  content: '✓';
  position: absolute; left: 0; top: 7px;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--mint-soft); color: #065f46;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.plan li.dim { color: var(--muted); }
.plan li.dim::before { content: '–'; background: #f1f5f9; color: var(--muted); }

/* ---- pill / badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary-hover);
}
.pill.paid  { background: var(--mint-soft); color: var(--ok-fg); }
.pill.free  { background: var(--sky-soft); color: #075985; }

/* ---- status banners ---- */
.status {
  padding: 12px 14px; border-radius: var(--radius-sm);
  margin-top: 14px; font-size: 14px;
}
.status.ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.status.warn { background: var(--warn-bg); color: var(--warn-fg); }
.status.err  { background: var(--err-bg);  color: var(--err-fg); }

/* ---- forms ---- */
input[type=text], input[type=email], textarea {
  width: 100%; padding: 12px 14px;
  font-size: 15px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: white; color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
}
label { display: block; font-size: 13px; font-weight: 500; color: var(--fg-soft); margin: 14px 0 6px; }
textarea { min-height: 130px; resize: vertical; }

/* ---- rows / lists ---- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.item-list { display: grid; gap: 12px; }
.item-row {
  display: flex; gap: 16px; align-items: center;
  padding: 16px;
  background: var(--primary-softer);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.item-row .inst-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: white;
  font-weight: 600; font-size: 14px;
  color: var(--primary-hover);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.item-row .inst-meta { flex: 1; min-width: 0; }
.item-row .inst-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.item-row .inst-name { font-weight: 600; color: var(--fg); font-size: 15px; }
.item-row .inst-last { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item-row .inst-accts { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.item-row .inst-accts .acct { display: block; }
.item-row .inst-accts .mask { color: var(--muted); opacity: 0.7; margin-left: 4px; }
.item-row .inst-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 500;
  font-family: inherit; line-height: 1;
  background: white; color: var(--fg-soft);
  border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.pill-btn:hover {
  background: var(--primary-softer); border-color: var(--primary); color: var(--primary-hover);
  text-decoration: none;
}
.pill-btn:disabled { opacity: 0.5; cursor: default; }
.pill-btn.primary { background: var(--primary-soft); color: var(--primary-hover); border-color: transparent; }
.pill-btn.primary:hover { background: var(--line-strong); }
@media (max-width: 700px) {
  .item-row { flex-wrap: wrap; }
  .item-row .inst-actions { width: 100%; padding-left: 56px; }
}

/* ---- blur (privacy) ---- */
.blurable { transition: filter 0.15s ease; }
body.blur-on .blurable { filter: blur(7px); user-select: none; }
.blur-toggle {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  background: white; border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; color: var(--fg-soft);
  transition: all 0.15s ease;
  font-size: 16px;
  padding: 0;
}
.blur-toggle svg { width: 16px; height: 16px; stroke: var(--fg-soft); }
body.blur-on .blur-toggle svg { stroke: white; }
.blur-toggle:hover { background: var(--primary-softer); color: var(--primary-hover); border-color: var(--primary); }
body.blur-on .blur-toggle { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- scope toggle (MTD/LM/YTD) ---- */
.scope-bar-wrap { display: flex; justify-content: flex-end; margin: 8px 0 14px; }
.scope-bar {
  display: inline-flex; gap: 4px; padding: 4px;
  background: white; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.scope-bar button {
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  background: transparent; color: var(--muted);
  border: none; border-radius: 999px;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.scope-bar button:hover { color: var(--fg); }
.scope-bar button.active {
  background: var(--primary-soft); color: var(--primary-hover);
}

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.55);
  display: none; place-items: center;
  padding: 24px;
}
.modal-backdrop.open {
  display: grid;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white; border-radius: 18px;
  padding: 24px 28px 22px;
  width: 100%; max-width: 540px; max-height: 80vh;
  overflow: auto; position: relative;
  box-shadow: 0 30px 60px rgba(15,23,42,0.25);
  animation: popIn 0.18s ease;
}
@keyframes popIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--primary-softer); color: var(--fg-soft);
  border: none; border-radius: 999px;
  cursor: pointer; font-size: 18px; line-height: 1;
}
.modal-close:hover { background: var(--line-strong); color: var(--fg); }
.modal h2 { margin: 0 0 4px; padding-right: 36px; }
.modal .modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.modal-summary {
  background: linear-gradient(135deg, var(--primary-softer) 0%, #ffe4e6 100%);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 6px 0 18px;
}
.modal-summary .label {
  display: block;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.modal-summary .value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.modal-summary .value.in  { color: var(--ok-fg); }
.modal-summary .value.out { color: #be123c; }
.modal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.modal-row:last-child { border-bottom: none; }
.modal-row .m-rank {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--primary-softer); color: var(--muted);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.modal-row .m-main { flex: 1; min-width: 0; }
.modal-row .m-name {
  font-weight: 500; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 3px;
}
.modal-row .m-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--muted); align-items: center;
}
.modal-row .m-pill {
  display: inline-block;
  padding: 1px 8px;
  background: var(--primary-softer);
  color: var(--fg-soft);
  border-radius: 999px;
  font-size: 11px;
}
.modal-row .m-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--fg);
}
.modal-row .m-amt.in  { color: var(--ok-fg); }
.modal-row .m-amt.out { color: #be123c; }

/* ---- dashboard tabs ---- */
.tab-bar {
  display: inline-flex; gap: 4px; padding: 4px;
  background: white; border: 1px solid var(--line); border-radius: 999px;
  margin: 14px 0 6px;
  box-shadow: var(--shadow-sm);
}
.tab-bar button {
  padding: 8px 18px; font-size: 14px; font-weight: 500;
  background: transparent; color: var(--muted);
  border: none; border-radius: 999px;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.tab-bar button:hover { color: var(--fg); }
.tab-bar button.active {
  background: var(--primary-soft); color: var(--primary-hover);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- dashboard stat cards ---- */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
.dash-stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dash-stat:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.dash-stat::after {
  content: '↗';
  position: absolute; top: 12px; right: 14px;
  color: var(--muted); font-size: 13px; opacity: 0;
  transition: opacity 0.15s ease;
}
.dash-stat:hover::after { opacity: 1; }
.dash-stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.dash-stat .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; color: var(--fg); font-variant-numeric: tabular-nums; }
.dash-stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dash-stat.violet .value { color: var(--primary-hover); }
.dash-stat.mint   .value { color: var(--ok-fg); }
.dash-stat.pink   .value { color: #be123c; }
.dash-stat.sky    .value { color: #075985; }
.dash-stat.neg .value { color: var(--err-fg); }

/* ---- monthly top-expenses ---- */
.month-block { margin-top: 22px; }
.month-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.month-header .m-title { font-weight: 600; color: var(--fg); }
.month-header .m-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-header .m-sub span.up { color: var(--ok-fg); }
.month-header .m-sub span.dn { color: var(--err-fg); }
.expense-row { display: grid; grid-template-columns: 80px 1fr 100px; gap: 12px; padding: 7px 4px; font-size: 14px; align-items: baseline; }
.expense-row .ex-date { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.expense-row .ex-name { color: var(--fg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-row .ex-amt { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 500; }

/* ---- admin self-toggle (dashboard only) ---- */
.self-plan { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.self-plan .plan-toggle { display: inline-flex; gap: 4px; padding: 2px; background: var(--primary-softer); border-radius: 999px; }
.self-plan .plan-toggle button { padding: 4px 12px; font-size: 12px; font-weight: 500; border: none; background: transparent; border-radius: 999px; cursor: pointer; color: var(--muted); font-family: inherit; }
.self-plan .plan-toggle button.active { background: white; color: var(--primary-hover); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.self-plan .plan-toggle button.active.paid { color: var(--ok-fg); }

/* ---- analytics bars (horizontal) ---- */
.bar { display: grid; grid-template-columns: 180px 1fr 110px; gap: 12px; align-items: center; margin: 8px 0; font-size: 13.5px; }
.bar .label { color: var(--fg-soft); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { background: var(--primary-softer); border-radius: 999px; height: 14px; overflow: hidden; }
.bar .fill  { height: 100%; background: linear-gradient(90deg, #c4b5fd 0%, #8b5cf6 100%); border-radius: 999px; }
.bar .amt { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }
.bar .sub-count { color: var(--muted); font-size: 11px; font-weight: 400; }
@media (max-width: 600px) { .bar { grid-template-columns: 1fr; } .bar .track { display: none; } }

/* ---- income vs spend line chart ---- */
.line-chart-wrap { position: relative; }
.line-chart {
  width: 100%; height: 240px;
  display: block;
}
.line-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.line-chart .axis-label { font-size: 10px; fill: var(--muted); font-family: inherit; }
.line-chart .series-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .series-dot { stroke: white; stroke-width: 2; transition: r 0.15s ease; cursor: pointer; }
.line-chart .series-dot:hover { r: 6; }
.line-chart .hit-area { fill: transparent; cursor: pointer; }
.line-legend { display: flex; gap: 14px; justify-content: flex-end; margin-bottom: 8px; }
.line-legend .lg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-soft); }
.line-legend .lg-dot { width: 10px; height: 10px; border-radius: 999px; }
.line-tooltip {
  position: absolute; pointer-events: none;
  background: white; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px 12px; box-shadow: var(--shadow);
  font-size: 12px; min-width: 140px;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 5; display: none;
}
.line-tooltip .tt-month { font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.line-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.line-tooltip .tt-row.in span:first-child { color: var(--ok-fg); }
.line-tooltip .tt-row.out span:first-child { color: #be123c; }

/* ---- expandable month block ---- */
.month-block.expandable .month-header { cursor: pointer; user-select: none; transition: background 0.15s ease; border-radius: 8px; padding: 8px 10px; }
.month-block.expandable .month-header:hover { background: var(--primary-softer); }
.month-block .chev { display: inline-block; transition: transform 0.2s ease; margin-right: 6px; color: var(--muted); font-size: 11px; }
.month-block.expanded .chev { transform: rotate(90deg); }
.month-detail { display: none; padding-top: 8px; }
.month-block.expanded .month-detail { display: block; animation: expandFade 0.2s ease; }
@keyframes expandFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.month-detail .more-link { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---- skeleton loader ---- */
@keyframes skel { 0% { opacity: 0.55; } 50% { opacity: 0.85; } 100% { opacity: 0.55; } }
.skeleton { background: var(--primary-softer); border-radius: 8px; animation: skel 1.4s ease-in-out infinite; }
.skeleton-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.skeleton-circle { width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0; }
.skeleton-bar { height: 14px; }
.skeleton-bar.short { width: 40%; }
.skeleton-bar.mid { width: 65%; }
.skeleton-bar.long { width: 90%; }
.skeleton-amt { width: 70px; height: 14px; margin-left: auto; flex-shrink: 0; }

/* ---- enter animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease both; }
.fade-up.d1 { animation-delay: 0.05s; }
.fade-up.d2 { animation-delay: 0.10s; }
.fade-up.d3 { animation-delay: 0.15s; }
.fade-up.d4 { animation-delay: 0.20s; }

/* ---- monthly trend chart (vertical) ---- */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  margin: 18px 0 6px;
  padding: 0 4px;
}
.trend-col {
  flex: 1;
  display: flex; flex-direction: column; align-items: stretch;
  text-align: center;
  min-width: 0;
}
.trend-col .col-bar-wrap {
  flex: 1;
  display: flex; align-items: flex-end;
  padding: 0 2px;
}
.trend-col .col-bar {
  width: 100%;
  background: linear-gradient(180deg, #c4b5fd 0%, #8b5cf6 100%);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: opacity 0.15s ease;
}
.trend-col:hover .col-bar { opacity: 0.85; }
.trend-col .col-amt { font-size: 10px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.trend-col .col-label { font-size: 11px; color: var(--fg-soft); margin-top: 2px; font-weight: 500; }
.trend-col.current .col-label { color: var(--primary-hover); }

/* ---- merchant + recurring lists ---- */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-name { font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-row .lr-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--fg); flex-shrink: 0; }
.list-row .lr-amt-sub { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ---- empty state ---- */
.empty {
  text-align: center; padding: 40px 24px;
  background: var(--primary-softer); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); color: var(--muted);
}
.empty .emoji { font-size: 36px; display: block; margin-bottom: 12px; }

/* ---- footer ---- */
footer {
  text-align: center; padding: 40px 24px;
  font-size: 13px; color: var(--muted);
}
footer a { color: var(--muted); }
