@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
}
:root {
  --black: #050609; --text: #f3f5f8; --muted: #929aaa;
  --purple: #8257ff; --purple-light: #a98dff; --cyan: #56e0ff;
  --green: #3ee3a1; --red: #ff5c7a; --amber: #ffb84d;
  --border: rgba(255,255,255,.08); --border-hover: rgba(255,255,255,.16);
  --radius: 14px; --card: #0a0c12;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(60rem 28rem at 50% -10rem, rgba(130,87,255,.16), transparent 70%), var(--black);
  background-repeat: no-repeat;
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .75rem; letter-spacing: -0.01em; }
a { color: var(--purple-light); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 2px; }

.shell { max-width: 960px; margin: 0 auto; padding: 1.25rem 16px calc(5.5rem + env(safe-area-inset-bottom)); }
.shell-bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding-bottom: 1.25rem; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px rgba(0,0,0,.35);
}
.auth-card { width: 100%; max-width: 380px; }

.field { display: block; margin: 0 0 1rem; }
.field > span { display: block; margin-bottom: .35rem; font-size: .875rem; color: var(--muted); }
.field input {
  width: 100%; min-height: 44px; padding: .6rem .75rem; font-size: 16px; color: var(--text);
  background: var(--black); border: 1px solid var(--border-hover); border-radius: 10px;
  font-family: inherit; transition: border-color .15s ease;
}
.field select, .field textarea { width: 100%; min-height: 44px; padding: .6rem .75rem; font: inherit; color: var(--text);
  background: var(--black); border: 1px solid var(--border-hover); border-radius: 10px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 1px; border-color: var(--purple); }
.field input.is-focus { outline: 2px solid var(--purple-light); outline-offset: 1px; border-color: var(--purple); } /* styleguide demo of :focus-visible */
.field input:disabled { opacity: .5; cursor: not-allowed; }
.field-error input, .field input[aria-invalid="true"] { border-color: var(--red); }
.field-msg { display: block; margin-top: .35rem; font-size: .8125rem; color: var(--red); }
.field-hint { display: block; margin-top: .35rem; font-size: .8125rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 1.25rem; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  background: transparent; border: 1px solid var(--border-hover); border-radius: 10px;
  text-decoration: none; transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: rgba(255,255,255,.05); }
/* #7a4cff (not --purple) so white label text clears 4.5:1 (4.88:1; --purple is 4.42:1). */
.btn-primary { background: #7a4cff; border-color: #7a4cff; color: #fff; }
.btn-primary:hover { background: #6c3cf5; border-color: #6c3cf5; }
.btn-ghost { border-color: transparent; color: var(--purple-light); }
.btn-ghost:hover { background: rgba(130,87,255,.1); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .icon { margin-right: .5rem; }
.auth-card .btn { width: 100%; }
.form-error { margin: 0 0 1rem; padding: .6rem .75rem; border-radius: 10px; color: var(--red);
  background: rgba(255,92,122,.08); border: 1px solid rgba(255,92,122,.3); }

.badge-ok, .badge-warn, .badge-bad {
  display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  border: 1px solid currentColor;
}
.badge-ok { color: var(--green); } .badge-warn { color: var(--amber); } .badge-bad { color: var(--red); }
.money { font-variant-numeric: tabular-nums; }
.money-neg { font-variant-numeric: tabular-nums; color: var(--red); }

/* Nav: bottom tab bar on phones, top bar from 720px */
.nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; background: rgba(10,12,18,.96);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav-brand { display: none; font-weight: 600; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.nav li { flex: 1; }
.nav a { display: flex; flex-direction: column; gap: .2rem; align-items: center; justify-content: center; min-height: 56px; padding: .35rem .25rem;
  font-size: .75rem; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--purple-light); font-weight: 600; }
@media (min-width: 720px) {
  .nav { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 2rem; padding: 0 max(16px, calc((100vw - 960px) / 2)); }
  .nav-brand { display: block; }
  .nav ul { gap: .25rem; }
  .nav li { flex: none; }
  .nav a { flex-direction: row; gap: .5rem; min-height: 56px; padding: 0 .9rem; font-size: .9rem; }
  .shell { padding-bottom: 2rem; }
}

/* ---- Type ---- */
.icon { flex: none; vertical-align: middle; }
.eyebrow { margin: 0 0 .5rem; font-size: .8125rem; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; letter-spacing: -0.005em; }
.stack > * + * { margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 20; padding: .6rem 1rem; background: var(--card); border-radius: 10px; }
.skip-link:focus { top: 12px; }

/* ---- Hero: the one big number ---- */
.hero { padding: 1.75rem 1.25rem 1.5rem; }
.hero-amount { display: block; margin: 0; font-size: 48px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; }
.hero-amount.money-neg { color: var(--red); }
.hero-basis { margin: .75rem 0 0; color: var(--muted); font-size: .9375rem; }
@media (min-width: 720px) { .hero { padding: 2.25rem 2rem 2rem; } .hero-amount { font-size: 64px; } }

/* ---- Lists ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: .875rem; min-height: 56px; padding: .625rem 0; border-top: 1px solid var(--border); }
.list > .list-row:first-child { border-top: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub { display: block; font-size: .8125rem; color: var(--muted); }
.list-row-amount { flex: none; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.list-row-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--muted); }
.list-row-housing .list-row-icon { color: var(--purple-light); background: rgba(130,87,255,.1); border-color: rgba(130,87,255,.25); }
.group-total { display: flex; justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--border-hover); font-weight: 600; }

/* ---- Date chip & monogram ---- */
.date-chip { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 40px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); line-height: 1; }
.date-chip-month { font-size: .625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.date-chip-day { margin-top: .2rem; font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.monogram { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; background: #161924; border: 1px solid var(--border-hover); font-size: .8125rem; font-weight: 600;
  letter-spacing: .02em; color: var(--text); }

/* ---- Payday runway (dashboard signature visual) ---- */
.runway { margin-top: 1.25rem; }
.runway-labels { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--muted); }
.runway-track { display: block; width: 100%; height: auto; margin: .25rem 0 .75rem; overflow: visible; }
.runway-line { stroke: rgba(255,255,255,.14); stroke-width: 2; stroke-linecap: round; }
.runway-end { fill: var(--muted); }
.runway-payday { fill: var(--purple); }
.runway-marker { fill: var(--card); stroke: var(--text); stroke-width: 2.5; }
.runway-overdue { stroke: var(--red); }
.split-bar { display: flex; justify-content: flex-end; height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.split-free { display: block; height: 100%; background: var(--purple); border-radius: 999px; }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; } 
.split-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: .6rem; font-size: .8125rem; color: var(--muted); }
.split-legend .money { color: var(--text); font-weight: 500; }
.key { display: inline-block; width: 8px; height: 8px; margin-right: .4rem; border-radius: 2px; vertical-align: middle; }
.key-committed { background: rgba(255,255,255,.3); } .key-free { background: var(--purple); }

/* ---- Details ---- */
details > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; color: var(--purple-light); font-weight: 500; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 7px; height: 7px; margin-left: .5rem; border: solid currentColor;
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s ease; }
details[open] > summary::after { transform: rotate(225deg); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; }
.empty-state .icon { width: 28px; height: 28px; color: var(--muted); }
.empty-state h2 { margin: .75rem 0 .35rem; }
.empty-state p { margin: 0 auto 1.25rem; max-width: 30ch; color: var(--muted); }

/* ---- Onboarding checklist ---- */
.checklist { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.checklist li { display: flex; align-items: flex-start; gap: .875rem; padding: .875rem 0; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 999px; border: 1px solid var(--border-hover); font-size: .8125rem; font-weight: 600; color: var(--muted); }
.checklist .is-done .checklist-mark { background: rgba(62,227,161,.12); border-color: rgba(62,227,161,.4); color: var(--green); }
.checklist .is-done .checklist-title { color: var(--muted); }
.checklist .is-current .checklist-mark { border-color: var(--purple); color: var(--purple-light); }
.checklist-title { display: block; font-weight: 500; }
.checklist-sub { display: block; font-size: .8125rem; color: var(--muted); }
.checklist .btn { margin-top: .6rem; }

.badge-ok, .badge-warn, .badge-bad { line-height: 1.5; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 1.4fr 1fr; align-items: start; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
