:root {
  color-scheme: light;
  /* Clean white palette for Zabudo. */
  --paper: #FFFFFF;        /* page background — white */
  --surface: #FFFFFF;      /* card */
  --surface-2: #F5F6F8;    /* subtle neutral surface (inputs) */
  --cream: #FFFFFF;        /* tiles — white */
  --ink: #0F1217;          /* near-black text */
  --warm-ink: #3A2F1E;
  --muted: #6B7482;
  --muted-2: #9AA0A8;
  --line: #E6E8EC;         /* neutral hairline */
  --line-strong: #D3D7DE;
  --accent: #1E8E57;
  --accent-deep: #176E43;
  --accent-soft: #E7F1E9;
  --bright: #74C043;
  --red: #D95C5C;          /* app red */
  --gold: #E0A838;         /* app gold */
  --gold-text: #B07D17;
  --shadow: 0 1px 2px rgba(27,32,25,.05), 0 10px 30px rgba(27,32,25,.07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
button { font-family: inherit; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; color: var(--ink); }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 20px; }
.brand--lg .brand-name { font-size: 30px; }
.brand--lg .brand-mark svg { width: 34px; height: 34px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 14px; padding: 10px 16px; transition: .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; width: 100%; padding: 13px; font-size: 15px; }
.btn--primary:hover { background: var(--accent-deep); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); padding: 8px 14px; }
.btn--ghost:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .6; cursor: default; }
.linkbtn { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px; }
.linkbtn:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 500; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow); padding: 34px 30px; text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.auth-form { display: grid; gap: 14px; text-align: left; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; width: 100%;
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.auth-error { color: var(--red); font-size: 13px; margin: -2px 0 0; }
.btn--primary { margin-top: 4px; }
.auth-foot { color: var(--muted-2); font-size: 12.5px; margin: 18px 0 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 13px; color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted-2); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.live.on { color: var(--accent-deep); }
.live.on i { background: var(--bright); box-shadow: 0 0 0 0 color-mix(in srgb, var(--bright) 70%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--bright) 60%,transparent);} 70%{box-shadow:0 0 0 7px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }
@media (prefers-reduced-motion: reduce){ .live.on i { animation: none; } }

/* ---------- Main ---------- */
.main { padding: 26px 20px 60px; }
.greeting { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 700; color: var(--accent-deep); margin: 0 0 4px; }
.greeting h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.tile--hero { background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%); border: none; color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; }
.tile-label { font-size: 13px; color: var(--muted); margin: 0 0 10px; font-weight: 500; }
.tile--hero .tile-label { color: rgba(255,255,255,.85); }
.tile-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; }
.tiles > .tile:not(.hero-split) .tile-value { color: var(--red); }
#mCount { color: var(--accent-deep); }
.tile--hero .tile-value { font-size: 38px; }
.tile-sub { margin: 8px 0 0; font-size: 13px; color: rgba(255,255,255,.85); font-weight: 600; }

/* Grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.muted-sm { font-size: 12.5px; color: var(--muted-2); }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 8px; }
/* Colored bar charts — value labels, y-axis + gridlines */
#chart, #mvChart, #cvChart, #miChart, #yvChart, #repChartMc, #repYearChart, #repMonthInc:has(.mc), #cats:has(.mc), #repCatsMc:has(.mc) { display: block; height: auto; padding: 0; gap: 0; }
.mc { display: flex; gap: 12px; }
.mc-axis { display: flex; flex-direction: column; justify-content: space-between; padding: 16px 0 26px; min-width: 66px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-plot { position: relative; flex: 1; height: 240px; }
.mc-lines { position: absolute; left: 0; right: 0; top: 16px; bottom: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.mc-lines i { height: 1px; background: var(--line); }
.mc-cols { position: absolute; left: 0; right: 0; top: 16px; bottom: 26px; display: flex; align-items: flex-end; gap: clamp(8px, 2.4vw, 22px); }
.mcol { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mcb { position: relative; display: block; width: 100%; max-width: 40px; border-radius: 7px 7px 3px 3px; }
.mcv { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mcv.cur { color: var(--ink); font-weight: 800; }
.mc-xrow { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; display: flex; gap: clamp(8px, 2.4vw, 22px); }
.mc-xrow span { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
/* packed mode — few bars grouped close together (e.g. top categories) */
.mc--pack .mc-cols, .mc--pack .mc-xrow { justify-content: center; gap: clamp(12px, 3vw, 30px); }
.mc--pack .mcol, .mc--pack .mc-xrow span { flex: 0 0 auto; width: 78px; }
/* Many categories: hide per-bar value labels and truncate long names so they all fit */
.mc--many .mc-cols, .mc--many .mc-xrow { gap: clamp(4px, 1.2vw, 12px); }
.mc--many .mcv { display: none; }
.mc--many .mcb { max-width: 30px; }
.mc--many .mc-xrow span { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1px; }
.mc--grouped .mcol { gap: 6px; }
.mc--grouped .mcb { max-width: 20px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.bar { width: 60%; max-width: 34px; min-height: 4px; border-radius: 7px 7px 3px 3px; background: var(--accent-soft); transition: height .4s ease; }
.bar.cur { background: linear-gradient(var(--bright), var(--accent)); }
.bar-label { font-size: 11px; color: var(--muted-2); font-weight: 600; }
.bar-val { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Categories */
.cats { display: grid; gap: 14px; }
.cat { display: grid; gap: 6px; }
.cat-top { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.cat-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cat-dot { width: 10px; height: 10px; border-radius: 3px; }
.cat-amt { font-variant-numeric: tabular-nums; color: var(--muted); }
.cat-bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cat-bar > span { display: block; height: 100%; border-radius: 4px; }

/* Receipts */
.receipts { display: grid; }
.receipt { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line); }
.receipt:first-child { border-top: none; }
.r-glyph { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.r-main { flex: 1; min-width: 0; }
.r-merch { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { font-size: 12.5px; color: var(--muted); }
.r-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.r-amt small { display: block; font-weight: 500; font-size: 11px; color: var(--muted-2); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

.foot { text-align: center; color: var(--muted-2); font-size: 12.5px; margin-top: 26px; }

/* Responsive */
@media (max-width: 780px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile--hero { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
  .greeting h1 { font-size: 22px; }
}
@media (max-width: 440px) {
  .tiles { grid-template-columns: 1fr; }
}

/* ---------- App shell with sidebar ---------- */
#app { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; color: var(--ink); cursor: pointer; border-radius: 12px; transition: opacity .15s ease; }
.sidebar-brand:hover { opacity: .75; }
.sidebar-brand .brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 19px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; margin: 14px 10px 6px; }
.nav-group:first-child { margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 11px;
  color: var(--muted); font-weight: 600; font-size: 14px;
  background: none; border: none; width: 100%; text-align: left; cursor: pointer; text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .user-email { max-width: 100%; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-inner { padding: 0 28px; height: 64px; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.main { padding: 24px 28px 60px; }
#dashboardView > .eyebrow { margin-top: 0; margin-bottom: 16px; }

/* Placeholder view */
.placeholder { text-align: center; padding: 72px 20px; color: var(--muted); }
.placeholder .ph-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; margin: 0 auto 16px; }
.placeholder .ph-icon svg { width: 28px; height: 28px; }
.placeholder h2 { color: var(--ink); font-size: 20px; margin: 0 0 6px; }
.placeholder p { margin: 0 auto; font-size: 14px; max-width: 360px; }

/* Sidebar becomes a top nav on narrow screens */
@media (max-width: 860px) {
  #app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: column; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding: 14px 18px 8px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding: 0 12px 12px; }
  .nav-group { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Transactions ---------- */
.tx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tx-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.btn--pill { border-radius: 999px; padding: 9px 18px; width: auto; }

.import-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 14px; margin-bottom: 18px; }
.import-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; flex-shrink: 0; }
.import-ic svg { width: 20px; height: 20px; }
.import-txt { display: flex; flex-direction: column; gap: 2px; }
.import-txt b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.import-txt small { font-size: 12.5px; color: var(--muted); }
.import-txt code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.soon { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); padding: 2px 7px; border-radius: 999px; }

.tx-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 12px; }
.search svg { width: 16px; height: 16px; color: var(--muted-2); flex-shrink: 0; }
.search input { border: none; background: none; outline: none; color: var(--ink); font-size: 14px; padding: 10px 0; width: 100%; }
.tx-filter { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 10px 0 12px; }
.tx-filter svg { width: 15px; height: 15px; color: var(--muted-2); }
.tx-filter select, .field select { border: none; background: none; outline: none; color: var(--ink); font-size: 14px; font-weight: 500; padding: 10px 4px; cursor: pointer; }
.tx-count { margin-left: auto; }

.tx-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.tx-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.tx-table thead th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 13px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tx-table th.num, .tx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tx-table th.sortable { cursor: pointer; user-select: none; }
.tx-table th.sortable:hover { color: var(--ink); }
.tx-table th .arw { opacity: .5; font-size: 10px; margin-left: 4px; }
.tx-table th.sorted .arw { opacity: 1; color: var(--accent-deep); }
.tx-table tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-table tbody tr:hover { background: var(--surface-2); }
.td-merch { display: flex; align-items: center; gap: 11px; }
.td-glyph { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.chip .dot { width: 9px; height: 9px; border-radius: 3px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.synced { background: var(--accent-soft); color: var(--accent-deep); }
.pill.syncing { background: color-mix(in srgb, #3F7FD8 16%, transparent); color: #3F7FD8; }
.pill.draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tx-empty { text-align: center; color: var(--muted); padding: 44px 10px; font-size: 14px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,18,14,.5); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; }
.modal-card h3 { margin: 0 0 2px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.modal-card form { display: grid; gap: 13px; }
.modal-card .field span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.modal-card .field input, .modal-card .field select { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: 11px; padding: 11px 12px; font-size: 15px; width: 100%; }
.modal-card .field input:focus, .modal-card .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal-actions .btn { width: auto; }

@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
  .tx-count { display: none; }
}

/* ---------- Settings ---------- */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.stab { background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.stab:hover { color: var(--ink); border-color: var(--muted-2); }
.stab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 22px; margin-bottom: 18px; }
.srow { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.srow:first-child { border-top: none; }
.slabel b { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.slabel span { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }
.scontrol { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.input { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: 11px; padding: 11px 13px; font-size: 15px; font-family: inherit; }
.scontrol > .input { width: 100%; max-width: 460px; }
select.input { cursor: pointer; }
.input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.btn--sm { padding: 7px 12px; font-size: 13px; width: auto; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-text); background: color-mix(in srgb, var(--gold) 15%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); font-weight: 700; }
.dl-btn:hover { color: #fff; background: var(--gold); border-color: var(--gold); }
.dl-btn::before { content: "↓"; font-weight: 800; }
.danger-text { color: var(--red) !important; }

.icon-control { align-items: center; }
.ws-icon { width: 64px; height: 64px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.icon-btns { display: flex; flex-direction: column; gap: 8px; }

/* Toggle switch */
.switch { position: relative; width: 46px; height: 27px; border-radius: 999px; border: none; background: var(--line-strong); cursor: pointer; padding: 0; transition: background .16s ease; flex-shrink: 0; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .16s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .knob { transform: translateX(19px); }

.tax-control { align-items: center; }
.tax-fields { display: flex; gap: 12px; }
.mini-field { display: grid; gap: 5px; }
.mini-field span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mini-field .input { max-width: 160px; padding: 9px 11px; font-size: 14px; }

.danger-card { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.danger-control { flex-direction: column; align-items: stretch; gap: 8px; max-width: 460px; }
.danger-control .mini { font-size: 12px; color: var(--muted); }
.danger-input { border-color: color-mix(in srgb, var(--red) 45%, var(--line-strong)); background: color-mix(in srgb, var(--red) 6%, var(--surface-2)); width: 100%; }
.danger-input:focus { border-color: var(--red); }
.danger-btn { background: var(--red); color: #fff; width: auto; align-self: flex-start; }
.danger-btn:hover:not(:disabled) { filter: brightness(.94); }
.danger-btn:disabled { background: var(--line-strong); color: var(--muted); }

.stab-other .placeholder { padding: 50px 20px; }

@media (max-width: 720px) {
  .srow { grid-template-columns: 1fr; gap: 12px; }
  .tax-fields { flex-wrap: wrap; }
}

/* ---------- Reconcile ---------- */
.dropzone { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; padding: 8px 14px; border: 2px dashed color-mix(in srgb, #7C5CD6 45%, var(--line-strong)); border-radius: 12px; background: color-mix(in srgb, #7C5CD6 9%, var(--surface)); cursor: pointer; transition: .15s ease; }
.dropzone:hover { border-color: #7C5CD6; }
.dropzone.drag { border-color: #7C5CD6; background: color-mix(in srgb, #7C5CD6 14%, var(--surface)); transform: translateY(-1px); }
.dz-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface); color: #7C5CD6; display: grid; place-items: center; flex-shrink: 0; }
.dz-ic svg { width: 17px; height: 17px; }
.dz-txt { display: flex; flex-direction: column; gap: 0; line-height: 1.25; }
.dz-txt b { color: #6A46C8; font-size: 13.5px; }
.dz-txt small { color: var(--muted); font-size: 11.5px; }
.dropzone--mini { padding: 7px 13px; gap: 11px; border-radius: 11px; }
.dropzone--mini .dz-ic { width: 28px; height: 28px; border-radius: 8px; }
.dropzone--mini .dz-ic svg { width: 16px; height: 16px; }
.dropzone--mini .dz-txt b { font-size: 13px; }
.dropzone--mini .dz-txt small { font-size: 11px; }

/* Spend (this month) tile with a Tax paid / Receipts side panel */
.spend-split { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.spend-main { flex: 1 1 55%; min-width: 0; padding: 20px; display: flex; flex-direction: column; justify-content: center; }
.spend-side { flex: 0 0 42%; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.spend-cell { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; min-width: 0; }
.spend-cell + .spend-cell { border-top: 1px solid var(--line); }
.ss-label { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.ss-value { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Month receipts — Total Sum bar above the table */
.rc-total-bar { display: flex; align-items: baseline; gap: 10px; width: fit-content; margin: 0 0 12px auto; padding: 10px 14px; background: color-mix(in srgb, #7C5CD6 12%, var(--surface)); border: 1px solid color-mix(in srgb, #7C5CD6 35%, var(--line)); border-radius: 12px; }
.rc-total-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rc-total-val { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: #7C5CD6; font-variant-numeric: tabular-nums; }

/* ---------- Manage Team ---------- */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.role-card b { display: block; font-size: 14px; margin-bottom: 3px; }
.role-card span { font-size: 12.5px; color: var(--muted); }
.pill.pending { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
@media (max-width: 720px) { .roles { grid-template-columns: 1fr; } }

/* ---------- Reports segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.seg button.active { background: var(--accent); color: #fff; }

/* ---------- Billing plans ---------- */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--accent); }
.plan-card.best { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.plan-badge { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-deep); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.plan-badge.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.plan-card h3 { margin: 6px 0 4px; font-size: 17px; }
.plan-price { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-trial { margin: 0 0 14px; font-size: 12.5px; font-weight: 700; color: var(--accent-deep); background: var(--accent-soft); display: inline-block; padding: 2px 9px; border-radius: 999px; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; flex: 1; }
.plan-card li { font-size: 13.5px; color: var(--ink); padding-left: 22px; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-deep); font-weight: 700; }
.plan-card .btn { width: 100%; }
@media (max-width: 720px) { .plan-cards { grid-template-columns: 1fr; } }

/* ---------- Export form ---------- */
.exp-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
.exp-group { display: flex; flex-direction: column; gap: 10px; }
.exp-h { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.chip-toggle { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.chip-toggle button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 9px 15px; border-radius: 10px; cursor: pointer; }
.chip-toggle button:hover { color: var(--ink); }
.chip-toggle button.active { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.exp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.ef { display: grid; gap: 6px; }
.ef > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ef .input { width: 100%; }
.ef select.input[disabled] { opacity: .6; cursor: not-allowed; }
.exp-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.exp-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.exp-check-txt b { display: block; font-size: 14px; }
.exp-check-txt small { font-size: 12.5px; color: var(--muted); }
.exp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- Receipts by month ---------- */
.year-step { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.year-step button { border: none; background: none; color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.year-step button:hover:not(:disabled) { background: var(--surface); }
.year-step button:disabled { opacity: .3; cursor: default; }
.year-step span { font-weight: 700; font-size: 14px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.month-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: .15s ease; min-height: 110px; }
.month-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.month-card.empty { opacity: .6; cursor: default; }
.month-card.empty:hover { border-color: var(--line); transform: none; }
/* Receipts view — every month is clickable so you can upload into any of them */
#rcMonths .month-card.empty { opacity: .72; cursor: pointer; }
#rcMonths .month-card.empty:hover { border-color: var(--accent); transform: translateY(-2px); opacity: 1; }
#rcMonths .month-card.empty .mc-total { color: var(--accent-deep); font-size: 15px; font-weight: 700; }
.mc-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.mc-count { font-size: 12.5px; color: var(--muted); }
.mc-sum { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 2px; }
.mc-sum .sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.mc-sum .sum-row > span { font-size: 12px; color: var(--muted); }
.mc-sum .sum-row b { font-size: 14.5px; font-weight: 700; }
.mc-sum .sum-in b { color: var(--accent-deep); }
.mc-sum .sum-out b { color: var(--red); }
/* Income yearly archive: all card text white/ink */
#incYears .month-card .mc-name,
#incYears .month-card .mc-count,
#incYears .month-card .mc-sum .sum-row > span,
#rcaYears .month-card .mc-name,
#rcaYears .month-card .mc-count,
#rcaYears .month-card .mc-sum .sum-row > span { color: var(--ink); }
#incYears .month-card .mc-sum .sum-in b,
#rcaYears .month-card .mc-sum .sum-in b { color: var(--accent-deep); }
#incYears .month-card .mc-sum .sum-out b,
#rcaYears .month-card .mc-sum .sum-out b { color: var(--red); }
/* Month cards inside a year: white text */
#incMonths .month-card .mc-name,
#incMonths .month-card .mc-count,
#incMonths .month-card .mc-total,
#rcaMonths .month-card .mc-name,
#rcaMonths .month-card .mc-count,
#rcaMonths .month-card .mc-total { color: var(--ink); }
.mc-total { margin-top: auto; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.month-card.has .mc-total { color: var(--accent-deep); }
@media (max-width: 860px) { .month-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .month-grid { grid-template-columns: 1fr; } }

/* ---------- Receipt photo thumbnails + lightbox ---------- */
.td-glyph.photo { cursor: zoom-in; background-size: cover; background-position: center; }
.td-glyph.photo.loaded { color: transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.photo-full { position: relative; max-width: min(92vw, 560px); max-height: 88vh; border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.55); cursor: zoom-out; background: var(--surface); }
.mc-photos { font-size: 11.5px; color: var(--accent-deep); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Bigger, clearer receipt-photo thumbnails in the month view */
#rcBody .td-glyph { width: 46px; height: 46px; border-radius: 9px; font-size: 14px; }
#rcBody .td-glyph.photo { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
#rcBody .td-glyph.photo::after { content: "⤢"; position: absolute; right: -6px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
#rcBody .td-glyph.photo { position: relative; }
#rcBody .td-glyph.photo:hover { transform: scale(1.06); transition: transform .12s ease; }

/* Photo lightbox actions */
.photo-box { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.photo-actions { display: flex; gap: 8px; }
.photo-actions .btn { width: auto; }

/* Upload receipt modal preview */
.upload-preview { display: none; max-width: 100%; max-height: 190px; margin: 0 auto 16px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; }
.upload-preview[src] { display: block; }

/* PDF support: upload note + lightbox iframe + pdf glyph */
.upload-pdf-note { display: flex; align-items: center; gap: 8px; justify-content: center; background: color-mix(in srgb, var(--red) 8%, var(--surface-2)); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; font-size: 13.5px; color: var(--ink); font-weight: 600; }
#photoFrame.photo-full { width: min(92vw, 640px); height: 84vh; background: #fff; border: none; cursor: default; }
#rcBody .td-glyph.pdf { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; cursor: pointer; }
#rcBody .td-glyph.pdf::after { content: "⤢"; position: absolute; right: -6px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
#rcBody .td-glyph.pdf { position: relative; }

/* ---------- Archive (10 years) ---------- */
.archive-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.month-card { position: relative; }
.arc-status { position: absolute; top: 12px; right: 12px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; }
.arc-status.archived { background: rgba(139, 92, 246, .16); color: #a78bfa; border: 1px solid rgba(139, 92, 246, .4); }
.arc-status.current { background: var(--accent-soft); color: var(--accent-deep); }
/* Reconcile document list: view link + action buttons */
.rca-view { border: none; background: none; padding: 0; font: inherit; color: var(--accent-deep); font-weight: 600; cursor: pointer; text-align: left; }
.rca-view:hover { text-decoration: underline; }
.rca-view[disabled] { color: var(--muted); cursor: default; text-decoration: none; }
#rcaBody .row-actions, #incBody .row-actions, #rcBody .row-actions, #txBody .row-actions, #reconBody .row-actions { white-space: nowrap; text-align: right; }
#txBody tr[data-path] .td-glyph { cursor: pointer; }
/* Contact Us & Privacy Policy document views */
.doc { max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 28px; }
.doc-meta { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.doc-lead { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0 0 22px; }
.doc h3 { font-size: 15px; font-weight: 800; margin: 22px 0 8px; }
.doc p { font-size: 14.5px; line-height: 1.65; color: var(--ink); margin: 0 0 12px; }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc li { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin: 0 0 7px; }
.doc a { color: var(--accent-deep); font-weight: 600; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.doc-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 4px 0 6px; }
.contact-card { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; text-decoration: none; transition: .15s ease; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-ic { flex: none; width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; }
.contact-ic svg { width: 20px; height: 20px; }
.contact-main { display: flex; flex-direction: column; gap: 2px; }
.contact-main b { font-size: 14.5px; color: var(--ink); }
.contact-main small { font-size: 13px; color: var(--muted); }
/* ---------- Reports ---------- */
.rep-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.rep-card { display: flex; flex-direction: column; border-radius: 18px; padding: 18px; color: var(--ink); background: var(--cream); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 130px; }
.rep-card .rep-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: rgba(15,18,23,.06); color: var(--ink); margin-bottom: auto; }
.rep-card .rep-ic svg { width: 21px; height: 21px; }
.rep-card-label { font-size: 13px; color: var(--muted); margin-top: 14px; }
.rep-card-val { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 5px; color: var(--ink); }
.rep-card-sub { font-size: 12px; color: var(--muted); }
/* cream cards, colored icon accent per card */
.rc-green .rep-ic { background: var(--accent-soft); color: var(--accent-deep); }
.rc-blue .rep-ic { background: #E3ECFB; color: #2F6DF0; }
.rc-purple .rep-ic { background: #EEE6FB; color: #8B5CF6; }
.rc-indigo .rep-ic { background: #E6E7FA; color: #4F46E5; }
.rep-cat-card { margin-bottom: 18px; }
.rep-cat-grid { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.rep-donut { display: flex; align-items: center; gap: 18px; }
.donut-svg svg { display: block; }
.donut-cur { fill: var(--muted); font-size: 9px; font-weight: 600; }
.donut-num { fill: var(--ink); font-size: 13px; font-weight: 800; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend .dl, .ln-legend .dl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.donut-legend .dl b { color: var(--muted); font-weight: 700; margin-left: 4px; }
.dl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rep-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.linechart svg { display: block; overflow: visible; }
.ln-lbl { fill: var(--muted); font-size: 10px; }
.ln-legend { display: flex; gap: 18px; justify-content: center; margin-top: 8px; }
@media (max-width: 720px) { .rep-cat-grid { grid-template-columns: 1fr; } .rep-donut { justify-content: center; } }
/* ---------- Cookie consent banner ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.35); padding: 14px 18px; max-width: 720px; margin: 0 auto; }
.cookie-txt { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.5; flex: 1 1 340px; }
.cookie-link { background: none; border: none; padding: 0; color: var(--accent-deep); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex: none; }
.cur-picker { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cur-picker > span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.cur-picker select { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.foot-link { background: none; border: none; padding: 4px 2px; margin-top: 8px; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.foot-link:hover { color: var(--ink); text-decoration: underline; }
.see-all { background: none; border: none; padding: 2px 2px; color: var(--accent-deep); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }
.linkinline { background: none; border: none; padding: 0; color: var(--accent-deep); font: inherit; font-weight: 600; cursor: pointer; }
.linkinline:hover { text-decoration: underline; }
/* ---------- Onboarding ---------- */
/* Fullscreen onboarding: a static scene fills the whole screen. */
.onb--full { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #ffffff; }
.onb--full .onb-scene { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 48px); }
.onb--full .onb-scene svg { width: 100%; height: 100%; display: block; }
.onb-overlay { position: absolute; top: clamp(20px, 5vh, 54px); right: clamp(24px, 4vw, 66px); left: auto; bottom: auto; z-index: 5; padding: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; background: none; }
.onb-overlay .btn--primary { width: auto; height: 44px; padding: 0 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; border-radius: 12px; }
.onb-overlay .linkbtn { color: var(--accent-ink, #155c33); font-weight: 600; font-size: 13px; }
/* download badges + brand */
.onb-dl { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 4px; }
.onb-brand { display: inline-flex; align-items: center; gap: 8px; color: #201f1d; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.onb-brand-ic { width: 30px; height: 30px; border-radius: 7px; display: block; }
.store-badge { display: inline-flex; align-items: center; gap: 8px; background: #000; border: 1px solid #000; border-radius: 9px; padding: 6px 12px; text-decoration: none; }
.store-badge svg { display: block; flex: none; }
.store-badge .sb-txt { display: flex; flex-direction: column; line-height: 1.05; text-align: left; color: #fff; }
.store-badge .sb-txt small { font-size: 8px; letter-spacing: .4px; text-transform: uppercase; opacity: .95; }
.store-badge .sb-txt b { font-size: 15px; font-weight: 600; }
.store-badge:hover { background: #111; }
.mock-web { width: 100%; max-width: 420px; background: #0f1420; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.mw-bar { display: flex; align-items: center; gap: 7px; padding: 10px 12px; background: #161c2b; position: relative; }
.mw-bar span { width: 9px; height: 9px; border-radius: 50%; background: #3a4256; }
.mw-bar span:nth-child(1){ background:#e5563f; } .mw-bar span:nth-child(2){ background:#e0a838; } .mw-bar span:nth-child(3){ background:#3ec27a; }
.mw-bar em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: #7b869c; }
.mw-body { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 12px; }
.mw-side { display: grid; gap: 8px; align-content: start; }
.mw-side i { height: 9px; border-radius: 5px; background: #222b3d; }
.mw-side i:first-child { background: #2f6df0; }
.mw-main { display: grid; gap: 12px; }
.mw-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mw-tile { height: 52px; border-radius: 9px; }
.mw-tile.red { background: linear-gradient(150deg, #5a1f22, #3a1416); }
.mw-tile.green { background: linear-gradient(150deg, #2f9e6a, #15694a); }
.mw-chart { display: flex; align-items: flex-end; gap: 8px; height: 84px; padding: 8px; background: #131a28; border-radius: 9px; }
.mw-chart i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #7ee0a6, #2f9e6a); }
.mw-chart i:last-child { background: linear-gradient(180deg, #86efac, #22c55e); }
.mock-phone { position: absolute; right: -6px; bottom: -20px; width: 150px; background: #0b0f18; border: 5px solid #05070c; border-radius: 26px; box-shadow: 0 28px 60px rgba(0,0,0,.5); }
.mp-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 46px; height: 5px; border-radius: 3px; background: #05070c; z-index: 2; }
.mp-screen { border-radius: 21px; overflow: hidden; padding: 20px 12px 14px; background: linear-gradient(180deg, #0f1622, #0b0f18); position: relative; }
.mp-hero { background: linear-gradient(150deg, #5a1f22, #3a1416); border-radius: 12px; padding: 12px; color: #fff; display: grid; gap: 3px; }
.mp-hero small { font-size: 8px; opacity: .8; }
.mp-hero b { font-size: 16px; letter-spacing: -.02em; }
.mp-hero .mp-tag { font-size: 8px; opacity: .75; }
.mp-list { display: grid; gap: 7px; margin-top: 10px; }
.mp-item { display: flex; align-items: center; gap: 8px; }
.mp-item i { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.mp-item i.g { background: #74c043; } .mp-item i.o { background: #e0a838; } .mp-item i.b { background: #4f8cf0; }
.mp-item u { flex: 1; height: 8px; border-radius: 4px; background: #1c2534; }
.mp-cam { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(150deg, #2f9e6a, #15694a); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.mp-cam svg { width: 17px; height: 17px; }
@media (max-width: 860px) {
  .onb-overlay { top: 16px; right: 16px; }
  .onb-overlay .btn--primary { width: 140px; height: 46px; font-size: 14px; }
}
/* ---- Onboarding animations ---- */
.mock-web, .mock-phone { will-change: transform; }
.onb-anim .mock-web { animation: onbFloatA 6s ease-in-out infinite; }
.onb-anim .mock-phone { animation: onbFloatB 6s ease-in-out infinite; }
@keyframes onbFloatA { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes onbFloatB { 0%,100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
/* scan line sweeping the phone screen */
.mp-scan { position: absolute; left: 8px; right: 8px; top: 16%; height: 22px; border-radius: 7px; pointer-events: none; z-index: 3; opacity: 0;
  background: linear-gradient(180deg, rgba(126,224,166,0), rgba(126,224,166,.45)); box-shadow: 0 0 16px rgba(126,224,166,.6); }
.onb-anim .mp-scan { animation: onbScan 5s ease-in-out infinite; }
@keyframes onbScan { 0% { top: 16%; opacity: 0; } 8% { opacity: 1; } 42% { top: 80%; opacity: 1; } 52% { top: 80%; opacity: 0; } 100% { opacity: 0; } }
/* receipt token flying phone → web dashboard */
.onb-token { position: absolute; right: 20%; bottom: 16%; width: 26px; height: 34px; border-radius: 4px; z-index: 6; opacity: 0;
  background: linear-gradient(180deg, #ffffff, #e7efe9); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.onb-token::before { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 2px; border-radius: 2px; background: #9fd4b3; box-shadow: 0 5px 0 #9fd4b3, 0 10px 0 #cfe7d8; }
.onb-anim .onb-token { animation: onbFly 5s ease-in-out infinite; }
@keyframes onbFly {
  0% { opacity: 0; transform: translate(0,0) scale(.5) rotate(-6deg); }
  46% { opacity: 0; transform: translate(0,0) scale(.5) rotate(-6deg); }
  54% { opacity: 1; transform: translate(0,-6px) scale(1) rotate(-6deg); }
  80% { opacity: 1; transform: translate(-150px,-120px) scale(.85) rotate(4deg); }
  92% { opacity: 0; transform: translate(-190px,-150px) scale(.5) rotate(8deg); }
  100% { opacity: 0; }
}
/* chart bars grow in on entry, then a soft pulse on the latest bar */
.onb-anim .mw-chart i { transform-origin: bottom; animation: onbGrow .9s cubic-bezier(.2,.8,.2,1) both; }
.onb-anim .mw-chart i:nth-child(1) { animation-delay: .15s; }
.onb-anim .mw-chart i:nth-child(2) { animation-delay: .25s; }
.onb-anim .mw-chart i:nth-child(3) { animation-delay: .35s; }
.onb-anim .mw-chart i:nth-child(4) { animation-delay: .45s; }
.onb-anim .mw-chart i:nth-child(5) { animation-delay: .55s; }
.onb-anim .mw-chart i:nth-child(6) { animation-delay: .65s; }
@keyframes onbGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* the synced income tile flashes when the receipt lands */
.onb-anim .mw-tile.green { animation: onbFlash 5s ease-in-out infinite; }
@keyframes onbFlash { 0%,74%,100% { box-shadow: none; } 80% { box-shadow: 0 0 0 2px rgba(126,224,166,.8), 0 0 22px rgba(126,224,166,.5); } }
@media (prefers-reduced-motion: reduce) {
  .onb-anim .mock-web, .onb-anim .mock-phone, .onb-anim .mp-scan, .onb-anim .onb-token,
  .onb-anim .mw-chart i, .onb-anim .mw-tile.green { animation: none !important; }
  .onb-token { display: none; }
}
.rca-act { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; vertical-align: middle; }
.rca-act svg { width: 16px; height: 16px; }
.rca-act:hover { color: var(--ink); border-color: var(--muted); }
.rca-act.rca-dl { color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.rca-act.rca-dl:hover { color: #fff; background: var(--gold); border-color: var(--gold); }
.rca-act.rca-del:hover { color: #fff; background: var(--red); border-color: var(--red); }
.rca-act[disabled] { opacity: .4; cursor: default; }
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .archive-grid { grid-template-columns: 1fr; } }

/* Row delete action */
.tx-table th.row-actions, .tx-table td.row-actions { text-align: right; width: 46px; }
.row-del { background: none; border: none; color: var(--muted-2); cursor: pointer; padding: 7px; border-radius: 9px; opacity: .75; display: inline-grid; place-items: center; }
.row-del:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); opacity: 1; }
.row-del svg { width: 16px; height: 16px; display: block; }

/* Make delete obvious + always reachable (pinned to the right) */
.row-del { color: var(--red); opacity: .9; background: color-mix(in srgb, var(--red) 10%, transparent); }
.row-del:hover { color: var(--red); opacity: 1; background: color-mix(in srgb, var(--red) 22%, transparent); }
.tx-table th.row-actions, .tx-table td.row-actions { position: sticky; right: 0; background: var(--surface); }
.tx-table tbody tr:hover td.row-actions { background: var(--surface-2); }

/* ---------- Split hero: Spend (red) | Income (green) ---------- */
.hero-split { padding: 0; overflow: hidden; border: none; display: grid; grid-template-columns: 1fr 1fr; min-height: 132px; }
.hero-half { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.hero-half .tile-label { color: rgba(255,255,255,.9); margin-bottom: 8px; font-weight: 500; }
.hero-half .tile-value { color: #fff; font-size: 25px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0; }
.hero-half .tile-sub { color: rgba(255,255,255,.85); margin: 8px 0 0; font-size: 12.5px; font-weight: 600; }
.hero-half.spend { background: linear-gradient(160deg, #E5645A 0%, #C74A40 100%); }
.hero-half.income { background: linear-gradient(160deg, #4FC07E 0%, #2E9E5B 100%); box-shadow: inset 1px 0 0 rgba(255,255,255,.15); }
@media (max-width: 460px) { .hero-split { grid-template-columns: 1fr; } .hero-half.income { box-shadow: inset 0 1px 0 rgba(255,255,255,.15); } }

/* Give the split hero its own full-width row so big numbers fit */
.tiles { grid-template-columns: 1fr 1fr; }
.hero-split { grid-column: 1 / -1; }
.hero-half .tile-value { font-size: 30px; }

/* Reverted split hero — restore original single-tile layout */
.tiles { grid-template-columns: 1.5fr 1fr 1fr; }

/* ===== Split hero — dark-red Spend | green Income (final styling) ===== */
.tiles { grid-template-columns: 1fr 1fr; }
.hero-split { grid-column: 1 / -1; padding: 0; overflow: hidden; border: none; display: grid; grid-template-columns: 1fr 1fr; min-height: 138px; }
.hero-half { padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-half .tile-label { margin-bottom: 8px; font-weight: 500; }
.hero-half .tile-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0; }
.hero-half .tile-sub { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
/* left: dark maroon with red text */
.hero-half.spend { background: linear-gradient(160deg, #3E0E0E 0%, #230707 100%); }
.hero-half.spend .tile-label { color: #E98A85; }
.hero-half.spend .tile-value { color: #F0736B; }
.hero-half.spend .tile-sub { color: #D9736E; }
/* right: green with white text */
.hero-half.income { background: linear-gradient(160deg, #86D6A6 0%, #5EBF87 100%); }
.hero-half.income .tile-label { color: rgba(255,255,255,.9); }
.hero-half.income .tile-value { color: #fff; }
.hero-half.income .tile-sub { color: rgba(255,255,255,.85); }
@media (max-width: 460px) { .hero-split { grid-template-columns: 1fr; } }

/* Keep split within ONE tile (3-across row), size text to fit both halves */
.tiles { grid-template-columns: 1.5fr 1fr 1fr; }
.hero-split { grid-column: auto; min-height: 132px; }
.hero-half { padding: 16px 15px; }
.hero-half .tile-label { font-size: 12px; margin-bottom: 6px; }
.hero-half .tile-value { font-size: 30px; }
.hero-half .tile-sub { font-size: 11.5px; margin-top: 6px; }
@media (max-width: 780px) { .tiles { grid-template-columns: 1fr 1fr; } .hero-split { grid-column: 1 / -1; } .hero-half .tile-value { font-size: 30px; } }
@media (max-width: 460px) { .tiles { grid-template-columns: 1fr; } .hero-split { grid-template-columns: 1fr 1fr; } .hero-half .tile-value { font-size: clamp(19px, 6vw, 30px); } }

/* ---- App-style stat tiles: warm cream, red spend, green income ---- */
.tile { background: var(--cream); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tile-label { color: var(--muted); }
.tile-value { color: var(--ink); }
.tile-sub { color: var(--muted); }
.tile--hero { background: var(--cream); border: 1px solid var(--line); color: var(--ink); }
.tile--hero .tile-label { color: var(--muted); }
.tile--hero .tile-value { color: var(--ink); }
.tile--hero .tile-sub { color: var(--muted); }
/* Spend / Income split — one cream card, colored numbers, hairline divider */
.hero-split { background: var(--cream); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-half { background: transparent !important; color: var(--ink); }
.hero-half.income { box-shadow: inset 1px 0 0 var(--line) !important; }
.hero-half .tile-label { color: var(--muted); font-weight: 500; }
.hero-half .tile-sub { color: var(--muted); font-weight: 600; }
.hero-half.spend .tile-label { color: var(--muted); }
.hero-half.spend .tile-value { color: var(--red); }
.hero-half.spend .tile-sub { color: var(--muted); }
.hero-half.income .tile-label { color: var(--muted); }
.hero-half.income .tile-value { color: var(--accent-deep); }
.hero-half.income .tile-sub { color: var(--muted); }
@media (max-width: 460px) { .hero-half.income { box-shadow: inset 0 1px 0 var(--line) !important; } }

/* Income tiles */
.inc-tiles { grid-template-columns: 1fr 1fr; }

/* Income year filter highlight + file input */
.month-card.active-year { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.file-input { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: 11px; padding: 9px 11px; font-size: 13.5px; width: 100%; }
.file-input::file-selector-button { border: none; background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; padding: 6px 12px; border-radius: 8px; margin-right: 10px; cursor: pointer; }

/* Summary tile numbers — sized so larger amounts (up to ~8 figures) fit without overlap */
.tiles .tile-value { font-size: clamp(17px, 2.1vw, 23px); white-space: nowrap; }
.hero-half .tile-value { font-size: clamp(16px, 2.1vw, 22px); white-space: nowrap; }
.spend-main .tile-value { font-size: clamp(14px, 3.1vw, 19px); }

/* Three separate "so far" tiles on row 1; the two "this month" tiles on row 2. */
.tiles { grid-template-columns: repeat(3, 1fr); }
.tile.sofar { display: flex; flex-direction: column; justify-content: center; }
.tiles .tile.sofar.spend .tile-value { color: var(--red); }
.tiles .tile.sofar.income .tile-value { color: var(--accent-deep); }
.tiles .tile.sofar.saved .tile-value { color: var(--ink); }
.spend-split { grid-column: span 2; }
@media (max-width: 780px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile.sofar.saved { grid-column: 1 / -1; }
  .spend-split { grid-column: span 1; }
}
@media (max-width: 460px) { .tiles { grid-template-columns: 1fr; } .tile.sofar.saved, .spend-split { grid-column: auto; } }

/* Saving view summary tiles */
.saving-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.saving-tiles .tile-value { font-size: clamp(18px, 2.2vw, 26px); white-space: nowrap; }
@media (max-width: 620px) { .saving-tiles { grid-template-columns: 1fr; } }

/* "PRO" badge on export buttons for free users (contextual paywall) */
:root[data-plan="free"] .dl-btn::after {
  content: "PRO"; font-size: 9px; font-weight: 800; letter-spacing: .04em;
  background: var(--ink); color: #fff; padding: 1px 5px; border-radius: 6px; margin-left: 6px;
}

/* Tax paid / Receipts as its own tile (split from the Spend tile) */
.tile.stat-split { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Billing — 7-day free trial info banner */
.trial-banner { display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; margin-top: 18px; padding: 10px 18px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--gold) 10%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); box-shadow: var(--shadow); }
.trial-banner-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #0a0a0a; color: #fff; display: grid; place-items: center; }
.trial-banner-ic svg { width: 23px; height: 23px; }
.trial-banner-txt { display: flex; flex-direction: column; gap: 3px; }
.trial-banner-txt b { font-size: 20.5px; color: var(--ink); letter-spacing: -0.01em; }
.trial-banner-txt span { font-size: 17px; color: var(--muted); line-height: 1.45; }

/* Visually-hidden content for SEO/screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Photos: yearly archive as "boxes of photos" ---------- */
#incYears .month-card.photo-box { align-items: center; text-align: center; padding: 18px 14px 16px; gap: 2px; min-height: 180px; justify-content: flex-end; }
.photo-box .pb-art { display: block; width: 112px; height: 94px; margin: 10px auto 6px; transition: transform .2s ease; }
.photo-box .pb-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(27,32,25,.18)); }
.photo-box:hover .pb-art { transform: translateY(-4px) scale(1.04); }
.photo-box:not(.has) .pb-art { filter: grayscale(.7); opacity: .5; }
.photo-box:not(.has):hover .pb-art { opacity: .8; }
#incYears .month-card.photo-box .mc-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
#incYears .month-card.photo-box .mc-count { font-size: 12.5px; }

/* ---------- Photos: months as photo albums ---------- */
#incMonths .month-card.album { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: 0; }
.album .al-art { display: block; width: 96px; height: 80px; flex: none; transition: transform .2s ease; }
.album .al-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(27,32,25,.18)); }
.album:hover .al-art { transform: translateY(-3px) rotate(-2deg); }
.album:not(.has) .al-art { filter: grayscale(.7); opacity: .5; }
.album:not(.has):hover .al-art { opacity: .8; }
.album .al-meta, .shot .al-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#incMonths .month-card.album .mc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- Event albums ---------- */
#evGrid .month-card.album { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: 0; }
#evGrid .month-card.album .mc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.ev-badge { align-self: flex-start; margin-top: 4px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- Photos: month view as thumbnails ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 16px; }
.ph { position: relative; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ph-img { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 12px; background-size: cover; background-position: center; cursor: zoom-in; color: #fff; font-weight: 700; font-size: 18px; padding: 0; transition: .15s ease; }
.ph-img:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ph-img.pdf { background: var(--red); cursor: pointer; }
.ph figcaption { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 0 2px; }
.ph figcaption b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph figcaption small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-del { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(15,18,23,.6); color: #fff; font-size: 12px; cursor: pointer; opacity: 0; transition: .15s ease; display: grid; place-items: center; }
.ph:hover .ph-del, .ph-del:focus-visible { opacity: 1; }
.ph-del:hover { background: var(--red); }

/* ---------- Screenshots: months as phone screenshots ---------- */
#rcMonths .month-card.shot { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: 0; }
.shot .sh-art { display: block; width: 96px; height: 80px; flex: none; transition: transform .2s ease; }
.shot .sh-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(27,32,25,.18)); }
.shot:hover .sh-art { transform: translateY(-3px); }
.shot.empty .sh-art { filter: grayscale(.7); opacity: .5; }
.shot.empty:hover .sh-art { opacity: .8; }
#rcMonths .month-card.shot .mc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
#rcMonths .month-card.shot .mc-add { font-size: 12.5px; font-weight: 700; color: var(--accent-deep); margin-top: 2px; }

/* ---------- Documents: months as paper documents ---------- */
#docMonths .month-card.doc { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: 0; }
.doc .al-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.doc .dc-art { display: block; width: 96px; height: 80px; flex: none; transition: transform .2s ease; }
.doc .dc-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(27,32,25,.18)); }
.doc:hover .dc-art { transform: translateY(-3px); }
.doc.empty .dc-art { filter: grayscale(.7); opacity: .5; }
.doc.empty:hover .dc-art { opacity: .8; }
#docMonths .month-card.doc .mc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
#docMonths .month-card.doc .mc-add { font-size: 12.5px; font-weight: 700; color: var(--accent-deep); margin-top: 2px; }
/* Document pages are portrait: show the whole page inside the tile */
#docBody .ph-img { background-size: contain; background-repeat: no-repeat; background-color: var(--surface-2); }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.dash-greet h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.dash-greet p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px; border-radius: 20px; background: linear-gradient(100deg, #E6F0FF 0%, #EEF1FF 55%, #F3E9FF 100%); border: 1px solid #DCE6FA; }
.dash-hero-txt h3 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: #0F1C3F; }
.dash-hero-txt p { margin: 0 0 16px; color: #4B5A7A; font-size: 14px; max-width: 420px; }
.dash-upload { background: #2F80FF; border-color: #2F80FF; color: #fff; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; font-size: 14px; border-radius: 12px; }
.dash-upload:hover { background: #1F6FEF; }
.dash-upload svg { width: 18px; height: 18px; }
.dash-hero-art { width: 170px; height: 140px; flex: none; filter: drop-shadow(0 10px 20px rgba(47,128,255,.25)); }
.dash-hero-art svg { width: 100%; height: 100%; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dt { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: .15s ease; font: inherit; color: inherit; min-width: 0; }
.dt:hover { border-color: var(--accent); transform: translateY(-2px); }
div.dt { cursor: default; } div.dt:hover { border-color: var(--line); transform: none; }
.dt-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.dt-ic svg { width: 22px; height: 22px; }
.dt-ic.blue { background: #E6F0FF; color: #2F80FF; } .dt-ic.purple { background: #F1E8FF; color: #9B4DFF; } .dt-ic.green { background: #E3F7EE; color: #1C9B6A; } .dt-ic.red { background: #FFE9E9; color: #E5484D; } .dt-ic.grey { background: var(--surface-2); color: var(--muted); }
.dt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dt-label { font-size: 13px; color: var(--muted); }
.dt-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.dt-trend { font-size: 12.5px; font-weight: 700; margin-top: 6px; } .dt-trend.up { color: #1C9B6A; } .dt-trend.down { color: #E5484D; }
.dt-sub { font-size: 12px; color: var(--muted); }
.dt-bar { display: block; height: 6px; border-radius: 999px; background: #E6F0FF; margin-top: 10px; overflow: hidden; }
.dt-bar i { display: block; height: 100%; background: #2F80FF; border-radius: 999px; }
.dt-pct { font-size: 12px; color: var(--muted); align-self: flex-end; margin-top: 2px; }
.dash-recent .card-head h2 { font-size: 18px; }
.dp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.dp-thumb { aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 14px; background-size: cover; background-position: center; cursor: pointer; padding: 0; transition: .15s ease; }
.dp-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.donut { width: 170px; height: 170px; border-radius: 50%; margin: 16px auto 18px; display: grid; place-items: center; }
.donut-hole { width: 128px; height: 128px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-hole b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.donut-hole small { font-size: 12px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend li span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.da-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.da-item { display: flex; gap: 12px; align-items: flex-start; }
.da-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.da-ic svg { width: 18px; height: 18px; }
.da-ic.blue { background: #E6F0FF; color: #2F80FF; } .da-ic.purple { background: #F1E8FF; color: #9B4DFF; } .da-ic.green { background: #E3F7EE; color: #1C9B6A; } .da-ic.grey { background: var(--surface-2); color: var(--muted); }
.da-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.da-txt b { font-size: 14px; font-weight: 600; } .da-txt span { font-size: 13px; color: var(--ink); opacity: .8; } .da-txt small { font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-hero { flex-direction: column; align-items: flex-start; } .dash-tiles { grid-template-columns: 1fr; } .dp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Videos: months as video players ---------- */
#vidMonths .month-card.vid { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: 0; }
.vid .al-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vid .vd-art { display: block; width: 96px; height: 80px; flex: none; transition: transform .2s ease; }
.vid .vd-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(27,32,25,.18)); }
.vid:hover .vd-art { transform: translateY(-3px); }
.vid.empty .vd-art { filter: grayscale(.7); opacity: .5; }
.vid.empty:hover .vd-art { opacity: .8; }
#vidMonths .month-card.vid .mc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
#vidMonths .month-card.vid .mc-add { font-size: 12.5px; font-weight: 700; color: var(--accent-deep); margin-top: 2px; }
.dt-ic.orange { background: #FFF1DB; color: #D97706; }
.dash-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Video player ---------- */
.modal-card.video-card { max-width: 860px; padding: 18px; background: #0F1217; border-color: #0F1217; color: #fff; }
.video-card .btn--ghost { color: #fff; border-color: rgba(255,255,255,.25); background: transparent; }
#videoPlayer { display: block; width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.ph-img.video { cursor: pointer; }

/* Real video frames get a play badge on top */
.ph-img { position: relative; }
.ph-img.poster::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%230F1217'/%3E%3C/svg%3E") center/26px no-repeat; box-shadow: 0 4px 12px rgba(0,0,0,.25); pointer-events: none; }
