:root {
  color-scheme: light dark;
  --page: light-dark(#f7f5f0, #1c1a20);
  --surface: light-dark(#fffefa, #25232b);
  --ink: light-dark(#24212c, #f5f1f6);
  --muted: light-dark(#625d6a, #bfb7c5);
  --line: light-dark(#e4dee7, #494151);
  --accent: light-dark(#5a3ba1, #d6c4ff);
  --soft: light-dark(#eee7fa, #382d4d);
  --mint: light-dark(#deeee3, #263d33);
  --mint-ink: light-dark(#25593c, #bce7c8);
  --warm: light-dark(#f4e9d8, #473529);
  --warm-ink: light-dark(#7d4c24, #f3c59f);
  --error: light-dark(#962e36, #ffaaaa);
  font: 15px/1.45 'Aptos', 'Segoe UI', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
h1, h2, p, ul, dl, dd { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.12; letter-spacing: -.055em; }
h2 { font-size: 1.14rem; line-height: 1.28; letter-spacing: -.035em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { max-width: 940px; min-height: 100dvh; margin: 0 auto; padding: 0 18px 110px; }
.topbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.17rem; font-weight: 800; letter-spacing: -.04em; }
.brand small { display: block; font-size: .75rem; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #fbf6ff; background: #4b327c; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; flex: none; }
.icon-button[aria-current="page"] { background: var(--soft); color: var(--accent); }
.view { padding-top: 19px; display: grid; gap: 16px; }
.heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.heading { flex-wrap: wrap; min-height: 40px; }
.heading .muted { font-size: .82rem; font-weight: 650; }
.section-heading > a { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 750; color: var(--accent); flex: none; min-height: 36px; }
.section-heading > a > svg { width: 15px; height: 15px; }
.forecast-card { padding: 16px 18px; color: #fcf7ff; border-radius: 22px; background: radial-gradient(ellipse at 100% 10%, #654e93, transparent 67%), #38294f; }
.forecast-card h2, .section-heading .forecast-link { color: #f3eafe; font-size: .88rem; font-weight: 750; letter-spacing: 0; }
.forecast-value { font-size: clamp(2.25rem, 10vw, 3.75rem); line-height: 1.12; font-weight: 820; letter-spacing: -.065em; margin-bottom: 12px; overflow-wrap: anywhere; }
.forecast-value.negative { color: #ffd6bb; }
.allocation { display: flex; height: 7px; gap: 4px; margin: 0 0 11px; }
.allocation span { min-width: 0; border-radius: 6px; background: #ddc9fa; }
.allocation span:nth-child(2) { background: #a08ac8; }
.allocation span:nth-child(3) { background: #c2e7cd; }
.forecast-breakdown { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 15px; font-size: .82rem; color: #f1e6ff; }
.forecast-breakdown strong { color: #fff; margin-left: 3px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 13px; }
.metric { display: grid; min-width: 0; gap: 4px; }
.metric > span { display: flex; justify-content: space-between; align-items: center; gap: 4px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.metric svg { width: 16px; height: 16px; color: var(--accent); }
.metric > strong { font-size: clamp(1.2rem, 5.2vw, 1.75rem); letter-spacing: -.05em; line-height: 1.15; overflow-wrap: anywhere; }
.metric > small, .muted { color: var(--muted); }
.glance { display: grid; gap: 7px; min-width: 0; }
.rows { list-style: none; padding: 0; display: grid; gap: 6px; min-width: 0; }
.row, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; min-width: 0; }
.row { display: flex; align-items: center; }
.row-main { display: flex; align-items: center; gap: 10px; flex: 1; text-align: start; width: 100%; min-width: 0; min-height: 60px; padding: 9px 11px; background: transparent; border: 0; border-radius: 15px; }
.row-copy { display: grid; flex: 1; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.row-copy strong { font-size: .94rem; }
.row-copy small { color: var(--muted); font-size: .82rem; white-space: pre-line; }
.row-end { flex: none; font-size: .86rem; font-weight: 750; }
.row-end.positive { color: var(--mint-ink); }
.swatch { display: grid; place-content: center; min-width: 38px; height: 39px; border-radius: 12px; color: var(--accent); background: var(--soft); text-align: center; font-size: .71rem; line-height: 1.1; font-weight: 750; white-space: pre-line; }
.swatch.mint { color: var(--mint-ink); background: var(--mint); }
.swatch.warm { color: var(--warm-ink); background: var(--warm); }
.swatch > svg { width: 17px; height: 17px; }
.row-action { margin-right: 8px; flex: none; }
.empty { padding: 13px; color: var(--muted); font-size: .87rem; }
.navigation { position: fixed; z-index: 1; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 6px 12px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.navigation a { display: grid; gap: 3px; justify-items: center; align-content: center; min-height: 53px; padding: 4px; border-radius: 12px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.navigation a[aria-current="page"] { color: var(--accent); background: var(--soft); }
.primary, .secondary, .text-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 11px; font-weight: 700; font-size: .88rem; }
.primary { border: 1px solid #52368b; background: #52368b; color: #fff; }
.primary svg { width: 16px; height: 16px; }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--accent); }
.text-button { border: 0; background: transparent; color: var(--accent); padding-inline: 4px; }
.attachment-link { justify-self: start; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding-block: 3px; }
.danger { color: var(--error); }
.danger-fill { border-color: #922d38; background: #922d38; }
.fields { display: grid; gap: 12px; }
.fields label { display: grid; gap: 5px; font-size: .87rem; font-weight: 650; min-width: 0; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 42px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-size: 1rem; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.fields label.check { display: flex; align-items: center; gap: 8px; min-height: 38px; }
textarea { resize: vertical; min-height: 86px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.month-field { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.month-field input { width: auto; }
.totals { display: grid; gap: 7px; }
.totals > p { display: flex; justify-content: space-between; gap: 10px; }
.totals > p:last-child { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 750; }
details summary { cursor: pointer; font-weight: 700; padding: 7px 0; }
.login { max-width: 415px; margin: 38px auto; display: grid; gap: 16px; }
.login p { margin-top: 6px; color: var(--muted); }
.login .card { padding: 18px; }
.error, .login .error { color: var(--error); }
.notice { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
dialog { border: 1px solid var(--line); border-radius: 20px; width: min(440px, calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 16px; background: var(--page); color: var(--ink); }
dialog::backdrop { background: rgb(27 19 39 / .52); }

@media (min-width: 700px) {
  .shell { padding-inline: 34px; }
  .view { gap: 17px; padding-top: 25px; }
  #start { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #start > .heading, #start > .forecast-card, #start > .metrics { grid-column: 1 / -1; }
  .forecast-card { padding: 20px 24px; }
  .metric { padding: 14px 18px; }
  .navigation { bottom: 14px; width: min(610px, calc(100% - 40px)); border: 1px solid var(--line); border-radius: 19px; padding: 6px; box-shadow: 0 6px 28px #251c3520; }
}
