:root {
  color-scheme: light;
  --green: #0b8f62;
  --green-dark: #08724f;
  --green-soft: #eaf7f1;
  --red: #d64545;
  --red-soft: #fff0f0;
  --ink: #17221e;
  --muted: #6f7b76;
  --line: #e7ece9;
  --surface: #ffffff;
  --background: #f5f8f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.screen { min-height: 100dvh; }

.login-screen { display: grid; place-items: center; padding: 28px 20px; background: radial-gradient(circle at top, #dff5ea 0, var(--background) 42%); }
.login-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 30px 24px; box-shadow: 0 18px 55px rgba(20, 61, 45, .1); }
.brand-mark { width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 16px; color: white; background: var(--green); font-size: 30px; font-weight: 800; box-shadow: 0 10px 24px rgba(11, 143, 98, .28); }
.login-card h1 { text-align: center; margin: 0; font-size: 31px; }
.login-card > .muted { text-align: center; margin: 8px 0 26px; }
label { display: block; margin: 15px 0 7px; font-size: 14px; font-weight: 700; }
input { width: 100%; height: 52px; border: 1px solid #dbe3df; border-radius: 14px; padding: 0 15px; outline: none; background: #fbfdfc; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11, 143, 98, .12); }
.primary-button, .secondary-button { width: 100%; min-height: 52px; border-radius: 14px; font-weight: 800; }
.primary-button { margin-top: 22px; border: 0; color: white; background: var(--green); }
.primary-button:disabled { opacity: .6; }
.secondary-button { margin-top: 18px; color: var(--red); background: var(--surface); border: 1px solid #f1cccc; }
.help-text { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

.app-screen { max-width: 680px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(94px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.eyebrow { color: var(--green); font-weight: 800; font-size: 14px; }
.topbar h2 { margin: 3px 0 0; font-size: 25px; }
.icon-button { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--green); font-size: 25px; }
.icon-button.loading { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.balance-card { padding: 22px; border-radius: 24px; color: white; background: linear-gradient(145deg, var(--green), var(--green-dark)); box-shadow: 0 16px 38px rgba(11, 143, 98, .24); }
.balance-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-weight: 650; }
.balance-value { display: block; margin: 23px 0 10px; font-size: clamp(38px, 10vw, 54px); letter-spacing: -1.5px; }
.balance-card .positive-text, .balance-card .negative-text, .balance-card .neutral-text { color: white; }
.updated-text { opacity: .78; font-size: 13px; }
.status-pill { border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.status-pill.positive { color: #07563d; background: #d9f8e9; }
.status-pill.negative { color: #9e2f2f; background: #ffe1e1; }
.status-pill.neutral { color: #4d5954; background: #edf1ef; }

.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 27px 2px 12px; }
.section-heading h3 { margin: 0; font-size: 18px; }
.section-heading strong { color: var(--green); }
.days-list { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.day-row { min-height: 61px; display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-row small { display: block; margin-top: 3px; color: var(--muted); }
.positive-text { color: var(--green); }
.negative-text { color: var(--red); }
.neutral-text { color: var(--muted); }

.profile-card, .info-card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.profile-card { text-align: center; padding: 28px 20px; }
.profile-card h3 { margin: 13px 0 5px; font-size: 22px; }
.profile-card p { margin: 0; }
.avatar { width: 76px; height: 76px; margin: auto; border-radius: 24px; display: grid; place-items: center; color: white; background: var(--green); font-size: 31px; font-weight: 800; }
.info-card { margin-top: 16px; padding: 4px 16px; }
.info-card div { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.info-card div:last-child { border-bottom: 0; }
.info-card span { color: var(--muted); }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 680px); display: grid; grid-template-columns: 1fr 1fr; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.nav-button { display: grid; place-items: center; gap: 3px; min-height: 50px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.nav-button span { font-size: 21px; }
.nav-button.active { color: var(--green); }
.toast { position: fixed; z-index: 30; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -120px); width: min(calc(100% - 32px), 460px); padding: 13px 16px; color: white; background: #26332e; border-radius: 14px; text-align: center; transition: transform .25s ease; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.toast.show { transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .app-screen { padding-top: 30px; }
}
