/* Hub — light by default, navy dark mode. Phone: bottom tab bar. Desktop: dark icon sidebar. */
:root {
  --bg: #F2F3F7; --card: #FFFFFF; --ink: #0F1222; --muted: #5C6178; --line: #E4E6EE; --chip: #EEF0F5; --seg: #E6E8F0;
  --accent: #3646F4; --accent-ink: #2331C9; --on-accent: #FFFFFF; --accent-soft: #E8EAFE;
  --good: #0E7A53; --good-soft: #E1F3EA; --warn: #8F5400; --warn-soft: #FFF0D6; --bad: #C02F2F; --bad-soft: #FBE3E3;
  --teal: #0E8C8C; --bill: #D97A00; --side: #0F1222; --side-ink: #A3A9D3;
  --hero-track: rgba(255,255,255,.22); --shadow: 0 12px 28px rgba(54,70,244,.28);
  --font: Figtree, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --r-lg: 24px; --r-md: 18px; --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A0E27; --card: #131A40; --ink: #EEF0FF; --muted: #A3A9D3; --line: #252D5E; --chip: #1C2452; --seg: #1C2452;
  --accent: #7C86FF; --accent-ink: #A3AAFF; --on-accent: #0A0E27; --accent-soft: #232C66;
  --good: #4BD69E; --good-soft: #12372E; --warn: #F4BB4F; --warn-soft: #3A2D10; --bad: #FF7D7D; --bad-soft: #3D1F2A;
  --teal: #3FD0D0; --bill: #F4BB4F; --side: #070A1D; --side-ink: #8C93C4;
  --hero-track: rgba(10,14,39,.18); --shadow: 0 0 34px rgba(124,134,255,.40); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0A0E27; --card: #131A40; --ink: #EEF0FF; --muted: #A3A9D3; --line: #252D5E; --chip: #1C2452; --seg: #1C2452;
  --accent: #7C86FF; --accent-ink: #A3AAFF; --on-accent: #0A0E27; --accent-soft: #232C66;
  --good: #4BD69E; --good-soft: #12372E; --warn: #F4BB4F; --warn-soft: #3A2D10; --bad: #FF7D7D; --bad-soft: #3D1F2A;
  --teal: #3FD0D0; --bill: #F4BB4F; --side: #070A1D; --side-ink: #8C93C4;
  --hero-track: rgba(10,14,39,.18); --shadow: 0 0 34px rgba(124,134,255,.40); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
h3 { font-size: 1rem; font-weight: 700; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
.num, .amt { font-variant-numeric: tabular-nums; }
.amt { white-space: nowrap; font-weight: 700; }
.amt.in { color: var(--good); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Frame ---------- */
.main {
  max-width: 1180px; margin: 0 auto;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
body.bare .main { padding-bottom: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.add-desk { display: none; }

.side { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-right, 0px));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 0; }
.tabbar a.on { color: var(--accent); font-weight: 700; }
.fab {
  justify-self: center; width: 60px; height: 60px; margin-top: -30px; border-radius: 30px;
  border: 4px solid var(--bg); background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: var(--shadow); cursor: pointer;
}

@media (min-width: 960px) {
  body.app { display: flex; }
  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; flex: 0 0 216px;
    background: var(--side); color: var(--side-ink); padding: 20px 12px; overflow-y: auto;
  }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); text-decoration: none; padding: 9px 12px; border-radius: 14px; font-weight: 600; font-size: .95rem; }
  .side a:hover { background: rgba(255,255,255,.06); color: #FFFFFF; }
  .side a.on { background: rgba(255,255,255,.12); color: #FFFFFF; }
  .side-brand { width: 44px; height: 44px; justify-content: center; padding: 0 !important; background: #3646F4; color: #FFFFFF !important; font-weight: 800; font-size: 18px; margin: 0 0 14px 8px; }
  .side-out { margin-top: auto; }
  .main { flex: 1; min-width: 0; padding-top: 28px; padding-bottom: 48px; padding-left: 32px; padding-right: 32px; }
  .tabbar { display: none; }
  .btn.add-desk { display: inline-flex; }
}

/* ---------- Building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flat { border: 0; }
.card.dark { background: #0F1222; color: #FFFFFF; border-color: transparent; }
.card.dark .muted { color: #C9CCE0; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.grid.two, .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two.stack-phone, .grid.three.stack-phone { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .grid.two.stack-phone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three, .grid.three.stack-phone { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.hero { background: var(--accent); color: var(--on-accent); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); text-decoration: none; }
.hero .label { font-size: 13px; font-weight: 600; opacity: .85; }
.hero .big { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero .track { height: 8px; border-radius: 4px; background: var(--hero-track); margin-top: 10px; overflow: hidden; }
.hero .track span { display: block; height: 100%; background: var(--on-accent); border-radius: 4px; }
.hero .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.hero .split div { background: var(--hero-track); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hero .split strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.hero .meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; opacity: .85; gap: 8px; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .label, .label-up { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.hero-stat { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: var(--shadow); }
.stat.hero-stat .label { color: inherit; opacity: .85; }
.stat .pill { align-self: flex-start; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Agenda rows */
.rows { display: flex; flex-direction: column; }
.rowi { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.rowi:first-child { border-top: 0; }
.rowi .when { width: 50px; flex: none; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rowi .when.late { color: var(--bad); }
.rowi .bar-mark { width: 4px; align-self: stretch; border-radius: 2px; background: var(--accent); flex: none; }
.rowi .bar-mark.bill { background: var(--bill); } .rowi .bar-mark.task { background: var(--teal); }
.rowi .bar-mark.birthday { background: #C2459A; } .rowi .bar-mark.countdown { background: var(--good); }
.rowi .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rowi .t { font-weight: 700; overflow-wrap: anywhere; }
.rowi .s { font-size: 13px; color: var(--muted); }
.rowi .end { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tick { width: 26px; height: 26px; flex: none; border-radius: 13px; border: 2px solid var(--muted); background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; }
.tick.late { border-color: var(--bad); }
.tick.done, .tick:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.done-text .t { text-decoration: line-through; color: var(--muted); }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.ok, .pill.good { background: var(--good-soft); color: var(--good); }
.pill.soon, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.late, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.bar { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.warn span { background: var(--bill); } .bar.none span { background: var(--muted); opacity: .45; } .bar.over span { background: var(--bad); } .bar.good span { background: var(--good); }
.budget-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .main, .list-main { min-width: 0; flex: 1; }
.list .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert strong { display: block; }
.alert a { color: inherit; font-weight: 700; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--seg); }
.seg a, .seg button { height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.seg .on { background: var(--ink); color: var(--card); font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); min-height: 104px; }
.tile .ic { color: var(--accent); }
.tile strong { font-size: 15px; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.on { background: var(--warn-soft); border-color: transparent; }
.tile.on .ic { color: var(--warn); }

.week-dots { display: flex; gap: 5px; }
.dot { width: 18px; height: 18px; border-radius: 9px; background: var(--chip); border: 0; padding: 0; cursor: pointer; }
.dot.done { background: var(--accent); }
.dot.today { box-shadow: inset 0 0 0 2px var(--accent); }
.dot.done.today { box-shadow: none; }
.dot.future { cursor: default; opacity: .55; }

/* Forms */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input[type=text], input[type=number], input[type=password], input[type=email], input[type=date], input[type=time], input[type=search], input[type=file], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.fields { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields .wide { grid-column: 1 / -1; } }
.field-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-inline > input, .field-inline > select { flex: 1 1 160px; width: auto; }
.check { display: flex; gap: 8px; align-items: center; font-size: .95rem; color: var(--ink); font-weight: 500; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 700;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; text-decoration: none; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.more-form > summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
details.more-form > summary::-webkit-details-marker { display: none; }
details.more-form[open] > summary { margin-bottom: 12px; }

.flash { background: var(--good-soft); color: var(--good); padding: 12px 14px; border-radius: var(--r-sm); font-weight: 600; }
.error { background: var(--bad-soft); color: var(--bad); padding: 12px 14px; border-radius: var(--r-sm); }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* Legacy money pages */
.txn { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.txn:first-child { border-top: 0; }
.txn .controls, .controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.txn .controls select { flex: 1 1 200px; width: auto; min-height: 38px; padding: 6px 10px; }
.controls label { margin: 0; display: flex; gap: 6px; align-items: center; font-size: .8rem; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.toolbar > * { flex: 1 1 160px; }
.toolbar button, .toolbar .btn { flex: 0 0 auto; }
table.edit { width: 100%; border-collapse: collapse; }
table.edit td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
button.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
button.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
button:not([class]), button.ghost, button.danger, button.small {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; font-weight: 700; border-radius: 999px; cursor: pointer;
}
button:not([class]) { border: 0; background: var(--accent); color: var(--on-accent); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 6px; }
.cal-day { height: 50px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 3px; text-decoration: none; color: var(--ink); border-radius: 12px; }
.cal-day .n { width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; }
.cal-day.out { color: var(--muted); opacity: .6; }
.cal-day.today .n { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.cal-day.sel .n { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.pay { background: var(--good-soft); border-radius: 0; }
.cal-day.pay.pay-first { border-radius: 14px 0 0 14px; } .cal-day.pay.pay-last { border-radius: 0 14px 14px 0; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.cal-dots i.bill { background: var(--bill); } .cal-dots i.task { background: var(--teal); } .cal-dots i.birthday { background: #C2459A; } .cal-dots i.countdown { background: var(--good); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
.legend i.bill { background: var(--bill); } .legend i.task { background: var(--teal); } .legend i.birthday { background: #C2459A; } .legend i.pay { width: 14px; background: var(--good-soft); }

/* Donut */
.donut-wrap { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.donut-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.donut-centre .big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 13px; }
@media (min-width: 500px) { .key { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.key span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* Sheet (quick capture) */
dialog.sheet { border: 0; padding: 0; background: transparent; width: 100%; max-width: 560px; margin: auto auto 0; color: var(--ink); }
dialog.sheet::backdrop { background: rgba(10,14,39,.45); }
.sheet-in { background: var(--card); border-radius: 26px 26px 0 0; padding: 20px max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 700px) { dialog.sheet { margin: auto; } .sheet-in { border-radius: 26px; } }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.capture-preview { border-radius: var(--r-md); background: var(--accent-soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.capture-preview .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.capture-preview strong { font-size: 17px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 40; background: var(--ink); color: var(--card); padding: 12px 18px; border-radius: 999px; font-weight: 600; max-width: calc(100% - 32px); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

.login { max-width: 380px; width: 100%; margin: 10vh auto 0; }
.brandmark { width: 52px; height: 52px; border-radius: 16px; background: #3646F4; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }

/* Fitness */
.ring-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sleep-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.bars7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 110px; }
.bars7 div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.bars7 b { width: 100%; max-width: 28px; border-radius: 8px 8px 4px 4px; background: var(--chip); display: block; }
.bars7 b.on { background: var(--accent); opacity: .6; } .bars7 b.today { opacity: 1; }

/* Smart home */
.light { border: 0; text-align: left; font: inherit; cursor: pointer; }
.light[aria-pressed="true"] { background: var(--warn-soft); border-color: transparent; }
.light[aria-pressed="true"] .ic { color: var(--warn); }
.light[disabled] { opacity: .5; }

/* Checklist */
.items { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item.is-done .t { text-decoration: line-through; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .bar span, .hero .track span { transition: width .4s ease; }
  .tick, .dot { transition: background .15s ease; }
}

/* Spending list */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1 1 220px; min-width: 0; }
.search-wrap .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 40px; border-radius: 999px; background: var(--card); }
select.pick { width: auto; flex: 0 1 auto; border-radius: 999px; background: var(--card); padding-right: 32px; }
.seg.mini { flex: 0 0 auto; }
.seg.mini a { height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.txn-summary { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 0 4px; }
.txn-summary .in { color: var(--good); font-weight: 700; }
.txn-day { display: flex; flex-direction: column; gap: 8px; }
.txn-day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.txn-day-head h3 { font-size: 14px; font-weight: 700; color: var(--muted); }
.txn-list { padding: 4px 16px; gap: 0; }
.txn-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.txn-row:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 800; font-size: 16px; }
.txn-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.txn-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.txn-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.txn-amt { font-weight: 800; white-space: nowrap; }
.txn-amt.in { color: var(--good); }
.txn-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select.cat-select { width: auto; max-width: 100%; min-height: 30px; padding: 3px 28px 3px 12px; font-size: 13px; font-weight: 600; border-radius: 999px; border: 0; background-color: var(--chip); color: var(--ink); cursor: pointer; }
select.cat-select.empty { background-color: var(--warn-soft); color: var(--warn); }
.always { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.always input { width: 15px; height: 15px; accent-color: var(--accent); }
.txn-src { font-size: 12px; color: var(--muted); margin-left: auto; }
@media (max-width: 520px) { .txn-src { display: none; } }
@media (max-width: 520px) {
  .txn-meta { flex-wrap: nowrap; }
  select.cat-select { flex: 0 1 auto; min-width: 0; }
  .always { flex: none; }
  .filterbar select.pick { flex: 1 1 140px; }
}
