:root {
  color-scheme: light;
  /* Palli: house-gecko jade, night jade, gecko-eye gold, cool sage paper */
  --bg: #F2F5F1; --card: #ffffff; --text: #13201A; --muted: #5B6A62; --faint: #93A39A;
  --line: #E1E8E2; --field: #EDF2EE; --accent: #0F7A57; --accent-ink: #ffffff;
  --gold: #E9B23A; --gold-soft: rgba(233, 178, 58, .16); --night: #0A2E24;
  --brand: radial-gradient(120% 140% at 100% 0%, #6EE7B72e 0%, transparent 55%), linear-gradient(140deg, #13906A 0%, #0D5E45 52%, #0A2E24 100%);
  --ease: cubic-bezier(.16, 1, .3, 1); --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --accent-soft: rgba(15, 122, 87, .10); --danger: #B42318; --danger-soft: rgba(180, 35, 24, .08);
  --warn: #A15C07; --warn-soft: rgba(233, 178, 58, .18); --good: #12804F; --good-soft: rgba(18, 128, 79, .10);
  --shadow: 0 24px 48px -14px rgba(10, 46, 36, .30), 0 2px 6px rgba(10, 46, 36, .06); --shadow-sm: 0 1px 2px rgba(10, 46, 36, .05), 0 6px 18px -8px rgba(10, 46, 36, .12);
  --radius: 18px; --field-h: 48px; --nav-h: 64px; --side-w: 232px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #0C1411; --card: #131D19; --text: #E6EEE9; --muted: #96A69D; --faint: #66766D;
  --line: #22302A; --field: #0F1915; --accent: #3CCB94; --accent-ink: #052A1D; --accent-soft: rgba(60, 203, 148, .13);
  --gold: #F0C05A; --gold-soft: rgba(240, 192, 90, .14); --night: #0A2E24;
  --danger: #F97066; --danger-soft: rgba(249, 112, 102, .12); --warn: #F0C05A; --warn-soft: rgba(240, 192, 90, .13); --good: #4ADE9B; --good-soft: rgba(74, 222, 155, .12);
  --shadow: 0 24px 48px -12px rgba(0, 0, 0, .7); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --brand: radial-gradient(120% 140% at 100% 0%, #6EE7B724 0%, transparent 55%), linear-gradient(140deg, #127D5C 0%, #0B4A37 55%, #072219 100%); } }
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #0C1411; --card: #131D19; --text: #E6EEE9; --muted: #96A69D; --faint: #66766D;
  --line: #22302A; --field: #0F1915; --accent: #3CCB94; --accent-ink: #052A1D; --accent-soft: rgba(60, 203, 148, .13);
  --gold: #F0C05A; --gold-soft: rgba(240, 192, 90, .14); --night: #0A2E24;
  --danger: #F97066; --danger-soft: rgba(249, 112, 102, .12); --warn: #F0C05A; --warn-soft: rgba(240, 192, 90, .13); --good: #4ADE9B; --good-soft: rgba(74, 222, 155, .12);
  --shadow: 0 24px 48px -12px rgba(0, 0, 0, .7); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --brand: radial-gradient(120% 140% at 100% 0%, #6EE7B724 0%, transparent 55%), linear-gradient(140deg, #127D5C 0%, #0B4A37 55%, #072219 100%); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { html { scroll-padding-bottom: 24px; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
.num, .amt, .hero-big, .d-hero .amt { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
[hidden] { display: none !important; }
button { font: inherit; border: 0; border-radius: 10px; cursor: pointer; color: inherit; background: none; padding: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
svg { display: block; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ================= auth ================= */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; flex: none; }
.brand h1 { font-size: 1.5rem; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.auth form { display: grid; gap: 14px; }
.auth .alt { text-align: center; font-size: .92rem; color: var(--muted); }
.auth .alt button { color: var(--accent); font-weight: 600; padding: 6px; }
.perks { display: grid; gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }

/* ================= shell ================= */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--card); background: color-mix(in srgb, var(--card) 82%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); border-top: 1px solid var(--line); padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left)); }
.nav-in { max-width: 640px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.nav .brand { display: none; }
.nav-tab { text-decoration: none; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 500; border-radius: 0; position: relative; }
.nav-tab svg { width: 24px; height: 24px; position: relative; z-index: 1; transition: transform .25s var(--ease); }
.nav-tab span { position: relative; z-index: 1; }
@media (max-width: 899px) {
  .nav-tab::before { content: ""; position: absolute; top: 9px; left: 50%; width: 56px; height: 30px; border-radius: 15px; background: var(--accent-soft); transform: translateX(-50%) scaleX(.4); opacity: 0; transition: transform .35s var(--ease), opacity .2s; }
  .nav-tab[aria-current="page"]::before { transform: translateX(-50%) scaleX(1); opacity: 1; }
  .nav-tab[aria-current="page"] svg { transform: translateY(-1px); }
}
.nav-tab[aria-current="page"] { color: var(--accent); }
.nav-tab .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.nav-create { justify-self: center; width: 54px; height: 54px; border-radius: 19px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px #0F7A57cc, inset 0 1px 0 #ffffff33; }
.nav-create svg { width: 26px; height: 26px; }
.nav-create .lbl { display: none; }
#view { max-width: 640px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
@media (min-width: 900px) {
  .nav { top: 0; right: auto; width: var(--side-w); border-top: 0; border-right: 1px solid var(--line); padding: 20px 14px; }
  .nav-in { height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: none; }
  .nav .brand { display: flex; margin: 0 6px 18px; order: -2; } .nav .brand .logo { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 11px; } .nav .brand h1 { font-size: 1.15rem; }
  .nav-tab { flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: .95rem; }
  .nav-tab[aria-current="page"] { background: var(--accent-soft); }
  .nav-tab .badge { position: static; margin-left: auto; }
  .nav-create { order: -1; width: 100%; height: 46px; border-radius: 12px; display: flex; gap: 8px; justify-content: center; font-weight: 600; margin-bottom: 12px; }
  .nav-create svg { width: 22px; height: 22px; } .nav-create .lbl { display: inline; }
  #view { margin-left: calc(var(--side-w) + max(24px, (100vw - var(--side-w) - 720px) / 2)); max-width: 720px; padding-bottom: 48px; }
}

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 60px; margin: 0 -16px 8px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.top h1 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .back { margin-left: -8px; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.bordered { border: 1px solid var(--line); background: var(--card); }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.sync-pill.ok i { background: var(--good); } .sync-pill.busy i { background: var(--warn); } .sync-pill.err i { background: var(--danger); }

/* ================= building blocks ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.card > h3, .sec-h { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.sec-h { margin: 18px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-h a, .sec-h button { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--accent); font-weight: 500; text-decoration: none; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: .85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  width: 100%; min-width: 0; max-width: 100%; height: var(--field-h); margin: 0; display: block; -webkit-appearance: none; appearance: none;
}
textarea { padding: 10px 12px; height: auto; min-height: 80px; resize: vertical; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type="date"] { line-height: var(--field-h); }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.45em; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; margin: 0; cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.money { position: relative; }
.money::before { content: var(--sym, "₹"); position: absolute; left: 12px; top: 0; bottom: 0; display: flex; align-items: center; line-height: 1; color: var(--muted); pointer-events: none; }
.money input { padding-left: calc(18px + var(--symw, 10px)); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.btn { height: var(--field-h); padding: 0 18px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px #0F7A5799, inset 0 1px 0 #ffffff26; }
.btn.secondary { border: 1px solid var(--line); background: var(--card); font-weight: 500; }
.btn.danger { border: 1px solid var(--line); color: var(--danger); font-weight: 500; background: var(--card); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.link { color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; }
.link svg { width: 16px; height: 16px; }
.err { color: var(--danger); font-size: .88rem; margin: 0; } .err:empty { display: none; }
.note-box { background: var(--field); border-radius: 12px; padding: 12px 14px; font-size: .88rem; color: var(--muted); }
.note-box b { color: var(--text); }
.note-box.warn { background: var(--warn-soft); color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text); }
.chip svg { width: 14px; height: 14px; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { height: 36px; border-radius: 9px; font-size: .88rem; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.bar { height: 8px; border-radius: 99px; background: var(--field); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar.over > i { background: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--field); color: var(--muted); white-space: nowrap; }
.pill.open { background: var(--accent-soft); color: var(--accent); } .pill.submitted { background: var(--warn-soft); color: var(--warn); } .pill.reimbursed { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill svg { width: 12px; height: 12px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ================= expense rows ================= */
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ghead { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px 2px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.mhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 18px 4px 8px; }
.mhead b { font-size: 1rem; } .mhead span { color: var(--muted); font-size: .9rem; }
ul.rows { list-style: none; margin: 0; padding: 2px 4px 4px; }
.erow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; position: relative; }
.erow + .erow::before { content: ""; position: absolute; left: 62px; right: 10px; top: 0; border-top: 1px solid var(--line); }
.erow:hover { background: var(--accent-soft); }
.erow:hover::before, .erow:hover + .erow::before, .erow.sel::before, .erow.sel + .erow::before { border-color: transparent; }
.erow.sel { background: var(--accent-soft); }
.erow .ck { display: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--faint); place-items: center; color: var(--accent-ink); }
.selecting .erow .ck { display: grid; }
.erow.sel .ck { background: var(--accent); border-color: var(--accent); }
.erow .ck svg { width: 14px; height: 14px; }
.selecting .erow { grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
.cat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; line-height: 1; position: relative; overflow: hidden; flex: none; }
.cat-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.erow .mid { min-width: 0; }
.erow .mid b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erow .mid small { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .8rem; overflow: hidden; white-space: nowrap; }
.erow .mid small span { overflow: hidden; text-overflow: ellipsis; }
.erow .mid small svg { width: 13px; height: 13px; flex: none; }
.erow .end { text-align: right; }
.erow .amt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.erow .end small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.erow .flags { display: flex; gap: 4px; justify-content: flex-end; margin-top: 2px; }
.scanning-txt { color: var(--accent); }
.erow .amt.office { color: var(--muted); font-weight: 500; }
.office-note { color: var(--accent); font-weight: 500; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cat-grid button { display: grid; justify-items: center; gap: 6px; padding: 10px 2px; border-radius: 12px; font-size: .74rem; line-height: 1.2; text-align: center; color: var(--text); border: 1px solid transparent; }
.cat-grid button:hover { background: var(--accent-soft); }
.cat-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat-grid .ce { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; }
.cat-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.office-line { width: 100%; text-align: left; border-radius: 0; align-items: center; display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.office-line b { color: var(--accent); }
@keyframes pulse { 50% { opacity: .45; } }
.erow.scanning .cat-ico, .erow.scanning .mid b { animation: pulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .erow.scanning .cat-ico, .erow.scanning .mid b { animation: none; } }

/* ================= home ================= */
.hero { display: grid; gap: 12px; }
.hero .label { font-size: .82rem; color: var(--muted); }
.hero .big { font-size: clamp(1.8rem, 9vw, 2.4rem); font-weight: 750; line-height: 1.1; white-space: nowrap; letter-spacing: -.01em; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hero-side { text-align: right; } .hero-side b { display: block; font-size: 1.05rem; white-space: nowrap; }
.budget-line { display: flex; justify-content: space-between; gap: 4px 8px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.budget-line b { color: var(--text); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.quick button { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px 10px; display: grid; justify-items: center; gap: 6px; font-size: .78rem; font-weight: 500; color: var(--text); }
.quick button span.i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.quick svg { width: 22px; height: 22px; }
.todo { display: grid; gap: 8px; margin-bottom: 12px; }
.todo button { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.todo .ti { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.todo .ti.good { background: var(--good-soft); color: var(--good); } .todo .ti.acc { background: var(--accent-soft); color: var(--accent); }
.todo .ti svg { width: 20px; height: 20px; }
.todo b { display: block; font-weight: 600; font-size: .95rem; } .todo small { color: var(--muted); font-size: .82rem; }
.todo .chev { color: var(--faint); } .todo .chev svg { width: 18px; height: 18px; }

/* ================= spend ================= */
.searchbar { position: relative; margin-bottom: 10px; }
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.searchbar input { padding-left: 40px; }
.filters { margin-bottom: 10px; }
.res-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 4px 8px; font-size: .88rem; color: var(--muted); }
.res-h b { color: var(--text); }
.bulkbar { position: fixed; z-index: 31; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); max-width: 616px; margin: 0 auto;
  background: var(--text); color: var(--bg); border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.bulkbar .cnt { flex: 1; min-width: 0; font-size: .88rem; } .bulkbar .cnt b { display: block; font-size: .95rem; }
.bulkbar button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--bg); }
.bulkbar button:hover { background: rgba(127, 127, 127, .2); }
.bulkbar button svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .bulkbar { bottom: 20px; left: calc(var(--side-w) + 24px); } }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.cal-title { font-size: 1.08rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; margin-left: -8px; white-space: nowrap; }
.cal-title svg { width: 16px; height: 16px; color: var(--muted); }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav .icon-btn { border: 1px solid var(--line); background: var(--card); }
.today-btn { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .85rem; color: var(--muted); background: var(--card); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-week { font-size: .72rem; color: var(--muted); text-align: center; margin-bottom: 4px; }
.cal-grid { touch-action: pan-y; }
.cday { height: clamp(46px, 12.5vw, 62px); min-width: 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; padding-top: 6px; gap: 2px; font-size: .9rem; position: relative; }
.cday small { font-size: .62rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; }
.cday.out { visibility: hidden; }
.cday.has { background: var(--accent-soft); background: color-mix(in srgb, var(--accent) calc(var(--h, 0) * 34% + 8%), transparent); }
.cday.has small { color: var(--text); font-weight: 600; }
.cday.today > span { color: var(--accent); font-weight: 800; }
.cday.today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cday.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.cday.future > span { color: var(--faint); }
.cal-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.cal-sum b { color: var(--text); }
.picker-year { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picker-year input { text-align: center; font-weight: 700; font-size: 1.1rem; height: 44px; width: 7em; }
.picker-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.picker-months button { height: 54px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; align-content: center; line-height: 1.2; }
.picker-months button small { font-size: .7rem; color: var(--muted); }
.picker-months button[aria-current="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* insights */
.period { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.period b { font-size: 1rem; text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.kpi { background: var(--field); border-radius: 12px; padding: 10px; min-width: 0; }
.kpi span { display: block; font-size: .72rem; color: var(--muted); }
.kpi b { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { font-size: .85rem; font-weight: 600; } .delta.up { color: var(--danger); } .delta.down { color: var(--good); }
.chart { display: block; }
.chart .b { fill: var(--accent); opacity: .85; } .chart .b.max { opacity: 1; } .chart .b.sel { fill: var(--warn); opacity: 1; } .chart .b0 { fill: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .avg { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.chart-tip { font-size: .85rem; color: var(--muted); min-height: 1.3em; margin-top: 4px; }
.chart-tip b { color: var(--text); }
.brk { display: grid; gap: 12px; }
.brk-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.brk-row .cat-ico { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
.brk-row .t { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; margin-bottom: 5px; }
.brk-row .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.brk-row .t span:last-child { color: var(--muted); flex: none; }
.brk-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.plain li:first-child { border-top: 0; padding-top: 0; } .plain li:last-child { padding-bottom: 0; }
.plain li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.plain li small { color: var(--muted); margin-left: 4px; }
.plain li b { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ================= detail ================= */
.d-hero { text-align: center; padding: 8px 0 4px; }
.d-hero .cat-ico { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; margin: 0 auto 10px; }
.d-hero .amt { font-size: clamp(2rem, 10vw, 2.6rem); font-weight: 750; line-height: 1.1; letter-spacing: -.01em; }
.d-hero .sub { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.d-hero .flags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.rimg { display: block; width: 100%; max-height: 340px; object-fit: contain; background: var(--field); border-radius: 12px; cursor: zoom-in; }
.rimg-empty { display: grid; place-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .9rem; width: 100%; }
.rimg-empty svg { width: 26px; height: 26px; color: var(--accent); }
.flist { display: grid; }
.frow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); text-align: left; width: 100%; border-radius: 0; }
.frow:first-child { border-top: 0; }
.frow > svg { width: 20px; height: 20px; color: var(--muted); }
.frow span { min-width: 0; } .frow span small { display: block; color: var(--muted); font-size: .78rem; }
.frow span b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.frow span b.ph { color: var(--faint); font-weight: 400; }
.frow .chev { color: var(--faint); } .frow .chev svg { width: 16px; height: 16px; }
.frow .switch { margin-left: 8px; }
.thread { display: grid; gap: 10px; }
.msg { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; font-size: .9rem; }
.msg .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.msg .av.sys { background: var(--field); color: var(--muted); } .msg .av svg { width: 15px; height: 15px; }
.msg small { color: var(--muted); font-size: .75rem; margin-left: 6px; }
.msg.sys .tx { color: var(--muted); }
.msg .tx { overflow-wrap: anywhere; white-space: pre-wrap; }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input { height: 44px; }
.composer .btn { height: 44px; }
.ri { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ri:last-child { border-bottom: 0; }
.ri .n { min-width: 0; overflow-wrap: anywhere; } .ri .n small { color: var(--muted); margin-left: 4px; white-space: nowrap; }
.ri .p { font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.totals .ri { border: 0; padding: 4px 0; color: var(--muted); }
.totals .ri.grand { color: var(--text); font-weight: 700; font-size: 1.02rem; padding-top: 8px; }
.totals .ri.gap { color: var(--warn); }
.fix { margin-top: 10px; width: 100%; height: 42px; border: 1px dashed var(--accent); color: var(--accent); font-size: .9rem; border-radius: 10px; }
.er { display: grid; grid-template-columns: minmax(0, 1fr) 3.4em 6.5em 36px; gap: 6px; align-items: center; padding: 4px 0; }
.er.tax { grid-template-columns: minmax(0, 1fr) 6.5em 36px; }
.er input { height: 42px; padding: 0 10px; border-radius: 8px; }
.er .money::before { left: 9px; } .er .money input { padding-left: 22px; }
.er .q { text-align: center; padding: 0 4px; }
.rm { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.rm:hover { color: var(--danger); } .rm svg { width: 16px; height: 16px; }
.er-head { display: grid; grid-template-columns: minmax(0, 1fr) 3.4em 6.5em 36px; gap: 6px; font-size: .72rem; color: var(--muted); padding: 0 2px; }
@media (max-width: 420px) {
  .er:not(.tax) { grid-template-columns: 3.2em minmax(0, 1fr) 36px; grid-template-areas: "n n n" "q p r"; row-gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .er:not(.tax) .nm { grid-area: n; } .er:not(.tax) .q { grid-area: q; } .er:not(.tax) .money { grid-area: p; } .er:not(.tax) .rm { grid-area: r; }
  .er-head { display: none; }
}
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: grid; place-items: center; overflow: auto; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; touch-action: pinch-zoom; }
.viewer button { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; }
.viewer button svg { width: 22px; height: 22px; }

/* ================= reports / splits / account ================= */
.rcard { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); border-radius: 0; }
.rcard:first-child { border-top: 0; }
.rcard .ri-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.rcard .ri-ico svg { width: 20px; height: 20px; }
.rcard b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard small { color: var(--muted); font-size: .8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rep-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.rep-actions .btn { padding: 0 8px; }
.rcard .end { text-align: right; font-weight: 600; white-space: nowrap; }
.bal-pos { color: var(--good); } .bal-neg { color: var(--danger); }
.set-list { display: grid; }
.set-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 2px; border-top: 1px solid var(--line); text-align: left; width: 100%; border-radius: 0; }
.set-row:first-child { border-top: 0; }
.set-row > svg { width: 20px; height: 20px; color: var(--muted); }
.set-row span small { display: block; color: var(--muted); font-size: .8rem; }
.set-row .val { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; max-width: 46vw; min-width: 0; }
.set-row .val > span { overflow: hidden; text-overflow: ellipsis; }
.set-row > span:nth-child(2) { min-width: 0; }
.set-row .val svg { width: 16px; height: 16px; color: var(--faint); }
.set-row.danger, .set-row.danger > svg { color: var(--danger); }
.ver { text-align: center; color: var(--faint); font-size: .75rem; margin: 16px 0; }

/* ================= sheets ================= */
dialog.sheet { border: 0; padding: 0; background: transparent; color: var(--text); width: 100%; max-width: 560px; max-height: 94dvh; margin: auto auto 0; }
dialog.sheet.center { margin: auto; width: calc(100% - 24px); max-width: 460px; max-height: calc(100dvh - 32px); }
@media (min-width: 640px) { dialog.sheet { margin: auto; width: calc(100% - 32px); } }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .45); }
dialog.sheet[open] { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
.sh { background: var(--card); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; max-height: 94dvh; overflow: hidden; box-shadow: var(--shadow); }
dialog.center .sh { border-radius: 20px; max-height: calc(100dvh - 32px); }
@media (min-width: 640px) { .sh { border-radius: 20px; } }
.grab { width: 40px; height: 4px; border-radius: 9px; background: var(--line); margin: 8px auto -4px; flex: none; }
@media (min-width: 640px) { .grab { display: none; } } dialog.center .grab { display: none; }
.sh-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 8px; flex: none; }
.sh-head h2 { font-size: 1.15rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-head p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.sh-body { overflow-y: auto; padding: 6px 18px 18px; display: grid; gap: 14px; overscroll-behavior: contain; align-content: start; }
.sh-foot { display: flex; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.sh-foot .btn { flex: 1; }
.sh-foot .btn.icon { flex: none; width: var(--field-h); padding: 0; }
.x { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); flex: none; margin-right: -8px; border-radius: 10px; }
.x svg { width: 20px; height: 20px; }
.menu { display: grid; gap: 4px; }
.menu button { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; padding: 10px 6px; border-radius: 12px; }
.menu button:hover { background: var(--accent-soft); }
.menu .mi { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.menu .mi svg { width: 22px; height: 22px; }
.menu b { display: block; font-weight: 600; } .menu small { color: var(--muted); font-size: .84rem; }
.menu button.danger, .menu button.danger .mi { color: var(--danger); } .menu button.danger .mi { background: var(--danger-soft); }
.amount-in { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); padding: 4px 0; }
.amount-in:focus-within { border-color: var(--accent); }
.amount-in input { border: 0; background: transparent; font-size: 2.2rem; font-weight: 700; height: 56px; padding: 0; outline: none; text-align: left; min-width: 0; }
.amount-in input:focus { outline: none; }
.cur-btn { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; flex: none; background: var(--card); }
.cur-btn svg { width: 14px; height: 14px; color: var(--muted); }
.conv { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.conv input { height: 34px; width: 7.5em; font-size: .9rem; padding: 0 8px; }
.inline-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inline-row > span { font-size: .95rem; } .inline-row > span small { display: block; color: var(--muted); font-size: .8rem; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5em 36px; gap: 8px; align-items: center; }
.share-row input { height: 42px; }
.share-row .money::before { left: 10px; } .share-row .money input { padding-left: 24px; }
.share-row .me { padding: 0 12px; height: 42px; display: flex; align-items: center; background: var(--field); border-radius: 10px; color: var(--muted); }

/* autocomplete */
.ac-wrap { position: relative; }
.ac { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: min(280px, 38vh); overflow-y: auto; overscroll-behavior: contain; display: none; padding: 4px 0; }
.ac.open { display: block; }
.ac-sec { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 14px 4px; }
.ac-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; cursor: pointer; }
.ac-opt b { font-weight: 700; } .ac-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-opt small { flex: none; color: var(--muted); font-size: .78rem; }
.ac-opt.active, .ac-opt:hover { background: var(--accent-soft); }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: .9rem; display: none; gap: 14px; align-items: center; box-shadow: var(--shadow); z-index: 200; }
.toast.show { display: flex; }
body:has(.bulkbar) .toast { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); }
.toast button { color: var(--bg); text-decoration: underline; font-weight: 600; flex: none; }
@media (min-width: 900px) { .toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); } }

@media (max-width: 360px) {
  .erow { gap: 10px; padding: 9px 8px; } .erow + .erow::before { left: 56px; }
  .cat-ico { width: 36px; height: 36px; font-size: 1.05rem; } .erow { grid-template-columns: 36px minmax(0, 1fr) auto; } .selecting .erow { grid-template-columns: 22px 36px minmax(0, 1fr) auto; }
  .erow .amt { font-size: .93rem; }
  .kpi { padding: 8px; } .kpi b { font-size: .88rem; }
  .quick button { font-size: .72rem; }
}
@media (max-width: 400px) {
  .row2.stack-sm { grid-template-columns: 1fr; }
  .cal-title { font-size: 1rem; } .cal-nav { gap: 4px; } .cal-nav .icon-btn { width: 36px; height: 36px; } .today-btn { height: 36px; padding: 0 8px; }
}
@media print {
  .nav, .top .icon-btn, .toast, .bulkbar, .no-print { display: none !important; }
  #view { margin: 0; padding: 0; max-width: none; }
  body { background: #fff; }
}

/* ================= Palli polish ================= */
.logo { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px #0F7A57; }
.logo svg { width: 58%; height: 58%; }
.sr { clip-path: inset(50%); }
/* hero card */
.hero-card { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 20px 18px; margin-bottom: 14px; color: #fff; background: var(--brand); box-shadow: 0 26px 44px -24px #0A2E24; isolation: isolate; }
.hero-card::after { content: ""; position: absolute; inset: auto -40px -70px auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #6EE7B726 0%, transparent 65%); z-index: -1; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .86rem; color: #D5EFE3cc; }
.hero-pill { background: #ffffff1f; border: 1px solid #ffffff26; padding: 4px 10px; border-radius: 99px; color: #F2F5F1; white-space: nowrap; }
.hero-pill b { font-weight: 650; margin-left: 2px; }
.hero-big { font-size: clamp(2.2rem, 11vw, 3rem); font-weight: 780; line-height: 1.05; margin: 8px 0 14px; letter-spacing: -.035em; white-space: nowrap; }
.hbar { height: 8px; border-radius: 99px; background: #ffffff26; overflow: hidden; }
.hbar > i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, #E9B23A, #F7D98B); transform-origin: left; animation: grow 1s var(--ease) both .1s; }
.hbar.warn > i { background: linear-gradient(90deg, #F59E0B, #FBBF24); } .hbar.over > i { background: linear-gradient(90deg, #fca5a5, #f87171); }
.hero-foot { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; margin-top: 10px; font-size: .84rem; color: #D5EFE3d9; }
.hero-foot b { color: #fff; font-weight: 650; }
.hero-link { color: #F2F5F1; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; margin-left: -4px; border-radius: 10px; background: #ffffff1a; }
.hero-link svg { width: 16px; height: 16px; }
.hero-office { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: #0000002b; color: #D5EFE3; font-size: .84rem; text-align: left; }
.hero-office b { color: #fff; }
/* bars animate in */
.bar > i { width: var(--w, 0); transform-origin: left; animation: grow .9s var(--ease) both .08s; transition: width .5s var(--ease); }
.bar.warn > i { background: var(--warn); } .bar.over > i { background: var(--danger); }
.bar.share > i { opacity: .85; }
.brk-row .sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }
@keyframes grow { from { transform: scaleX(0); } }
.todo .ti.bad { background: var(--danger-soft); color: var(--danger); }
/* budgets editor */
.bud-list { display: grid; gap: 2px; }
.bud-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 7.5em; gap: 10px; align-items: center; padding: 6px 0; }
.bud-row .cat-ico { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
.bud-n { min-width: 0; font-size: .93rem; } .bud-n small { display: block; color: var(--muted); font-size: .76rem; }
.bud-row input { height: 42px; }
/* fast form */
.form-sheet .amount-in { border-bottom-width: 2px; }
.form-sheet .amount-in input { font-size: 2.6rem; height: 64px; letter-spacing: -.03em; }
.amount-in.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.date-chip { position: relative; cursor: pointer; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.date-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.more-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 2px; border-top: 1px solid var(--line); border-radius: 0; color: var(--text); font-weight: 600; text-align: left; }
.more-toggle small { flex: 1; min-width: 0; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-toggle svg { width: 18px; height: 18px; color: var(--muted); transition: transform .25s var(--ease); }
.more-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.more-box { display: grid; gap: 14px; animation: rise .3s var(--ease); }
/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
#view.enter > * { animation: rise .5s var(--ease) both; }
#view.enter > *:nth-child(2) { animation-delay: .03s; } #view.enter > *:nth-child(3) { animation-delay: .06s; } #view.enter > *:nth-child(4) { animation-delay: .09s; }
#view.enter > *:nth-child(5) { animation-delay: .12s; } #view.enter > *:nth-child(6) { animation-delay: .15s; } #view.enter > *:nth-child(n+7) { animation-delay: .18s; }
.btn, .chip, .quick button, .todo button, .nav-create, .rcard, .set-row, .menu button, .cat-grid button, .cday, .icon-btn, .hero-link, .hero-office, .x, .rimg-empty, .more-toggle { transition: transform .14s var(--ease), background-color .15s, border-color .15s, box-shadow .2s; }
.btn:active, .chip:active, .quick button:active, .todo button:active, .nav-create:active, .menu button:active, .cat-grid button:active, .cday:active, .icon-btn:active, .hero-link:active, .x:active, .rimg-empty:active { transform: scale(.96); }
.erow { transition: background-color .15s, transform .14s var(--ease); } .erow:active, .rcard:active, .set-row:active, .hero-office:active { transform: scale(.985); }
.quick button { box-shadow: var(--shadow-sm); }
dialog.sheet[open] { animation: sheetIn .42s var(--ease); }
dialog.sheet.center[open] { animation: popIn .32s var(--ease); }
dialog.sheet[open]::backdrop { animation: fadeIn .3s ease; }
dialog.sheet.closing { animation: sheetOut .2s ease-in forwards; } dialog.sheet.center.closing { animation: popOut .16s ease-in forwards; }
dialog.sheet.closing::backdrop { animation: fadeOut .2s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(2, 6, 23, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes sheetIn { from { transform: translateY(100%); } } @keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes popIn { from { transform: scale(.94); opacity: 0; } } @keyframes popOut { to { transform: scale(.96); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.sh { border-radius: 26px 26px 0 0; } @media (min-width: 640px) { .sh { border-radius: 24px; } }
.toast.show { animation: toastIn .35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.erow.scanning .mid b { background: linear-gradient(90deg, var(--field) 25%, var(--line) 50%, var(--field) 75%); background-size: 200% 100%; color: transparent; border-radius: 6px; animation: shimmer 1.2s linear infinite; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.ac.open { animation: rise .2s var(--ease); }
.cat-grid button { transition: transform .14s var(--ease), background-color .15s; }
.chart .b, .chart .b0 { transform-box: fill-box; transform-origin: bottom; animation: barUp .7s var(--ease) both; }
@keyframes barUp { from { transform: scaleY(0); } }
.d-hero .cat-ico, .empty b { animation: rise .45s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, dialog.sheet[open], dialog.sheet.closing, dialog.sheet[open]::backdrop { animation: none !important; transition: none !important; }
}
.hero-big .paise { font-size: .5em; font-weight: 600; opacity: .7; letter-spacing: 0; margin-left: 1px; }

/* import: statements, SMS, automatic alerts */
.imp-card { display: grid; gap: 12px; }
.imp-h { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.imp-h b { display: block; font-size: 1.02rem; margin-top: 2px; }
.imp-h small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: 2px; }
.imp-h .mi, .imp-inbox .mi { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.imp-h .mi svg, .imp-inbox .mi svg { width: 22px; height: 22px; }
.imp-card .btn svg { width: 18px; height: 18px; }
.imp-inbox { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; gap: 12px; align-items: center; text-align: left; border-color: var(--accent); background: var(--accent-soft); animation: rise .45s var(--ease) both; }
.imp-inbox b { display: block; } .imp-inbox small { color: var(--muted); font-size: .85rem; } .imp-inbox > svg { width: 18px; height: 18px; color: var(--accent); }
.imp-err { margin-bottom: 12px; animation: shake .4s var(--ease); }
.imp-how { font-size: .88rem; color: var(--muted); }
.imp-how summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; list-style: none; }
.imp-how summary::-webkit-details-marker { display: none; }
.imp-how summary::after { content: " ›"; display: inline-block; transition: transform .2s var(--ease); }
.imp-how[open] summary::after { transform: rotate(90deg); }
.imp-how ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.45; }
.imp-how b, .steps b { color: var(--text); }
.imp-pw { display: grid; gap: 10px; } .imp-pw p { margin: 0; }
.imp-busy { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: popIn .2s var(--ease); }
.imp-busy.inline { position: static; background: none; backdrop-filter: none; padding: 24px 0; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp-sum { padding-bottom: 12px; }
.imp-big { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; display: block; }
.imp-links { display: flex; gap: 14px; margin-top: 6px; font-size: .88rem; }
.imp-row { grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
.imp-row:not(.sel) .cat-ico, .imp-row:not(.sel) .mid, .imp-row:not(.sel) .amt { opacity: .5; }
.imp-row .cat-ico { border: 0; cursor: pointer; transition: transform .15s var(--ease); }
.imp-row .cat-ico:active { transform: scale(.92); }
.imp-row .mid b { cursor: text; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.imp-row.in .amt { color: var(--good); }
.imp-row .ck { transition: background .15s, border-color .15s; }
.imp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.imp-foot { text-align: center; margin: 4px 12px 16px; }
#view:has(.imp-bar) { padding-bottom: calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); }
.imp-bar { position: fixed; z-index: 31; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); max-width: 616px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); animation: rise .35s var(--ease) both; }
.imp-bar .cnt { flex: 1; min-width: 0; font-size: .88rem; color: var(--muted); } .imp-bar .cnt b { display: block; font-size: .98rem; color: var(--text); }
.imp-bar .btn { min-width: 108px; }
body:has(.imp-bar) .toast { bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .imp-bar { bottom: 20px; left: calc(var(--side-w) + 24px); } #view:has(.imp-bar) { padding-bottom: 110px; } }
.steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 12px; line-height: 1.45; font-size: .92rem; }
.steps li > .btn { display: flex; margin-top: 8px; width: fit-content; }
.steps .btn svg, .sh-body > .btn svg { width: 16px; height: 16px; }
pre.code { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .74rem; line-height: 1.45; overflow: auto; max-height: 220px; white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
code { background: var(--field); border-radius: 6px; padding: 1px 5px; font-size: .88em; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .imp-inbox, .imp-bar, .imp-err, .imp-busy { animation: none; } }
.sh-body > .seg:first-child { margin-top: 2px; }
.imp-people { width: 100%; margin-top: 12px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 14px; background: var(--warn-soft); color: var(--text); }
.imp-people svg { width: 22px; height: 22px; color: var(--warn); justify-self: center; }
.imp-people b { display: block; font-size: .92rem; } .imp-people small { color: var(--muted); font-size: .8rem; }
.imp-people[aria-pressed="true"] { background: var(--accent-soft); } .imp-people[aria-pressed="true"] svg { color: var(--accent); }
.pill.ask { background: var(--warn-soft); color: var(--warn); border: 0; cursor: pointer; }
.imp-unread .raw { font-size: .8rem; background: var(--field); border-radius: 10px; padding: 8px 10px; margin: 8px 0; color: var(--muted); word-break: break-word; }
.ppl { display: grid; gap: 12px; }
.ppl-h { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ppl-h b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ppl-h small { color: var(--muted); font-size: .8rem; }
.ppl-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.ppl-cats .chip { height: 34px; font-size: .84rem; }
.ppl-each { font-size: .86rem; justify-self: start; }
.ppl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ppl-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; align-items: center; }
.ppl-list b { display: block; } .ppl-list small { color: var(--muted); font-size: .78rem; }

/* ================= Palli identity: gecko + display type ================= */
.top h1, .brand h1, .hero-big, .d-hero .amt, .hero .big, .sh-head h2, .imp-big, .mhead b, .cal-title, .empty b, .auth h2 { font-family: var(--display); font-optical-sizing: auto; }
.top h1 { font-size: 1.62rem; font-weight: 700; letter-spacing: -.025em; }
.hero-big { font-weight: 700; letter-spacing: -.03em; font-size: clamp(2.4rem, 12vw, 3.2rem); }
.d-hero .amt { font-weight: 700; letter-spacing: -.025em; }
.sh-head h2 { font-weight: 650; letter-spacing: -.015em; font-size: 1.22rem; }
.brand h1 { font-weight: 750; letter-spacing: -.03em; text-transform: lowercase; }
.logo { background: var(--brand); color: #F2F5F1; box-shadow: 0 10px 22px -12px #0A2E24, inset 0 1px 0 #ffffff26; }
.logo svg { width: 74%; height: 74%; }
.nav-create { background: var(--brand); box-shadow: 0 12px 26px -10px #0A2E24cc, inset 0 1px 0 #ffffff2e; }
/* hero: night jade with gecko-skin dots and the gecko resting in the corner */
.hero-card { background: radial-gradient(130% 120% at 0% 0%, #13906A 0%, transparent 60%), linear-gradient(160deg, #0E5A43 0%, #0A2E24 70%); color: #F2F5F1; }
.hero-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(circle, #ffffff12 1.2px, transparent 1.6px); background-size: 14px 14px; -webkit-mask-image: radial-gradient(120% 90% at 100% 100%, #000 0%, transparent 70%); mask-image: radial-gradient(120% 90% at 100% 100%, #000 0%, transparent 70%); }
.hero-card::after { background: radial-gradient(circle, #E9B23A1f 0%, transparent 65%); }
.hero-gecko { position: absolute; right: -14px; bottom: -18px; width: 132px; height: 132px; color: #ffffff12; transform: rotate(-28deg); z-index: -1; pointer-events: none; animation: geckoIn 1.1s var(--ease) both .25s; }
.hero-gecko svg { width: 100%; height: 100%; }
@keyframes geckoIn { from { transform: translate(40px, 50px) rotate(-8deg); opacity: 0; } }
.hero-pill { background: #ffffff17; border-color: #ffffff22; }
.erow .amt, .ghead span:last-child { font-family: var(--font); }
@media (prefers-reduced-motion: reduce) { .hero-gecko { animation: none; } }
.auth { background: radial-gradient(90% 60% at 50% 0%, var(--accent-soft) 0%, transparent 70%), var(--bg); }
.auth .brand { flex-direction: column; text-align: center; gap: 14px; }
.auth .brand .logo { width: 76px; height: 76px; border-radius: 22px; }
.auth .brand h1 { font-size: 2.3rem; }
.ver { font-family: var(--display); }
.hero-gecko { right: -34px; bottom: -58px; width: 158px; height: 158px; transform: rotate(-38deg); color: #ffffff14; }
.hero-gecko circle[fill] { opacity: .75; }
@keyframes geckoIn { from { transform: translate(46px, 60px) rotate(-20deg); opacity: 0; } }
.hero-top, .hero-big, .hbar, .hero-foot, .hero-link, .hero-office { position: relative; }
.sec-h { font-family: var(--display); font-size: 1.06rem; font-weight: 650; letter-spacing: -.012em; text-transform: none; color: var(--text); }
.sec-h a, .sec-h button { font-family: var(--font); }
.hero-gecko { right: -44px; bottom: -40px; width: 136px; height: 136px; transform: rotate(-62deg); }
.hero-gecko circle[fill] { opacity: .5; }
@keyframes geckoIn { from { transform: translate(46px, 40px) rotate(-40deg); opacity: 0; } }

/* ================= money out / money in ================= */
.quick.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick .flow-btn { display: grid; grid-template-columns: 44px minmax(0, 1fr); justify-items: start; align-items: center; gap: 12px; text-align: left; padding: 14px; font-size: 1rem; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease); min-width: 0; }
.flow-btn:active { transform: scale(.97); }
.flow-btn .fi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.flow-btn .fi svg { width: 22px; height: 22px; }
.flow-btn b { display: block; font-family: var(--display); font-size: 1.12rem; font-weight: 650; letter-spacing: -.015em; }
.flow-btn small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-btn.out .fi { background: var(--accent-soft); color: var(--accent); }
.flow-btn.in .fi { background: var(--gold-soft); color: #9A6B00; }
:root[data-theme="dark"] .flow-btn.in .fi { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flow-btn.in .fi { color: var(--gold); } }
.hero-in { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: #ffffff14; color: #D5EFE3; font-size: .86rem; text-align: left; }
.hero-in b { color: #fff; font-weight: 650; } .hero-in span:first-child b { color: #F7D98B; }
.hero-in svg { width: 16px; height: 16px; opacity: .7; }
.in-amt, .in-note, .imp-row.in .amt { color: var(--good); }
.in-note { font-weight: 600; }
.in-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.in-sum small { display: block; color: var(--muted); font-size: .78rem; }
.in-sum b { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-sum b.good { color: var(--good); } .in-sum b.bad { color: var(--danger); }
.in-rows { padding: 4px; list-style: none; margin: 0 0 12px; }
.amount-in.in .in-sign { font-size: 1.6rem; font-weight: 700; color: var(--good); }
.amount-in.in:focus-within { border-color: var(--good); }
.in-btn { background: var(--good); }
.chk-list { list-style: none; margin: 0; padding: 0; }
.chk-list .erow { grid-template-columns: 22px minmax(0, 1fr) auto; } .chk-list .erow .ck { display: grid; }
.amount-in.in .in-sign { white-space: nowrap; flex: none; line-height: 1; }
.in-sum b { font-size: clamp(.98rem, 4.4vw, 1.18rem); }
.per-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--field); text-align: left; margin-bottom: 4px; }
.per-row span { color: var(--muted); font-size: .88rem; } .per-row b { font-weight: 600; font-size: .92rem; } .per-row svg { width: 16px; height: 16px; color: var(--muted); }
.hero-budget { display: block; width: 100%; text-align: left; color: inherit; padding: 0; border-radius: 10px; }
.hero-set { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; margin-left: -2px; border-radius: 99px; background: #ffffff14; color: #D5EFE3; font-size: .84rem; font-weight: 500; position: relative; }
.hero-set svg { width: 14px; height: 14px; }
.cur-chips { margin-top: 10px; }
.cur-chip { height: 32px; font-size: .84rem; font-variant-numeric: tabular-nums; }
.cur-chip svg { width: 14px; height: 14px; }
.cur-btn span { white-space: nowrap; }
.amount-in.in .in-sign { font-size: 1.8rem; }
.fx-stale { flex-basis: 100%; color: var(--warn); font-size: .8rem; }
