:root {
  --ink: #271d18;
  --muted: #70655f;
  --paper: #f8f5f1;
  --cell: #efebe6;
  --red: #a12e31;
  --red-bg: #f9dada;
  --green: #075d2a;
  --green-bg: #dcefd4;
  --line: #d7d0ca;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 50% 0%, #fff 0, var(--paper) 52%, #eee8e2 100%); font-family: Georgia, "Times New Roman", serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 600px); min-height: 100vh; margin: auto; padding: max(28px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
.auth-shell { width: min(100%, 510px); min-height: 100vh; margin: auto; padding: max(28px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
.app-header { text-align: center; padding: 8px 0 25px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-family: Arial, sans-serif; font-size: .65rem; font-weight: 700; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2.5rem, 11vw, 4.3rem); line-height: .95; letter-spacing: -.055em; }
.auth-intro { max-width: 320px; margin: 18px auto 0; color: var(--muted); font-size: 1.05rem; line-height: 1.4; }
.auth-card { padding: 8px 22px 24px; border: 1px solid rgba(156, 143, 133, .35); border-radius: 20px; background: rgba(255,255,255,.76); box-shadow: 0 13px 34px rgba(61,45,34,.09); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -1px -22px 25px; border-bottom: 1px solid var(--line); }
.auth-tab { min-height: 52px; border: 0; border-bottom: 3px solid transparent; padding: 8px; color: var(--muted); background: transparent; font-size: .94rem; font-weight: 700; }.auth-tab.active { border-bottom-color: var(--green); color: var(--ink); }.auth-tab:focus-visible { outline: 3px solid #1d5886; outline-offset: -3px; }
.auth-form h2 { margin: 0 0 20px; font-size: 1.75rem; letter-spacing: -.035em; }.field-help { margin: 5px 0 0; color: var(--muted); font-family: Arial, sans-serif; font-size: .76rem; }.form-message { min-height: 1.2em; margin: 4px 0 14px; color: var(--red); font-family: Arial, sans-serif; font-size: .82rem; }.form-message.success { color: var(--green); }
.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin: -6px 0 15px; color: var(--muted); font-family: Arial, sans-serif; font-size: .75rem; text-align: left; }.account-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.logout-button { flex: 0 0 auto; border: 0; border-bottom: 1px solid currentColor; padding: 3px 0; color: var(--ink); background: transparent; font: inherit; font-weight: 700; }.logout-button:focus-visible { outline: 3px solid #1d5886; outline-offset: 3px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-card { min-height: 159px; border: 0; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 1.55rem; font-weight: 700; transition: transform .15s, box-shadow .15s; }
.action-card:active { transform: scale(.975); }
.action-card:focus-visible, .icon-button:focus-visible, .close-button:focus-visible, input:focus-visible, .save-button:focus-visible { outline: 3px solid #1d5886; outline-offset: 3px; }
.action-card.expense { color: var(--red); background: var(--red-bg); }
.action-card.income { color: var(--green); background: var(--green-bg); }
.symbol { font-family: Arial, sans-serif; font-size: 5rem; font-weight: 400; line-height: .5; }
.calendar-section { margin-top: 34px; }
.month-navigation { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin-bottom: 22px; }
.month-navigation h2 { margin: 0; text-align: center; font-size: clamp(1.55rem, 7vw, 2.25rem); letter-spacing: -.04em; }
.icon-button, .close-button { color: var(--ink); background: transparent; border: 0; line-height: 1; }
.icon-button { width: 48px; height: 48px; font-family: Arial, sans-serif; font-size: 3rem; font-weight: 200; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.weekdays { margin-bottom: 9px; color: #675e59; font-size: .92rem; font-weight: 700; text-align: center; }
.calendar-day { position: relative; aspect-ratio: .9; min-height: 48px; border: 0; border-radius: 10px; padding: 7px 3px 5px; color: var(--ink); background: var(--cell); font-size: 1rem; font-weight: 700; text-align: center; }
.calendar-day.empty { pointer-events: none; opacity: .43; }
.calendar-day.positive { color: #075b29; background: var(--green-bg); }
.calendar-day.negative { color: var(--red); background: var(--red-bg); }
.calendar-day.is-today::after { position: absolute; inset: 2px; border: 3px solid #075b38; border-radius: 8px; content: ""; pointer-events: none; }
.balance-mark { display: block; margin-top: 2px; font-family: Arial, sans-serif; font-size: 1.35rem; line-height: 1; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 27px; margin: 31px 0 6px; color: #3f3630; font-size: .93rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 17px; height: 17px; border-radius: 5px; display: inline-block; }.legend-dot.positive { background: var(--green-bg); }.legend-dot.negative { background: var(--red-bg); }.legend-dot.neutral { background: var(--cell); }
.sync-status { min-height: 1.2em; margin: 16px 0 0; color: var(--muted); font-family: Arial, sans-serif; font-size: .73rem; text-align: center; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; background: rgba(22, 19, 17, .58); backdrop-filter: blur(2px); }
.movement-modal { position: fixed; z-index: 11; right: 0; bottom: 0; left: 0; width: min(100%, 630px); margin: auto; padding: 10px 25px calc(26px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; color: var(--ink); background: #fffdfb; box-shadow: 0 -8px 35px rgba(0,0,0,.2); animation: slide-up .24s ease-out; }
.modal-handle { width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 8px; background: #d4cdc7; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.modal-heading h2 { margin-bottom: 23px; font-size: 2.2rem; letter-spacing: -.045em; }.close-button { margin-top: -20px; padding: 6px; font-family: Arial, sans-serif; font-size: 2.7rem; }
.field { margin-bottom: 16px; }.field label { display: block; margin-bottom: 6px; font-size: 1.05rem; font-weight: 700; }.field input { width: 100%; height: 49px; border: 1px solid #bcb6b1; border-radius: 10px; padding: 9px 13px; color: var(--ink); background: #fff; font-size: 1.1rem; }.amount-input { position: relative; }.amount-input input { padding-right: 42px; }.amount-input span { position: absolute; top: 13px; right: 15px; font-weight: 700; }.field-error { min-height: 1.1em; margin: 5px 0 0; color: var(--red); font-family: Arial, sans-serif; font-size: .78rem; }.today-line { display: flex; gap: 11px; align-items: center; margin: 24px 0; color: #5d554f; font-size: 1rem; }.today-line span:first-child { font-family: Arial, sans-serif; font-size: 1.3rem; }.save-button { width: 100%; min-height: 57px; border: 0; border-radius: 12px; padding: 10px 18px; color: #fff; background: var(--green); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); font-size: 1.32rem; font-weight: 700; }.save-button.expense { background: var(--red); }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 650px) { body { padding: 22px 0; }.app-shell { min-height: auto; border-radius: 25px; background: rgba(255,255,255,.58); box-shadow: 0 12px 40px rgba(61,45,34,.12); }.movement-modal { bottom: 22px; border-radius: 24px; } }
@media (max-width: 370px) { .app-shell { padding-inline: 13px; }.calendar-day { font-size: .9rem; }.weekdays { font-size: .78rem; }.action-card { min-height: 140px; } }
