:root {
  --bg: #120b1f;
  --bg-2: #211233;
  --card: rgba(255,255,255,.09);
  --card-strong: rgba(255,255,255,.14);
  --line: rgba(255,255,255,.13);
  --text: #fff9fb;
  --muted: rgba(255,249,251,.68);
  --soft: rgba(255,249,251,.48);
  --purple: #a78bfa;
  --violet: #7c3aed;
  --pink: #fb7185;
  --gold: #fbbf24;
  --mint: #34d399;
  --blue: #60a5fa;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(251,113,133,.34), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgba(124,58,237,.38), transparent 28rem),
    linear-gradient(180deg, var(--bg), #0b0711 70%);
  min-height: 100svh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(960px, 100%); margin: 0 auto; padding: 18px 16px 30px; }
.hero {
  padding: calc(14px + env(safe-area-inset-top)) 0 12px;
}
.hero-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; letter-spacing: .13em; font-weight: 900; font-size: .72rem; color: #f0abfc; }
h1 { margin: 0; font-size: clamp(2.1rem, 10vw, 4.7rem); line-height: .88; letter-spacing: -.07em; }
h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.04em; }
h3 { margin: 0; font-size: 1.25rem; }
.subhead { margin: 16px 0 0; color: var(--muted); max-width: 38rem; font-size: 1.02rem; line-height: 1.5; }
.icon-btn, .month-nav {
  border: 1px solid var(--line); color: var(--text); background: var(--card); border-radius: 18px; min-width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(18px);
}
.month-card {
  margin-top: 22px; background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07)); border: 1px solid var(--line); border-radius: 28px; padding: 12px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); backdrop-filter: blur(24px);
}
.month-label { font-weight: 950; font-size: 1.15rem; text-align: center; }
.tiny { color: var(--soft); font-size: .78rem; line-height: 1.35; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.summary-card {
  min-height: 118px; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); display: flex; flex-direction: column; justify-content: space-between; backdrop-filter: blur(18px);
}
.summary-card span, .summary-card small { color: var(--muted); font-size: .78rem; font-weight: 800; }
.summary-card strong { font-size: clamp(1.4rem, 6vw, 2rem); letter-spacing: -.05em; }
.summary-card.income strong { color: var(--mint); }
.summary-card.spend strong { color: var(--pink); }
.summary-card.remaining strong { color: var(--gold); }
.panel {
  margin: 14px 0; padding: 18px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.085); backdrop-filter: blur(20px); box-shadow: 0 18px 60px rgba(0,0,0,.18);
}
.love-note { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; background: linear-gradient(135deg, rgba(167,139,250,.23), rgba(251,113,133,.15)); }
.love-note p:not(.eyebrow), .modal-copy { color: var(--muted); line-height: 1.45; margin: 8px 0 0; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
button.primary, button.secondary, .file-btn, .text-btn, .chip, .ghost {
  border: 0; border-radius: 16px; padding: 12px 15px; font-weight: 900; cursor: pointer;
}
.primary { color: white; background: linear-gradient(135deg, var(--violet), #db2777); box-shadow: 0 12px 30px rgba(124,58,237,.3); }
.secondary, .file-btn { color: var(--text); background: var(--card-strong); border: 1px solid var(--line); }
.text-btn { color: #f0abfc; background: transparent; padding: 8px 0; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.danger { color: var(--danger); }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.stack { display: grid; gap: 10px; }
.item {
  background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
}
.item-title { font-weight: 950; }
.item-meta { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.item-amount { font-weight: 950; font-size: 1.05rem; text-align: right; }
.item-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.small-btn { border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--text); border-radius: 999px; padding: 7px 10px; font-weight: 800; font-size: .78rem; }
.paid { opacity: .56; }
.paid .item-title { text-decoration: line-through; }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.chip { color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line); white-space: nowrap; }
.chip.active { color: white; background: rgba(167,139,250,.25); border-color: rgba(167,139,250,.55); }
.bars { display: grid; gap: 13px; }
.bar-row { display: grid; gap: 7px; }
.bar-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .86rem; font-weight: 850; }
.bar-track { height: 12px; background: rgba(0,0,0,.22); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink)); border-radius: inherit; }
.progress { margin-top: 10px; }
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(520px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; z-index: 10;
  padding: 8px; border: 1px solid var(--line); border-radius: 24px; background: rgba(18,11,31,.78); backdrop-filter: blur(25px); box-shadow: var(--shadow);
}
.bottom-nav button { border: 0; background: transparent; color: var(--text); border-radius: 16px; padding: 8px 4px; font-weight: 900; display: grid; gap: 2px; place-items: center; }
.bottom-nav span { font-size: .67rem; color: var(--muted); }
.modal {
  width: min(520px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 28px; padding: 18px; color: var(--text); background: linear-gradient(180deg, rgba(33,18,51,.98), rgba(18,11,31,.98)); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0,0,0,.58); backdrop-filter: blur(8px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
label { display: grid; gap: 7px; margin: 12px 0; color: var(--muted); font-size: .85rem; font-weight: 850; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; color: var(--text); background: rgba(0,0,0,.22); outline: none; }
input:focus, select:focus, textarea:focus { border-color: rgba(167,139,250,.75); box-shadow: 0 0 0 4px rgba(167,139,250,.12); }
.modal-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 16px; }
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.file-btn { display: grid; place-items: center; grid-column: 1 / -1; }
.install-card { padding: 14px; border-radius: 20px; background: rgba(167,139,250,.13); border: 1px solid rgba(167,139,250,.25); color: var(--muted); }
.install-card strong { color: var(--text); }
.warn { color: #fde68a; }
.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); bottom: calc(96px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); color: #201027; border-radius: 999px; padding: 11px 15px; font-weight: 950; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 20; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; padding: 14px; text-align: center; }
@media (max-width: 720px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 92px; }
  .love-note { grid-template-columns: 1fr; }
  .quick-actions { justify-content: stretch; }
  .quick-actions button { flex: 1; }
  .section-head { align-items: center; }
}
