/* Upwork-style: grey sidebar, white content panel, flat grey blocks instead of outlined cards,
   faint dividers, green for actions, one black feature card, one soft lime gradient for reminders. */
:root {
  --ink: #181818;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #ececec;
  --line-2: #e0e0e0;
  --side: #f2f4f5;
  --panel: #f7f7f7;
  --track: #e8e8e8;
  --white: #ffffff;
  --green: #108a00;
  --green-hover: #0c7300;
  --green-soft: #e6f4e2;
  --green-ink: #0b6b00;
  --red: #c4291c;
  --red-soft: #fcebe9;
  --amber-soft: #fbf1d5;
  --amber-ink: #7d5400;
  --blue-soft: #e8eefb;
  --blue-ink: #1f4fa3;
  --black: #121212;
  --lime: linear-gradient(100deg, #e2f4dc 0%, #e8f6cc 55%, #eef8b9 100%);
  --surface: #ffffff;          /* inputs, windows, menus, buttons on a grey panel */
  --hover: #e8ecee;
  --nav-active: #dfe4e8;
  --card-hover: #f0f0f0;
  --chip: #ececec;
  --row-hover: #fafafa;
  --card-line: #e6e6e6;
  --grid: #e6e6e6;
  --spark: #c9c9c9;
  --series-in: #108a00;
  --series-out: #cfcfcf;
  --glass: rgba(255, 255, 255, .96);
  --pop-shadow: 0 10px 34px rgba(0, 0, 0, .14);
  --card-edge: none;             /* dark mode: a faint lit top edge on cards */
  --hero-bg: var(--black);
  --tip-bg: var(--black);
  --glow: 0;                     /* how much charts glow (dark mode turns it up) */
  --bar-fade: .78;               /* opacity at the foot of a chart column */
  /* Film grain laid over gradients (an SVG noise tile). */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --radius: 20px;
  --font: "Neue Montreal", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23181818' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --search-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23181818' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--side); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
small, .muted { color: var(--muted); }
b, strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 10px 8px; }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.green { color: var(--green-ink); }
.red { color: var(--red); }

/* ---------- Shell: sidebar + white content panel ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 12px 14px; overflow-y: auto; background: var(--side); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.logo { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -0.06em; text-decoration: none !important; line-height: 1; }
.sidebar .side-close { display: none; }
.profile { display: flex; align-items: center; gap: 12px; padding: 10px 8px 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; color: var(--ink); text-decoration: none !important; }
.avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--black); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; }
.profile-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.profile-text b { font-weight: 500; font-size: 15.5px; }
.profile-text small { font-size: 13px; }
.profile-chev { color: var(--muted); }
.add-menu { position: relative; margin: 0 4px 12px; }
.add-btn { width: 100%; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 16px; text-decoration: none; }
.side-nav a .ic { color: var(--ink-2); }
.side-nav a:hover { background: var(--hover); }
.side-nav a.active { background: var(--nav-active); font-weight: 500; }
.side-bottom { margin-top: auto; padding-top: 10px; }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: 14px; box-shadow: var(--pop-shadow); padding: 6px; z-index: 30; }
.dropdown button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font: inherit; color: var(--ink); cursor: pointer; }
.dropdown button:hover { background: var(--panel); }
/* White page sits flush top/right with one big rounded corner against the sidebar */
.main-wrap { flex: 1; min-width: 0; padding: 8px 0 0 0; }
.page { background: var(--white); border-radius: 40px 0 0 0; min-height: calc(100vh - 8px); padding: 40px 48px 80px; box-shadow: -1px 0 0 rgba(0, 0, 0, .03); }
.page > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.mobile-bar { display: none; }
/* Mac/Windows app showing the older copy on the drive instead of online Hisaab */
.drive-warn { display: flex; align-items: center; gap: 12px; margin: 0 16px 8px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--amber-soft); color: var(--ink); font-size: 14.5px; }
.drive-warn[hidden] { display: none; }
.drive-warn .ic { color: var(--amber-ink); flex: none; display: flex; }
.drive-warn .grow { flex: 1; min-width: 0; }
.drive-warn .btn { flex: none; }
body:has(.lock) .drive-warn { position: fixed; top: 12px; left: 16px; right: 16px; margin: 0; z-index: 101; }
.scrim { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 35; }
  .sidebar .side-close { display: grid; }
  .main-wrap { padding: 0; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; position: sticky; top: 0; background: var(--side); z-index: 20; }
  .sidebar { padding-top: max(14px, env(safe-area-inset-top)); }
  .mobile-bar .logo { font-size: 24px; }
  .page { border-radius: 0; padding: 22px 16px calc(60px + env(safe-area-inset-bottom)); }
}

/* ---------- Page layout ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15.5px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 1180px) { .grid-main { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } h1 { font-size: 26px; } }

/* ---------- Blocks (no outlines: light grey panels) ---------- */
.card { background: var(--panel); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: var(--card-edge); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 18px; }
.card-head a { font-weight: 500; }
.card-flush { background: transparent; padding: 0; border-radius: 0; }
.card-flush .card-head { padding: 0 0 4px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 14px; }
.stat .value { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .sub { font-size: 13.5px; color: var(--muted); }
/* The one dark feature card per page */
.hero { background: var(--hero-bg); color: #fff; }
.hero .label, .hero .sub, .hero small, .hero .muted { color: rgba(255, 255, 255, .72); }
.hero .green { color: #8fe07f; }
/* Office: what an office mate owes, month by month */
.owe-months { display: flex; flex-direction: column; margin: 8px 0 4px; }
.owe-month { display: grid; grid-template-columns: 1fr auto 64px; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.owe-month small { display: block; font-size: 12.5px; color: var(--muted); }
.owe-month .num { font-variant-numeric: tabular-nums; font-weight: 500; }
.owe-month .owe-pay { justify-self: end; }
.hero .owe-month { border-top-color: rgba(255, 255, 255, .14); }
.hero .owe-month small { color: rgba(255, 255, 255, .66); }
.hero .owe-month .btn { background: #fff; color: #181818; }
a.card { color: inherit; text-decoration: none !important; transition: background .15s; }
a.card:hover { background: var(--card-hover); }
a.card.hero { color: #fff; }
a.card.hero:hover { background: #222; }
/* Soft lime gradient, only for reminders */
.callout { background: var(--lime); border-radius: 16px; padding: 16px 20px; color: var(--ink); }
.callout-amber { background: var(--amber-soft); }
.callout-red { background: var(--red-soft); }
.banner { display: flex; align-items: center; gap: 14px; background: var(--lime); border-radius: 16px; padding: 14px 18px; margin-bottom: 24px; }
.banner .ic { color: var(--green-ink); }
.banner .grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: 999px; border: 0; font: inherit; font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; text-decoration: none !important; }
.btn-sm { height: 36px; padding: 0 18px; font-size: 14.5px; }
.btn-xs { height: 30px; padding: 0 14px; font-size: 13.5px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); }
.btn-outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-outline:hover { background: var(--panel); }
.card .btn-outline { box-shadow: none; }
.hero .btn-outline { background: #fff; color: #181818; }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: #2b2b2b; }
.btn-ghost { background: transparent; color: var(--green); padding: 0 12px; }
.btn-ghost:hover { background: var(--green-soft); }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-whatsapp { background: #1fa855; color: #fff; }
.btn-whatsapp:hover { background: #178c46; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 999px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--hover); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--green); cursor: pointer; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.chip-green { background: var(--green-soft); color: var(--green-ink); }
.chip-amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip-blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip-sm { height: 20px; padding: 0 8px; font-size: 11.5px; vertical-align: 1px; }
.chip-red { background: var(--red-soft); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-toggle { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px; }
.pill-toggle button { border: 0; background: none; font: inherit; font-size: 14.5px; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.pill-toggle button.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 14px; height: 44px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
select { appearance: none; -webkit-appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px; cursor: pointer; text-overflow: ellipsis; }
textarea { padding: 12px 14px; height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); flex: none; margin: 1px 0 0; border-radius: 6px; }
input[type=color] { padding: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-weight: 500; font-size: 14.5px; }
.field small { font-size: 13px; }
.field.check { flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; }
.field.check span { display: flex; flex-direction: column; font-size: 15px; }
.is-hidden { display: none !important; }
.form-preview { background: var(--panel); border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.form-intro { color: var(--muted); }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.filters input, .filters select { width: auto; min-width: 170px; }
.filters input[type=search] { flex: 1; min-width: 240px; max-width: 420px; padding-left: 44px; background: var(--surface) var(--search-ic) no-repeat 14px center / 19px; border-radius: 999px; }
.inline-input { width: 130px; height: 36px; }

/* ---------- Tables: no box, just faint dividers ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13.5px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 4px; }
th:last-child, td:last-child { padding-right: 4px; }
.card table th:first-child, .card table td:first-child { padding-left: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--row-hover); }
td.right, th.right { text-align: right; }
td.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.date, .table-wrap td:first-child { white-space: nowrap; }
td .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
tr.group-row td { background: var(--panel); font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 9px 14px; border-bottom: 0; }
tr.group-row td:first-child { border-radius: 10px 0 0 10px; padding-left: 14px; }
tr.group-row td:last-child { border-radius: 0 10px 10px 0; padding-right: 14px; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.card .list-item { border-bottom-color: var(--card-line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 13.5px; color: var(--muted); }
.check-dot { width: 26px; height: 26px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; flex: none; font-size: 13px; color: #fff; }
.check-dot.done { background: var(--green); box-shadow: none; }

/* ---------- Bars, progress, charts ---------- */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar[data-action] { cursor: pointer; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; margin-bottom: 6px; }
.hbar-top b { font-variant-numeric: tabular-nums; font-weight: 500; }
.hbar-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.hbar-track div { height: 100%; border-radius: 99px; }
.progress { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.hero .progress { background: rgba(255, 255, 255, .18); }
.progress div { height: 100%; background: var(--green); border-radius: 99px; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 18px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.months-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.month-cell { text-align: center; font-size: 11.5px; padding: 6px 0; border-radius: 8px; background: var(--chip); color: var(--muted); }
.month-cell.ok { background: var(--green-soft); color: var(--green-ink); font-weight: 600; }
.month-cell.miss { background: var(--red-soft); color: var(--red); }
@media (max-width: 680px) { .months-grid { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Accounts ---------- */
.acct { display: flex; flex-direction: column; gap: 12px; }
.acct-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.acct-name { font-weight: 500; font-size: 16.5px; }
.acct-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.with-logo { display: flex; align-items: center; gap: 12px; }
.with-logo > span:last-child { min-width: 0; }
.acct-bal { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.acct-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Report picker ---------- */
.tree { display: flex; flex-direction: column; gap: 2px; max-height: 540px; overflow: auto; padding-right: 4px; }
.tree .cat-line { display: flex; align-items: center; gap: 4px; padding: 4px 2px; border-radius: 10px; }
.tree .cat-line:hover { background: var(--hover); }
.tree .cat-line label { flex: 1; }
.tree .caret { width: 26px; height: 26px; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 10px; border-radius: 8px; transition: transform .15s; flex: none; }
.tree .caret:hover { background: var(--hover); }
.tree .cat-row.open .caret { transform: rotate(90deg); }
.tree .subs { padding: 2px 0 8px 58px; display: flex; flex-direction: column; gap: 6px; }
.tree label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.tree .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 24px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0, 0, 0, .25); }
.modal-wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 8px; }
.modal-head h2 { font-size: 24px; }
.modal-body { padding: 14px 28px 20px; overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 28px 24px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Misc ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--tip-bg); color: #fff; padding: 12px 22px; border-radius: 999px; opacity: 0; transition: all .25s; z-index: 60; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--red); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 16px; font-size: 15px; }
.kv > :nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.kv .total { font-weight: 600; border-top: 1px solid var(--line-2); padding-top: 9px; }
.evidence { font-size: 14.5px; }
.evidence td { vertical-align: top; }
details.learn { background: var(--panel); border-radius: 16px; padding: 0 20px; }
details.learn > summary { cursor: pointer; padding: 16px 0; font-weight: 500; }
details.learn[open] > summary { border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
details.learn > div { padding-bottom: 18px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line-2); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 500; font-size: 15.5px; padding: 10px 0; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--ink); }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 12px; }
.price-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }

[hidden] { display: none !important; }

/* ---------- Lock screen ---------- */
.lock { position: fixed; inset: 0; z-index: 100; background: var(--side); display: grid; place-items: center; padding: 16px; }
.lock-card { background: var(--surface); border-radius: 28px; padding: 40px 36px 32px; width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .08); }
.lock-card .logo { font-size: 30px; margin-bottom: 8px; }
.lock-icon { width: 56px; height: 56px; border-radius: 999px; background: var(--black); color: #fff; display: grid; place-items: center; }
.lock-card h2 { font-size: 22px; }
/* PINs are plain text boxes drawn as dots, so the browser doesn't offer to save them as a password. */
.pin-input { -webkit-text-security: disc; text-security: disc; }
.lock-card input { text-align: center; font-size: 26px; letter-spacing: .5em; height: 56px; border-radius: 14px; }
.lock-card .btn { width: 100%; }
.lock-error { color: var(--red); min-height: 20px; font-size: 14px; }
.lock-card small { font-size: 12.5px; }
.lock-bio { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; font-size: 13.5px; }
.lock-bio .btn { height: 52px; gap: 8px; font-size: 16px; }

/* ---------- Photo & logos ---------- */
.avatar-slot { display: contents; }
img.avatar { object-fit: cover; background: var(--track); }
.photo-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.photo-row label.btn { cursor: pointer; }
.m-avatar { display: none; }
.side-nav kbd, #navBottom kbd { margin-left: auto; font: 500 11.5px var(--font); color: var(--muted); background: var(--chip); border-radius: 6px; padding: 2px 6px; }
.logo-tile { display: inline-grid; place-items: center; flex: none; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.logo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-letter { font-weight: 600; box-shadow: none; }

/* ---------- Dashboard ---------- */
.dash-hello { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.dash-hello small { display: block; color: var(--muted); font-size: 14.5px; }
.dash-hello h1 { font-size: 30px; }
.dash-avatar { display: flex; border-radius: 999px; }
.dash-avatar .avatar { box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--line-2); }
.dash-date { margin-left: auto; background: var(--panel); border-radius: 999px; padding: 8px 14px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }

/* The one feature card: deep green with a soft light in one corner. */
.balance-card { position: relative; overflow: hidden; border-radius: 28px; padding: 26px 28px 22px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(160, 235, 120, .38) 0%, rgba(160, 235, 120, 0) 55%),
    radial-gradient(80% 120% at 0% 110%, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(140deg, #146b14 0%, #0d4a12 55%, #0a3a10 100%); }
.bal-top { display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: rgba(255, 255, 255, .78); }
.bal-eye { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.bal-eye:hover { background: rgba(255, 255, 255, .2); }
.bal-value { font-size: 52px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; margin: 6px 0 14px; }
.bal-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.bal-pill { background: rgba(255, 255, 255, .13); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.bal-pill.good { background: rgba(170, 240, 140, .22); color: #d6ffc6; }
.bal-pill.bad { background: rgba(255, 140, 120, .22); color: #ffd9d2; }
.bal-accounts { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85) !important; text-decoration: none !important; font-size: 14px; }
.bal-accounts > span:last-child { display: inline-flex; align-items: center; gap: 4px; }
.logo-stack { display: flex; }
.logo-stack > * { margin-left: -9px; box-shadow: 0 0 0 2px #0f5214 !important; border-radius: 999px !important; }
.logo-stack > :first-child { margin-left: 0; }
.logo-more { width: 34px; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; }
.is-hidden-amounts .secret { filter: blur(11px); user-select: none; }
.dash-accounts.is-hidden-amounts .secret { filter: blur(7px); }
.verify-form { display: flex; flex-direction: column; gap: 12px; min-width: min(320px, 80vw); }
.verify-form .pin-input { text-align: center; font-size: 24px; letter-spacing: .5em; height: 52px; }
.verify-form .btn { gap: 8px; }

.quick-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
.qa-ic { width: 54px; height: 54px; border-radius: 18px; background: var(--panel); display: grid; place-items: center; color: var(--ink); transition: background .15s, transform .1s; }
.qa:hover .qa-ic { background: var(--green-soft); color: var(--green-ink); }
.qa:active .qa-ic { transform: scale(.95); }

.stat-row .stat { position: relative; padding-bottom: 20px; }
.stat-row .value { font-size: 25px; font-variant-numeric: normal; }
.delta { font-size: 13px; color: var(--muted); }
.delta span { color: var(--muted); }
.delta.up { color: var(--green-ink); }
.delta.down { color: var(--red); }
.spark-box { position: relative; display: block; height: 30px; margin-top: 10px; }
.spark { width: 100%; height: 30px; display: block; overflow: visible; }
.spark-dot { position: absolute; width: 8px; height: 8px; border-radius: 99px; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--panel); }

.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink) !important; text-decoration: none !important; border-bottom: 1px solid var(--card-line); min-width: 0; }
.tx:last-child { border-bottom: 0; padding-bottom: 0; }
.tx:first-child { padding-top: 0; }
.tx-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tx-text b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-text small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; line-height: 1.3; white-space: nowrap; }
.tx-amt b { font-weight: 500; font-variant-numeric: tabular-nums; }
.tx-amt.in b { color: var(--green-ink); }
.tx-amt small { color: var(--muted); font-size: 12.5px; }
.tx-amt .chip { font-size: 11.5px; padding: 1px 8px; }
.mini-card { display: flex; align-items: flex-start; gap: 14px; }
.mini-card h3 { font-size: 16px; margin-bottom: 2px; }
.mini-card p { font-size: 14.5px; }
.mini-ic { width: 40px; height: 40px; border-radius: 13px; background: var(--surface); display: grid; place-items: center; flex: none; color: var(--ink); }
.card-head small { color: var(--muted); font-size: 13px; }
.card-head a { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }

/* ---------- Charts ---------- */
.chart-slot { position: relative; width: 100%; }
.chart-slot svg:focus { outline: none; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .axis-now { fill: var(--ink); font-weight: 600; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .col-group { transition: opacity .12s; }
.chart.hovering .col-group:not(.on) { opacity: .38; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--tip-bg); color: #fff; border-radius: 12px; padding: 9px 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); white-space: nowrap; }
.tip-title { color: rgba(255, 255, 255, .7); font-size: 12px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row i { width: 12px; height: 3px; border-radius: 2px; }
.tip-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-row span { color: rgba(255, 255, 255, .7); }
.legend { gap: 16px; }
.legend i { border-radius: 3px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.donut-wrap .chart-slot { display: flex; justify-content: center; }
.donut { position: relative; }
.donut svg { display: block; overflow: visible; }
.donut-track { stroke: var(--track); opacity: .55; }
.donut-glow { opacity: calc(var(--glow) * .5); }
.donut .slice { cursor: pointer; outline: none; transition: opacity .15s; }
.donut svg.hovering .slice:not(.on) { opacity: .28; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 24%; }
.donut-center b { font-size: 21px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.donut-center span { font-size: 12.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.donut-legend { width: 100%; display: grid; gap: 4px; }
.dl-row { padding: 7px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; transition: opacity .15s, background .15s; }
.dl-row.on { background: var(--surface); }
.dl-row.dim { opacity: .45; }
.dl-top { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; align-items: center; gap: 9px; font-size: 14px; }
.dl-top i { width: 10px; height: 10px; border-radius: 99px; box-shadow: 0 0 calc(var(--glow) * 10px) currentColor; }
.dl-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-top b { font-weight: 500; font-variant-numeric: tabular-nums; }
.dl-top small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.dl-bar { height: 5px; border-radius: 99px; background: var(--track); margin: 6px 0 0 19px; overflow: hidden; }
.dl-bar div { height: 100%; border-radius: 99px; box-shadow: 0 0 calc(var(--glow) * 8px) currentColor; }

.lock-remember { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; align-self: flex-start; text-align: left; }
.lock-remember input { width: 20px; height: 20px; flex: none; margin: 0; }

/* ---------- Calculator (floats over any page: ⌥C / Alt+C) ---------- */
.calc { position: fixed; right: 24px; bottom: 24px; z-index: 70; width: 300px; background: var(--surface); border-radius: 24px; padding: 14px; box-shadow: var(--pop-shadow), 0 20px 60px rgba(0, 0, 0, .18); animation: fade .12s ease-out; }
.calc-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin: -2px -4px 8px 4px; }
.calc-head span { display: flex; align-items: center; gap: 8px; }
.calc-head kbd { font: 500 11.5px var(--font); color: var(--muted); background: var(--chip); border-radius: 6px; padding: 2px 6px; margin-left: auto; }
.calc-head .icon-btn { width: 32px; height: 32px; }
.calc-screen { background: var(--panel); border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; }
.calc-input { width: 100%; border: 0; background: none; padding: 0; height: auto; font-size: 18px; text-align: right; color: var(--ink-2); box-shadow: none; outline: none; }
.calc-input:focus { box-shadow: none; outline: none; }
.calc-result { display: block; width: 100%; min-height: 34px; border: 0; background: none; padding: 0; font: 600 26px var(--font); text-align: right; color: var(--ink); cursor: copy; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-head { cursor: grab; user-select: none; touch-action: none; }
.calc.dragging { animation: none; box-shadow: var(--pop-shadow), 0 30px 80px rgba(0, 0, 0, .28); }
.calc.dragging .calc-head { cursor: grabbing; }
.calc-fx:empty { display: none; }
.calc-fx { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; text-align: right; }
.calc-fx-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; }
.calc-fx-row button { border: 0; background: var(--chip); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: 500 13.5px var(--font); cursor: pointer; font-variant-numeric: tabular-nums; }
.calc-fx-row button:hover { background: var(--hover); }
.calc-fx small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.calc-units { display: flex; gap: 4px; background: var(--panel); border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.calc-units button { flex: 1; border: 0; background: none; border-radius: 9px; height: 30px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; }
.calc-units button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys button { height: 46px; border: 0; border-radius: 14px; background: var(--panel); color: var(--ink); font: 500 18px var(--font); cursor: pointer; }
.calc-keys button:hover { background: var(--hover); }
.calc-keys .op { background: var(--chip); }
.calc-keys .eq { background: var(--green); color: var(--white); }
.calc-history { display: flex; flex-direction: column; margin-top: 8px; max-height: 150px; overflow-y: auto; }
.calc-history:empty { display: none; }
.calc-history button { display: flex; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 6px 4px; font: 13px var(--font); color: var(--muted); cursor: pointer; border-radius: 8px; text-align: left; }
.calc-history button:hover { background: var(--hover); }
.calc-history b { color: var(--ink); font-weight: 500; white-space: nowrap; }
.m-calc { display: none; }

.tabbar, .sheet, .sheet-scrim { display: none; }
.m-only { display: none; }
@media (max-width: 900px) {
  /* Bottom tabs with a big + in the middle (thumb reach), instead of the ☰ menu. */
  .mobile-bar #menuBtn { display: none; }
  .m-avatar { display: flex; margin-left: auto; }
  .m-calc { display: grid; margin-left: auto; }
  .m-calc + .m-lock:not([hidden]) { margin-left: 0; }
  .m-calc ~ .m-avatar { margin-left: 0; }
  .calc { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; }
  .m-lock:not([hidden]) + .m-avatar { margin-left: 0; }
  .m-avatar .avatar { width: 34px; height: 34px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--glass); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .06); padding: 6px 6px max(8px, env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar .tab-more { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none !important; border: 0; background: none; font-family: inherit; line-height: 1.2; cursor: pointer; }
  .tabbar a.active, .tabbar .tab-more.active { color: var(--ink); }
  .tabbar a.active .ic { stroke-width: 2.2; }
  .tab-add { justify-self: center; width: 56px; height: 56px; margin-top: -22px; border-radius: 999px; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(16, 138, 0, .35); cursor: pointer; }
  .tab-add:active { transform: scale(.96); }
  .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important; }

  /* "Add" sheet that slides up from the bottom */
  .sheet-scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 44; animation: fade .15s; }
  .sheet:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-radius: 24px 24px 0 0;
    padding: 8px 18px max(20px, env(safe-area-inset-bottom)); animation: rise .2s ease-out; }
  .sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 4px auto 12px; }
  .sheet h3 { margin-bottom: 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border: 0; border-radius: 16px; background: var(--panel); font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
  .sheet-grid button:active { background: var(--chip); }
  .sheet-grid .ic { color: var(--green-ink); }
  .sheet-grid .sheet-wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; padding: 14px; font-size: 14.5px; }

  /* Forms and windows slide up as bottom sheets; Save is a big full-width button. */
  .overlay { place-items: end stretch; padding: 0; }
  .modal, .modal-wide { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; animation: rise .22s ease-out; }
  .modal-head { padding: 18px 20px 4px; }
  .modal-head h2 { font-size: 20px; }
  .modal-body { padding: 10px 20px 16px; }
  .modal-foot { padding: 10px 20px max(16px, env(safe-area-inset-bottom)); gap: 8px; box-shadow: 0 -1px 0 var(--line); }
  .modal-foot .spacer { display: none; }
  .modal-foot [data-close].btn { display: none; }
  .modal-foot .btn { height: 40px; padding: 0 14px; }
  .modal-foot .btn-primary, .modal-foot .btn-whatsapp { flex: 1 1 100%; height: 50px; font-size: 16px; order: 9; }
  .modal-foot .btn-ghost, .modal-foot .btn-danger-ghost, .modal-foot .btn-outline { flex: 1 1 auto; }
  /* iPhone zooms into any field with text under 16px — keep inputs at 16px on phones. */
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; height: 46px; }
  textarea { height: auto; }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

@media (max-width: 640px) {
  .page-head { margin-bottom: 18px; align-items: center; }
  .dash-hello { margin-bottom: 16px; gap: 12px; }
  .dash-hello h1 { font-size: 24px; }
  .dash-date { display: none; }
  .balance-card { padding: 20px 20px 16px; border-radius: 24px; }
  .bal-value { font-size: 38px; margin: 4px 0 12px; }
  .bal-pill { font-size: 12.5px; padding: 5px 10px; }
  .quick-actions { gap: 4px; }
  .qa { font-size: 12.5px; }
  .qa-ic { width: 52px; height: 52px; border-radius: 17px; }
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .stat-row .stat { padding: 12px 12px 14px; border-radius: 16px; }
  .stat-row .label { font-size: 12px; }
  .stat-row .value { font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
  .m-hide { display: none; }
  .dash-avatar { display: none; }
  .acct-top > .chip { display: none; }
  .acct-id { gap: 10px; }
  .stat-row .delta { font-size: 11.5px; }
  .stat-row .delta span { display: none; }
  .spark-box { height: 22px; margin-top: 8px; }
  .spark { height: 22px; }
  .page-head h1 { font-size: 26px; }
  .page-head p { display: none; }
  .page-head .actions .btn { height: 38px; padding: 0 16px; font-size: 14.5px; }
  .grid { gap: 10px; }
  .grid-main { gap: 18px; }
  .card { padding: 16px; border-radius: 18px; }
  .stat .value { font-size: 21px; }
  .stat .label { font-size: 13px; }
  .stat .sub { font-size: 12.5px; }
  /* Four stats as a 2×2 grid, with the dark "money you have" card on top */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 > .hero { grid-column: 1 / -1; order: -1; }
  .grid-4:has(> .hero) > :nth-child(4):last-child:not(.hero) { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > .hero { grid-column: 1 / -1; }
  /* Filters: search on its own line, the dropdowns share the next one */
  .filters { gap: 8px; }
  .filters input[type=search] { flex: 1 1 100%; max-width: none; min-width: 0; }
  .filters select { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 30px; background-position: right 8px center; font-size: 15px; height: 42px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .form-grid .field { grid-column: 1 / -1; }
  .form-grid .field.m-half { grid-column: span 1; }
  .months-grid { grid-template-columns: repeat(6, 1fr); }
  .banner { flex-wrap: wrap; padding: 14px; }
  .banner .btn { flex: 1 1 100%; height: 44px; }
  .tabs { gap: 18px; }

  /* Wide tables become simple two-column lists: what on the left, amount on the right. */
  .m-only { display: inline; }
  table.m-list thead { display: none; }
  table.m-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  table.m-list td { display: block; padding: 0 !important; border: 0; min-width: 0; }
  table.m-list td .sub { margin-top: 0; }
  table.m-list .m1a { grid-row: 1; grid-column: 1; }
  table.m-list .m1b { grid-row: 1; grid-column: 2; text-align: right; }
  table.m-list .m2a { grid-row: 2; grid-column: 1; font-size: 13px; color: var(--muted); }
  table.m-list .m2b { grid-row: 2; grid-column: 2; text-align: right; font-size: 13px; color: var(--muted); }
  table.m-list .m3a { grid-row: 3; grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  table.m-list .mx { display: none !important; }
  table.m-list .m3a .sub { display: none; }
  table.m-list tr.group-row { display: flex; justify-content: space-between; padding: 0; border: 0; margin-top: 10px; border-radius: 10px; background: var(--panel); }
  table.m-list tr.group-row td { padding: 9px 12px !important; background: none !important; }
  table.m-list tfoot tr { border-top: 1px solid var(--line-2); }
  table.m-list tr.clickable:active { background: var(--row-hover); }
  table.m-list tbody tr.clickable:hover td { background: none; }
  table.m-list td.date, .table-wrap table.m-list td:first-child { white-space: normal; }
  table.m-list [data-label]::before { content: attr(data-label) ' '; color: var(--muted); }
}

/* ---------- Grain + lit cards (both themes) ---------- */
/* Gradients get a layer of film grain (~40%) so they read as light on a surface, not flat digital fills. */
.balance-card::after, .glow-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grain); background-size: 160px; opacity: .4; mix-blend-mode: overlay; pointer-events: none; }
.balance-card > *, .glow-card > * { position: relative; z-index: 1; }
.glow-card { position: relative; overflow: hidden; }
.chart .col-group.now .s0 { filter: drop-shadow(0 0 calc(var(--glow) * 10px) var(--series-in)); }
.chart .col-group.on .s0 { filter: drop-shadow(0 0 calc(var(--glow) * 12px) var(--series-in)); }

/* ---------- Dark theme: near-black glass, cards lit from an edge, vivid glowing data ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f4f5;
  --ink-2: #d2d2d8;
  --muted: #8d8d97;
  --faint: #5f5f69;
  --line: #1f1f24;
  --line-2: #2a2a31;
  --side: #050506;
  --white: #0a0a0c;
  --panel: #131316;
  --surface: #1c1c21;
  --track: #25252b;
  --hover: #1a1a1f;
  --nav-active: #202027;
  --card-hover: #18181c;
  --chip: #25252c;
  --row-hover: #111114;
  --card-line: #222228;
  --grid: #222228;
  --spark: #4a4a54;
  --green: #34d36b;
  --green-hover: #2bbd5d;
  --green-soft: rgba(52, 211, 107, .14);
  --green-ink: #5fe892;
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .14);
  --amber-soft: rgba(255, 190, 60, .14);
  --amber-ink: #ffc857;
  --blue-soft: rgba(96, 150, 255, .16);
  --blue-ink: #93b6ff;
  --black: #000;
  --lime: linear-gradient(100deg, rgba(52, 211, 107, .17) 0%, rgba(190, 240, 60, .10) 100%);
  --series-in: #3ee07a;
  --series-out: #3a3a43;
  --glass: rgba(12, 12, 15, .82);
  --pop-shadow: 0 16px 48px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .07);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, .055), inset 0 0 0 1px rgba(255, 255, 255, .035);
  --hero-bg: #17171c;
  --tip-bg: #2a2a31;
  --glow: 1;
  --bar-fade: .18;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23e4e4e7' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --search-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23e4e4e7' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}
[data-theme="dark"] .page { box-shadow: -1px 0 0 rgba(255, 255, 255, .04), inset 0 1px 0 rgba(255, 255, 255, .03); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .tab-add { color: #03140a; }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 0 22px rgba(52, 211, 107, .35); }
[data-theme="dark"] .tab-add { box-shadow: 0 0 26px rgba(52, 211, 107, .45), 0 6px 18px rgba(0, 0, 0, .5); }
[data-theme="dark"] .btn-outline { box-shadow: inset 0 0 0 1px var(--line-2); }
[data-theme="dark"] .avatar { background: #2a2a31; }
[data-theme="dark"] .lock-icon { background: #25252c; }
[data-theme="dark"] .logo-tile { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
[data-theme="dark"] .switch:not(.on) span { background: var(--ink); }
[data-theme="dark"] .logo-letter { box-shadow: none; }
[data-theme="dark"] .modal, [data-theme="dark"] .lock-card, [data-theme="dark"] .sheet { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 30px 80px rgba(0, 0, 0, .7); }
[data-theme="dark"] .overlay { background: rgba(0, 0, 0, .65); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { border-color: #2c2c34; }
[data-theme="dark"] .chart-tip { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 30px rgba(0, 0, 0, .6); }
[data-theme="dark"] .qa-ic { background: var(--panel); box-shadow: var(--card-edge); }
[data-theme="dark"] .qa:hover .qa-ic { box-shadow: var(--card-edge), 0 0 18px rgba(52, 211, 107, .25); }
[data-theme="dark"] .hero { box-shadow: var(--card-edge); }

/* Balance card: a black glass card lit from below by blue-violet light (light mode keeps the green). */
[data-theme="dark"] .balance-card {
  background:
    radial-gradient(120% 105% at 50% 108%, rgba(235, 240, 255, .9) 0%, rgba(150, 178, 255, .82) 14%, rgba(72, 98, 255, .7) 30%, rgba(84, 46, 222, .38) 48%, rgba(30, 20, 90, .12) 62%, rgba(0, 0, 0, 0) 72%),
    radial-gradient(55% 55% at 100% 0%, rgba(150, 90, 255, .3) 0%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #0c0d14 0%, #07070b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 110px -34px rgba(80, 120, 255, .85);
}
[data-theme="dark"] .balance-card::after { opacity: .5; }
[data-theme="dark"] .bal-eye { background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
[data-theme="dark"] .bal-pill { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
[data-theme="dark"] .bal-pill.good { background: rgba(62, 224, 122, .14); color: #a6f5c2; }
[data-theme="dark"] .bal-pill.bad { background: rgba(255, 107, 107, .14); color: #ffc4c4; }
[data-theme="dark"] .bal-accounts { border-top-color: rgba(255, 255, 255, .16); color: #fff !important; text-shadow: 0 1px 8px rgba(10, 20, 80, .5); }
[data-theme="dark"] .logo-stack > * { box-shadow: 0 0 0 2px #0e0f1c !important; }

/* Stat cards: a coloured light leaking in from one corner, with grain. */
[data-theme="dark"] .stat-row .glow-card.tone-in { background: radial-gradient(90% 80% at 0% 0%, rgba(62, 224, 122, .22), rgba(0, 0, 0, 0) 60%), var(--panel); }
[data-theme="dark"] .stat-row .glow-card.tone-out { background: radial-gradient(90% 80% at 0% 0%, rgba(255, 90, 140, .2), rgba(0, 0, 0, 0) 60%), var(--panel); }
[data-theme="dark"] .stat-row .glow-card.tone-save { background: radial-gradient(90% 80% at 0% 0%, rgba(100, 140, 255, .24), rgba(0, 0, 0, 0) 60%), var(--panel); }
:root:not([data-theme="dark"]) .glow-card::after { opacity: 0; }

/* ---------- Pending page ---------- */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12.5px; font-weight: 600; display: grid; place-items: center; }
.month-step { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 2px; box-shadow: inset 0 0 0 1px var(--line-2); }
.month-step b, .month-step span { min-width: 120px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.month-step .icon-btn:first-child .ic { transform: rotate(180deg); }
.month-step .icon-btn[disabled] { opacity: .3; cursor: default; background: none; }
.month-step.small { box-shadow: none; background: transparent; padding: 0; }
.month-step.small span { min-width: 70px; font-size: 14px; color: var(--muted); }
.month-step.small .icon-btn { width: 30px; height: 30px; }
.remind-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 24px; }
.remind-card .grow { flex: 1; min-width: 220px; }
.remind-card p { font-size: 13.5px; margin-top: 2px; }
.pend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 26px; }
.pend-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; position: relative; }
.pend-card.is-late { box-shadow: var(--card-edge), inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, transparent); }
.pend-card.is-done { opacity: .62; }
.pend-card.is-done:hover { opacity: 1; }
.pend-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pend-ic { --c: var(--ink-2); width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.pend-name h3 { font-size: 17px; line-height: 1.25; }
.pend-name small { display: block; margin-top: 2px; font-size: 13px; }
.pend-amt { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-height: 30px; }
.pend-amt .muted { font-size: 14px; letter-spacing: 0; font-weight: 400; }
.pend-amt small { display: block; font-size: 13px; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.pend-amt .bill-line { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.pend-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.pend-actions .btn-primary { margin-right: 4px; }
.pend-done { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 500; font-size: 14px; margin-right: 6px; }
.pend-edit { margin-left: auto; width: 34px; height: 34px; }
.check-dot.late { box-shadow: inset 0 0 0 1.5px var(--red); }

/* ---------- Subscriptions: on/off switch ---------- */
.switch { position: relative; width: 42px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 999px; cursor: pointer; background: var(--faint); transition: background .18s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.sub-top-right { display: flex; align-items: center; gap: 10px; }
.sub-off-note { color: var(--amber-ink) !important; }
.sub-off .title { color: var(--muted); }

/* ---------- Office: monthly bills ---------- */
.bills { display: flex; flex-direction: column; }
.bill-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--card-line); cursor: pointer; }
.bill-row:last-child { border-bottom: 0; }
.bill-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bill-row .grow b { font-weight: 500; }
.bill-row .grow small { font-size: 12.5px; }
.bill-check { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex: none; margin: 0; padding: 0; border-radius: 8px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); cursor: pointer; display: grid; place-items: center; }
.bill-check:checked { background: var(--green); box-shadow: none; }
.bill-check:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.bill-amt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.bill-amt input { width: 104px; height: 38px; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; }
.bill-amt b { color: var(--ink); font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bill-row.is-done .grow b { color: var(--muted); }

/* ---------- Office: shops ---------- */
.shop-row .title .link-btn { color: var(--ink); font-weight: 500; }
.shop-row .meta .link-btn { font-size: 13.5px; }
.shop-quick { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.section-sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 2px; }
.shop-items { display: flex; flex-direction: column; }
.shop-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.shop-item:last-child { border-bottom: 0; }
.shop-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-item .grow b { font-weight: 500; }
.shop-item .grow small { font-size: 12.5px; color: var(--muted); }
.shop-item input { width: 56px; height: 40px; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.shop-item input::-webkit-inner-spin-button, .shop-item input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: var(--panel); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.step-btn:active { background: var(--green-soft); }

/* ---------- Balances: expected from clients ---------- */
.exp-card .card-head h3 { font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.exp-list { display: flex; flex-direction: column; }
.exp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--card-line); }
.exp-row:last-child { border-bottom: 0; }
.exp-text { min-width: 0; display: flex; flex-direction: column; }
.exp-text b { font-weight: 500; }
.exp-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-amt { text-align: right; display: flex; flex-direction: column; min-width: 96px; font-variant-numeric: tabular-nums; }
.exp-amt b { font-weight: 600; font-size: 16px; }
.exp-actions { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 760px) {
  .exp-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 8px; }
  .exp-status { display: none; }
  .exp-actions { grid-column: 2 / -1; justify-content: flex-start; }
}

/* ---------- Income rows ---------- */
.row-links { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; font-size: 13px; }
.row-links .link-btn { white-space: nowrap; }
.row-links .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.inv-lines { display: flex; flex-direction: column; gap: 8px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 120px 36px; gap: 8px; align-items: center; }
@media (max-width: 560px) { .inv-line { grid-template-columns: minmax(0, 1fr) 56px 96px 32px; } }

/* ---------- Where it went (doughnut list) ---------- */
.donut-center em { font-style: normal; font-size: 12px; margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.donut-center em.up { color: var(--green); }
.donut-center em.down { color: var(--red); }
.dl-top[role=button] { cursor: pointer; }
.dl-top span { display: inline-flex; align-items: center; gap: 4px; }
.dl-chev { color: var(--faint); flex: none; transition: transform .15s; }
.dl-row.open .dl-chev { transform: rotate(180deg); }
.dl-bottom { display: flex; align-items: center; gap: 10px; margin: 6px 0 0 19px; }
.dl-bottom .dl-bar { flex: 1; margin: 0; }
.dl-chg { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.dl-chg.more { color: var(--red); }
.dl-chg.less { color: var(--green); }
.dl-kids { display: none; margin: 10px 0 2px 19px; padding-left: 12px; border-left: 2px solid var(--card-line); flex-direction: column; gap: 9px; }
.dl-row.open .dl-kids { display: flex; }
.dl-kid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 13px; }
.dl-kid span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-kid b { font-weight: 500; font-variant-numeric: tabular-nums; }
.dl-kbar { grid-column: 1 / -1; height: 3px; border-radius: 99px; background: var(--track); overflow: hidden; }
.dl-kbar div { height: 100%; border-radius: 99px; opacity: .8; }
.dl-hint { font-size: 12.5px; color: var(--faint); text-align: center; margin-top: 12px; }

/* ---------- FBR returns ---------- */
.fbr-ret .kv { grid-template-columns: minmax(0, 1fr) auto; font-size: 14.5px; }
.kv .sub-k { padding-left: 14px; color: var(--muted); font-size: 14px; }
.kv .sub-v { font-weight: 500; font-size: 14px; }
.cell-note { display: block; font-size: 12.5px; }
.fbr-flow { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface); }
.fbr-flow > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.fbr-flow > div span { color: var(--muted); }
.fbr-x .link-btn { font-size: 12.5px; margin-left: 6px; }
.fbr-flow .total { border-top: 1px solid var(--line-2); padding-top: 8px; }
.fbr-flow .total span { color: var(--ink); font-weight: 500; }
.fbr-flow .red b { color: var(--red); }
.fbr-flow .green b { color: var(--green); }

@media print {
  .sidebar, .mobile-bar, .no-print, .filters, .btn, .tree { display: none !important; }
  body, .main-wrap { background: #fff; padding: 0; }
  .page { padding: 0; border-radius: 0; }
  .card { break-inside: avoid; }
  .grid-main { grid-template-columns: 1fr; }
}
@media (pointer: coarse) { .calc-head kbd { display: none; } }

/* To-do page */
.todo-add { display: flex; gap: 10px; margin-bottom: 18px; }
.todo-add input { flex: 1; min-width: 0; background: var(--surface); }
.todo-add .btn { flex: none; }
.todo-item { cursor: pointer; align-items: flex-start; }
.todo-item > .ic { color: var(--muted); align-self: center; flex: none; }
.todo-item .check-dot { border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; margin-top: 1px; }
.todo-item .check-dot:not(.done):hover { box-shadow: inset 0 0 0 1.5px var(--green); }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.todo-item .meta { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.todo-today { color: var(--green); font-weight: 600; }

/* ---------- Scan a receipt ---------- */
.steps-list { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.rc-photos { display: flex; flex-wrap: wrap; gap: 12px; }
.rc-thumb { position: relative; width: 104px; height: 140px; border-radius: 14px; overflow: hidden; background: var(--panel); }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rc-thumb .icon-btn { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; background: var(--surface); font-size: 12px; }
.rc-thumb > span { position: absolute; left: 6px; bottom: 6px; background: var(--surface); color: var(--ink); border-radius: 99px; font-size: 12px; padding: 1px 8px; font-weight: 600; }
.rc-add { width: 104px; height: 140px; border-radius: 14px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--green-ink); font-size: 13.5px; font-weight: 500; text-align: center; }
.rc-add:hover { background: var(--hover); }
.rc-busy:not([hidden]) { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--ink-2); }
.rc-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--green); animation: rc-spin .8s linear infinite; flex: none; }
@keyframes rc-spin { to { transform: rotate(360deg); } }
.rc-head, .rc-item { display: grid; grid-template-columns: minmax(0, 1fr) 64px 96px 170px 150px 36px; gap: 8px; align-items: center; }
.rc-head { margin: 20px 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.rc-head span:nth-last-child(2) { grid-column: span 2; }
.rc-items { display: flex; flex-direction: column; gap: 6px; }
.rc-item input, .rc-item select { height: 38px; min-width: 0; width: 100%; }
.rc-item .rc-qty, .rc-item .rc-amt { text-align: right; font-variant-numeric: tabular-nums; }
.rc-item .icon-btn { width: 34px; height: 34px; font-size: 13px; }
.rc-head-mixed, .rc-item:has(.rc-office) { grid-template-columns: 70px minmax(0, 1fr) 64px 96px 170px 150px 36px; }
.rc-office { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.rc-office input { width: 16px; height: 16px; }
.rc-odd { background: var(--amber-soft); border-radius: 12px; padding: 6px; margin: 0 -6px; }
.rc-note { grid-column: 1 / -1; color: var(--amber-ink); font-size: 12.5px; }
.rc-check { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 16px; margin-top: 16px; }
.rc-check.ok { background: var(--panel); }
.rc-check.ok .ic { color: var(--green-ink); flex: none; margin-top: 1px; }
.rc-check.bad { background: var(--red-soft); }
.rc-paid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 12px; font-size: 14.5px; }
.rc-paid label { display: flex; align-items: center; gap: 10px; font-weight: 500; margin-left: auto; }
@media (max-width: 760px) {
  .rc-head { display: none; }
  .rc-item, .rc-item:has(.rc-office) { grid-template-columns: 1fr 1fr 34px; grid-template-areas: "off off off" "name name del" "qty amt amt" "cat cat cat" "sub sub sub" "note note note";
    background: var(--panel); border-radius: 14px; padding: 10px; margin: 0; row-gap: 6px; }
  .rc-office { grid-area: off; }
  .rc-item .rc-name { grid-area: name; }
  .rc-item .icon-btn { grid-area: del; }
  .rc-item .rc-qty { grid-area: qty; }
  .rc-item .rc-amt { grid-area: amt; }
  .rc-item .rc-cat { grid-area: cat; }
  .rc-item .rc-sub { grid-area: sub; }
  .rc-item .rc-sub:empty { display: none; }
  .rc-note { grid-area: note; }
  .rc-odd { margin: 0; background: var(--amber-soft); }
}

/* Long notes (e.g. a scanned receipt's items) stay two lines in the expenses list; the full text is in the entry. */
#expTable td.m3a .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
