:root {
  color-scheme: dark;
  --paper: #090a16;
  --ink: #f4f2ff;
  --muted: #aaa9c3;
  --line: #303149;
  --green: #69e5d2;
  --green-dark: #17182d;
  --lime: #d7ff62;
  --mint: #173a39;
  --amber: #ffd084;
  --amber-bg: #44341e;
  --red: #ffaaa5;
  --red-bg: #45232e;
  --display: Georgia, 'Times New Roman', serif;
  --body: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background: var(--paper);
}

.video-background { position: fixed; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; background: var(--paper); }
body::before { position: fixed; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(7, 8, 20, .84), rgba(9, 9, 25, .7) 52%, rgba(7, 8, 20, .84)), linear-gradient(0deg, rgba(7, 8, 20, .79), transparent 43%, rgba(7, 8, 20, .38)); content: ""; pointer-events: none; }

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-shell { position: relative; z-index: 0; width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: 0 30px 112px; animation: arrive 450ms ease-out both; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(228, 226, 255, .16); }
.brand, .setup-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: 0; text-decoration: none; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px 10px 10px 3px; color: var(--lime); background: var(--green-dark); font-family: var(--display); font-size: 19px; font-weight: 800; }
.visually-hidden { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.currency-control { display: inline-flex; min-height: 44px; align-items: center; margin-left: auto; }
.currency-select { width: 94px; min-height: 44px; padding: 0 8px; border: 1px solid rgba(208, 205, 255, .24); border-radius: 5px; background: rgba(13, 14, 30, .78); color: #e8e6fb; cursor: pointer; font-size: 11px; font-weight: 600; }
.currency-select:focus-visible { outline: 3px solid rgba(105, 229, 210, .55); outline-offset: 2px; }
.reset-button { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 0 10px; border: 0; background: transparent; color: #d4d3e7; cursor: pointer; font-size: 13px; }
.reset-button span:first-child { font-size: 20px; }
main { display: block; }
.screen { padding-top: 38px; animation: arrive 300ms ease-out both; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #83eee3; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #8eaf55; box-shadow: 0 0 0 4px rgba(142, 175, 85, .15); }
.home-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 22px 0 21px; padding: 14px 17px; border: 1px solid rgba(208, 205, 255, .16); border-radius: 8px; background: rgba(13, 14, 30, .72); backdrop-filter: blur(14px); }
.section-kicker { margin: 0 0 8px; color: #b9b7d0; font-size: 10px; font-weight: 700; letter-spacing: 1.05px; }
h1, h2, p { margin-top: 0; }
.home-heading h1 { display: flex; align-items: baseline; gap: 10px; margin: 0; font-family: var(--display); font-size: clamp(66px, 15vw, 96px); font-weight: 700; line-height: .98; letter-spacing: 0; }
.days-word { color: #84eee2; font-family: var(--body); font-size: 19px; font-weight: 500; }
.balance-chip { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-bottom: 8px; }
.balance-chip span, .card-topline, .stat-label { color: #b9b7d0; font-size: 9px; font-weight: 700; letter-spacing: .9px; }
.balance-chip strong { font-family: var(--display); font-size: 20px; font-weight: 700; white-space: nowrap; }
.runway-card { padding: 22px 23px 19px; border: 1px solid rgba(208, 205, 255, .18); border-radius: 8px; background: rgba(15, 16, 34, .84); box-shadow: 0 14px 38px rgba(2, 3, 14, .3); backdrop-filter: blur(16px); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.horizon-label { display: inline-flex; align-items: center; gap: 6px; color: #f4f2ff; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.horizon-dot { width: 6px; height: 6px; border-radius: 50%; background: #a7ad9d; }
.horizon-track, .preview-track { position: relative; overflow: hidden; height: 13px; margin-top: 18px; border-radius: 20px; background: #292a43; }
.horizon-fill { width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .4s ease; }
.track-labels { display: flex; justify-content: space-between; margin-top: 8px; color: #a7a6bf; font-size: 10px; }
.status-line { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 21px; padding: 8px 12px 8px 9px; border-radius: 5px; background: var(--mint); color: #9af2dd; font-size: 12px; font-weight: 600; }
.status-icon { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: rgba(105, 229, 210, .2); font-size: 12px; }
.status-line.tight { background: var(--amber-bg); color: #ffdc9d; }
.status-line.tight .status-icon { background: rgba(255, 208, 132, .2); }
.status-line.short { background: var(--red-bg); color: #ffb7b0; }
.status-line.short .status-icon { background: rgba(255, 170, 165, .2); }
.stats-row { display: flex; align-items: center; gap: 25px; padding: 23px 4px 22px; border-bottom: 1px solid rgba(228, 226, 255, .16); }
.stat-block { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 8px; }
.stat-block strong { font-family: var(--display); font-size: 22px; font-weight: 700; }
.stat-divider { width: 1px; height: 34px; background: rgba(228, 226, 255, .18); }
.recent-section { padding-top: 26px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; }
.text-link { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; padding: 0 2px; border: 0; background: transparent; color: #8ceee2; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.expense-list { display: grid; gap: 0; }
.expense-row { display: flex; min-height: 58px; align-items: center; gap: 12px; border-bottom: 1px solid rgba(228, 226, 255, .12); }
.expense-symbol { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: rgba(112, 89, 227, .24); color: #a8a0ff; font-size: 15px; }
.expense-description { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.expense-description strong { font-size: 12px; font-weight: 600; }
.expense-description span { color: #aaa9c3; font-size: 10px; }
.expense-amount { font-size: 13px; font-weight: 700; white-space: nowrap; }
.empty-state { padding: 15px 0; color: #aaa9c3; font-size: 12px; }
.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 5px; min-height: 76px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(208, 205, 255, .17); background: rgba(9, 10, 22, .9); backdrop-filter: blur(18px); }
.nav-button { display: flex; width: min(31%, 170px); min-height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 6px; background: transparent; color: #aaa9c3; cursor: pointer; font-size: 10px; font-weight: 600; }
.nav-icon { height: 22px; font-size: 20px; line-height: 20px; }
.nav-button.selected { color: #aaf5e7; background: rgba(68, 188, 184, .15); }

.page-intro { margin: 29px 0 25px; }
.page-intro h1, .setup-card h1 { margin: 0 0 10px; font-family: var(--display); font-size: clamp(40px, 10vw, 54px); font-weight: 700; line-height: 1.05; letter-spacing: 0; }
.intro-copy { max-width: 330px; margin: 0; color: #c0bed5; font-size: 13px; line-height: 1.6; }
.question-card { padding: 23px; border: 1px solid rgba(208, 205, 255, .18); border-radius: 8px; background: rgba(15, 16, 34, .86); box-shadow: 0 14px 38px rgba(2, 3, 14, .3); backdrop-filter: blur(16px); }
.field-label { display: block; margin-bottom: 9px; color: #f1efff; font-size: 12px; font-weight: 600; }
.money-input-wrap { display: flex; height: 59px; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid rgba(208, 205, 255, .24); border-radius: 5px; background: rgba(8, 9, 20, .76); color: #80eee1; font-family: var(--display); font-size: 23px; font-weight: 700; transition: border-color .2s, box-shadow .2s; }
.money-input-wrap:focus-within, .days-input-wrap:focus-within { border-color: #73e6da; box-shadow: 0 0 0 3px rgba(105, 229, 210, .14); }
.money-input-wrap input, .days-input-wrap input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--display); font-size: 23px; font-weight: 700; }
input::placeholder { color: #77778f; opacity: 1; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.whatif-result { display: flex; align-items: center; gap: 12px; min-height: 72px; margin: 22px 0 15px; padding: 13px; border-radius: 5px; background: rgba(28, 65, 65, .85); color: #a5f1e1; }
.result-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; background: rgba(105, 229, 210, .18); font-size: 16px; }
.whatif-result div { display: flex; flex-direction: column; gap: 4px; }
.whatif-result strong { font-size: 12px; font-weight: 700; }
.whatif-result div span { color: #c2d8d4; font-size: 11px; }
.whatif-result.warning { background: var(--amber-bg); color: #ffdc9d; }
.whatif-result.warning .result-icon { background: rgba(255, 208, 132, .2); }
.preview-labels, .preview-days { display: flex; justify-content: space-between; }
.preview-labels { color: #b9b7d0; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.preview-track { display: flex; height: 9px; margin-top: 8px; }
.preview-current, .preview-after { height: 100%; transition: width .4s ease; }
.preview-current { border-radius: 20px 0 0 20px; background: #796de0; }
.preview-after { border-radius: 0 20px 20px 0; background: var(--green); }
.preview-days { margin-top: 7px; color: #b9b7d0; font-size: 10px; font-weight: 500; }
.preview-days strong { color: var(--ink); font-weight: 600; }
.category-fieldset { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.category-button { display: flex; min-height: 64px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 5px 2px; border: 1px solid rgba(208, 205, 255, .23); border-radius: 5px; background: rgba(8, 9, 20, .62); color: #d0cee1; cursor: pointer; font-size: 10px; font-weight: 600; transition: border-color .18s, background .18s, color .18s; }
.category-button span { color: #80eee1; font-size: 16px; }
.category-button:hover, .category-button:focus-visible { border-color: #76ded5; background: rgba(51, 93, 111, .38); color: #fff; outline: 0; }
.category-button.selected { border-color: #80eee1; background: rgba(49, 117, 119, .32); color: #dffffa; }
.form-message { min-height: 16px; margin: 9px 0 5px; color: var(--red); font-size: 11px; }
.primary-button { display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: space-between; padding: 0 17px; border: 0; border-radius: 5px; background: #5042b5; color: white; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .2s, transform .2s; }
.primary-button:hover { background: #6253d1; }
.primary-button:active { transform: translateY(1px); }
.primary-button span:last-child { color: var(--lime); font-size: 18px; }

.setup-wrap { position: relative; z-index: 0; display: grid; min-height: 100vh; place-items: center; padding: 72px 20px 28px; animation: arrive 450ms ease-out both; }
.setup-brand { position: absolute; top: 25px; left: max(24px, calc((100vw - 620px) / 2)); }
.setup-currency-control { position: absolute; top: 25px; right: max(24px, calc((100vw - 620px) / 2)); margin: 0; }
.setup-card { width: min(100%, 440px); padding: 28px; border: 1px solid rgba(208, 205, 255, .2); border-radius: 8px; background: rgba(15, 16, 34, .89); box-shadow: 0 18px 55px rgba(2, 3, 14, .4); backdrop-filter: blur(18px); }
.setup-art { display: none; }
.art-sun { position: absolute; top: 20px; right: 67px; width: 52px; height: 52px; border-radius: 50%; background: #d7ed8b; }
.art-ground { position: absolute; right: -8%; bottom: -48px; left: -8%; height: 91px; border-radius: 50% 50% 0 0; background: #9bb68b; transform: rotate(-4deg); }
.art-line { position: absolute; z-index: 1; bottom: 20px; height: 2px; border-radius: 4px; background: rgba(255, 255, 255, .76); transform: rotate(-9deg); }
.art-line-one { left: 12%; width: 28%; }
.art-line-two { left: 26%; bottom: 31px; width: 25%; }
.art-line-three { left: 42%; bottom: 43px; width: 19%; }
.art-plane { position: absolute; z-index: 2; top: 24px; left: 22%; color: var(--green-dark); font-size: 22px; transform: rotate(-25deg); }
.setup-card h1 { margin-bottom: 8px; font-size: 43px; }
.setup-card .intro-copy { margin-bottom: 22px; }
.setup-form .money-input-wrap { margin-bottom: 17px; }
.days-field-label { margin-top: 1px; }
.days-input-wrap { display: flex; height: 51px; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid rgba(208, 205, 255, .24); border-radius: 5px; background: rgba(8, 9, 20, .76); transition: border-color .2s, box-shadow .2s; }
.days-input-wrap input { font-size: 17px; }
.days-input-wrap span { color: #b9b7d0; font-size: 12px; }
.setup-form .form-message { margin-top: 8px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 17px 0 0; color: #aaa9c3; font-size: 10px; }
.privacy-note span { color: #80eee1; font-size: 9px; }

button:focus-visible, a:focus-visible { outline: 3px solid rgba(105, 229, 210, .55); outline-offset: 2px; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 760px) {
  .app-shell { padding-right: 48px; padding-left: 48px; }
  .screen { padding-top: 47px; }
  .runway-card { padding: 25px 27px 21px; }
  .stats-row { padding-top: 26px; padding-bottom: 25px; }
}

@media (max-width: 390px) {
  .app-shell { padding-right: 20px; padding-left: 20px; }
  .currency-select { width: 84px; padding-right: 5px; padding-left: 5px; font-size: 10px; }
  .reset-button { gap: 4px; padding-right: 2px; padding-left: 6px; }
  .home-heading { gap: 8px; }
  .home-heading h1 { gap: 6px; font-size: 66px; }
  .days-word { font-size: 16px; }
  .balance-chip strong { font-size: 17px; }
  .runway-card, .question-card { padding-right: 17px; padding-left: 17px; }
  .stats-row { gap: 15px; }
  .stat-block strong { font-size: 19px; }
  .stat-label { font-size: 8px; letter-spacing: .55px; }
  .setup-card { padding-right: 22px; padding-left: 22px; }
  .setup-art { margin-right: -22px; margin-left: -22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}