/* Marlin: design system
   ------------------------------------------------------------------------------------------
   Design read: a private personal-finance dashboard for one owner who checks it often,
   calm and precise (Linear / Mercury family), built with native CSS tokens, Geist and
   Phosphor icons, no framework.
   Dials (Taste skill): DESIGN_VARIANCE 4, MOTION_INTENSITY 4, VISUAL_DENSITY 6.
   Locks:
     - One accent (blue). Status colors (good / warning / critical) only for state, always with text.
     - One gray family (cool neutral). Never pure #000 or #fff.
     - Radius rule: panels and floating layers 12px, controls 8px, small items (chips, badges,
       menu items, segmented thumb) 6px, logo tiles = size / 4.
     - Theme: follows the system unless Settings pins Light or Dark ([data-theme] on <html>).
   Tokens use light-dark(), so each color is defined once for both themes.
   Full rules for future pages: .claude/skills/finance-app-ui/SKILL.md */

@font-face {
  font-family: 'Geist';
  src: url('/assets/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Surfaces */
  --page: light-dark(#f4f5f7, #0b0d10);
  --surface: light-dark(#fcfcfd, #14171b);
  --surface-2: light-dark(#f2f4f7, #1b1f24);
  --surface-3: light-dark(#e8ebf0, #242a31);
  --line: light-dark(#e3e6eb, #272c33);
  --line-strong: light-dark(#cbd1d9, #373e47);
  --control: light-dark(#848b96, #6c737e);       /* input and secondary button borders, 3:1 */

  /* Ink */
  --ink: light-dark(#0e1116, #eceef1);
  --ink-2: light-dark(#464d58, #b6bcc5);
  --ink-3: light-dark(#646b77, #8f96a0);          /* muted text, still 4.5:1 on surfaces */

  /* The one accent */
  --accent: light-dark(#2a78d6, #3987e5);         /* chart marks, meters */
  --accent-text: light-dark(#1f63c0, #7db1f2);    /* links, focus rings, active states */
  --accent-wash: light-dark(#e6eefb, #16283f);
  --accent-track: light-dark(#d3e3f8, #1b3353);

  /* Status (never used for identity) */
  --pos: light-dark(#0f7a3e, #48c78a);            /* money in */
  --warn: light-dark(#8a5700, #f2bd4b);
  --warn-fill: light-dark(#e8a317, #f2bd4b);
  --warn-track: light-dark(#f7e6c0, #3a2f16);
  --warn-wash: light-dark(#fff6e0, #2a2112);
  --warn-line: light-dark(#f0d59a, #5a4718);
  --crit: light-dark(#b3261e, #f28b82);
  --crit-fill: light-dark(#d03b3b, #e05252);
  --crit-track: light-dark(#f6d5d5, #3d1f1f);
  --danger-bg: light-dark(#c2362f, #f28b82);
  --danger-ink: light-dark(#fcfcfd, #14171b);

  /* Charts */
  --viz-accent: var(--accent);
  --viz-muted: light-dark(#868d98, #646c77);      /* de-emphasis series */
  --viz-grid: var(--line);
  --viz-axis: var(--line-strong);

  /* Depth: tinted, barely there */
  --shadow-1: 0 1px 2px light-dark(rgb(14 17 22 / 4%), rgb(0 0 0 / 35%));
  --shadow-float: 0 14px 36px -10px light-dark(rgb(14 17 22 / 20%), rgb(0 0 0 / 65%)),
                  0 2px 6px light-dark(rgb(14 17 22 / 6%), rgb(0 0 0 / 35%));

  /* Shape */
  --r-panel: 12px;
  --r-control: 8px;
  --r-small: 6px;

  /* Type */
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 120ms;
  --med: 200ms;

  /* Layout */
  --topbar-h: 60px;
  --tabbar-h: 64px;
  --max: 1280px;
  --gutter: 24px;

  /* Layers */
  --z-header: 20;
  --z-drawer: 35;
  --z-popover: 40;
  --z-tooltip: 50;
  --z-toast: 60;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
::selection { background: var(--accent-wash); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }
[tabindex='-1']:focus { outline: none; } /* headings focused after navigation */

.icon { width: 16px; height: 16px; flex: none; fill: currentColor; }
.icon-lg { width: 20px; height: 20px; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.pos { color: var(--pos); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: calc(var(--z-header) + 1);
  background: var(--ink); color: var(--surface); padding: 8px 12px; border-radius: var(--r-control);
}
.skip-link:focus { top: 12px; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-header);
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--page) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; display: block; }

.nav { display: flex; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: var(--r-control); color: var(--ink-2); font-weight: 500;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current='page'] { background: var(--accent-wash); color: var(--accent-text); }
.nav .icon { width: 17px; height: 17px; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-status { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sync-status .icon { width: 14px; height: 14px; color: var(--warn); }
.avatar-btn {
  width: 32px; height: 32px; border-radius: var(--r-control); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  display: inline-grid; place-items: center; transition: background var(--fast) var(--ease);
}
.avatar-btn:hover { background: var(--surface-3); }

.tabbar { display: none; }

main { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 72px; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.page-head .sub { margin-top: 4px; color: var(--ink-3); font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.stack { display: grid; gap: 16px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow-1); padding: 20px 22px; min-width: 0;
}
.panel-flush { padding: 0; overflow: clip; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 30px; }
.panel-flush > .panel-head { padding: 16px 22px 0; }
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel-head .tools { display: flex; align-items: center; gap: 6px; }
.panel-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 28px; flex-wrap: wrap; }
.footnote { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* Figures */
.figure-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.hero-figure { font-size: 48px; line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; margin-top: 6px; }
.stat-value { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; margin-top: 4px; }
.mini-stat .label { font-size: 12.5px; color: var(--ink-3); }
.mini-stat .value { font-size: 15px; font-weight: 600; margin-top: 2px; }
.delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.delta .icon { width: 14px; height: 14px; }
.split-figures { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }

/* Net worth panel: figure left, trend right */
.networth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 32px; align-items: end; height: 100%; }
.networth .figures { align-self: start; }
.sparkline { display: block; width: 100%; height: auto; overflow: visible; }
.sparkline .line { fill: none; stroke: var(--viz-muted); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sparkline .area { fill: var(--viz-muted); opacity: 0.08; }
.sparkline .dot { fill: var(--viz-accent); stroke: var(--surface); stroke-width: 2; }
.trend-caption { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; text-align: right; }
.trend-empty { font-size: 13px; color: var(--ink-3); text-align: right; max-width: 34ch; justify-self: end; }

/* Balances by type */
.type-list { display: grid; gap: 2px; }
.type-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 10px; margin: 0 -10px; border-radius: var(--r-control); color: var(--ink);
  transition: background var(--fast) var(--ease);
}
.type-row:hover { background: var(--surface-2); text-decoration: none; }
.type-icon {
  width: 32px; height: 32px; border-radius: var(--r-control); background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center;
}
.type-row:hover .type-icon { background: var(--surface-3); }
.type-row .name { font-weight: 500; }
.type-row .meta { font-size: 12.5px; color: var(--ink-3); }
.type-row .amount { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-control); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 86%, var(--page)); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--control); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger-ink); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-bg) 88%, var(--ink)); }
.btn-danger-quiet { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.btn-danger-quiet:hover:not(:disabled) { background: color-mix(in srgb, var(--crit) 8%, transparent); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn .icon { width: 16px; height: 16px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.input, .select {
  height: 36px; width: 100%; min-width: 0; padding: 0 12px; border-radius: var(--r-control);
  border: 1px solid var(--control); background: var(--surface); color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: var(--accent-text); }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-wrap .input { padding-left: 34px; }
.input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap .icon { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }

/* Trigger button that opens a menu (looks like a select) */
.menu-trigger {
  height: 36px; width: 100%; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 12px;
  border-radius: var(--r-control); border: 1px solid var(--control); background: var(--surface); text-align: left;
  transition: background var(--fast) var(--ease);
}
.menu-trigger:hover { background: var(--surface-2); }
.menu-trigger .label-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-trigger .icon.caret { color: var(--ink-3); }
.menu-trigger[aria-expanded='true'] { border-color: var(--accent-text); }
.menu-trigger.is-active { border-color: var(--accent-text); background: var(--accent-wash); color: var(--accent-text); }

/* Segmented control (radio group) */
.segmented {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-control);
  background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-small); background: transparent;
  color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked='true'] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
.segmented .count { color: var(--ink-3); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Popover menus ---------- */
.popover {
  position: fixed; z-index: var(--z-popover); min-width: 240px; max-width: min(360px, calc(100vw - 24px));
  max-height: min(440px, 70vh); overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-float);
  animation: pop-in var(--med) var(--ease) both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.985); } }
.menu-group + .menu-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.menu-heading { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.menu-item {
  width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  border: 0; border-radius: var(--r-small); background: transparent; color: var(--ink); text-align: left; font-size: 14px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-text); }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .count { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.menu-item .check { width: 16px; height: 16px; color: var(--accent-text); visibility: hidden; }
.menu-item[aria-checked='true'] .check, .menu-item[aria-selected='true'] .check { visibility: visible; }
.menu-item[aria-checked='true'] { font-weight: 500; }
.menu-item.is-dim .grow { color: var(--ink-3); }
.checkbox {
  width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1px solid var(--control); background: var(--surface);
  display: grid; place-items: center; color: var(--surface);
}
.checkbox .icon { width: 12px; height: 12px; visibility: hidden; }
.menu-item[aria-checked='true'] .checkbox { background: var(--accent-text); border-color: var(--accent-text); }
.menu-item[aria-checked='true'] .checkbox .icon { visibility: visible; }
.menu-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 6px 2px; margin-top: 4px; border-top: 1px solid var(--line); }
.menu-note { padding: 8px 10px 4px; font-size: 12.5px; color: var(--ink-3); max-width: 34ch; }
.menu-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 6px 4px; }
.menu-range .btn { grid-column: span 2; }
.user-card { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-card .name { font-weight: 600; }
.user-card .email { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Logos and avatars ---------- */
.logo {
  --size: 20px;
  width: var(--size); height: var(--size); flex: none; border-radius: calc(var(--size) / 4);
  object-fit: cover; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px light-dark(rgb(14 17 22 / 8%), rgb(255 255 255 / 8%));
}
img.logo { outline: 1px solid light-dark(rgb(14 17 22 / 6%), rgb(255 255 255 / 10%)); outline-offset: -1px; }
.logo-mono {
  display: inline-grid; place-items: center; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  font-size: calc(var(--size) * 0.44); color: var(--mono-ink, var(--ink-2)); background: var(--mono-bg, var(--surface-3));
}
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-control); object-fit: cover; background: var(--surface-2);
}
img.avatar { outline: 1px solid light-dark(rgb(14 17 22 / 6%), rgb(255 255 255 / 10%)); outline-offset: -1px; }
.avatar-icon { display: grid; place-items: center; color: var(--ink-2); }
.avatar-icon .icon { width: 17px; height: 17px; }

/* ---------- Chips and badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 100%; padding: 0 8px;
  border-radius: var(--r-small); border: 0; background: var(--surface-2); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background var(--fast) var(--ease);
}
.chip .icon { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
button.chip:hover { background: var(--surface-3); color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--r-small);
  font-size: 11.5px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line-strong);
}
.badge .icon { width: 12px; height: 12px; }

/* Account reference inside a transaction row */
.acct-ref {
  vertical-align: middle; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; padding: 3px 6px; margin: -3px -6px;
  border: 0; border-radius: var(--r-small); background: transparent; color: var(--ink-2); font-size: 13px;
}
.acct-ref:hover { background: var(--surface-2); color: var(--ink); }
.acct-ref .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-ref .mono { color: var(--ink-3); }

/* ---------- Filter bar ---------- */
.filters {
  display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr));
  align-items: end; gap: 12px; margin-bottom: 14px;
}
.filter-toggle { display: none; }
.type-filter { display: grid; gap: 6px; justify-items: start; min-width: 0; max-width: 100%; }
.type-filter .label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.results-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 22px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.results-bar .totals { display: flex; gap: 20px; flex-wrap: wrap; }
.results-bar strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: var(--topbar-h); z-index: 1; background: var(--surface);
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table .right { text-align: right; }
.table tbody tr { transition: background var(--fast) var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.sort-btn {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  border-radius: var(--r-small); font: inherit; color: inherit;
}
.sort-btn:hover { color: var(--ink); background: var(--surface-2); }
.sort-btn .icon { width: 12px; height: 12px; opacity: 0; }
th[aria-sort] .sort-btn { color: var(--ink); }
th[aria-sort] .sort-btn .icon { opacity: 1; }

.txn-table { table-layout: fixed; }
.txn-table col.c-date { width: 92px; }
.txn-table col.c-cat { width: 20%; }
.txn-table col.c-acct { width: 24%; }
.txn-table col.c-amt { width: 132px; }

/* Column resize handles: a hairline shows on header hover, the accent while dragging or focused */
.col-resizer {
  position: absolute; top: 0; bottom: 0; right: 0; width: 9px; z-index: 2;
  cursor: col-resize; touch-action: none; outline: none;
}
.col-resizer::after {
  content: ''; position: absolute; top: 8px; bottom: 8px; right: 0; width: 2px; border-radius: 1px;
  background: var(--line-strong); opacity: 0; transition: opacity var(--fast) var(--ease), background var(--fast) var(--ease);
}
.txn-table thead:hover .col-resizer::after { opacity: 1; }
.col-resizer:hover::after, .col-resizer.is-active::after, .col-resizer:focus-visible::after { opacity: 1; background: var(--accent); }
.col-resizer:focus-visible::before {
  content: ''; position: absolute; inset: 2px 0; border-radius: var(--r-small); outline: 2px solid var(--accent-text);
}
.is-col-resizing, .is-col-resizing * { cursor: col-resize !important; user-select: none; }
.txn-desc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.txn-desc .text { min-width: 0; display: grid; }
.txn-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.txn-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-name .badge { flex: none; }
.txn-meta { display: none; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-date { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-refreshing { opacity: 0.55; transition: opacity var(--med) var(--ease); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

/* Compact list of transactions (overview) */
.txn-list { list-style: none; margin: 0; padding: 0; }
.txn-list li {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.txn-list li:last-child { border-bottom: 0; padding-bottom: 2px; }
.txn-list .main { min-width: 0; display: grid; }
.txn-list .sub { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; min-width: 0; }
.txn-list .sub .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-list .right { text-align: right; display: grid; }
.txn-list .when { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart:focus-visible { outline-offset: 4px; border-radius: var(--r-small); }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-emph { stroke: var(--viz-accent); }
.chart .series-muted { stroke: var(--viz-muted); }
.chart .area-emph { fill: var(--viz-accent); opacity: 0.1; }
.chart .end-dot, .chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .end-dot.emph, .chart .hover-dot.emph { fill: var(--viz-accent); }
.chart .hover-dot.muted { fill: var(--viz-muted); }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.line-key { width: 16px; height: 2px; border-radius: 1px; background: var(--viz-muted); }
.line-key.emph { background: var(--viz-accent); }
.chart-tip {
  position: absolute; z-index: var(--z-tooltip); pointer-events: none; min-width: 150px;
  padding: 8px 10px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-float); font-size: 12.5px;
}
.chart-tip .row { display: flex; align-items: center; gap: 8px; }
.chart-tip .row + .row { margin-top: 4px; }
.chart-tip strong { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.chart-tip .lbl { color: var(--ink-3); }
.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { color: var(--ink-3); font-weight: 500; }
.chart-table-wrap { max-height: 264px; overflow: auto; }

/* Category bars: bar length carries the value; no background track */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 8px 10px; margin: 0 -10px; border-radius: var(--r-control); color: var(--ink);
  transition: background var(--fast) var(--ease);
}
a.bar-row:hover { background: var(--surface-2); text-decoration: none; }
.bar-row .label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.bar-row .label .icon { color: var(--ink-3); }
.bar-row .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .track { grid-column: span 2; height: 8px; }
.bar-row .fill { display: block; height: 8px; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--viz-accent); }
.bar-row.rest .fill { background: var(--viz-muted); }

/* Meter (credit used vs limit): track is a lighter step of the fill's own hue */
.meter { height: 6px; border-radius: 3px; background: var(--accent-track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter.warn { background: var(--warn-track); }
.meter.warn > span { background: var(--warn-fill); }
.meter.crit { background: var(--crit-track); }
.meter.crit > span { background: var(--crit-fill); }

/* ---------- Accounts ---------- */
.acct-group { padding: 0; overflow: clip; }
.acct-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.acct-group-head h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.acct-group-head .total { font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-group-head .count { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.acct-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 220px) 130px; align-items: center; gap: 16px;
  padding: 14px 22px; color: var(--ink); border-bottom: 1px solid var(--line); transition: background var(--fast) var(--ease);
}
.acct-row:last-child { border-bottom: 0; }
.acct-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); text-decoration: none; }
.acct-row .name { font-weight: 500; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.acct-row .name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row .sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row .balance { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-row .balance .sub { font-weight: 400; }
.acct-row .usage { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.acct-row .usage .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.usage .warn-text { color: var(--warn); display: inline-flex; align-items: center; gap: 4px; }
.usage .crit-text { color: var(--crit); display: inline-flex; align-items: center; gap: 4px; }
.usage .icon { width: 13px; height: 13px; }
.stale { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: 12.5px; }
.stale .icon { width: 13px; height: 13px; }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 16px; max-width: 920px; }
.conn-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
}
.conn-row:last-child { border-bottom: 0; }
.conn-row .name { font-weight: 500; }
.conn-row .sub { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 12px; flex-wrap: wrap; }
.conn-row .status-fail { color: var(--crit); display: inline-flex; align-items: center; gap: 4px; }
.conn-row .status-fail .icon { width: 13px; height: 13px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setting-row .text { max-width: 60ch; }
.setting-row .title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.setting-row .desc { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.danger-zone { border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); }
.danger-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.danger-form .field { width: 200px; }

/* ---------- Banners, empty states, skeletons, toasts ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  border-radius: var(--r-panel); background: var(--warn-wash); border: 1px solid var(--warn-line); color: var(--ink);
}
.banner > .icon { color: var(--warn); margin-top: 2px; }
.banner .body { font-size: 13.5px; }
.banner .body .muted { color: var(--ink-2); }

.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 40px 20px; }
.empty .empty-icon {
  width: 44px; height: 44px; border-radius: var(--r-panel); background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center; margin-bottom: 6px;
}
.empty .empty-icon .icon { width: 22px; height: 22px; }
.empty h3 { font-size: 15px; font-weight: 600; }
.empty p { color: var(--ink-3); max-width: 46ch; font-size: 13.5px; }
.empty .btn { margin-top: 10px; }

.skeleton { background: var(--surface-2); border-radius: var(--r-small); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.sk-line { height: 12px; }
.sk-fig { height: 44px; width: 60%; margin-top: 10px; }
.sk-chart { height: 220px; margin-top: 12px; }
.sk-row { height: 52px; border-radius: var(--r-control); }

.toasts {
  position: fixed; z-index: var(--z-toast); right: 20px; bottom: 20px; display: grid; gap: 8px; justify-items: end;
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: var(--r-panel); background: var(--ink); color: var(--surface);
  box-shadow: var(--shadow-float); font-size: 13.5px; animation: toast-in 260ms var(--ease) both;
}
.toast .icon { width: 16px; height: 16px; }
.toast.is-error { background: var(--danger-bg); color: var(--danger-ink); }
.toast.is-leaving { animation: toast-out 200ms var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

/* View entrance: a short fade so a route change reads as a change of place */
.view-enter { animation: view-in 280ms var(--ease) both; }
.view-enter .stagger { animation: view-in 320ms var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .f-search { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
  .topbar-inner { gap: 16px; }
  .nav a { padding: 0 10px; }
  .acct-row { grid-template-columns: 36px minmax(0, 1fr) 130px; }
  .acct-row .usage { grid-column: 2 / span 2; grid-row: 2; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; --topbar-h: 56px; }
  .nav, .sync-status { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); min-height: var(--tabbar-h);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: var(--r-control);
    color: var(--ink-3); font-size: 11.5px; font-weight: 500;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a[aria-current='page'] { color: var(--accent-text); }
  main { padding: 20px var(--gutter) calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); justify-items: center; }
  .hero-figure { font-size: 40px; }
  .networth { grid-template-columns: 1fr; gap: 12px; }
  .trend-caption { text-align: left; }
  .panel:not(.panel-flush):not(.acct-group) { padding: 16px; }
  .panel-flush > .panel-head { padding: 14px 16px 0; }
  .results-bar, .table-foot { padding-left: 16px; padding-right: 16px; }

  .filters { grid-template-columns: minmax(0, 1fr) auto; }
  .filters .f-search { grid-column: 1; grid-row: 1; }
  .filter-toggle { display: inline-flex; grid-column: 2; grid-row: 1; align-self: end; }
  .filters .f-period, .filters .f-accounts, .filters .f-category, .filters .f-tags { grid-column: 1 / -1; }
  .filters:not(.is-open) .f-period, .filters:not(.is-open) .f-accounts,
  .filters:not(.is-open) .f-category, .filters:not(.is-open) .f-tags { display: none; }
  .type-filter { width: 100%; }

  /* Transactions table becomes a list of two-line rows */
  .txn-table, .txn-table tbody { display: block; }
  .txn-table thead, .txn-table colgroup { display: none; }
  .txn-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'desc amount' 'desc date';
    column-gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  }
  .txn-table tr:last-child { border-bottom: 0; }
  .txn-table td { padding: 0; border: 0; }
  .txn-table td:first-child, .txn-table td:last-child { padding: 0; }
  .txn-table td.c-date { grid-area: date; text-align: right; font-size: 12.5px; color: var(--ink-3); }
  .txn-table td.c-desc { grid-area: desc; }
  .txn-table td.c-amt { grid-area: amount; }
  .txn-table td.c-cat, .txn-table td.c-acct { display: none; }
  .txn-meta { display: block; }

  .acct-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; }
  .acct-row .name { flex-wrap: wrap; row-gap: 0; }
  .acct-row .name > span:first-child, .acct-row .sub { white-space: normal; }
  .acct-group-head { padding: 14px 16px; }
  .conn-row { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; }
  .conn-row .actions { grid-column: 2; }
}
@media (max-width: 479px) {
  .brand-name { display: none; }
  .page-head .actions .btn-label { display: none; }
  .segmented .count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (forced-colors: active) {
  .meter > span, .bar-row .fill { background: CanvasText; }
  .chart .series-emph { stroke: Highlight; }
}

/* Small layout helpers used by views */
.month-nav { display: flex; gap: 6px; }
.legend-spaced { margin-top: 18px; }
.section-gap { margin-top: 16px; }
.btn[aria-disabled='true'] { pointer-events: none; opacity: 0.45; }
.panel-intro { padding: 0 22px 14px; font-size: 13px; color: var(--ink-3); max-width: 80ch; }
.conn-list { border-top: 1px solid var(--line); }
.danger-title { font-size: 15px; }
.danger-desc { margin-top: 4px; font-size: 13px; color: var(--ink-3); max-width: 62ch; }
.acct-main { min-width: 0; }
.acct-row { row-gap: 8px; }
.acct-row .balance { grid-column: -2 / -1; }
.acct-group { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.acct-group-head .type-icon { width: 28px; height: 28px; }
.acct-group-head .total .muted { font-weight: 400; font-size: 13px; }
@media (max-width: 1023px) {
  .acct-row .usage { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 767px) {
  .panel-intro { padding: 0 16px 12px; }
}

/* ---------- Transaction editing ---------- */
.txn-open {
  display: grid; min-width: 0; width: 100%; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: var(--r-small);
  background: transparent; color: inherit; text-align: left; font: inherit;
}
.txn-open:hover .txn-name > span:first-child { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; max-width: 100%; padding: 0 7px;
  border-radius: var(--r-small); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag-chip .icon { width: 12px; height: 12px; color: var(--ink-3); }
.tag-chip span { overflow: hidden; text-overflow: ellipsis; }
.tag-chip.is-link { cursor: pointer; transition: background var(--fast) var(--ease); }
.tag-chip.is-link:hover { background: var(--surface-2); color: var(--ink); }
.tag-chip button { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: -3px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-3); }
.tag-chip button:hover { background: var(--surface-3); color: var(--ink); }

.drawer {
  position: fixed; z-index: var(--z-drawer); top: calc(var(--topbar-h) + 12px); right: 12px; bottom: 12px;
  width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-float);
  animation: drawer-in 240ms var(--ease) both;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(16px); } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-title p { font-size: 12.5px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px; display: grid; align-content: start; gap: 20px; }
.drawer-facts { display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; padding: 14px 16px; border-radius: var(--r-control); background: var(--surface-2); }
.drawer-facts > div { display: grid; gap: 2px; min-width: 0; }
.drawer-facts .wide { grid-column: 1 / -1; }
.drawer-facts .label { font-size: 12px; color: var(--ink-3); }
.drawer-facts .muted { font-size: 13px; overflow-wrap: anywhere; }
.acct-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; min-width: 0; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; align-items: center; font-size: 13px; }
.tag-add { display: flex; gap: 8px; }
.tag-add .input { flex: 1; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-control); font-size: 13.5px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent-text); flex: none; }
.drawer-foot { display: flex; gap: 8px; padding-top: 4px; }

/* Account rows: the name link covers the row; the rename button sits above it */
.acct-row { position: relative; }
.acct-row.is-linked:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.acct-link { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-link:hover { text-decoration: none; }
.acct-link::after { content: ''; position: absolute; inset: 0; }
.acct-link:focus-visible { outline: none; }
.acct-link:focus-visible::after { outline: 2px solid var(--accent-text); outline-offset: -2px; border-radius: var(--r-small); }
.rename-btn { position: relative; z-index: 1; width: 26px; height: 26px; margin: -4px 0; color: var(--ink-3); opacity: 0.55; }
.acct-row:hover .rename-btn, .rename-btn:focus-visible { opacity: 1; }
.rename-form { position: relative; z-index: 1; display: grid; gap: 6px; }
.rename-form > label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.rename-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rename-controls .input { flex: 1; min-width: 160px; height: 32px; }
.rename-form .help { font-size: 12.5px; color: var(--ink-3); }

/* Tag filter menu and tag settings */
.menu-mode { display: grid; gap: 6px; padding: 8px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-mode .label { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.tag-row-setting { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.tag-row-setting:last-child { border-bottom: 0; }
.tag-row-setting .actions { margin-left: auto; display: flex; gap: 4px; }

@media (hover: none) { .rename-btn { opacity: 1; } }
@media (max-width: 767px) {
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; border: 0; z-index: calc(var(--z-header) + 5); }
  .drawer-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .tag-row-setting { padding: 12px 16px; }
  .tag-row-setting .actions { margin-left: 0; width: 100%; }
}
.txn-desc .text { flex: 1; grid-template-columns: minmax(0, 1fr); }

/* Demo instance banner */
.demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px var(--gutter);
  background: var(--accent-wash); color: var(--accent-text); font-size: 13px; font-weight: 500; text-align: center;
}
.demo-bar .icon { width: 15px; height: 15px; flex: none; }
