/* Деньги: dark finance dashboard. Visual language sampled from the iOS money app in the references:
   pure black canvas, graphite cards, tinted category tiles, green income / orange expense chips, pill switchers. */

:root {
  --bg: #000;
  --card: #111112;
  --card-2: #1c1c1e;
  --card-3: #2c2c2e;
  --card-4: #3a3a3c;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #fff;
  --text-2: #8e8e93;
  --text-3: #5c5c61;
  --green: #34c77b;
  --green-bg: rgba(52, 199, 123, .16);
  --orange: #ff9f0a;
  --orange-bg: rgba(255, 159, 10, .17);
  --red: #ff453a;
  --red-bg: rgba(255, 69, 58, .16);
  --blue: #0a84ff;
  --prev: #8e8e93;
  --r-card: 24px;
  --r-row: 18px;
  --r-tile: 13px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.hide { display: none !important; }
.show-m { display: none; }

/* ---------- shell ---------- */

.shell { max-width: 1320px; margin: 0 auto; padding: 18px 28px 64px; }
.topbar { display: flex; align-items: center; gap: 16px; height: 64px; margin-bottom: 18px; }
.brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; height: 52px;
  background: var(--card-2); border-radius: 999px; border: 1px solid var(--line);
}
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.1; }
.brand-sub { color: var(--text-2); font-size: 12.5px; line-height: 1.2; }
.nav {
  margin: 0 auto; display: flex; gap: 2px; padding: 5px; background: var(--card-2); border-radius: 999px; border: 1px solid var(--line);
}
.nav a {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; color: var(--text-2);
  font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); }
.nav a.on { background: var(--card-4); color: var(--text); }
.tools { display: flex; gap: 2px; padding: 5px; background: var(--card-2); border-radius: 999px; border: 1px solid var(--line); }
.tool { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.tool:hover, .tool.on { background: var(--card-4); }

.demo-bar {
  display: flex; align-items: center; gap: 12px; margin: -4px 0 18px; padding: 12px 16px; border-radius: 16px;
  background: var(--orange-bg); color: #ffd29a; font-size: 14px;
}
.demo-bar b { color: #fff; font-weight: 600; }
.demo-bar button { margin-left: auto; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 500; font-size: 13.5px; }

/* ---------- grid & cards ---------- */

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .card:last-child { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; min-width: 0; position: relative; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-height: 36px; }
.card-t { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.card-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.more { color: var(--text-2); font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.more:hover { color: var(--text); }
.page-h { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; flex-wrap: wrap; }
.page-t { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.page-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- pills, buttons, chips ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-weight: 500; white-space: nowrap;
}
button.pill:hover { background: var(--card-3); }
.pill.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.monthsw { display: inline-flex; align-items: center; height: 40px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.monthsw button { width: 36px; height: 38px; display: grid; place-items: center; color: var(--text-2); border-radius: 999px; }
.monthsw button:hover:not(:disabled) { color: var(--text); }
.monthsw button:disabled { opacity: .3; cursor: default; }
.monthsw span { min-width: 112px; text-align: center; font-weight: 500; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 13px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card-4); color: var(--text); }
.seg button.on.exp { background: var(--orange-bg); color: var(--orange); }
.seg button.on.inc { background: var(--green-bg); color: var(--green); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 16px;
  background: var(--card-3); color: var(--text); font-weight: 600; font-size: 16px;
}
.btn.light { background: #e9e9eb; color: #000; }
.btn.light:hover { background: #fff; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); }
.round:hover { background: var(--card-3); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 7px; font-size: 12.5px; font-weight: 500; background: var(--card-3); color: var(--text-2); }
.arrow-chip { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.arrow-chip.inc { background: var(--green-bg); color: var(--green); }
.arrow-chip.exp { background: var(--orange-bg); color: var(--orange); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; padding: 2px 7px 2px 5px; border-radius: 8px; }
.delta.good { color: var(--green); background: var(--green-bg); }
.delta.bad { color: var(--red); background: var(--red-bg); }
.delta.flat { color: var(--text-2); background: var(--card-3); }

/* category tile: tinted square with the category color */
.tile { width: 44px; height: 44px; border-radius: var(--r-tile); display: grid; place-items: center; flex: none; }
.tile.sm { width: 34px; height: 34px; border-radius: 10px; }
.tile.lg { width: 56px; height: 56px; border-radius: 16px; }

/* ---------- hero (balance) ---------- */

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 22px 22px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 70% at 50% -10%, rgba(52, 199, 123, .13), transparent 60%);
}
.hero.negative::before { background: radial-gradient(120% 70% at 50% -10%, rgba(255, 159, 10, .13), transparent 60%); }
.hero-label { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; }
.hero-num { font-size: clamp(46px, 5.2vw, 68px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; margin: 18px 0 12px; white-space: nowrap; }
.hero-flows { display: flex; gap: 22px; justify-content: center; font-size: 19px; font-weight: 500; }
.hero-flows > div { display: inline-flex; align-items: center; gap: 8px; }
.savebar { width: min(340px, 100%); margin: 22px auto 10px; display: flex; gap: 3px; height: 5px; }
.savebar i { display: block; height: 100%; border-radius: 3px; }
.savecap { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 500; font-size: 14.5px; }
.savecap.warn { color: var(--orange); }
.hero-actions { display: flex; gap: 8px; margin-top: 18px; }

/* ---------- insight tiles ---------- */

.stat { display: flex; flex-direction: column; min-height: 168px; padding: 20px; }
.stat-h { display: flex; align-items: flex-start; gap: 10px; }
.stat-t { font-weight: 600; font-size: 16px; line-height: 1.25; }
.stat-h .ic { margin-left: auto; color: var(--text-2); }
.stat-d { color: var(--text-2); font-size: 14px; margin-top: 6px; line-height: 1.35; }
.stat-v { margin-top: auto; text-align: right; font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; padding-top: 14px; white-space: nowrap; }
.stat.center { align-items: center; text-align: center; }
.stat.center .stat-t { margin-bottom: 12px; }
.stat-name { font-weight: 500; color: var(--text-2); margin-top: 10px; }
.stat-merch { color: var(--text-3); font-size: 13.5px; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-amt { margin-top: auto; padding-top: 10px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

/* ---------- charts ---------- */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.axis text, .chart .lbl { fill: var(--text-3); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.grid-line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; shape-rendering: crispEdges; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 14px; font-size: 15px; font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend em { font-style: normal; color: var(--text-2); font-weight: 400; font-size: 13px; }
.hit { fill: transparent; cursor: pointer; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; background: #2c2c2e; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 9px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); max-width: 260px;
}
.tip b { font-weight: 600; }
.tip .row { display: flex; gap: 14px; justify-content: space-between; align-items: center; }
.tip .k { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.tip .k i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* donut */
.donut-wrap { display: flex; flex-direction: column; align-items: center; }
.donut { position: relative; width: min(270px, 100%); aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; }
.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 22%; }
.donut-center .k { color: var(--text-2); font-size: 13px; }
.donut-center .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.seg-arc { transition: opacity .15s; cursor: pointer; }
.donut.focus .seg-arc { opacity: .35; }
.donut.focus .seg-arc.on { opacity: 1; }

/* category share list */
.clist { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.crow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; cursor: pointer; }
.crow:hover, .crow.on { background: var(--card-2); }
.crow .nm { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .amt { font-weight: 600; white-space: nowrap; }
.crow .sh { color: var(--text-2); font-size: 13px; width: 46px; text-align: right; }

/* ---------- transactions ---------- */

.day-h { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13.5px; padding: 14px 6px 8px; }
.day-h:first-child { padding-top: 0; }
.tx {
  display: flex; align-items: center; gap: 13px; padding: 12px 16px 12px 12px; background: var(--card-2); border-radius: var(--r-row);
  margin-bottom: 6px; width: 100%; text-align: left; transition: background .12s;
}
.tx:hover { background: #242426; }
.tx .body { flex: 1; min-width: 0; }
.tx .t1 { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .t2 { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tx .t3 { display: flex; gap: 6px; margin-top: 5px; align-items: center; flex-wrap: wrap; }
.acc-chip { gap: 5px; color: #c7c7cc; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx.adjustment .t1 { color: var(--text-2); }

/* accounts */
.accrow {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 12px 16px 12px 12px; margin-bottom: 6px;
  background: var(--card-2); border-radius: var(--r-row); transition: background .12s;
}
.accrow:hover { background: #242426; }
.accrow .body { flex: 1; min-width: 0; }
.accrow .nm { font-weight: 500; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accrow .sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.accrow .amt { text-align: right; white-space: nowrap; }
.accrow .a1 { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.accrow .a2 { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.accline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.accline .pill { height: 46px; min-width: 0; }
.accline.tr { flex-direction: column; align-items: stretch; gap: 6px; }
.pill.full { width: 100%; }
.pill.full select { flex: 1; max-width: none; }
.seg.wide { display: flex; width: 100%; margin: 6px 0 4px; }
.seg.wide button { flex: 1; justify-content: center; height: 38px; }
.pill .lbl { color: var(--text-2); font-size: 13.5px; font-weight: 400; }
.pill select { background: none; border: 0; outline: none; appearance: none; -webkit-appearance: none; font-weight: 600; color: var(--text); min-width: 0; max-width: 220px; text-overflow: ellipsis; cursor: pointer; }
.pill select option { background: #1c1c1e; color: #fff; }
.basesw { margin-top: 20px; }
.setbal { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--orange-bg); color: var(--orange); font-weight: 600; font-size: 13.5px; }
.brand-sub.warn { color: var(--orange); }
.tx .amt { text-align: right; white-space: nowrap; }
.tx .a1 { font-weight: 500; font-size: 16px; }
.tx .a2 { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.tx.income .a1 { color: var(--green); }
.tile-wrap { position: relative; }
.tile-badge { position: absolute; right: -5px; top: -5px; width: 19px; height: 19px; border-radius: 50%; background: #e5e5ea; color: #000; display: grid; place-items: center; border: 2px solid var(--card-2); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search input { width: 100%; height: 40px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); padding: 0 14px 0 40px; outline: none; }
.search input:focus { border-color: var(--line-2); }
.search .ic { position: absolute; left: 14px; top: 11px; color: var(--text-2); }
.catsel { height: 40px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); padding: 0 34px 0 14px; outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; font-weight: 500; }
.totals-line { display: flex; gap: 18px; color: var(--text-2); font-size: 14px; margin: -4px 0 14px 4px; flex-wrap: wrap; }
.totals-line b { color: var(--text); font-weight: 600; }
.loadmore { display: flex; justify-content: center; margin-top: 10px; }

/* ---------- budgets ---------- */

.budget { background: var(--card-2); border-radius: var(--r-row); padding: 14px 16px 16px 14px; margin-bottom: 8px; cursor: pointer; transition: background .12s; display: block; width: 100%; text-align: left; }
.budget:hover { background: #242426; }
.budget .top { display: flex; align-items: center; gap: 13px; }
.budget .body { flex: 1; min-width: 0; }
.budget .nm { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget .meta { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.budget .lim { text-align: right; }
.budget .l1 { font-weight: 500; font-size: 16px; white-space: nowrap; }
.budget .l2 { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 4px; white-space: nowrap; }
.budget .left { color: var(--green); font-size: 14.5px; font-weight: 500; }
.budget.over .left { color: var(--red); }
.budget.ahead .left { color: var(--orange); }
.bar { position: relative; height: 4px; border-radius: 2px; background: var(--card-3); margin: 14px 2px 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: #e5e5ea; }
.budget.over .bar i { background: var(--red); }
.budget.ahead .bar i { background: var(--orange); }
.bar .pace { position: absolute; top: -5px; width: 2px; height: 14px; border-radius: 1px; background: #c7c7cc; transform: translateX(-1px); }
.group-h { color: var(--text-2); font-size: 14px; text-align: center; padding: 6px 0 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.nobudget { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.nobudget:hover { background: var(--card-2); }
.nobudget .nm { flex: 1; font-weight: 500; }
.nobudget .pill { height: 32px; font-size: 13.5px; }

/* ---------- report ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 20px; }
.kpi .k { color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin: 10px 0 8px; white-space: nowrap; }
.kpi .d { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 14px; }
.hbar:hover { background: var(--card-2); }
.hbar .top { display: flex; align-items: baseline; gap: 8px; }
.hbar .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .sh { color: var(--text-2); font-size: 13px; }
.hbar .track { height: 6px; border-radius: 3px; background: transparent; margin-top: 7px; }
.hbar .track i { display: block; height: 100%; border-radius: 3px; }
.hbar .r { text-align: right; }
.hbar .amt { font-weight: 600; white-space: nowrap; }
.hbar .r .delta { margin-top: 4px; }
.insights { display: flex; flex-direction: column; gap: 10px; }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--card-2); border-radius: 16px; line-height: 1.45; }
.insight .ic { color: var(--orange); margin-top: 1px; }
.mlist { display: flex; flex-direction: column; gap: 2px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 14px; }
.mrow:hover { background: var(--card-2); }
.mrow .body { flex: 1; min-width: 0; }
.mrow .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .sub { color: var(--text-2); font-size: 13px; }
.mrow .amt { font-weight: 600; white-space: nowrap; }
.rank { width: 22px; color: var(--text-3); font-size: 13px; text-align: center; flex: none; }
.print-head { display: none; }

/* ---------- settings ---------- */

.steps { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.7; }
.steps b { color: var(--text); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--text-2); font-size: 13.5px; }
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow code, .codebox {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  font: 13px/1.45 ui-monospace, "SF Mono", Menlo, monospace; color: #d1d1d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.codebox { white-space: pre-wrap; max-height: 220px; overflow: auto; display: block; }
.input, .select, textarea.input {
  height: 46px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); padding: 0 14px; outline: none; width: 100%;
}
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: rgba(255, 255, 255, .25); }
.cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.catitem { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; text-align: left; }
.catitem:hover { background: var(--card-2); }
.catitem .nm { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catitem .nm small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.catitem .n { color: var(--text-3); font-size: 13px; }
.log { font-size: 13px; }
.log .row { display: grid; grid-template-columns: 120px 70px 1fr; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.log .row:last-child { border-bottom: 0; }
.log .p { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.tag-src { font-size: 11.5px; color: var(--text-2); background: var(--card-3); border-radius: 6px; padding: 1px 6px; justify-self: start; }

/* ---------- empty & loading ---------- */

.empty { text-align: center; color: var(--text-2); padding: 28px 16px; line-height: 1.5; }
.empty > .ic { margin: 0 auto 10px; color: var(--text-3); }
.empty b { color: var(--text); font-weight: 500; }
.say { display: inline-block; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); color: #d1d1d6; font-size: 14px; }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--card-3); border-top-color: var(--text-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal (bottom sheet on mobile) ---------- */

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.sheet { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #0d0d0e; border: 1px solid var(--line-2); border-radius: 30px; padding: 18px 18px 20px; animation: rise .2s ease; }
.sheet-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet-h .t { flex: 1; text-align: center; font-weight: 600; font-size: 17px; }
.sheet-h .round { width: 40px; height: 40px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.amount-in { text-align: center; margin: 22px 0 6px; }
.amount-in input {
  width: 100%; background: none; border: 0; outline: none; text-align: center; font-size: 60px; font-weight: 600; letter-spacing: -.04em; padding: 0;
}
.amount-in input::placeholder { color: var(--text-3); }
.amount-conv { text-align: center; color: var(--text-3); font-size: 24px; font-weight: 600; min-height: 32px; letter-spacing: -.02em; }
.row-pills { display: flex; gap: 8px; margin: 18px 0 8px; flex-wrap: wrap; }
.row-pills .pill { height: 46px; }
.row-pills input[type=date] { background: none; border: 0; outline: none; color: var(--text); width: 132px; }
.row-pills select { background: none; border: 0; outline: none; appearance: none; -webkit-appearance: none; font-weight: 600; }
.picker { background: var(--card-2); border-radius: 22px; padding: 14px 10px 10px; margin-top: 8px; }
.picker-icons { display: flex; gap: 10px; overflow-x: auto; padding: 8px 8px 12px; margin: -4px -2px 0; scrollbar-width: none; scroll-padding: 8px; }
.picker-icons::-webkit-scrollbar { display: none; }
.picker-icons button { flex: none; width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; transition: box-shadow .12s; }
.picker-icons button.on { box-shadow: 0 0 0 2px var(--card-2), 0 0 0 4px currentColor; }
.picker-name { text-align: center; font-weight: 500; font-size: 15px; min-height: 22px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; }
.swatches button.on { box-shadow: 0 0 0 2px #0d0d0e, 0 0 0 4px #fff; }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.iconpick button { height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); background: var(--card-2); }
.iconpick button.on { color: #000; background: #e5e5ea; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; text-align: center; min-height: 20px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; background: #2c2c2e; border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 999px; font-weight: 500; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }

/* ---------- login ---------- */

.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(360px, 100%); text-align: center; }
.login-box .brand-mark { width: 64px; height: 64px; margin: 0 auto 18px; }
.login-box h1 { font-size: 34px; letter-spacing: -.03em; margin: 0 0 6px; }
.login-box p { color: var(--text-2); margin: 0 0 26px; }
.pin { width: 100%; height: 60px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); text-align: center; font-size: 26px; letter-spacing: .4em; outline: none; font-weight: 600; }
.login-box .btn { width: 100%; margin-top: 12px; }

/* ---------- mobile bottom nav ---------- */

.tabbar { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .s3 { grid-column: span 6; } .s4, .s5, .s7, .s8 { grid-column: span 12; } .s6 { grid-column: span 6; }
  .nav a { padding: 0 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  /* stack overview columns as plain grid items so the long "recent" list goes last */
  .col { display: contents; }
  .col > .card { grid-column: span 12; }
  .col > .o2, .col > .o3 { grid-column: span 6; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; }
}
@media (max-width: 960px) {
  .nav a span { display: none; }
  .nav a { padding: 0 14px; }
  .s6 { grid-column: span 12; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { padding: max(10px, env(safe-area-inset-top)) 14px calc(110px + env(safe-area-inset-bottom)); }
  .topbar { height: 56px; margin-bottom: 8px; }
  .brand { height: 48px; padding-right: 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .nav { display: none; }
  .tools { margin-left: auto; }
  .tool { width: 38px; height: 38px; }
  .grid, .col { gap: 10px; }
  .s3 { grid-column: span 6; }
  .col > .o2, .col > .o3 { grid-column: span 12; }
  .hide-m { display: none !important; }
  .card-h { flex-wrap: wrap; row-gap: 10px; }
  .accrow { gap: 11px; padding: 11px 12px 11px 10px; }
  .accrow .nm .chip { display: none; }
  .accrow .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .setbal { height: 28px; padding: 0 10px; font-size: 12.5px; }
  .show-m { display: inline !important; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .filters .seg { display: flex; width: 100%; }
  .filters .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .filters .catsel { flex: 1 1 0; min-width: 0; }
  .card { padding: 18px 16px; border-radius: 22px; }
  .hero { background: transparent; border: 0; padding: 14px 0 6px; }
  .hero::before { display: none; }
  .hero-num { font-size: 52px; }
  .hero-flows { font-size: 17px; }
  .stat { min-height: 150px; padding: 16px; }
  .stat-v { font-size: 28px; }
  .page-t { font-size: 30px; }
  .page-h .right { margin-left: 0; width: 100%; }
  .kpis { gap: 10px; }
  .kpi { padding: 16px; }
  .kpi .v { font-size: 24px; }
  .tabbar {
    display: flex; position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 2px; padding: 5px; border-radius: 999px; background: rgba(28, 28, 30, .86); border: 1px solid var(--line-2);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  .tabbar a { width: 58px; height: 50px; border-radius: 999px; display: grid; place-items: center; color: var(--text-2); }
  .tabbar a.on { background: var(--card-4); color: var(--text); }
  .tabbar .add { background: #e9e9eb; color: #000; margin-left: 4px; }
  .overlay { align-items: end; padding: 0; }
  .sheet { width: 100%; border-radius: 30px 30px 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .log .row { grid-template-columns: 1fr; gap: 2px; }
  .demo-bar { flex-wrap: wrap; }
}

/* ---------- print (report → PDF) ---------- */

@media print {
  :root { --bg: #fff; --card: #fff; --card-2: #f2f2f7; --card-3: #e5e5ea; --text: #000; --text-2: #555; --text-3: #888; --line: #ddd; }
  body { background: #fff; color: #000; }
  .topbar, .tabbar, .demo-bar, .noprint, .page-h .right { display: none !important; }
  .print-head { display: block; color: #555; margin-bottom: 12px; }
  .shell { padding: 0; max-width: none; }
  .card { break-inside: avoid; border-color: #ddd; }
  .grid { gap: 10px; }
  .s5, .s7 { grid-column: span 12; }
}
