:root {
  color-scheme: light;
  --paper: #fff9de;
  --white: #ffffff;
  --ink: #152845;
  --muted: #4d5464;
  --accent: #0057b7;
  --deep: #003e87;
  --wash: #ffec9a;
  --border: #d1ad4073;
  --green: #166546;
  --shadow: 0 10px 30px #38260016;
  font-family: system-ui, sans-serif;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { opacity: .52; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
#app { height: 100%; }
.shell { height: 100%; display: flex; flex-direction: column; }
.toolbar {
  flex: none; min-height: 72px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 9px max(16px, calc((100% - 740px) / 2)); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { min-width: 0; }
.wordmark { display: block; direction: ltr; text-align: right; line-height: 1.1; font-weight: 850; letter-spacing: -.045em; font-size: 1.23rem; }
.mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffd700; color: white; font-size: 26px; font-weight: 900; flex: none; }
.account-button { max-width: 108px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; }
.small { font-size: .8rem; color: var(--muted); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.main { width: min(100%, 740px); margin: auto; padding: 17px 16px 26px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 5.5vw, 2.1rem); line-height: 1.25; }
h2 { font-size: 1.06rem; }
h3 { font-size: .98rem; overflow-wrap: anywhere; }
.hero {
  background: linear-gradient(135deg, #0057b7, #145da9 68%, #234d88);
  padding: 20px; color: white; border-radius: 22px; box-shadow: var(--shadow);
  margin-bottom: 16px; overflow-wrap: anywhere;
}
.hero .small { color: #fff8ce; }
.hero p { margin-top: 8px; }
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hero .primary { background: #fff4b2; color: var(--deep); white-space: nowrap; }
.hero .primary:hover { background: #fff; }
.hero .metrics { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.metric { background: #ffffff22; padding: 5px 10px; border-radius: 9px; font-size: .8rem; color: white; }
.nav { flex: none; display: flex; justify-content: center; background: var(--white); border-top: 1px solid var(--border); padding: 5px 5px 4px; }
.nav button { display: flex; flex: 1; max-width: 125px; gap: 2px; flex-direction: column; justify-content: center; align-items: center; padding: 5px 1px; min-height: 49px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: clamp(.67rem, 2.85vw, .8rem); }
.nav button[aria-current="page"] { background: var(--wash); color: var(--deep); font-weight: 750; }
.nav .nav-icon { font-size: 18px; font-weight: 700; line-height: 1; }
.section-title { margin: 17px 0 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 8px; }
.card { display: flex; gap: 9px; flex-direction: column; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--white); overflow-wrap: anywhere; }
.card p { overflow-wrap: anywhere; }
.empty { border: 1px dashed var(--border); border-radius: 12px; padding: 22px 12px; text-align: center; color: var(--muted); }
.button { border: 1px solid transparent; border-radius: 11px; background: var(--wash); color: var(--deep); padding: 8px 11px; font-weight: 720; font-size: .83rem; min-height: 40px; }
.button:active { transform: translateY(1px); }
.primary { background: var(--accent); color: white; padding-inline: 15px; }
.quiet { background: white; border-color: var(--border); }
.danger { color: #8d1e12; background: #ffebe6; }
.done { color: var(--green); background: #def1e8; }
.symbol { font-size: 1.1rem; min-width: 40px; }
.badge { display: inline-block; color: var(--deep); background: var(--wash); padding: 3px 8px; border-radius: 999px; font-size: .74rem; white-space: nowrap; }
.good { color: var(--green); background: #def1e8; }
.bad { color: #8d2618; background: #ffebe6; }
.date-bar { background: var(--white); border: 1px solid var(--border); border-radius: 13px; padding: 4px 6px; margin-bottom: 12px; }
.date-bar input { position: absolute; inset: 0; width: 100%; opacity: 0; }
.date-display { position: relative; font-weight: 750; text-align: center; flex: 1; padding: 6px 0; }
.date-display input::-webkit-calendar-picker-indicator { position: absolute; width: 100%; height: 100%; inset: 0; cursor: pointer; }
.signin { height: 100%; overflow: auto; padding: 24px 16px; display: grid; align-content: center; }
.signin-inner { width: min(100%, 440px); margin: auto; }
.signin .brand { margin-bottom: 18px; }
.signin .mark { height: 56px; width: 56px; font-size: 31px; }
.signin .wordmark { font-size: 1.7rem; }
.signin .card { padding: 19px; border-radius: 20px; box-shadow: var(--shadow); }
.signin h1 { margin-bottom: 4px; font-size: 1.45rem; }
.signin .form { margin-top: 7px; }
.form { display: grid; gap: 11px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: .85rem; font-weight: 700; }
.field input, .field select, .field textarea {
  border: 1px solid var(--border); border-radius: 10px; color: var(--ink); min-height: 44px;
  width: 100%; min-width: 0; padding: 8px 10px; background: #fffdfb;
}
.field textarea { min-height: 76px; resize: vertical; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.error { background: #ffebe6; color: #8d2618; border-radius: 9px; padding: 8px 10px; font-size: .83rem; overflow-wrap: anywhere; }
dialog {
  position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%, 520px); max-width: 100%;
  max-height: 86%; overflow: auto; color: var(--ink); border: 0; border-radius: 22px 22px 0 0;
  background: var(--paper); padding: 15px 16px 20px;
}
dialog::backdrop { background: #321b1480; }
.sheet-head { margin-bottom: 11px; }
#toast { position: fixed; inset: auto 12px 67px; z-index: 5; width: fit-content; max-width: calc(100% - 24px); margin: auto; border-radius: 12px; padding: 9px 13px; background: var(--ink); color: white; font-size: .875rem; }
@media (max-height: 460px) { .signin { align-content: start; } dialog { max-height: 96%; } }

.task-photo { align-self: start; width: min(100%, 520px); max-height: 480px; object-fit: contain; object-position: right; border-radius: 10px; }
.date-button { text-align: right; width: 100%; background: #fffdfa; border-color: var(--border); }
.date-bar .date-display > span { display: block; }
.date-bar .date-button { text-align: center; border-color: transparent; }
.calendar-dialog {
  inset: 0; margin: auto; width: min(calc(100% - 24px), 440px); border-radius: 16px;
  border: 1px solid var(--border); padding: 15px; background: #fff;
}
.calendar-tools { display: grid; grid-template-columns: auto 1fr minmax(72px, .7fr) auto; gap: 6px; margin-bottom: 12px; }
.calendar-tools select { width: 100%; min-height: 42px; padding: 5px; background: #fff; border-radius: 9px; border: 1px solid var(--border); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar-weekday { font-size: clamp(.5rem, 2.4vw, .72rem); padding-block: 5px; color: var(--muted); }
.button.calendar-day { padding: 3px 0; background: #f8f5f0; min-height: 39px; }
.button.calendar-day.current { border-color: #b75326; }
.button.calendar-day.selected { background: var(--accent); color: #fff; }
.calendar-footer { margin-top: 12px; }

:root {
  --paper: #fbf5ee;
  --white: #fffdf9;
  --ink: #291d17;
  --accent: #a33a13;
  --deep: #783317;
}
.toolbar {
  background: #fffaf4;
  padding-inline: max(18px, calc((100% - 1036px) / 2));
  padding-top: max(9px, env(safe-area-inset-top));
}
.mark { object-fit: contain; background: transparent; }
.main { width: min(100%, 1068px); padding: 18px 16px 25px; }
.nav {
  min-height: 63px;
  gap: 6px;
  box-shadow: 0 -4px 18px #3a27120a;
  padding-bottom: max(5px, env(safe-area-inset-bottom));
}
.nav button { min-height: 51px; max-width: 154px; font-size: .8rem; }
.nav-icon { display: block; margin-bottom: 2px; }
.hero { background: linear-gradient(121deg, #54240f, #873b18 58%, #a9471d); }
.hero .metric { font-size: .88rem; }
.hero .primary { color: var(--deep); background: #fff9ec; }
.hero-top { align-items: center; gap: 8px; }
.date-bar { background: #fffaf4; }
.date-bar .date-display input { display: none; }
.date-bar .date-button { padding-inline: 2px; font-size: .85rem; min-height: 44px; background: transparent; }
.date-bar .symbol { padding-inline: 4px; min-width: 35px; }
.sync-status { max-width: 43vw; overflow-wrap: anywhere; }
.dashboard { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.card { min-width: 0; border-radius: 17px; padding: 14px; box-shadow: 0 3px 10px #5d2b1008; }
.card h2 { margin-bottom: 3px; }
.controls, .completed { margin-block: 12px; }
.completed > summary { cursor: pointer; font-weight: 730; }
.completed[open] > summary { margin-bottom: 10px; }
.button { min-height: 44px; }
.active { color: white; background: var(--accent); }
.tabs { display: inline-flex; align-self: start; gap: 4px; border-radius: 12px; padding: 3px; background: #f8e9db; }
.tabs button { min-width: 78px; }
.record {
  border: 1px solid #eedfd3; border-radius: 13px; background: #fffefa;
  padding: 7px 9px; min-width: 0; line-height: 1.45;
}
.task-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.task-check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.task-check input { flex: 0 0 auto; accent-color: var(--accent); width: 19px; height: 19px; }
.task-check .checked { color: var(--muted); text-decoration: line-through; }
.task-check small { display: block; color: var(--muted); text-decoration: none; }
.expense-record { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto; gap: 7px; align-items: center; }
.amount { font-size: .92rem; color: var(--deep); text-align: end; max-width: 14ch; overflow-wrap: anywhere; }
.credit { color: var(--green); }
.chart { gap: 12px; }
.bars { display: grid; gap: 9px; min-width: 0; }
.bars-scroll { max-height: 270px; overflow: auto; overscroll-behavior: contain; padding-inline-end: 5px; }
.bar-row, .compare-bar {
  display: grid; grid-template-columns: minmax(65px, 1.2fr) minmax(0, 1.8fr) minmax(72px, 1.2fr);
  align-items: center; gap: 8px; font-size: .83rem;
}
.bar-value, .compare-bar bdi { color: var(--deep); text-align: end; font-variant-numeric: tabular-nums; }
meter { width: 100%; height: 14px; appearance: none; }
meter::-webkit-meter-bar { background: #0057b7; border: 0; border-radius: 8px; }
meter::-webkit-meter-optimum-value { background: #a67300; border-radius: 8px; }
meter::-moz-meter-bar { background: #a67300; border-radius: 8px; }
.comparison-item { border-bottom: 1px solid #f1e5db; padding-bottom: 6px; }
.compare-bar { grid-template-columns: minmax(0, 1.8fr) minmax(80px, 1fr); }
.prior-series meter::-webkit-meter-optimum-value { background: #ebd99b; }
.prior-series meter::-moz-meter-bar { background: #ebd99b; }
.legend span::before { content: ''; display: inline-block; width: .7em; height: .7em; background: #a67300; border-radius: 50%; margin-inline-end: .35em; }
.legend span + span::before { background: #ebd99b; }
.forecast-days { color: var(--deep); font-size: 1.24rem; }
#sheet { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
#sheet input[data-money] { text-align: right; font-variant-numeric: tabular-nums; }
#toast { inset-block-end: max(72px, calc(env(safe-area-inset-bottom) + 66px)); }
@media (min-width: 861px) {
  #sheet { inset: 0; margin: auto; border-radius: 22px; }
}
@media (max-width: 720px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 13px 12px 21px; }
}
@media (max-width: 360px) {
  .main { padding-inline: 8px; }
  .card { padding: 11px; }
  .brand .small { font-size: .72rem; }
  .bar-row, .compare-bar { gap: 5px; }
  .date-bar .quiet { padding-inline: 5px; }
  .date-bar .date-button { font-size: .75rem; }
  .columns { gap: 5px; }
}

/* Sunflower yellow and Ukrainian blue glass surfaces. */
:root {
  --paper: #fff8d8;
  --white: #ffffef;
  --ink: #142746;
  --muted: #4a556b;
  --accent: #0057b7;
  --deep: #003f8b;
  --wash: #fff1a9;
  --border: #d7a31975;
  --green: #166546;
  --shadow: 0 16px 42px #51430923;
  --glass-shadow: 0 10px 32px #bc8d122c, inset 0 1px 0 #fff, inset 0 -1px 0 #ffe05e;
}
html, body {
  background: radial-gradient(ellipse at 4% 8%, #9cc9fd 0, transparent 47%),
    radial-gradient(ellipse at 94% 45%, #fff7ce 0, transparent 51%), #fff9d5da;
}
.shell {
  position: relative; isolation: isolate; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.auth-shell { grid-template-rows: minmax(0, 1fr); }
.auth-shell .signin { height: auto; min-height: 0; overflow: auto; }
.shell .scroll { min-height: 0; }
.hero, .hero .metric { color: var(--ink); }
.toolbar {
  background: #fff8dbe8;
  border-bottom: 1px solid #ffffffc9;
  box-shadow: 0 3px 18px #31456c1a;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
.wordmark { color: #15365e; font-size: 1.37rem; }
.mark { border-radius: 15px; object-fit: contain; filter: drop-shadow(0 4px 7px #18355b26); }
.main { padding-bottom: 26px; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(120deg, #ffd700 0%, #ffca24 55%, #fff2a3b2 100%);
  padding: clamp(17px, 4vw, 26px);
  border: 1px solid #71560735;
  box-shadow: 0 16px 40px #fffff0a0, inset 0 1px 0 #fffff98b;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 13% 1%, #fffffb38 0, transparent 46%),
    linear-gradient(168deg, #ffffff88, transparent 46%);
}
.hero .small { color: #223b59; }
.hero .primary { color: #113c82; background: #fff9d8; box-shadow: inset 0 1px 0 #fff, 0 5px 18px #fff6be86; }
.hero .metric { background: #fffde9a9; border: 1px solid #fffceaed; }
.card, .date-bar, .nav {
  background: #fffff7ce; border: 1px solid #ffffffd9; box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(15px) saturate(140%);
  backdrop-filter: blur(15px) saturate(140%);
}
.record { background: #ffffffc1; border-color: #fffff2ed; }
.button {
  border-radius: 13px; transition: transform 180ms cubic-bezier(.2,.8,.2,1),
    background-color 210ms, box-shadow 210ms; box-shadow: inset 0 1px 0 #fff9;
}
.button:active { transform: scale(.96); }
.quiet, .date-button, .field input, .field select, .field textarea, .calendar-tools select {
  color: var(--ink); background: #fffdf1ed; border-color: #bd9b484d;
}
.primary { background: linear-gradient(155deg, #0864c8, #003f8b); color: #fff; }
.danger { background: #ffe8e6; color: #811e2d; }
.badge, .tabs { background: #0057b7; }
.active, .button.calendar-day.selected { background: #fff4b5; color: #fff; }
.button.calendar-day { background: #b58b0c; }
.button.calendar-day.current { border-color: #f7e9ae; }
.metric, .amount, .bar-value, .forecast-days { font-variant-numeric: tabular-nums; }
meter::-webkit-meter-bar { background: #337ad7; }
meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, #0057b7, #a67300); }
meter::-moz-meter-bar { background: #a67300; }
.prior-series meter::-webkit-meter-optimum-value { background: #b98d195e; }
.prior-series meter::-moz-meter-bar { background: #b98d195e; }
.legend span::before { background: #a67300; }
.legend span + span::before { background: #b98d195e; }
.comparison-item { border-color: #fff9e1f7; }
#sheet, .calendar-dialog {
  background: #263e6640; border: 1px solid #faffff; box-shadow: 0 22px 50px #13294c78;
}
#sheet[open], .calendar-dialog[open] { animation: sheet-in 340ms cubic-bezier(.16,.86,.29,1) both; }
dialog::backdrop { background: #ffe785; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.page-enter { animation: page-in 300ms cubic-bezier(.2,.77,.24,1) both; }
.page-enter.from-left { --entry-x: -14px; }
.page-enter.from-right { --entry-x: 14px; }
@keyframes page-in {
  from { opacity: .48; transform: translate(var(--entry-x, 0px), 6px); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes sheet-in { from { opacity: .25; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: none; } }

.nav {
  width: min(calc(100% - 18px), 560px);
  align-self: end; justify-self: center; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end; justify-content: stretch; gap: 2px; padding: 4px 5px 5px;
  margin: 0 auto max(9px, env(safe-area-inset-bottom)); border-radius: 27px;
  min-height: 68px;
  position: relative;
  isolation: isolate;
  background: linear-gradient(155deg, #fffffff2, #fff4c6d9);
}
.nav button {
  width: 100%; max-width: none; min-width: 0; min-height: 54px;
  font-size: clamp(.66rem, 2.6vw, .83rem); border-radius: 19px; gap: 2px;
  padding: 4px 0; color: #123e76; background: transparent;
  transition: transform 165ms ease-out; font-weight: 680;
}
.nav button[aria-current="page"] {
  background: #ffe275; color: #123e76;
  box-shadow: 0 2px 8px #9c720126, inset 0 1px 0 #ffffffbc;
}
.nav button:active { transform: scale(.94); }
.nav-glyph { width: 30px; height: 29px; display: grid; place-items: center; }
.nav .nav-icon { width: 24px; height: 24px; display: block; object-fit: contain; margin: 0; }
.nav-motion button[aria-current="page"] .nav-glyph { animation: dock-select 340ms ease-out both; }
@keyframes dock-select {
  0% { transform: translateY(2px) scale(.87); }
  58% { transform: translateY(-3px) scale(1.1); }
  100% { transform: none; }
}
.sync-status { display: flex; align-items: center; gap: 7px; text-align: right; }
.sync-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #0057b72e; box-shadow: 0 0 0 3px #0057b707; }
[data-sync="busy"] .sync-dot { animation: sync-pulse 800ms ease-in-out infinite alternate; }
@keyframes sync-pulse { to { box-shadow: 0 0 0 7px #674e1632; opacity: .5; } }
.auth-actions { margin-top: 7px; }
.bank-wallets { margin: 0; padding-inline-start: 23px; font-size: .92rem; }
@media (hover: hover) {
  .button:hover { box-shadow: inset 0 1px 0 #fff9, 0 5px 16px #fff0a7; }
  .nav button:not([aria-current="page"]):hover { background: #f7eab2; }
}
@media (max-width: 380px) {
  .nav { width: calc(100% - 14px); }
  .nav button { font-size: .68rem; }
  .toolbar { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.nav button > span:last-child { white-space: nowrap; }
@media (max-width: 340px) {
  .nav { width: calc(100% - 8px); gap: 1px; padding-inline: 2px; }
  .nav button { font-size: .63rem; }
}

.user-entry { padding: 10px; border: 1px solid var(--border); border-radius: 13px; }
.user-entry .small { margin-inline-start: 8px; }
