/* Budgeteer web. Tokens follow design-system/budget/MASTER.md (blue brand on slate,
   green only for positive money, red for negative). System font stack, light and dark. */

:root {
  --color-primary: #1D4ED8;
  --color-on-primary: #FFFFFF;
  --color-brand: #1D4ED8;
  --color-positive: #047857;
  --color-negative: #DC2626;
  --color-bg: #F1F5F9;
  --color-bg-elevated: #FFFFFF;
  --color-fg: #0F172A;
  --color-muted: #526075;
  --color-track: #E2E8F0;
  --color-border: rgba(15, 23, 42, 0.08);
  --color-tint: rgba(29, 78, 216, 0.10);
  --color-glow: rgba(59, 130, 246, 0.28);
  --color-ink: #0F172A;
  --color-ink-fg: #FFFFFF;
  --color-ink-muted: #94A3B8;
  --color-ink-card: #1E293B;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --radius-chip: 12px;
  --radius-button: 14px;
  --radius-card: 20px;
  --radius-phone: 54px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, Segoe UI, Roboto, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px -12px rgba(15, 23, 42, 0.12);
  --shadow-phone: 0 40px 80px -30px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.06);

  --duration: 200ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #1D4ED8;
    --color-brand: #60A5FA;
    --color-positive: #34D399;
    --color-negative: #F87171;
    --color-bg: #0F172A;
    --color-bg-elevated: #1E293B;
    --color-fg: #F8FAFC;
    --color-muted: #94A3B8;
    --color-track: #3B4A63;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-tint: rgba(96, 165, 250, 0.16);
    --color-glow: rgba(59, 130, 246, 0.35);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
    --shadow-phone: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.16);
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.money, .tabular { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.eyebrow {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-brand);
  margin-bottom: var(--space-3);
}

.lead {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--color-muted);
  max-width: 60ch;
}

.section { padding-block: clamp(64px, 10vw, 128px); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(32px, 5vw, 48px); margin-bottom: var(--space-4); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease), opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: #1E40AF; }
.btn-secondary { background: var(--color-tint); color: var(--color-brand); }
.btn-secondary:hover { background: rgba(29, 78, 216, 0.16); }
.btn-ghost { background: transparent; color: var(--color-brand); padding-inline: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* App Store badge: a black pill with the Apple mark and two lines of text. */
.app-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 18px 8px 14px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.app-store:hover { text-decoration: none; opacity: 0.88; }
.app-store:active { transform: scale(0.98); }
.app-store svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.app-store span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.app-store small { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; }
.app-store strong { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.app-store.is-pending { position: relative; }
.app-store .coming-soon {
  position: absolute; top: -10px; right: -8px;
  background: var(--color-positive); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--color-fg);
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.site-nav ul { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--color-fg); font-weight: 500; font-size: 15px;
  transition: background-color var(--duration) var(--ease);
}
.site-nav a:hover { text-decoration: none; background: var(--color-tint); }
.site-nav .nav-cta { background: var(--color-primary); color: var(--color-on-primary); padding-inline: 16px; }
.site-nav .nav-cta:hover { background: #1E40AF; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: transparent; border-radius: 10px;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 24px; height: 24px; stroke: currentColor; }

/* ---------- Hero (copy left, live demo right) ---------- */

.hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 72px) clamp(48px, 7vw, 88px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 55% at 72% 55%, var(--color-glow), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  text-align: center;
}
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 14ch;
  margin-bottom: var(--space-6);
}
.hero h1 .accent { color: var(--color-brand); }
.hero .lead { margin-bottom: var(--space-8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: center; }
.hero-note { font-size: 14px; color: var(--color-muted); margin-top: var(--space-3); width: 100%; }
.hero-demo { display: flex; flex-direction: column; align-items: center; }
.hero-demo .demo-footer { width: min(390px, 100%); }

.try-copy { margin-top: clamp(32px, 4vw, 48px); padding-top: var(--space-6); border-top: 1px solid var(--color-border); width: 100%; }
.try-title { font-size: 21px; margin-bottom: var(--space-2); }
.try-lead { color: var(--color-muted); font-size: 16px; }
.try-steps { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-3); counter-reset: step; text-align: left; }
.try-steps li { display: flex; gap: 14px; align-items: flex-start; counter-increment: step; }
.try-steps li::before {
  content: counter(step);
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-tint); color: var(--color-brand);
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.try-steps li strong { display: block; }
.try-steps li span { color: var(--color-muted); font-size: 15px; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; text-align: left; align-items: start; }
  .hero-copy { align-items: flex-start; }
  .hero-actions { justify-content: flex-start; }
  .hero-demo { position: sticky; top: 84px; }
}

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  width: min(360px, 82vw);
  aspect-ratio: 390 / 848;
  border-radius: var(--radius-phone);
  background: #0B1220;
  padding: 12px;
  box-shadow: var(--shadow-phone);
  margin-inline: auto;
}
.phone::after {
  content: "";
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 32%; height: 26px;
  background: #0B1220;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}
.phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: calc(var(--radius-phone) - 12px);
  overflow: hidden;
  background: #F1F5F9;
}
.phone-screen img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Features (bento) ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}
.feature {
  grid-column: span 4;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.feature:hover { transform: translateY(-2px); }
.feature.wide { grid-column: span 8; }
.feature.half { grid-column: span 6; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-tint); color: var(--color-brand);
}
.feature-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 21px; }
.feature p { color: var(--color-muted); font-size: 16px; }
.feature .mini {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 12px;
  border-radius: var(--radius-chip);
  background: var(--color-tint); color: var(--color-brand);
  font-weight: 600; font-size: 14px;
}
.chip.money { color: var(--color-positive); background: color-mix(in srgb, var(--color-positive) 12%, transparent); }
.chip.neg { color: var(--color-negative); background: color-mix(in srgb, var(--color-negative) 12%, transparent); }

/* ---------- Screens strip ---------- */

.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(260px, 70vw);
  gap: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--space-4) clamp(16px, 4vw, 32px) var(--space-6);
  margin-inline: calc(-1 * clamp(16px, 4vw, 32px));
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screen { scroll-snap-align: center; }
.screen .phone { width: 100%; padding: 8px; border-radius: 40px; }
.screen .phone::after { height: 18px; }
.screen .phone-screen { border-radius: 32px; }
.screen figcaption { text-align: center; margin-top: var(--space-4); font-weight: 600; font-size: 15px; }
.screen figcaption span { display: block; color: var(--color-muted); font-weight: 400; font-size: 14px; }

/* ---------- Privacy band ---------- */

.band {
  background: var(--color-ink);
  color: var(--color-ink-fg);
  padding-block: clamp(64px, 10vw, 128px);
}
.band .eyebrow { color: #93C5FD; }
.band .lead { color: var(--color-ink-muted); }
.band-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-12); align-items: center; }
@media (min-width: 900px) { .band-grid { grid-template-columns: 1.1fr 0.9fr; } }
.band h2 { font-size: clamp(32px, 5vw, 56px); margin-bottom: var(--space-4); }
.band ul { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-3); }
.band li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.band li svg { width: 24px; height: 24px; flex: none; stroke: #34D399; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.band .phone { box-shadow: 0 40px 80px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.1); }

/* ---------- Try it (demo inside the hero) ---------- */

/* The live demo lives in a phone frame. Everything inside mirrors the app's own layout rules. */
.demo-phone { width: min(390px, 100%); aspect-ratio: auto; }
.demo-phone .phone-screen {
  --d-bg: #F1F5F9; --d-card: #FFFFFF; --d-fg: #0F172A; --d-muted: #526075; --d-track: #E2E8F0;
  --d-brand: #1D4ED8; --d-positive: #047857; --d-negative: #DC2626; --d-tint: rgba(29, 78, 216, 0.10);
  height: 640px;
  background: var(--d-bg);
  color: var(--d-fg);
  display: flex; flex-direction: column;
  font-family: var(--font);
}
@media (prefers-color-scheme: dark) {
  .demo-phone .phone-screen {
    --d-bg: #0F172A; --d-card: #1E293B; --d-fg: #F8FAFC; --d-muted: #94A3B8; --d-track: #3B4A63;
    --d-brand: #60A5FA; --d-positive: #34D399; --d-negative: #F87171; --d-tint: rgba(96, 165, 250, 0.16);
  }
}
.demo-phone .phone-screen .money { font-family: var(--font-rounded); }

.d-status {
  height: 48px; flex: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 28px 2px; font-weight: 600; font-size: 14px;
}
.d-status span:last-child { visibility: hidden; }
.d-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 8px; flex: none;
}
.d-header h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: 0; }
.d-header h3 img { width: 24px; height: 24px; border-radius: 6px; }
.d-icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--d-card); color: var(--d-fg);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
  transition: opacity var(--duration) var(--ease);
}
.d-icon-btn:active { opacity: 0.6; }
.d-icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.d-icon-btn.is-hidden { visibility: hidden; }

.demo-phone .phone-screen { overflow: clip; }
#demo-home, #demo-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#demo-home[hidden], #demo-detail[hidden] { display: none; }
.d-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 96px; display: grid; gap: 12px; align-content: start; -webkit-overflow-scrolling: touch; }

.d-card {
  background: var(--d-card); border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.d-card-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; padding: 0; min-height: 44px; text-align: left;
  font-weight: 600; font-size: 17px;
}
.d-card-head svg.lead-icon { width: 22px; height: 22px; stroke: var(--d-muted); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.d-card-head .chev { margin-left: auto; width: 18px; height: 18px; stroke: var(--d-muted); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--duration) var(--ease); }
.d-card-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.d-summary-body { display: grid; gap: 12px; padding-top: 8px; border-top: 1px solid var(--d-track); margin-top: 8px; }
.d-summary-body[hidden] { display: none; }
.d-hero-money { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.d-hero-money.neg { color: var(--d-negative); }
.d-progress { height: 8px; border-radius: 999px; background: var(--d-track); overflow: hidden; }
.d-progress > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--d-brand); transition: transform 300ms var(--ease); transform-origin: left; }
.d-progress > span.over { background: var(--d-negative); }
.d-caption { font-size: 13px; color: var(--d-muted); }
.d-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; font-size: 15px; }
.d-stats dt { color: var(--d-muted); }
.d-stats dd { margin: 0; font-weight: 600; font-size: 17px; }
.d-stats dd.pos { color: var(--d-positive); }
.d-stats dd.neg { color: var(--d-negative); }
.d-stats div { display: grid; gap: 2px; }
.d-hint { font-size: 13px; color: var(--d-muted); display: flex; align-items: center; gap: 6px; }
.d-hint svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.d-list { display: grid; gap: 0; padding: 4px 0 0; margin: 0; list-style: none; }
.d-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 0; border: 0; background: transparent; text-align: left;
  border-top: 1px solid var(--d-track); color: inherit;
  transition: opacity var(--duration) var(--ease);
}
.d-row:active { opacity: 0.6; }
.d-row:first-child { border-top: 0; }
.d-cat-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--d-tint); color: var(--d-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.d-cat-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.d-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.d-row-title { font-weight: 500; font-size: 17px; }
.d-row-sub { font-size: 13px; color: var(--d-muted); }
.d-row-money { font-weight: 600; font-size: 17px; text-align: right; }
.d-row-money small { display: block; font-weight: 400; font-size: 13px; color: var(--d-muted); }
.d-row .chev { width: 16px; height: 16px; stroke: var(--d-muted); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.d-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.d-badge svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.d-badge.notStarted { color: var(--d-muted); background: color-mix(in srgb, var(--d-muted) 14%, transparent); }
.d-badge.onTrack { color: var(--d-brand); background: var(--d-tint); }
.d-badge.done { color: var(--d-positive); background: color-mix(in srgb, var(--d-positive) 14%, transparent); }
.d-badge.overBudget { color: var(--d-negative); background: color-mix(in srgb, var(--d-negative) 14%, transparent); }

.d-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 16px 20px;
  background: linear-gradient(to top, var(--d-bg) 70%, transparent);
  display: grid; gap: 10px;
}
.d-btn {
  min-height: 50px; border-radius: 14px; border: 0;
  font-weight: 600; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  padding: 0 14px;
  white-space: nowrap;
}
.d-btn:active { opacity: 0.7; }
.d-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.d-btn.primary { background: #1D4ED8; color: #fff; }
.d-btn.secondary { background: var(--d-tint); color: var(--d-brand); }
.d-btn[disabled] { opacity: 0.4; pointer-events: none; }
.d-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-tabbar {
  display: flex; justify-content: space-around; align-items: center;
  background: var(--d-card); border-radius: 999px; padding: 6px; margin-inline: 24px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.08);
}
.d-tab { display: grid; justify-items: center; gap: 2px; font-size: 10px; font-weight: 600; padding: 6px 14px; border-radius: 999px; min-width: 44px; min-height: 44px; align-content: center; color: var(--d-fg); }
.d-tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-tab.active { background: var(--d-tint); color: var(--d-brand); }

/* Detail view */
.d-detail-hero { display: grid; gap: 10px; }
.d-detail-hero .d-caption { font-size: 15px; }
.d-detail-stats { display: flex; align-items: flex-end; gap: 20px; }
.d-detail-stats div { display: grid; gap: 2px; }
.d-detail-stats .d-badge { margin-left: auto; }
.d-entries h4 { font-size: 15px; color: var(--d-muted); font-weight: 600; margin: 8px 0 8px 4px; }
.d-entry { display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-top: 1px solid var(--d-track); padding: 8px 0; }
.d-entry:first-child { border-top: 0; }
.d-entry .d-row-money { text-align: left; }
.d-entry .d-badge { color: var(--d-muted); background: color-mix(in srgb, var(--d-muted) 14%, transparent); }
.d-empty { color: var(--d-muted); font-size: 15px; padding: 12px 4px; }

/* Add expense sheet */
.d-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35);
  opacity: 0; transition: opacity var(--duration) var(--ease); z-index: 5;
}
.d-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 48px; z-index: 6;
  background: var(--d-bg); border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 280ms var(--ease);
  box-shadow: 0 -8px 40px rgba(15,23,42,0.2);
}
.d-sheet[hidden], .d-sheet-backdrop[hidden] { display: none; }
.d-sheet.is-open { transform: translateY(0); }
.d-sheet-backdrop.is-open { opacity: 1; }
.d-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; }
.d-sheet-head h3 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.d-sheet-head .d-text-btn { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: var(--d-card); color: var(--d-fg); font-weight: 500; font-size: 15px; }
.d-sheet-body { flex: 1; overflow-y: auto; padding: 8px 16px 140px; display: grid; gap: 14px; align-content: start; }
.d-field { background: var(--d-card); border-radius: 16px; padding: 12px 16px; display: grid; gap: 4px; }
.d-field label { font-size: 15px; color: var(--d-muted); }
.d-field input {
  font: inherit; font-family: var(--font-rounded); font-size: 36px; font-weight: 700; letter-spacing: -0.02em;
  border: 0; background: transparent; color: var(--d-fg); width: 100%; padding: 0; outline: none;
  font-variant-numeric: tabular-nums;
}
.d-field input::placeholder { color: var(--d-track); }
.d-field .d-error { font-size: 13px; color: var(--d-negative); min-height: 18px; }
.d-section-label { font-size: 15px; color: var(--d-muted); margin: 4px 0 -6px 4px; }
.d-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-chip {
  min-height: 48px; border-radius: 12px; border: 0;
  background: var(--d-card); color: var(--d-fg);
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  font-weight: 500; font-size: 15px; text-align: left;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.d-chip svg { width: 18px; height: 18px; stroke: var(--d-brand); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.d-chip[aria-pressed="true"] { background: #1D4ED8; color: #fff; }
.d-chip[aria-pressed="true"] svg { stroke: #fff; }
.d-chip .check { margin-left: auto; width: 16px; height: 16px; stroke-width: 3; display: none; }
.d-chip[aria-pressed="true"] .check { display: block; }
.d-recent { display: flex; flex-wrap: wrap; gap: 8px; }
.d-recent[hidden] { display: none; }
.d-recent button {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0;
  background: var(--d-tint); color: var(--d-brand); font-weight: 600; font-size: 15px;
}
.d-sheet-actions {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px 20px;
  background: linear-gradient(to top, var(--d-bg) 70%, transparent);
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 10px;
}

.d-toast {
  position: absolute; left: 16px; right: 16px; bottom: 150px; z-index: 7;
  background: var(--d-fg); color: var(--d-bg);
  border-radius: 14px; padding: 12px 16px;
  font-weight: 600; font-size: 15px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  pointer-events: none;
}
.d-toast.is-visible { opacity: 1; transform: translateY(0); }
.d-toast svg { width: 18px; height: 18px; stroke: #34D399; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.demo-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: var(--space-4); font-size: 14px; color: var(--color-muted); flex-wrap: wrap; }

/* ---------- Download ---------- */

.download {
  text-align: center;
  padding-block: clamp(64px, 10vw, 128px);
  position: relative; overflow: hidden;
}
.download::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(50% 60% at 50% 40%, var(--color-glow), transparent 70%);
  pointer-events: none;
}
.download .container { position: relative; display: flex; flex-direction: column; align-items: center; }
.download .logo { width: 112px; height: 112px; border-radius: 26px; box-shadow: var(--shadow-card); margin-bottom: var(--space-6); }
.download h2 { font-size: clamp(32px, 6vw, 60px); margin-bottom: var(--space-4); }
.download .lead { margin-inline: auto; margin-bottom: var(--space-8); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-8);
  font-size: 14px; color: var(--color-muted);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--color-fg); min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Policy page ---------- */

.policy { max-width: 720px; margin-inline: auto; padding-block: clamp(48px, 8vw, 96px); }
.policy h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: var(--space-3); }
.policy .meta { color: var(--color-muted); margin-bottom: var(--space-8); }
.policy h2 { font-size: 24px; margin: var(--space-12) 0 var(--space-3); }
.policy h3 { font-size: 19px; margin: var(--space-6) 0 var(--space-2); }
.policy p, .policy li { margin-bottom: var(--space-3); color: var(--color-fg); }
.policy ul { padding-left: 22px; }
.policy .callout {
  background: var(--color-bg-elevated); border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-positive);
  border-radius: 12px; padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
}
.policy .callout p { margin: 0; }
.policy table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: var(--space-6); }
.policy th, .policy td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.policy th { color: var(--color-muted); font-weight: 600; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 60ms; }
.reveal:nth-child(3) { transition-delay: 120ms; }
.reveal:nth-child(4) { transition-delay: 180ms; }
.reveal:nth-child(5) { transition-delay: 240ms; }
.reveal:nth-child(6) { transition-delay: 300ms; }

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) clamp(16px, 4vw, 32px) var(--space-4);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { min-height: 48px; width: 100%; }
  .site-nav .nav-cta { justify-content: center; margin-top: var(--space-2); }
  .nav-toggle { display: inline-flex; }
  .feature, .feature.wide, .feature.half { grid-column: span 12; }
  .demo-phone .phone-screen { height: 600px; }
  .d-chips { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .feature { grid-column: span 6; }
  .feature.wide { grid-column: span 12; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .feature:hover { transform: none; }
}
