:root {
  color-scheme: dark;
  --bg: #080c18;
  --surface: #111a2d;
  --border: #263b5e;
  --text: #f5f8ff;
  --muted: #91a5c7;
  --blue: #64b8ff;
  --blue-strong: #3987e6;
  --positive: #4ade80;
  --negative: #fb7185;
  --shadow: 0 16px 40px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 50% -20%, #16294b 0, var(--bg) 44rem);
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, input, select { border-radius: 11px; }
button { border: 0; color: var(--text); cursor: pointer; font-weight: 700; transition: filter .18s ease, transform .18s ease, background .18s ease; }
button:hover { filter: brightness(1.13); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8bd2ff; outline-offset: 2px; }
input, select { width: 100%; border: 1px solid var(--border); background: #0c1527; color: var(--text); padding: 11px 12px; }
input::placeholder { color: #63799f; }
.shell { width: min(1080px, 100%); margin: 0 auto; padding: 28px 24px 12px; }
.topbar, .hero-topline, .calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 25px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #386da6; border-radius: 13px; background: #162c4d; color: var(--blue); font-size: 23px; box-shadow: 0 0 25px rgba(70, 150, 240, .12); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: 23px; letter-spacing: .03em; }
h1 span { color: var(--blue); }
.brand-lockup p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.privacy-pill { border: 1px solid #244468; border-radius: 999px; background: rgba(20, 42, 70, .6); color: #b6d5f5; font-size: 12px; padding: 7px 11px; white-space: nowrap; }
.privacy-pill span { color: var(--positive); font-size: 9px; vertical-align: 1px; }
.panel { margin-bottom: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: rgba(17, 26, 45, .88); box-shadow: var(--shadow); }
.hero { min-height: 214px; padding: 28px; border-color: #31598b; background: linear-gradient(135deg, rgba(26, 64, 111, .98), rgba(16, 27, 49, .98) 65%); }
.hero-topline { align-items: flex-start; }
.eyebrow { margin-bottom: 5px; color: #9fc0e8; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-date { margin: 0; color: #bbd0eb; font-size: 13px; }
.hero-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #4a83bf; border-radius: 13px; color: #b9e1ff; font-size: 24px; }
.hero-balance { margin: 20px 0 2px; font-size: clamp(39px, 7vw, 60px); font-weight: 850; letter-spacing: -.04em; line-height: 1; }
.hero-result, .hero-count { margin: 0; color: #c7dcf4; }
.hero-count { margin-top: 17px; color: #91b0d4; font-size: 13px; }
.summary-grid, .content-grid, .settings-grid { display: grid; gap: 16px; }
.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-card { padding: 18px 20px; }
.summary-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; font-size: 25px; letter-spacing: -.02em; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-positive { background: var(--positive); }
.dot-negative { background: var(--negative); }
.tabs { display: flex; gap: 7px; overflow-x: auto; margin: 18px 0; padding: 4px; scrollbar-width: thin; }
.tabs button { flex: 0 0 auto; padding: 10px 15px; background: #172744; color: #a9bedc; }
.tabs button.active { background: var(--blue-strong); color: white; box-shadow: 0 7px 18px rgba(57, 135, 230, .23); }
.hidden { display: none !important; }
.content-grid { grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr); align-items: stretch; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; }
.heading-icon { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #31527e; border-radius: 10px; color: var(--blue); font-size: 18px; }
.chart-icon { font-size: 24px; }
label { display: block; margin: 13px 0 6px; color: #b5c8e2; font-size: 13px; font-weight: 650; }
.field-hint { color: #7891b5; font-size: 11px; font-weight: 500; }
.primary-action { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 18px; padding: 12px 14px; background: var(--blue-strong); }
.compact-action { justify-content: center; margin-top: 18px; }
.form-error { min-height: 21px; margin: 12px 0 0; color: #ff9aad; font-size: 13px; }
.form-error:empty { min-height: 0; margin: 0; }
.chart-panel { display: flex; flex-direction: column; }
canvas { display: block; width: 100%; height: auto; max-height: 290px; }
.chart-note, .subheading, .chart-summary, .selected-date { color: var(--muted); font-size: 13px; }
.chart-note { margin: auto 0 0; padding-top: 10px; }
.monthly-panel { margin-top: 16px; }
.monthly-panel .section-heading { margin-bottom: 2px; }
.legend { display: flex; gap: 18px; margin: 14px 0 5px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 7px; height: 7px; }
.chart-summary { margin: 4px 0 0; }
.calendar-header { margin-bottom: 20px; }
.calendar-header h2 { text-transform: capitalize; }
.icon-button { width: 38px; height: 38px; background: #203657; font-size: 25px; line-height: 1; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekday { padding: 5px 0; color: #8ea5c8; font-size: 11px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar button { min-height: 43px; padding: 7px 0; background: #172844; color: #d8e7fb; }
.calendar button.active { background: var(--blue-strong); }
.calendar button.plus { border-bottom: 3px solid var(--positive); }
.calendar button.minus { border-bottom: 3px solid var(--negative); }
.day-summary { background: linear-gradient(135deg, rgba(23, 40, 68, .95), rgba(17, 26, 45, .88)); }
.selected-date { margin-bottom: 6px; }
.day-balance { font-size: 38px; font-weight: 800; letter-spacing: -.04em; }
.day-summary .subheading { margin-bottom: 0; }
.filterbar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.filterbar label { margin-top: 0; }
.statsline { margin: 11px 0; color: var(--muted); font-size: 13px; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #263956; padding: 14px 0; }
.entry > div { min-width: 0; overflow-wrap: anywhere; }
.entry strong { font-size: 16px; }
.entry .muted { margin-top: 3px; color: var(--muted); font-size: 12px; }
.entry button { flex: 0 0 auto; padding: 7px 10px; background: #662e43; font-size: 12px; }
.action-stack { display: grid; gap: 9px; margin: 16px 0; }
.action-stack button, #clear { padding: 11px 12px; background: #286bc8; }
button.secondary { background: #203657; }
button.danger { background: #662e43; }
input[type="file"] { padding: 8px; color: var(--muted); font-size: 12px; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status { min-height: 0; margin: -9px 0 11px; color: #9ed0ff; font-size: 13px; }
.status:empty { display: none; }
footer { padding: 14px 0 10px; color: #7186a8; font-size: 12px; text-align: center; }
@media (max-width: 760px) { .content-grid, .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .shell { padding: 19px 12px 8px; }
  .topbar { align-items: flex-start; }
  .privacy-pill { padding: 6px 8px; font-size: 10px; }
  .panel, .hero { padding: 17px; border-radius: 15px; }
  .hero { min-height: 192px; }
  .hero-balance { font-size: 39px; }
  .summary-card { padding: 15px; }
  .summary-card strong { font-size: 21px; }
  .filterbar { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
