@charset "UTF-8";
:root {
  color-scheme: dark;
  --bg: #10131b;
  --sidebar: #10121a;
  --panel: #171b26;
  --raised: #1c2230;
  --line: #292f40;
  --text: #f1f3fc;
  --muted: #a4aec3;
  --accent: #92b8ff;
  --accent-strong: #6a9aff;
  --green: #81d4b2;
  --red: #ffa4ac;
  --amber: #f3ca86;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(ellipse at 48% 0%, #172134 0, transparent 48rem), var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { min-width: 0; }
button { cursor: pointer; }
a, summary, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p, h1, h2, h3 { margin: 0; }
small { font-size: .875rem; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem, 4.2vw, 2.65rem); font-weight: 720; letter-spacing: -.055em; }
h2 { font-size: 1.12rem; font-weight: 680; letter-spacing: -.018em; }
h3 { font-size: 1rem; }
svg { flex: none; vertical-align: middle; }
code { overflow-wrap: anywhere; }
.skip { position: fixed; top: .5rem; left: .5rem; transform: translateY(-160%); z-index: 10; padding: .65rem; background: var(--panel); }
.skip:focus { transform: translateY(0); }
.app { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.7rem 1.15rem 1.25rem;
  background: color-mix(in srgb, var(--sidebar) 96%, transparent);
  border-right: 1px solid var(--line);
}
.brand-link { display: inline-flex; width: fit-content; }
.brand { display: inline-flex; align-items: center; gap: .65rem; white-space: nowrap; font-size: 1.25rem; font-weight: 750; letter-spacing: -.045em; }
.brand-os { color: var(--accent); }
.brand-mark { display: grid; place-items: center; position: relative; width: 2.1rem; height: 2.1rem; border-radius: .66rem; background: #80abff; color: #101e3a; }
.brand-mark i { width: .99rem; height: .99rem; border: .2rem solid currentColor; border-right-color: transparent; border-radius: 100%; transform: rotate(-12deg); }
.brand-mark b { position: absolute; width: .23rem; height: .23rem; right: .57rem; top: .92rem; border-radius: 50%; background: currentColor; }
.side-nav { display: grid; gap: .25rem; margin-top: 2.35rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .82rem; color: var(--muted); border: 1px solid transparent; border-radius: .74rem; font-size: .925rem; font-weight: 570; }
.side-nav a:hover { background: var(--panel); color: var(--text); }
.side-nav a[aria-current] { color: #c4d8ff; border-color: #344974; background: #202d48; }
.sidebar-footer { margin-top: auto; padding-top: .75rem; }
.sidebar-footer .quiet { color: var(--muted); background: transparent; border-color: transparent; }
.work { min-width: 0; padding-inline: clamp(1.5rem, 4vw, 3.75rem); width: 100%; max-width: 105rem; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 5.45rem; padding-top: env(safe-area-inset-top); }
.desktop-context { color: var(--muted); font-size: .88rem; }
.mobile-brand, .bottom-nav { display: none; }
.main { display: grid; gap: 1.12rem; padding-bottom: 2.5rem; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem 1rem; margin-bottom: .38rem; flex-wrap: wrap; }
.heading p { padding-top: .38rem; color: var(--muted); }
.status, .flag { display: inline-flex; align-items: center; gap: .48rem; min-width: 0; align-self: flex-start; padding: .33rem .65rem; color: var(--accent); background: #212d46; border: 1px solid #364969; border-radius: 99px; font-size: .875rem; line-height: 1.3; }
.status i { flex: none; width: .43rem; height: .43rem; border-radius: 50%; background: currentColor; }
.mode-stabilization, .flag { color: var(--amber); background: #332b27; border-color: #594637; }
.mode-debt_repayment { color: #f4c29a; background: #392e30; border-color: #64474b; }
.mode-investment { color: var(--green); background: #1b3333; border-color: #2c5451; }
.panel {
  background: linear-gradient(133deg, #1a1f2b 0, var(--panel) 64%);
  border: 1px solid var(--line);
  border-radius: 1.13rem;
  padding: clamp(.95rem, 1.7vw, 1.35rem);
  min-width: 0;
}
.panel-head, .item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .72rem; min-width: 0; }
.panel-head { margin-bottom: .8rem; }
.panel-head p { margin-top: .28rem; font-size: .875rem; color: var(--muted); }
.panel-head > :first-child { min-width: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.overview, .dashboard-bottom, .cards, .metrics { display: grid; gap: 1rem; min-width: 0; }
.overview { grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); }
.dashboard-bottom { grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); align-items: start; }
.cards.two, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three, .metrics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.side-stack, .stack { display: grid; gap: .75rem; min-width: 0; }
.side-stack { gap: 1rem; }
.stack.compact { gap: .45rem; }
.hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 2.6vw, 1.85rem);
  background: radial-gradient(ellipse at 86% -7%, #31588e 0, transparent 69%), linear-gradient(140deg, #233a60, #152744 70%);
  border: 1px solid #3b5986;
  border-radius: 1.22rem;
  min-width: 0;
}
.hero-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background:
    radial-gradient(ellipse at 110% 70%, transparent 47%, #81adf525 47.25%, transparent 48%, transparent 53%, #81adf530 53.25%, transparent 54%, transparent 59%, #81adf52b 59.3%, transparent 60%, transparent 65%, #81adf522 65.35%, transparent 66%),
    repeating-linear-gradient(90deg, transparent 0 23px, #a5cbff18 24px 25px),
    repeating-linear-gradient(0deg, transparent 0 23px, #a5cbff14 24px 25px);
  mask-image: linear-gradient(105deg, transparent 19%, #000 86%);
}
.hero-caption { display: flex; align-items: center; gap: .6rem; color: #c6d9fa; font-weight: 540; font-size: .94rem; }
.balance, .section-amount, .metric strong, .item-top > strong { font-variant-numeric: tabular-nums; }
.balance { font-size: clamp(2rem, 5vw, 3.65rem); font-weight: 740; line-height: 1.12; letter-spacing: -.06em; margin: .46rem 0 1rem; overflow-wrap: anywhere; }
.hero-sub { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; padding-top: .8rem; border-top: 1px solid #c0d6fb3b; }
.hero-sub > div { display: grid; gap: .12rem; align-content: start; }
.hero-sub span, .hero-note { color: #c6d9fa; font-size: .875rem; }
.hero-sub strong { font-size: clamp(1rem, 2vw, 1.3rem); overflow-wrap: anywhere; }
.narrow-hero .balance { margin-bottom: .5rem; }
.focus-panel { display: grid; align-content: space-between; justify-items: start; gap: .55rem; }
.focus-panel .caption { margin-bottom: .2rem; }
.focus-panel p { color: var(--muted); margin-top: .33rem; font-size: .9rem; }
.focus-panel h2 { font-size: clamp(1.05rem, 1.8vw, 1.35rem); }
.tile-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.25rem; height: 2.25rem; background: #263654; border: 1px solid #35466a; color: #a6c6ff; border-radius: .67rem; }
.metric { display: grid; align-content: start; gap: .42rem; }
.metric span, .caption { color: var(--muted); font-size: .875rem; display: flex; align-items: center; gap: .44rem; }
.metric span svg { color: var(--accent); }
.metric strong, .section-amount { font-weight: 710; line-height: 1.2; letter-spacing: -.036em; font-size: clamp(1.18rem, 2.5vw, 1.65rem); overflow-wrap: anywhere; }
.section-amount { margin-bottom: .65rem; }
a.panel:hover { border-color: #4c6389; }
.chart-panel { display: grid; gap: .35rem; }
.chart-wrap { position: relative; }
canvas { display: block; width: 100%; height: clamp(12rem, 24vw, 19rem); }
.chart-detail { display: block; position: absolute; top: .15rem; right: .2rem; max-width: 90%; padding: .38rem .55rem; border: 1px solid #51607b; background: #171f2c; border-radius: .55rem; color: var(--text); font-size: .8rem; pointer-events: none; }
.legend { display: flex; gap: .3rem 1rem; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.legend i { display: inline-block; width: .55rem; height: .55rem; margin-right: .2rem; border-radius: 50%; background: var(--accent-strong); }
.legend span:nth-child(2) i { background: #aeb9cd; }
.range { display: flex; background: #121722; border: 1px solid var(--line); padding: .18rem; border-radius: .7rem; flex: none; font-size: .875rem; }
.range a { padding: .32rem .55rem; border-radius: .49rem; color: var(--muted); }
.range a.selected { background: #283856; color: #dbe8ff; }
button, .button, .pill-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-weight: 620; line-height: 1.25; border: 1px solid transparent; border-radius: .67rem;
  min-height: 2.7rem; padding: .58rem .87rem; text-align: center; max-width: 100%;
}
.primary { background: #84afff; color: #101c32; border-color: #a1c2ff; }
.primary:hover { background: #a6c8ff; }
.quiet { background: #242d40; color: #c5d9fd; border-color: #37445d; }
.quiet:hover { background: #303d58; color: #f0f5ff; }
.pill-link { font-size: .875rem; min-height: 2.1rem; padding: .36rem .65rem; white-space: nowrap; }
.text-link { display: inline-block; color: var(--accent); font-weight: 600; font-size: .875rem; line-height: 1.4; }
.text-link:hover { text-decoration: underline; }
progress { display: block; width: 100%; height: .48rem; appearance: none; border: 0; border-radius: 99px; color: var(--accent-strong); background: #2a3348; overflow: hidden; }
progress::-webkit-progress-bar { background: #2a3348; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #5688ff, #95c3ff); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #5688ff, #95c3ff); border-radius: 99px; }
.progress-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem .6rem; color: var(--muted); font-size: .875rem; margin-top: .45rem; margin-bottom: .5rem; }
.item-top { align-items: center; }
.stack > .item-top { padding: .52rem 0; border-bottom: 1px solid var(--line); }
.stack > .item-top:last-child { border-bottom: 0; }
.item-top > strong { text-align: right; max-width: 48%; overflow-wrap: anywhere; }
.item-top small, .daily small, .allocation-labels small, .strategy small { display: block; margin-top: .12rem; color: var(--muted); }
.date-box { display: grid; justify-items: center; align-items: center; height: 2.7rem; min-width: 3rem; padding: .16rem; border: 1px solid #334260; border-radius: .55rem; color: #c4d9ff; background: #212c42; line-height: 1.15; }
.date-box span { font-size: .72rem; color: var(--muted); }
.empty-inline { display: flex; align-items: center; gap: .55rem; min-height: 2.6rem; font-size: .925rem; color: var(--muted); }
.empty-inline svg { color: var(--accent); }
.issue-list { color: #dcc9ad; padding-left: 1.18rem; margin: .15rem 0 0; }
.issue-list li + li { margin-top: .4rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; overflow-wrap: anywhere; }
.positive, .success-text { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.caution-text { color: var(--amber); }
.notice { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: .75rem; background: #24334c; color: #c5daff; border: 1px solid #3d547b; }
.notice.error { background: #3b2633; color: var(--red); border-color: #653b4c; }
.notice.success { background: #1e3330; color: var(--green); border-color: #335650; }
.notice.caution { background: #392f24; color: var(--amber); border-color: #66513c; }
.editor, .fields { display: grid; gap: .8rem; min-width: 0; }
.editor { margin-top: .75rem; }
.editor button { justify-self: start; }
.form-grid { display: grid; gap: .7rem; }
.field { display: grid; align-content: start; gap: .27rem; min-width: 0; font-size: .875rem; color: #cbd3e7; }
.field input, .field select {
  min-height: 2.78rem; width: 100%; border: 1px solid #3a445b; border-radius: .57rem;
  background: #111622; color: var(--text); padding: .56rem .68rem; font-size: 1rem; font-weight: 450;
}
.field select { appearance: none; padding-right: 1.9rem; background-image: linear-gradient(45deg, transparent 50%, #acb9d5 51%), linear-gradient(135deg, #acb9d5 50%, transparent 51%); background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; }
.field input::placeholder { color: #7f8ba5; }
input[type="date"] { display: block; }
.toggle { display: flex; align-items: flex-start; gap: .6rem; min-height: 2.25rem; cursor: pointer; }
.toggle input { width: 1.1rem; height: 1.1rem; margin: .18rem 0 0; accent-color: #85b2ff; flex: none; }
fieldset { display: grid; gap: .65rem; margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: .7rem; padding: .75rem; }
legend { padding: 0 .35rem; font-weight: 650; }
summary { cursor: pointer; color: var(--accent); font-weight: 610; overflow-wrap: anywhere; }
summary svg { margin-right: .25rem; }
.fold[open] > summary { margin-bottom: .4rem; }
.inline-fold { padding: .6rem 0 .18rem; }
.inline-fold > summary { font-size: .875rem; }
.inline-fold > .stack, .inline-fold > p { margin-top: .5rem; }
.account-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .65rem; }
.account-tile p { color: var(--muted); font-size: .875rem; }
.account-tile .section-amount { grid-column: 1 / -1; margin: .2rem 0 0; }
.detail-row { margin-top: .65rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .33rem .6rem; border-block: 1px solid var(--line); padding: .55rem 0; }
.detail-row span { color: var(--muted); }
.list-item { border-bottom: 1px solid var(--line); padding: .36rem 0 .66rem; }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.reversed > .item-top { opacity: .62; }
.list-item > .hint, .list-item > .flag, .list-link { margin-top: .38rem; }
.daily-row { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.daily-row > div { min-width: 0; overflow-wrap: anywhere; }
.strategy ol { padding-left: 1.55rem; margin: .5rem 0 0; }
.strategy li + li { margin-top: .32rem; }
.allocation-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 .75rem; }
.allocation-labels > div { display: grid; gap: .19rem; }
.allocation-labels > div:nth-child(2) { text-align: right; }
.allocation-labels strong { font-size: 1.64rem; }
.allocation-labels span { color: var(--muted); }
.allocation > .hint { margin-top: .7rem; }
.decision-action { margin-bottom: .34rem; font-weight: 650; }
.raw-data { max-height: 17rem; overflow: auto; scrollbar-width: thin; padding: .65rem; background: #111622; border-radius: .55rem; color: #b7c7e9; }
.record { margin-top: .5rem; padding: .7rem; background: #111622; border-radius: .55rem; overflow-wrap: anywhere; }
.record p { margin-bottom: .4rem; color: var(--muted); }
.auth-shell { display: grid; min-height: 100vh; min-height: 100dvh; align-items: center; justify-items: center; padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)); }
.auth-card { width: min(100%, 27rem); padding: clamp(1.15rem, 5vw, 2.15rem); display: grid; gap: 1rem; }
.auth-card h1 { font-size: clamp(1.55rem, 5vw, 2rem); }
.auth-card .editor { margin-top: 0; }
.auth-card .editor button { width: 100%; }
.auth-card p { color: var(--muted); }
@media (max-width: 1050px) {
  .app { grid-template-columns: 12rem minmax(0, 1fr); }
  .work { padding-inline: 1.35rem; }
  .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .app { display: block; }
  .sidebar, .desktop-context { display: none; }
  .mobile-brand { display: inline-flex; }
  .work { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .topbar { min-height: calc(4.55rem + env(safe-area-inset-top)); }
  .main { padding-bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0,1fr));
    padding: .35rem max(.45rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.45rem, env(safe-area-inset-left));
    border-top: 1px solid #343d52; background: #151a26f2; backdrop-filter: blur(17px);
  }
  .bottom-nav a { display: grid; min-height: 2.9rem; justify-items: center; align-content: center; gap: .12rem; color: var(--muted); font-size: .78rem; border-radius: .65rem; font-weight: 550; line-height: 1.15; }
  .bottom-nav a[aria-current] { color: #bcd4ff; background: #283955; }
}
@media (max-width: 570px) {
  .main, .overview, .dashboard-bottom, .cards, .side-stack { gap: .78rem; }
  .overview, .dashboard-bottom, .cards.two, .cards.three { grid-template-columns: minmax(0, 1fr); }
  .metrics, .metrics.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem; }
  .heading p { font-size: .94rem; }
  .balance { font-size: clamp(2rem, 9vw, 3.1rem); }
  .focus-panel { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .6rem .68rem; }
  .focus-panel .pill-link { grid-column: 2; }
  .panel, .hero { border-radius: 1rem; }
  .metric { padding: .74rem .8rem; }
  .metric span { gap: .3rem; }
  .range a { padding-inline: .4rem; }
  .top-link { min-height: 2.4rem; }
}
@media (max-width: 360px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .range a { padding-inline: .25rem; }
  .panel-head { flex-wrap: wrap; }
}