:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-elevated: #fbf8f2;
  --bg-subtle: #e8e1d4;
  --fg: #1c1915;
  --fg-muted: #6b6458;
  --fg-subtle: #8a8376;
  --border: #d8d0c2;
  --border-strong: #c3b8a6;
  --primary: #1f5c4d;
  --primary-fg: #f6f2ea;
  --in: #2c6a4a;
  --out: #9a3f30;
  --warn: #8a6420;
  --on-danger: #fff;
  --glow: rgba(31, 92, 77, 0.07);
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04), 0 12px 32px -18px rgba(28, 25, 21, 0.18);
  --radius: 12px;
  --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sidebar: 240px;
  --auth-panel: #1f5c4d;
  --auth-panel-fg: #f6f2ea;
  --theme-meta: #f3efe6;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110e;
  --bg-elevated: #1d1914;
  --bg-subtle: #2a241d;
  --fg: #f1eadf;
  --fg-muted: #b3aa9c;
  --fg-subtle: #8c8376;
  --border: #3c352c;
  --border-strong: #534a3e;
  --primary: #7dccb5;
  --primary-fg: #0c1a16;
  --in: #86d4a8;
  --out: #ee9a8c;
  --warn: #e2b65e;
  --on-danger: #1c1210;
  --glow: rgba(125, 204, 181, 0.09);
  --shadow: 0 0 0 1px rgba(241, 234, 223, 0.05), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  --theme-meta: #14110e;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--fg); }
body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--glow), transparent 50%),
    var(--bg);
  color: var(--fg);
  line-height: 1.5;
}
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
p { margin: 0; text-wrap: pretty; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
img, svg { display: block; }

.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;
}

.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1fr 1fr; }
}
.auth-panel {
  display: none;
  background: var(--auth-panel);
  color: var(--auth-panel-fg);
  padding: 3rem;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 960px) {
  .auth-panel { display: flex; }
}
.auth-panel h1 { font-size: 3rem; max-width: 22rem; color: var(--auth-panel-fg); }
.auth-panel p { color: color-mix(in srgb, var(--auth-panel-fg) 75%, transparent); max-width: 22rem; margin-top: 1.25rem; }
.auth-panel .tiny { color: color-mix(in srgb, var(--auth-panel-fg) 60%, transparent); }
.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
@media (min-width: 640px) {
  .auth-form { padding: 3rem; }
}
.auth-form-inner { width: 100%; max-width: 24rem; margin: 0 auto; }
.auth-form h2 { font-size: 1.9rem; }
.lede { color: var(--fg-muted); font-size: 0.95rem; margin-top: 0.5rem; }

.brand {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-size: 1.4rem; color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.mark { width: 2rem; height: 2rem; color: inherit; }

.app { min-height: 100dvh; }
@media (min-width: 860px) {
  .app { display: grid; grid-template-columns: var(--sidebar) 1fr; }
}
.sidebar {
  display: none;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  flex-direction: column;
}
@media (min-width: 860px) {
  .sidebar {
    display: flex;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.25rem 1rem;
  flex-shrink: 0;
}
.sidebar-brand .mark { color: var(--primary); }
.sidebar-kicker { font-size: 0.75rem; color: var(--fg-muted); margin-top: 0.2rem; }
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav a {
  display: flex; align-items: center; gap: 0.75rem;
  height: 44px; padding: 0 0.75rem; border-radius: 10px;
  color: var(--fg-muted); font-size: 0.925rem; font-weight: 550; text-decoration: none;
}
.nav a:hover { background: var(--bg-subtle); color: var(--fg); text-decoration: none; }
.nav a.is-active { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.nav svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 1rem;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.view-switch { width: 100%; }
.view-switch select {
  width: 100%; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  padding: 0 0.75rem; font: inherit; color: var(--fg);
}

.content { padding-bottom: 5.5rem; }
@media (min-width: 860px) {
  .content { padding-bottom: 0; min-width: 0; }
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
}
@media (min-width: 860px) { .bottom-nav { display: none; } }
.bottom-nav a,
.bottom-nav .more-open {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: 52px; color: var(--fg-muted); font-size: 0.68rem; font-weight: 600;
  text-decoration: none; border-radius: 10px;
  background: none; border: 0; font-family: inherit; width: 100%;
}
.bottom-nav a.is-active,
.bottom-nav .more-open.is-active { color: var(--primary); }
.bottom-nav svg { width: 1.15rem; height: 1.15rem; }

.more-scrim {
  position: fixed; inset: 0; z-index: 30;
  background: color-mix(in srgb, var(--fg) 28%, transparent);
}
.more-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--bg-elevated);
  color: var(--fg);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  max-height: min(88dvh, 640px);
  overflow: auto;
  padding: 1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px color-mix(in srgb, var(--fg) 12%, transparent);
}
.more-sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.more-sheet-head h2 { font-size: 1.25rem; }
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 1rem 0 1.15rem;
}
.more-grid a {
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 48px; padding: 0.55rem 0.75rem;
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-subtle);
  font-size: 0.9rem; font-weight: 550;
}
.more-grid a:hover { text-decoration: none; color: var(--fg); }
.more-grid a.is-active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--bg-subtle)); }
.more-grid svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
body.more-open { overflow: hidden; }
@media (min-width: 860px) {
  .more-scrim, .more-sheet { display: none !important; }
}


/* Account action dialogs */
.lw-dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  max-width: min(36rem, calc(100vw - 2rem));
  width: 100%;
  background: var(--bg-elevated);
  color: var(--fg);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--fg) 18%, transparent);
}
.lw-dialog::backdrop {
  background: color-mix(in srgb, var(--fg) 28%, transparent);
}
.lw-dialog > form,
.lw-dialog > .stack {
  padding: 1rem 1rem 1.1rem;
}
.lw-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.lw-dialog-head h2 {
  font-size: 1.2rem;
  margin: 0;
}
.page-head { padding: 1.5rem 1rem 0; }
@media (min-width: 640px) { .page-head { padding: 2rem 2rem 0; } }
.kicker {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 0.4rem;
}
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-head .desc { margin-top: 0.45rem; color: var(--fg-muted); font-size: 0.95rem; max-width: 40rem; }

.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; margin-top: 1rem;
  padding: 3px; background: var(--bg-subtle); border-radius: 10px;
}
.seg a {
  padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.85rem; font-weight: 650;
  color: var(--fg-muted); text-decoration: none; line-height: 1.2;
}
.seg a:hover { color: var(--fg); text-decoration: none; }
.seg a.on, .seg a[aria-current="page"] {
  background: var(--bg-elevated); color: var(--fg); box-shadow: var(--shadow);
}


.pad { padding: 1rem; }
@media (min-width: 640px) { .pad { padding: 2rem; } }
.grid { display: grid; gap: 1rem; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .span-2 { grid-column: span 2; }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 1.25rem; }
.stat .label {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-muted);
}
.stat .value { margin-top: 0.35rem; font-family: var(--font-display); font-size: 1.55rem; }

.progress {
  height: 6px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden;
  margin: 0 1rem;
}
@media (min-width: 640px) { .progress { margin: 0 2rem; } }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

.money { font-variant-numeric: tabular-nums; font-weight: 550; }
.money.in { color: var(--in); }
.money.out { color: var(--out); }

.row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; border-top: 1px solid var(--border);
  font-size: 0.925rem;
}
.row:first-of-type { border-top: 0; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.tiny { font-size: 0.8rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  padding: 0.7rem 0; border-top: 1px solid var(--border); font-size: 0.925rem;
}
.list.bordered { border-top: 1px solid var(--border); margin-top: 1rem; }

.badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.5rem; border-radius: 99px;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.02em;
  background: var(--bg-subtle); color: var(--fg-muted); text-transform: capitalize;
}
.badge.primary { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.badge.in { background: color-mix(in srgb, var(--in) 14%, transparent); color: var(--in); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
a.badge { text-decoration: none; cursor: pointer; }
.txn > details { grid-column: 1 / -1; }
.balance-cmp { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; justify-content: flex-end; align-items: center; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 99px; display: inline-block; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
label, .label { font-size: 0.8rem; font-weight: 650; color: var(--fg); }
/* Bare <input> (no type attr) defaults to text in HTML but does NOT match
   input[type="text"] in CSS — those were shorter than select/date. */
input:not([type]),
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
  height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elevated); color: var(--fg); font: inherit;
  padding: 0 0.8rem; width: 100%;
}
textarea { height: auto; min-height: 88px; padding: 0.7rem 0.8rem; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 1px; border-color: var(--primary);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  box-shadow: 0 0 0 44px var(--bg-elevated) inset;
  transition: background-color 99999s ease-out;
}
.stack { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.notice {
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  color: var(--primary); padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.9rem;
  margin: 1rem 1rem 0;
}
@media (min-width: 640px) { .notice { margin: 1rem 2rem 0; } }
.error {
  background: color-mix(in srgb, var(--out) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--out) 30%, var(--border));
  color: var(--out); padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.9rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1rem; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 0.925rem;
  background: var(--primary); color: var(--primary-fg); text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost {
  background: transparent; border-color: var(--border); color: var(--fg);
}
.btn.ghost:hover { background: var(--bg-subtle); }
.btn.ghost.danger { color: var(--out); border-color: color-mix(in srgb, var(--out) 35%, var(--border)); }
.btn.ghost.danger:hover { background: color-mix(in srgb, var(--out) 10%, var(--bg-elevated)); }
.btn.warn { background: var(--out); color: var(--on-danger); }
.txn-edit-meta { margin: 0.5rem 0 0; }
.txn-edit-secondary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.55rem;
  margin: 0.75rem 0 0.35rem;
}
.txn-edit-secondary .btn.ghost {
  min-height: 32px; padding: 0.15rem 0.55rem; font-weight: 500; font-size: 0.8rem;
}
.txn-edit-panel { margin-top: 0.5rem; }
.txn-edit-void { margin-top: 0.85rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.spend { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }
.spend-row { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 0.7rem; align-items: center; font-size: 0.85rem; }
.spend-row .track { height: 8px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; }
.spend-row .track > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.spend-row .amt { font-variant-numeric: tabular-nums; color: var(--fg-muted); white-space: nowrap; }

.chart-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap;
}
.chart-head h2 { margin-top: 0.15rem; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 0.85rem; font-size: 0.82rem; color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.chart-legend .swatch {
  display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.35rem;
  vertical-align: -1px;
}
.chart-legend .swatch.in { background: var(--in); }
.chart-legend .swatch.out { background: var(--out); }
.chart-grid {
  display: grid; gap: 1.5rem; margin-top: 1.1rem;
}
@media (min-width: 900px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
}
.chart { width: 100%; height: auto; display: block; margin-top: 0.55rem; overflow: visible; }
.chart-axis, .chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-tick, .chart-label {
  fill: var(--fg-muted); font-size: 11px; font-family: var(--font-sans);
}
.chart-in { fill: var(--in); }
.chart-out { fill: var(--out); opacity: 0.85; }
.chart-line {
  fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round;
}
.chart-fill { fill: color-mix(in srgb, var(--primary) 18%, transparent); }
.chart-dot { fill: var(--primary); }
.chart-dot.high { fill: var(--in); }
.chart-dot.low { fill: var(--out); }
.chart-dot.now { fill: var(--primary); stroke: var(--bg-elevated); stroke-width: 2; }
.chart-hit { fill: transparent; }
.mix { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.55rem; }
.mix-row {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 0.7rem; align-items: center; font-size: 0.85rem;
}
.mix-row .track { height: 8px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; }
.mix-row .track > i { display: block; height: 100%; border-radius: 99px; }
.mix-row .track > i.asset { background: var(--primary); }
.mix-row .track > i.debt { background: var(--out); }
.mix-row .amt { font-variant-numeric: tabular-nums; color: var(--fg-muted); white-space: nowrap; }

.day {
  display: grid; grid-template-columns: 7.2rem minmax(0,1fr) 7.8rem; gap: 0.75rem;
  padding: 0.85rem 0; border-top: 1px solid var(--border); align-items: start;
}
.day.today { background: color-mix(in srgb, var(--primary) 7%, transparent); margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; border-radius: 8px; }
.day.payday .label { color: var(--primary); font-weight: 700; }
.day.low .run { color: var(--out); }
.day.gap { padding: 0.35rem 0; border-top: 0; color: var(--fg-subtle); font-size: 0.8rem; }
.day.gap .label { letter-spacing: 0.2em; }
.day .items { font-size: 0.9rem; min-width: 0; }

.day .items div { display: flex; justify-content: space-between; gap: 0.75rem; }
.day .run { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.txn {
  display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem;
  padding: 0.8rem 0; border-top: 1px solid var(--border); font-size: 0.925rem;
}
.txn .meta { font-size: 0.78rem; color: var(--fg-subtle); }
@media (min-width: 720px) {
  .txn { grid-template-columns: 6.5rem 1fr 8rem auto; align-items: center; }
  .txn .meta { grid-column: auto; }
}

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.member-card .filters { flex-direction: column; align-items: stretch; }
.activity-filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.activity-more-filters > summary { list-style: none; cursor: pointer; }
.activity-more-filters > summary::-webkit-details-marker { display: none; }
.activity-more-summary { align-self: end; }
@media (max-width: 859px) {
  .activity-filter-search { flex: 1 1 100%; }
  .activity-more-filters { flex: 1 1 100%; }
  .activity-more-body {
    display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end;
    margin-top: 0.6rem;
  }
}
@media (min-width: 860px) {
  .activity-more-filters { display: contents; }
  .activity-more-filters > summary { display: none; }
  .activity-more-body { display: contents; }
}

.loan-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.loan-stats .label {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-muted);
}
.loan-stats .value { margin-top: 0.2rem; font-family: var(--font-display); font-size: 1.7rem; }
.loan-split {
  display: grid; gap: 1rem; margin-top: 1.25rem;
}
@media (min-width: 800px) {
  .loan-split { grid-template-columns: 1fr 1fr; align-items: start; }
}
.loan-forms {
  display: grid; gap: 1.5rem; margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
  .loan-forms { grid-template-columns: 1fr 1fr; }
}
.loan-forms h3 { font-size: 1.15rem; }
.loan-row { align-items: center !important; }
.loan-row-amt { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.loan-callout {
  margin-top: 0.85rem; padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--warn) 10%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--warn) 22%, var(--border));
  border-radius: 10px; font-size: 0.925rem;
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 44px; padding: 0 0.85rem; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-weight: 600; font-size: 0.875rem;
}
.theme-toggle:hover { background: var(--bg-subtle); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle.block { width: 100%; }
.theme-toggle.icon-only { width: 44px; padding: 0; }
.theme-toggle.icon-only .theme-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.theme-toggle.floating {
  position: fixed; top: 0.75rem; right: 0.75rem; z-index: 30;
  background: var(--bg-elevated); box-shadow: var(--shadow);
}
@media (min-width: 860px) {
  .theme-toggle.floating { display: none; }
}
.auth-layout .theme-toggle.floating { display: inline-flex; }

@media (prefers-reduced-motion: no-preference) {
  html, body, .card, .sidebar, .bottom-nav, .btn, .theme-toggle,
  input, select, textarea, .badge, .notice {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Brief 6 — quiet due strip (Planner + Bills) */
.due-nudge {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-subtle) 70%, transparent);
}
.due-nudge-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.75rem; margin-bottom: 0.35rem;
}
.due-nudge-group { margin-top: 0.45rem; }
.due-nudge-group + .due-nudge-group { margin-top: 0.65rem; }
.due-nudge-list {
  list-style: none; padding: 0; margin: 0.35rem 0 0;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.due-nudge-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.55rem;
  font-size: 0.9rem;
}
.due-nudge-list a { color: inherit; text-decoration: none; font-weight: 600; }
.due-nudge-list a:hover { text-decoration: underline; }
.due-nudge.compact { padding: 0.5rem 0.75rem; }
.due-nudge.compact .due-nudge-list li { font-size: 0.85rem; }


/* Brief 9 — quiet goals glance on Home */
.goals-glance {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-subtle) 70%, transparent);
}
.goals-glance-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.75rem; margin-bottom: 0.25rem;
}
.goals-glance-head a { text-decoration: none; }
.goals-glance-head a:hover { text-decoration: underline; }
.goals-glance-list {
  list-style: none; padding: 0; margin: 0.2rem 0 0;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.goals-glance-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.55rem;
  font-size: 0.9rem;
}
.goals-glance-list a { color: inherit; text-decoration: none; font-weight: 600; }
.goals-glance-list a:hover { text-decoration: underline; }
.goals-glance-list .badge { font-size: 0.7rem; font-weight: 500; opacity: 0.85; }


/* Brief 10 — net-worth equation strip on Home */
.nw-equation {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-subtle) 70%, transparent);
}
.nw-equation > summary {
  list-style: none;
  cursor: pointer;
}
.nw-equation > summary::-webkit-details-marker { display: none; }
.nw-phone-net {
  display: flex; align-items: baseline; gap: 0.55rem;
}
.nw-phone-net .label {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-muted);
}
.nw-phone-net .value {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 500;
}
.nw-desktop-eq { display: none; }
.nw-chev {
  margin-left: auto;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--fg-muted);
  border-bottom: 2px solid var(--fg-muted);
  transform: rotate(45deg);
  transition: transform 120ms ease;
  flex-shrink: 0;
  align-self: center;
}
.nw-equation[open] .nw-chev { transform: rotate(-135deg); }
.nw-equation-body {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.35rem 0.55rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.925rem;
}
.nw-part { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.4rem; }
.nw-k {
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-muted);
}
.nw-sep, .nw-arrow { color: var(--fg-subtle); font-weight: 500; }
.nw-asof { display: block; width: 100%; margin-top: -0.1rem; }
.nw-net .money { font-family: var(--font-display); font-size: 1.15rem; }
@media (min-width: 720px) {
  .nw-equation > summary { cursor: default; }
  .nw-phone-net { display: none; }
  .nw-desktop-eq {
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 0.4rem 0.65rem; font-size: 0.95rem;
  }
  .nw-equation-body { display: none; }
  .nw-asof { display: inline; width: auto; margin: 0; }
}


/* Brief 15 — Credit Cards list: Balance · Current · Expected next */
.cc-list { display: flex; flex-direction: column; gap: 0.85rem; max-width: 44rem; }
.cc-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.cc-metric .value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 0.1rem;
}
@media (min-width: 640px) {
  .cc-metrics {
    flex-direction: row;
    gap: 1.25rem;
  }
  .cc-metric { flex: 1; min-width: 0; }
}

/* Brief 16 — Planner statement pay session */
.spp-h { margin-top: 1.1rem; font-size: 0.95rem; }
.spp-cards { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.spp-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg-subtle);
}
.spp-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; }
.spp-card-name { font-family: var(--font-display); font-size: 1.05rem; }
.spp-card-meta { margin-top: 0.25rem; margin-left: 1.55rem; }
.spp-amt { margin-top: 0.55rem; margin-left: 1.55rem; max-width: 22rem; }
.spp-amt-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.2rem; }
.spp-amt-row input { flex: 1; min-width: 7rem; }
.spp-fund { display: grid; gap: 0.35rem 0.75rem; }
@media (min-width: 560px) {
  .spp-fund { grid-template-columns: 1fr 7.5rem; align-items: end; }
  .spp-fund .spp-floor { grid-column: 1 / -1; margin: 0; }
}
.spp-floor.warn, .spp-floor-warn { color: var(--warn); }
.spp-proj-list {
  list-style: none; margin: 0.65rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.spp-proj-list li {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem; align-items: baseline;
  padding: 0.45rem 0; border-bottom: 1px solid var(--border);
}
.spp-proj-list li:last-child { border-bottom: 0; }
