/* RR Books — black / gold / white theme, layout mirrors the Simplifi web app */
:root {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --surface: #161616;
  --surface-2: #1d1d1d;
  --surface-3: #242424;
  --border: #2a2a2a;
  --border-2: #363636;
  --text: #f5f2ea;
  --muted: #a39f94;
  --muted-2: #6f6c64;
  --gold: #d4af37;
  --gold-2: #f0d77a;
  --gold-3: #b08d24;
  --gold-dim: rgba(212,175,55,.16);
  --white: #ffffff;
  --pos: #34c759;
  --neg: #f5f2ea;
  --danger: #e5484d;
  --danger-dim: rgba(229,72,77,.15);
  --radius: 12px;
  --radius-s: 8px;
  --rail-w: 56px;
  --accounts-w: 400px;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --font: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; }
button { font-family: inherit; color: inherit; }
a { color: var(--gold); }
/* action links have no href (the CSP blocks javascript: URLs, and href="#" would trip the hash router); :where() keeps
   this at zero specificity so it looks like the browser's own link style and every existing "a" rule still wins */
:where(a[role="button"]:not([href]), a[role="link"]:not([href])) { cursor: pointer; text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-s); padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.rail { width: var(--rail-w); background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 2px; flex-shrink: 0; }
.rail .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--gold); color: #000; font-weight: 800; font-size: 13px; display: grid; place-items: center; margin-bottom: 14px; letter-spacing: -.5px; }
.rail .divider { width: 28px; height: 1px; background: var(--border-2); margin: 8px 0; }
.rail .spacer { flex: 1; }
.rail-item { position: relative; width: 36px; height: 34px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.rail-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item.active { background: var(--gold-dim); color: var(--gold); }
.rail-item .new-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.rail-item .tip { position: absolute; left: 44px; top: 50%; transform: translateY(-50%); background: #000; border: 1px solid var(--border-2); color: var(--text); padding: 4px 8px; border-radius: 6px; white-space: nowrap; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 50; }
.rail-item:hover .tip { opacity: 1; }

.frame { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 20px; border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0; }
.page-title { font-size: 20px; }
.page-title .q { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--muted-2); border-radius: 50%; font-size: 11px; color: var(--muted); margin-left: 8px; vertical-align: middle; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn .badge { position: absolute; top: -7px; right: -8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #000; font-weight: 800; font-size: 12px; border: 0; cursor: pointer; }

.body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; overflow: auto; padding: 16px 18px 40px; min-width: 0; container-type: inline-size; }
/* dashboard: three cards across like Simplifi once the content area is wide enough (two below that) */
@container (min-width: 1060px) { .grid-2.dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-2.dash-grid .span-2 { grid-column: span 2; } .grid-2.dash-grid .span-full { grid-column: 1 / -1; } }
.trend-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--gold-dim); font-size: 13px; }
.trend-badge.down { background: var(--danger-dim); }
.legend.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
/* floating, rounded column like Simplifi: two elevated cards (accounts, then investments/assets) on the page background */
.accounts-panel { width: var(--accounts-w); background: transparent; overflow: hidden; padding: 14px 0 14px 14px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
/* the account list scrolls inside its own bubble; the thin scrollbar only shows while the mouse is over it */
.ap-card.ap-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; scrollbar-gutter: stable; }
.ap-scroll:hover { scrollbar-color: #4a4a4a transparent; }
.ap-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); flex-shrink: 0; }
.accounts-panel[hidden] { display: none; }
.app.dashboard-mode .accounts-panel { position: static; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn-gold { background: var(--gold); color: #000; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-soft { background: var(--gold-dim); color: var(--gold); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--gold); }
.btn-sm { padding: 5px 9px; font-size: 13px; }
.btn.pill { border-radius: 20px; }
.btn[disabled] { opacity: .45; cursor: default; }
.split { display: inline-flex; }
.split .btn:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.split .btn:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; border-left: 1px solid rgba(0,0,0,.25); padding: 7px 8px; }
.kebab { width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.kebab:hover { background: var(--surface-3); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border-2); font-size: 13px; cursor: pointer; }
.chip.active, .chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.gold { background: var(--gold-dim); color: var(--gold); border-color: transparent; }
.pill-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text); max-width: 120px; white-space: nowrap; vertical-align: middle; }
.pill-tag .pt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tbl td.catcol { max-width: 190px; }
.tbl td.acctcol { max-width: 170px; }
.pill-tag .dot { width: 8px; height: 8px; border-radius: 50%; }
.tag-new { font-size: 10px; font-weight: 800; background: var(--gold); color: #000; padding: 1px 5px; border-radius: 6px; vertical-align: middle; margin-left: 4px; }
.tag-beta { font-size: 10px; font-weight: 800; background: var(--surface-3); color: var(--gold); padding: 1px 5px; border-radius: 6px; vertical-align: middle; margin-left: 4px; }
.toggle { width: 34px; height: 18px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; cursor: pointer; flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: .15s; }
.toggle.on { background: var(--gold); border-color: var(--gold); }
.toggle.on::after { left: 18px; background: #000; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 16.5px; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 6px; }
/* no align-items: start — the two cards in a row stretch to the same height so rows line up without ragged gaps (pages that pass inline grid-template-columns are unaffected) */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-2 > * { min-width: 0; }
.grid-2 > .card { margin: 0; overflow: hidden; }
.review-tiles > .tile, .stat-tiles > .tile, .tile-grid > .pick, .two-col > *, .client-layout > *, .plan-layout > *, .reports-layout > *, .settings-layout > * { min-width: 0; }
.tile { overflow-wrap: anywhere; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
/* dashboard Invoices card: the three tiles (unpaid / draft / paid) always share one row */
[data-card="invoices"] .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
[data-card="invoices"] .tile .val { font-size: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; }
.tile.active { border-color: var(--gold); }
.tile .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile .val { font-size: 18px; font-weight: 700; margin-top: 4px; }
.tile.inner { background: var(--surface-2); border-color: var(--border-2); }
.empty { text-align: center; padding: 38px 16px 32px; color: var(--muted); }
.empty .illu { font-size: 46px; margin-bottom: 12px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.empty h4 { color: var(--text); font-size: 16.5px; margin-bottom: 6px; }
.empty h4:empty { display: none; }
.empty p { margin: 0 0 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: -4px -18px 14px; padding: 0 18px; overflow-x: auto; }
.tab { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; border: 0; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover { color: var(--text); }
.subtabs { display: flex; gap: 4px; margin-bottom: 12px; }
.subtab { padding: 6px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.subtab.active { background: var(--gold-dim); color: var(--gold); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.big { font-size: 25px; font-weight: 800; }
.big.gold { color: var(--gold); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.danger { color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.right { text-align: right; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; }
.legend .item { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; max-width: 100%; }
.legend .item > div { min-width: 0; overflow: hidden; }
.legend .item > div > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .sw { flex-shrink: 0; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .amt { font-weight: 700; }
.search { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 0 8px; }
.search input { border: 0; background: transparent; padding: 7px 4px; min-width: 160px; }
.search input:focus { box-shadow: none; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--gold-dim); border: 1px solid rgba(212,175,55,.3); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold); }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .group td { font-weight: 700; background: var(--surface-2); }
.tbl .indent-1 td:first-child { padding-left: 24px; }
.tbl .indent-2 td:first-child { padding-left: 40px; }
.tbl .indent-3 td:first-child { padding-left: 56px; }
.tbl .total td { font-weight: 700; }
.tbl .check { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted-2); display: inline-block; }
.tbl .check.on { border-color: var(--gold); background: var(--gold); }
.tbl .excl { color: var(--muted); font-size: 12px; }
.tbl input[type=checkbox] { accent-color: var(--gold); }
.tbl .nowrap { white-space: nowrap; }
/* sort buttons in a header cell read like the header text, not like a toolbar button */
.tbl th .btn { font-size: inherit; font-weight: inherit; color: inherit; padding: 0; background: transparent; border-color: transparent; }
.tbl th .btn:hover { color: var(--gold); }
.tbl tr.selected td { background: var(--gold-dim); }
/* bulk-action bar shown above the register while rows are selected */
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; margin: 0 0 10px; border-radius: var(--radius-s); background: var(--gold-dim); border: 1px solid rgba(212,175,55,.3); font-size: 13px; }
.bulk-bar b { color: var(--gold); }
.bulk-bar .grow { flex: 1; }
.bulk-bar .btn { background: var(--surface); }
/* the register scrolls inside the card: the chrome above it (topbar, tabs, account head, reminders, toolbars, card padding) is about 430px tall, so the page itself must not need to scroll as well */
.register-wrap { max-height: calc(100vh - 430px); overflow: auto; }
.register-wrap .tbl td { padding: 13px 8px; }
.register-wrap .tbl tr.group td { padding: 9px 8px; font-weight: 700; }
/* with border-collapse the th border belongs to the table grid and scrolls away under the stuck header; paint the rule on the cell itself */
.register-wrap thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border); }

/* ---------- accounts panel ---------- */
.ap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ap-head h3 { font-size: 18px; }
.ap-total { display: flex; justify-content: space-between; font-weight: 800; padding: 6px 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.loans-top { margin-bottom: 16px; }
.loans-tbl td { vertical-align: top; }
.ap-total.ap-total-cash { border-bottom: 0; margin-bottom: 0; padding-bottom: 2px; }
.ap-total.ap-total-owed { font-weight: 600; font-size: .92em; padding-top: 2px; color: var(--muted, inherit); }
.ap-band { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); margin-top: 10px; cursor: pointer; }
.ap-group { display: flex; justify-content: space-between; padding: 6px 8px; font-weight: 700; cursor: pointer; }
.ap-sub { display: flex; justify-content: space-between; padding: 5px 8px 5px 16px; font-weight: 600; cursor: pointer; }
.ap-acct { display: flex; justify-content: space-between; padding: 5px 8px 5px 28px; color: var(--text); cursor: pointer; border-radius: 6px; }
.ap-acct:hover, .ap-acct.active { background: var(--surface-2); color: var(--gold); }
.ap-prompt { padding: 8px 6px; cursor: pointer; border-radius: 8px; }
.ap-prompt + .ap-prompt { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 2px; }
.ap-prompt:hover { background: var(--surface-2); }
.ap-prompt:hover b { color: var(--gold); }
.ap-prompt b { display: block; }
.ap-show-tab { flex-shrink: 0; width: 26px; border: 0; border-right: 1px solid var(--border); background: var(--bg-2); color: var(--muted); cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 14px; font: inherit; font-size: 12.5px; letter-spacing: .4px; }
.ap-show-tab span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.ap-show-tab:hover { color: var(--gold); background: var(--surface-2); }
.ap-show-tab[hidden] { display: none; }
.ap-prompt span { color: var(--muted); font-size: 12.5px; }
.caret { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; margin-right: 6px; transition: .15s; }
.collapsed .caret { transform: rotate(-90deg); }

/* ---------- popovers, drawers, modals ---------- */
.popover-layer:empty, .drawer-layer:empty, .modal-layer:empty { display: none; }
.popover { position: fixed; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; z-index: 350; min-width: 200px; max-height: calc(100vh - 80px); overflow: auto; }
.popover .menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.popover .menu-item:hover { background: var(--surface-2); color: var(--gold); }
.popover .menu-item small { display: block; color: var(--muted); }
.popover h4 { padding: 6px 10px 8px; font-size: 15px; }
.popover .sep { height: 1px; background: var(--border); margin: 6px 0; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 150; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 95vw; background: var(--surface); border-left: 1px solid var(--border-2); z-index: 300; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 16.5px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px; }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 560px; max-width: 95vw; max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; z-index: 300; box-shadow: var(--shadow); }
.modal.wide { width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile-grid .pick { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 18px 10px; text-align: center; cursor: pointer; }
.tile-grid .pick:hover { border-color: var(--gold); }
.tile-grid .pick .ic { font-size: 32px; margin-bottom: 8px; }
.close-x { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-2); background: transparent; color: var(--text); cursor: pointer; }

/* ---------- AI ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--gold); color: #000; font-size: 20px; cursor: pointer; box-shadow: 0 6px 18px rgba(212,175,55,.35); z-index: 120; }
.ai-card { position: fixed; right: 22px; top: 62px; width: 470px; max-width: 95vw; height: 640px; max-height: calc(100vh - 80px); background: linear-gradient(180deg, #1a1709 0%, #121212 45%); border: 1px solid var(--border-2); border-radius: 16px; z-index: 180; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ai-card[hidden] { display: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.ai-body { flex: 1; overflow: auto; padding: 14px 18px; text-align: center; }
.ai-body .hello { font-size: 22px; font-weight: 800; color: var(--gold); margin-top: 60px; }
.ai-msg { text-align: left; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.ai-msg.user { background: var(--gold-dim); border-color: transparent; }
.ai-input { display: flex; gap: 8px; margin: 14px 0 8px; }
.ai-input input { flex: 1; }
.ai-try { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }

/* ---------- dashboard specifics ---------- */
.hello { font-size: 22px; font-weight: 800; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.task .ic { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-dim); color: var(--gold); display: grid; place-items: center; }
.task b { display: block; }
.task span { color: var(--muted); font-size: 13px; }
.tx-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tx-row > div:first-child { flex: 1; min-width: 0; }
.tx-row b { display: block; font-weight: 600; }
.tx-row span { color: var(--muted); font-size: 12.5px; }
.tx-row b, .tx-row > div:first-child > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row .amt { text-align: right; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.scroll-list { max-height: 230px; overflow: auto; }
.review-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-tiles .tile { background: var(--surface-2); }
.review-tiles .tile b { display: block; margin: 6px 0 2px; }
.review-tiles .tile span { color: var(--muted); font-size: 12.5px; }
/* the leading glyph sits in a small gold-dim icon box, like the task and report-tile icons */
.review-tiles .tile > span:first-child { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--gold-dim); color: var(--gold); font-size: 14px; line-height: 1; }
.pnl-totals { display: flex; gap: 14px; margin-top: 8px; }
.pnl-totals > div { flex: 1; border-left: 3px solid var(--gold); padding-left: 8px; }
.pnl-totals span { color: var(--muted); font-size: 12px; display: block; }
.reminder-chip { width: 190px; min-width: 0; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; flex-shrink: 0; }
.reminder-chip .d { color: var(--muted); font-size: 12px; }
.reminder-chip b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.badges { display: flex; gap: 8px; }
.badges .bg { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-dim); color: var(--gold); display: grid; place-items: center; font-size: 18px; }
.achv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.achv .a { display: flex; gap: 8px; align-items: center; }
.achv .a b { display: block; font-size: 13px; }
.customize-list .ci { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.customize-list .ci .drag { color: var(--muted-2); cursor: grab; }
.customize-list .ci .name { flex: 1; }
.customize-list .kebab { font-size: 11px; }

/* ---------- spending plan ---------- */
.plan-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.plan-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.plan-row.active { border-color: var(--gold); }
.plan-row .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; color: #000; }
.plan-row .n { flex: 1; font-weight: 600; }
.plan-row .v { font-weight: 700; }
.plan-left { margin-top: 20px; text-align: center; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal .dow { background: var(--surface); padding: 6px; text-align: center; color: var(--muted); font-weight: 700; font-size: 12px; }
.cal .day { background: var(--surface); min-height: 74px; padding: 4px 6px; font-size: 12px; }
.cal .day.other { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 7px); color: var(--muted-2); }
.cal .day .n { font-weight: 700; }
.cal .day .n.today { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #000; }
.cal .ev { display: flex; justify-content: space-between; gap: 4px; margin-top: 3px; padding: 2px 5px; border-radius: 4px; background: var(--surface-3); font-size: 11.5px; }
.cal .ev.income { background: var(--gold-dim); color: var(--gold); }
.cal .ev .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.settings-nav .sn { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.settings-nav .sn.active { background: var(--gold-dim); color: var(--gold); }
.settings-nav .sn:hover { background: var(--surface-2); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row b { display: block; }
.setting-row span { color: var(--muted); font-size: 13px; }
.appearance { display: flex; gap: 10px; }
.appearance .ap { flex: 1; text-align: center; padding: 14px 8px; border: 1px solid var(--border-2); border-radius: 10px; cursor: pointer; }
.appearance .ap.active { border-color: var(--gold); background: var(--gold-dim); }
.inst-card { margin-bottom: 12px; }
.inst-card .logo { width: 34px; height: 34px; border-radius: 50%; background: var(--white); color: #000; display: grid; place-items: center; font-weight: 800; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; margin-bottom: 8px; }
.notif-row .t { flex: 1; }
.notif-row .ch { display: flex; gap: 6px; }

/* ---------- reports ---------- */
.report-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.report-tiles .rt { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; position: relative; min-height: 96px; }
.report-tiles .rt:hover { border-color: var(--gold); }
.report-tiles .rt .ic { width: 28px; height: 28px; border-radius: 7px; background: var(--gold-dim); color: var(--gold); display: grid; place-items: center; margin-bottom: 8px; }
.report-tiles .rt b { display: block; }
.report-tiles .rt span { color: var(--muted); font-size: 12.5px; }
.report-tiles .rt .biz { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; background: var(--gold); color: #000; padding: 1px 6px; border-radius: 6px; }
.reports-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.report-strip { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: -4px -18px 14px; padding: 0 18px; overflow: auto; }
.summary-hero { text-align: center; padding: 20px 0 10px; }
.summary-hero h2 { font-size: 22px; }
.summary-hero .m { color: var(--gold); }
.mini-bars { display: flex; gap: 10px; align-items: flex-end; height: 70px; margin-top: 10px; }
.mini-bars > div { width: 34px; border-radius: 4px 4px 0 0; }

/* ---------- misc ---------- */
.gauge-wrap { display: flex; align-items: center; gap: 20px; }
.gauge-wrap > div { min-width: 0; flex: 1; }
.score-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.score-pills .sp { flex: 1 1 70px; min-width: 70px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.score-pills .sp span { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.client-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.client-layout .col { display: flex; flex-direction: column; gap: 14px; }
.client-layout .card { margin: 0; }
.invoice-editor { position: fixed; inset: 0; background: var(--bg); z-index: 300; display: flex; flex-direction: column; }
.invoice-editor .ie-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.invoice-editor .ie-body { flex: 1; overflow: auto; padding: 20px 24px; }
.ie-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.dropzone { border: 1px dashed var(--border-2); border-radius: 12px; padding: 40px; text-align: center; color: var(--muted); }
.dropzone.hover { border-color: var(--gold); background: var(--gold-dim); }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: min(90vw, 640px); background: var(--gold); color: #000; font-weight: 700; padding: 10px 16px; border-radius: 10px; z-index: 400; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.toast .toast-msg { min-width: 0; }
.toast .toast-msg .money { color: inherit; }
/* Undo sits inside the gold toast as a small black pill (U.undoToast) */
.toast .toast-undo { flex-shrink: 0; border: 0; border-radius: 6px; background: #000; color: var(--gold); font: inherit; font-weight: 700; padding: 4px 10px; cursor: pointer; }
.toast .toast-undo:hover { color: var(--gold-2); }
.privacy .money { filter: blur(6px); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-card { max-width: 560px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.kv span { color: var(--muted); }
.period-chips { display: flex; gap: 4px; }
.period-chips .chip { padding: 4px 8px; border-radius: 6px; }
.ai-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.ratio-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin: 8px 0; }
.ratio-bar > i { display: block; height: 100%; background: var(--danger); }
.stack-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 10px 0; }
/* a 400px accounts panel leaves a 1280–1440px laptop too little room for the register columns and the toolbar; Simplifi uses ~300px */
@media (max-width: 1500px) { :root { --accounts-w: 320px; } }
@media (max-width: 1100px) { .grid-2, .two-col, .client-layout, .plan-layout, .reports-layout { grid-template-columns: 1fr; } .report-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .body { flex-direction: column; } .accounts-panel { width: auto; border-right: 0; border-bottom: 1px solid var(--border); max-height: 300px; } .ap-show-tab { width: auto; padding: 6px 14px; border-right: 0; border-bottom: 1px solid var(--border); justify-content: flex-start; } .ap-show-tab span { writing-mode: horizontal-tb; transform: none; } .settings-layout { grid-template-columns: 1fr; } }

/* ---------- bank connections (Plaid) ---------- */
pre.code-block { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--gold-2); overflow: auto; margin: 8px 0; }
#bankCard .setting-row:last-child { border-bottom: 0; }
#bankCard .logo { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; font-weight: 800; }
.btn.spinning::before { content: "↻"; display: inline-block; animation: spin 1s linear infinite; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip.danger { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--border-2); color: inherit; }
.chip.static.gold:hover { color: var(--gold); border-color: transparent; }
.chip.static.danger:hover { color: var(--danger); border-color: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.modal-foot .grow { flex: 1; }

#dataCard .setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
#dataCard .setting-row span { display: block; max-width: 520px; }

/* ---------- transactions register (Simplifi-style) ---------- */
/* row height preference: compact / medium / large (vertical padding 8 / 13 / 18px); group headers scale with it */
.register-wrap.rh-sm .tbl td { padding: 8px 8px; }
.register-wrap.rh-md .tbl td { padding: 13px 8px; }
.register-wrap.rh-lg .tbl td { padding: 18px 8px; }
.register-wrap.rh-sm .tbl tr.group td { padding: 6px 8px; }
.register-wrap.rh-lg .tbl tr.group td { padding: 11px 8px; }
/* hover-only row actions: reserve the space (visibility, not display) so columns do not jump when the mouse enters a row */
.tbl tr.clickable .row-act { display: inline-flex; align-items: center; gap: 4px; visibility: hidden; }
.tbl tr.clickable:hover .row-act, .tbl tr.clickable.selected .row-act { visibility: visible; }
.tbl tr.clickable .row-act > button, .tbl tr.clickable .row-act > .btn { padding: 2px 7px; font-size: 12px; line-height: 1.4; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); cursor: pointer; }
.tbl tr.clickable .row-act > button:hover, .tbl tr.clickable .row-act > .btn:hover { border-color: var(--gold); color: var(--gold); }
/* transfer rows show the counter-account where the category would be */
.tbl td.cat-transfer { color: var(--muted); font-style: italic; }
/* running total of the selected rows (bulk bar) */
.sel-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulk-bar .sel-total { color: var(--text); }
/* results header above the register: bold count, muted total, gold link */
.hdr-results { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.hdr-results b { color: var(--text); font-size: 14px; }
.hdr-results a, .hdr-results .link { color: var(--gold); font-weight: 600; cursor: pointer; text-decoration: none; }
.hdr-results a:hover, .hdr-results .link:hover { text-decoration: underline; }
.hdr-results .grow { flex: 1; }
.chip.quiet { background: transparent; border-color: var(--border); color: var(--muted); }
.chip.quiet:hover { border-color: var(--border-2); color: var(--text); }

/* three-column filter popover: nav | checklist | selected chips */
.filter-panel { display: grid; grid-template-columns: 150px minmax(0, 1fr) 180px; gap: 12px; min-height: 240px; }
.filter-panel > * { min-width: 0; }
.filter-panel .fp-nav { border-right: 1px solid var(--border); padding-right: 8px; display: flex; flex-direction: column; gap: 2px; }
.filter-panel .fp-nav > * { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.filter-panel .fp-nav > *:hover { background: var(--surface-2); color: var(--text); }
.filter-panel .fp-nav > .active { background: var(--gold-dim); color: var(--gold); }
.filter-panel .fp-nav .n { font-size: 11px; font-weight: 800; background: var(--gold); color: #000; border-radius: 9px; padding: 0 6px; }
.filter-panel .fp-list { max-height: 320px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.filter-panel .fp-list label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.filter-panel .fp-list label:hover { background: var(--surface-2); }
.filter-panel .fp-list label.sub { padding-left: 22px; }
.filter-panel .fp-list input[type=checkbox] { accent-color: var(--gold); margin: 0; }
.filter-panel .fp-list .search { display: flex; margin-bottom: 6px; }
.filter-panel .fp-list .search input { min-width: 0; width: 100%; }
.filter-panel .fp-sel { max-height: 320px; overflow-y: auto; scrollbar-width: thin; border-left: 1px solid var(--border); padding-left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.filter-panel .fp-sel .chip { max-width: 100%; }
.filter-panel .fp-sel .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel .fp-sel .chip .x { color: var(--muted); font-size: 11px; }
.filter-panel .fp-title { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 2px 0 6px; }
.filter-panel .fp-sel .fp-title { align-self: stretch; }
.popover .fp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* date range picker (U.dateRangePicker): inputs over two side-by-side month calendars */
.drp { padding: 4px; }
.drp-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.drp-inputs .field { margin: 0; }
.drp input.invalid, .drp input.invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-dim); }
.drp-cals { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 16px; justify-items: center; }
.drp-cal { width: 236px; }
.drp-cal-head { display: flex; align-items: center; justify-content: space-between; height: 28px; margin-bottom: 6px; font-weight: 700; font-size: 13.5px; }
.drp-cal-head .nav { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.drp-cal-head .nav:hover { background: var(--surface-2); color: var(--gold); }
.drp-cal-head .nav.ghost { visibility: hidden; }
.drp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
/* small picker calendar: 7 x 32px cells, no bordered grid (the bordered .cal look belongs to the Bills calendar) */
.cal.mini { grid-template-columns: repeat(7, 32px); gap: 2px; justify-content: center; background: transparent; border: 0; border-radius: 0; overflow: visible; }
.cal.mini .dow { background: transparent; padding: 0; height: 22px; display: grid; place-items: center; font-size: 11px; }
.cal .d { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal .d:hover { background: var(--surface-3); }
.cal .d.in { background: var(--gold-dim); border-radius: 0; }
.cal .d.in:hover { background: rgba(212,175,55,.3); }
.cal .d.sel { background: var(--gold); color: #000; font-weight: 700; }
.cal .d.sel:hover { background: var(--gold-2); }
.cal .d.today:not(.sel) { box-shadow: inset 0 0 0 1px var(--gold-3); }
.cal .d.out { color: var(--muted-2); cursor: default; background: transparent; }

/* single-account header (Transactions filtered to one account): logo, name + meta, balance on the right */
.acct-hero { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.acct-hero .logo { width: 40px; height: 40px; border-radius: 50%; background: var(--white); color: #000; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.acct-hero .logo img { width: 100%; height: 100%; object-fit: cover; }
.acct-hero .name { flex: 1; min-width: 0; }
.acct-hero .name b, .acct-hero .name h3 { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-hero .meta { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-hero .bal, .acct-hero > .right { margin-left: auto; text-align: right; white-space: nowrap; }
.acct-hero .bal .big { font-size: 22px; }
.acct-hero .bal .meta { justify-content: flex-end; }

/* projected cash flow section (upcoming bills / income walked against the balance) */
.pcf { margin-top: 14px; }
.pcf .pcf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pcf .pcf-head h4 { font-size: 14px; }
.pcf .pcf-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pcf .pcf-row:last-child { border-bottom: 0; }
.pcf .pcf-row .d { width: 58px; flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcf .pcf-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcf .pcf-row .amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcf .pcf-row .bal { width: 110px; text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcf .pcf-row.low .bal { color: var(--danger); }
.pcf .tbl td { padding: 8px 8px; }
.pcf .chart-wrap { margin: 6px 0 10px; }

/* inline cell editing */
.tbl tr.clickable td[data-f], .tbl tr.clickable span.money[data-f] { cursor: text; }
.tbl tr.clickable:hover td[data-f]:not(.editing) { box-shadow: inset 0 0 0 1px var(--border-2); border-radius: 6px; }
.tbl tr.clickable:hover span.money[data-f] { box-shadow: inset 0 0 0 1px var(--border-2); border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.tbl td.editing { padding-top: 4px; padding-bottom: 4px; }
.tbl .inl { width: 100%; min-width: 90px; padding: 5px 8px; font-size: 13px; border-color: var(--gold); }
span.money.editing .inl { width: 120px; }

/* category combobox (U.catCombo): text field + ▾ button; the menu (.catm) and its cascading submenus (.catm.sub) are fixed panels on document.body, above drawers / modals */
.catc { display: flex; align-items: center; width: 100%; min-width: 0; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-s); }
.catc:focus-within, .catc.open { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
.catc .catc-in { flex: 1 1 auto; min-width: 0; width: 0; border: 0; border-radius: var(--radius-s) 0 0 var(--radius-s); background: transparent; box-shadow: none; padding: 8px 10px; text-overflow: ellipsis; }
.catc .catc-in:focus { border: 0; box-shadow: none; }
.catc .catc-btn { flex: 0 0 32px; width: 32px; align-self: stretch; border: 0; border-left: 1px solid var(--border); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.catc .catc-btn:hover, .catc.open .catc-btn { color: var(--gold); }
.tbl .catc .catc-in { padding: 5px 8px; font-size: 13px; }
.popover .catc-pop { min-width: 0; }
.catm { position: fixed; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 450; min-width: 300px; max-height: 420px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.catm.sub { min-width: 220px; max-width: 340px; }
.catm .hd { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 3px; }
.catm .it + .hd { margin-top: 4px; }
.catm .it { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; line-height: 1.3; white-space: nowrap; }
.catm .it .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.catm .it:hover, .catm .it.hi, .catm .it.open { background: var(--surface-2); }
.catm .it.sel { color: var(--gold); }
.catm .it .chev { flex-shrink: 0; color: var(--muted); font-size: 15px; line-height: 1; }
.adv-alert { border-left: 4px solid var(--border-2); background: var(--surface-2); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.adv-red { border-left-color: var(--danger); }
.adv-amber { border-left-color: var(--gold); }
.adv-good { border-left-color: var(--pos); }
.adv-alert details { margin-top: 4px; }
.adv-alert summary { cursor: pointer; }
.adv-row { display: grid; grid-template-columns: minmax(70px, 150px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; }
.adv-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.adv-bar i { display: block; height: 100%; border-radius: 4px; }
@media (max-width: 600px) { .ai-card { width: calc(100vw - var(--rail-w, 56px)); } }
.ai-msg { overflow-wrap: anywhere; }
.en-card { border: 1px solid var(--border-2); border-radius: 10px; padding: 10px; margin: 8px 0; background: var(--surface); }
.en-done { border-color: var(--pos); }
.en-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.en-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.en-grid input, .en-grid select { width: 100%; min-width: 0; padding: 6px 8px; }
.en-wide { grid-column: 1 / -1; }
.en-need { color: var(--danger); font-size: 13px; margin-top: 6px; }
.en-warn { color: var(--gold); font-size: 13px; margin-top: 4px; }
@media (max-width: 600px) { .en-grid { grid-template-columns: 1fr 1fr; } }
.ai-gap { height: 6px; }
.ai-pre { white-space: pre-wrap; max-height: 320px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px; font-size: 12px; }
.privacy .ai-pre { filter: blur(6px); }
#aiState { align-items: center; }
.ai-list { margin: 6px 0; padding-left: 18px; }
.ai-list li { margin: 4px 0; }
.wk { border-bottom: 1px solid var(--border); }
.wk:last-of-type { border-bottom: 0; }
.wk > summary { display: flex; align-items: center; gap: 14px; padding: 12px 4px; cursor: pointer; flex-wrap: wrap; }
.wk > summary:hover { color: var(--gold); }
.wk-name { flex: 1 1 150px; display: flex; flex-direction: column; }
.wk-n { display: flex; flex-direction: column; align-items: flex-end; min-width: 92px; font-variant-numeric: tabular-nums; }
.wk-total { min-width: 100px; }
.wk-body { padding: 0 4px 12px 22px; }
.wk-item { gap: 10px; padding: 6px 0; min-width: 0; }
.privacy .wk-plan { filter: blur(6px); }
.wk-plan { width: 110px; text-align: right; padding: 5px 8px; }
@media (max-width: 720px) { .wk-n { min-width: 30%; align-items: flex-start; } .wk-body { padding-left: 4px; } .wk-item { flex-wrap: wrap; } }
.catm .it .chev-btn { margin: -7px -10px -7px 0; padding: 7px 14px; border-radius: 6px; }
.catm .it .chev-btn:hover { color: var(--gold); background: var(--surface-3); }
@media (pointer: coarse) { .catm .it .chev-btn { padding: 7px 20px; font-size: 18px; border-left: 1px solid var(--border); border-radius: 0 6px 6px 0; } }
.catm .it.create { color: var(--gold); }
.catm .it.create .plus { font-weight: 800; margin-right: 6px; }
.catm .path { color: var(--muted); font-size: 12px; }
.catm .it.sel .path { color: var(--gold-3); }
.catm .acc .l4 { color: var(--muted); font-size: 12px; }
.catm .it.none { color: var(--muted); cursor: default; }
.catm .it.none:hover { background: transparent; }

.catm.paym .it { gap: 10px; }
.catm.paym .it .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catm.paym .it .path { flex-shrink: 0; }

/* rules (Simplifi layout) */
.rules-card { padding: 0; overflow: hidden; }
.rules-top { padding: 14px 16px; }
.rules-tbl th { font-weight: 700; color: var(--text); font-size: 13px; padding: 10px 16px; background: var(--surface-2); }
.rules-tbl td { vertical-align: top; padding: 12px 16px; line-height: 1.95; font-size: 13px; }
.rules-tbl td:first-child, .rules-tbl th:first-child { width: 50%; border-right: 1px solid var(--border); }
.rules-tbl td:last-child { width: 44px; padding-top: 10px; }
.rl-k { font-weight: 600; } .rl-op { font-weight: 700; } .rl-or { color: var(--muted); font-size: 11.5px; font-weight: 700; margin: 0 2px; }
.rules-tbl .gold, .rule-sum .gold, b.gold { color: var(--gold); }
.kw { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-2); font-size: 12.5px; font-weight: 700; line-height: 1.6; vertical-align: middle; }
.kw .x { cursor: pointer; color: var(--muted); font-size: 11px; } .kw .x:hover { color: var(--text); }
.menu-item.danger { color: #e5484d; }
.rule-ed .ie-head { padding: 12px 22px; } .rule-ed .ie-head h3 { font-size: 15.5px; }
.rule-ed .ie-body { padding: 26px 40px; }
.rule-cols { gap: 16px; max-width: 1180px; margin: 0 auto; }
.rule-col { padding: 0; overflow: hidden; }
.rule-col-h { padding: 13px 16px; font-weight: 700; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.rsec { border: 1px solid var(--border-2); border-radius: 10px; margin: 12px; background: var(--surface); }
.rsec > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13.5px; cursor: pointer; user-select: none; }
.rsec > header .rsec-cb { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); cursor: pointer; flex-shrink: 0; }
.rsec .rsec-b { display: none; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.rsec.on .rsec-b { display: block; }
.rsec .hint { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.rsec-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.radios label { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.radios input { accent-color: var(--gold); margin: 0; }
.rsec input[type=checkbox] { accent-color: var(--gold); }
.kw-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.kw-mode { width: 128px; flex-shrink: 0; } .kw-mode-ph { width: 128px; flex-shrink: 0; text-align: right; }
.kw-box { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); cursor: text; align-items: center; }
.kw-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }
.kw-in { flex: 1; min-width: 90px; border: 0; background: transparent; padding: 4px 2px; font-size: 13px; }
.kw-in:focus { box-shadow: none; }
.kw-add { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; }
.kw-add:hover { background: var(--gold); color: #000; }
.kw-or { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.kw-orl { flex: 1; height: 1px; background: var(--border); }
.acct-sel { flex: 1; }
.rule-foot { justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); border-bottom: 0; }
.rule-foot .del { color: #e5484d; margin-right: auto; background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 13px; }
.rule-sum { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; max-width: 1180px; margin: 0 auto; }
.rule-sum > div + div { border-left: 1px solid var(--border); }
.rule-sum-b { padding: 12px 16px; line-height: 1.95; font-size: 13px; }
.rule-ed .ie-body > .card.mt { max-width: 1180px; margin: 14px auto 0; }
.rv-tbl td { padding: 10px 12px; font-size: 13px; } .rv-tbl th { padding: 8px 12px; }
.rsec .info, .rule-ed .info { color: var(--muted); font-size: 12px; cursor: help; }

/* rule editor: Update Category block */
.rsec .catc-host { flex: 1; min-width: 0; }
.usage-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px 0 6px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; flex-shrink: 0; }
.usage-btn:hover { border-color: var(--gold); }
.usage-btn .caret { font-size: 11px; color: var(--muted); }
.uav { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #000; flex-shrink: 0; }
.uav.per { background: var(--surface-3); color: var(--text); }
.uav svg { width: 13px; height: 13px; }
.cat-split-l { font-size: 13px; } .cat-split-l.on { color: var(--gold); }
.cat-split-row { gap: 10px; margin-top: 10px; } .cat-split-row .rl-k { width: 172px; flex-shrink: 0; font-size: 12.5px; line-height: 1.3; }
.popover .menu-hd { padding: 8px 12px 4px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.popover .menu-item.sel { background: var(--gold-dim); }
.rule-foot .btn:not(.btn-gold) { background: none; border-color: transparent; color: var(--gold); }

/* rules: Simplifi sizes */
.rules-head h2 { font-size: 24px; font-weight: 700; }
.rules-head .btn-gold { height: 36px; padding: 7px 16px; font-size: 14px; border-radius: 8px; }
.rules-card { background: var(--surface-3); border-radius: 12px; }
.rules-top { padding: 12px 16px; height: 57px; border-bottom: 1px solid var(--border-2); }
.rules-top > b { font-size: 18px; font-weight: 600; }
.rules-top .search { height: 32px; width: 270px; border-radius: 8px; background: var(--surface-3); }
.rules-top .search input { font-size: 14px; padding: 0 5px; width: 100%; }
.rules-tbl th { height: 48px; padding: 12px 16px; font-size: 16px; font-weight: 600; background: var(--surface); border-bottom: 1px solid var(--border-2); border-right: 0; }
.rules-tbl th:first-child { border-right: 1px solid var(--border-2); }
.rules-tbl td { padding: 12px 16px; font-size: 16px; line-height: 24px; border-bottom: 1px solid var(--border-2); }
.rules-tbl td > div { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.rules-tbl td:first-child { border-right: 1px solid var(--border-2); }
.rules-tbl td:last-child { width: 62px; padding: 12px 16px; }
.rules-tbl .kebab { width: 30px; height: 30px; border-radius: 6px; background: var(--surface); font-size: 18px; }
.rules-tbl .rl-k { font-weight: 450; } .rules-tbl .rl-op { font-weight: 600; } .rules-tbl b { font-weight: 600; }
.rules-tbl .rl-or { font-size: 14px; }
.rules-tbl .gold, .rule-sum .gold { font-weight: 600; }
.kw { font-size: 16px; font-weight: 600; padding: 2px 4px; border-radius: 6px; line-height: 24px; background: var(--surface); border: 1px solid var(--border-2); }
.kw .x { font-size: 12px; }
/* editor + review drawer: rail stays visible, 72px header, 40px gutters, two 50% columns */
.rule-ed { left: var(--rail-w); background: var(--surface); }
.rule-ed .ie-head { height: 72px; padding: 24px 24px 16px; border-bottom: 0; }
.rule-ed .ie-head h3 { font-size: 18px; font-weight: 700; margin-left: 8px; }
.rule-ed .ie-head .kebab, .rule-ed .ie-head .close-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 18px; line-height: 1; }
.rule-ed .ie-body { padding: 3px 40px 0; }
.rule-cols { grid-template-columns: 1fr 1fr; gap: 1px; max-width: none; margin: 0; }
.rule-col { background: var(--surface-2); border: 0; border-radius: 12px; padding: 16px; }
.rule-col-h { height: 48px; padding: 12px 16px; font-size: 16px; font-weight: 600; background: var(--surface-3); border-bottom: 0; }
.rsec { margin: 16px 0 0; border: 0; border-radius: 12px; background: var(--surface); }
.rsec:first-of-type { margin-top: 0; }
.rsec > header { min-height: 52px; padding: 12px 16px; font-size: 16px; font-weight: 600; }
.rsec > header .rsec-cb { width: 20px; height: 20px; }
.rsec .rsec-b { padding: 0 16px 16px; border-top: 0; }
.rsec .hint { font-size: 12px; line-height: 16px; }
.rsec-split { gap: 16px; }
.radios label { font-size: 16px; line-height: 24px; margin-bottom: 4px; }
.radios input[type=radio] { width: 18px; height: 18px; }
.rsec input[type=checkbox] { width: 20px; height: 20px; }
.rsec input:not([type=checkbox]):not([type=radio]):not(.kw-in):not(.catc-in), .rsec select, .rsec textarea, .rsec .catc, .rsec .catc-in { font-size: 16px; }
.rsec input:not([type=checkbox]):not([type=radio]):not(.kw-in):not(.catc-in), .rsec select { height: 52px; padding: 0 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid transparent; }
.rsec textarea { padding: 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid transparent; min-height: 80px; }
.rsec .catc { min-height: 52px; border-radius: 12px; background: var(--surface-3); border: 1px solid transparent; }
.rsec .catc:focus-within, .rsec input:focus, .rsec select:focus, .rsec textarea:focus, .rsec .kw-box:focus-within { border-color: var(--gold); box-shadow: none; }
.rsec .catc-in { padding: 0 16px; height: 50px; }
.rsec .catc-btn { height: 50px; width: 40px; font-size: 14px; }
.kw-row { gap: 8px; margin-top: 8px; }
.kw-mode { width: 150px; } .kw-mode-ph { width: 150px; font-size: 14px; }
.kw-box { min-height: 55px; padding: 8px 0 8px 8px; border-radius: 12px; background: var(--surface-3); border: 1px solid transparent; gap: 6px; }
.kw-in { font-size: 16px; padding: 7px 4px; min-width: 120px; }
.kw-add { width: 24px; height: 24px; font-size: 18px; }
.kw-or { font-size: 16px; font-weight: 450; color: var(--text); margin-top: 8px; }
.acct-sel { height: 52px; }
.usage-btn { height: 52px; width: 110px; border-radius: 12px 0 0 12px; border: 1px solid transparent; background: var(--surface-3); justify-content: center; gap: 10px; }
.usage-btn + input + .catc-host .catc { border-radius: 0 12px 12px 0; border-left: 1px solid var(--border-2); }
#catOne .row { gap: 0 !important; }
.uav { width: 26px; height: 26px; font-size: 12px; } .uav svg { width: 15px; height: 15px; }
.usage-btn .caret { font-size: 12px; }
.cat-split-l { font-size: 14px; line-height: 20px; }
.cat-split-row { gap: 12px; margin-top: 12px; } .cat-split-row .rl-k { width: 200px; font-size: 14px; line-height: 20px; }
.rule-foot { height: 80px; padding: 16px 32px 24px; gap: 24px; }
.rule-foot .muted.small { font-size: 14px; }
.rule-foot .btn { height: 42px; font-size: 16px; font-weight: 600; border-radius: 12px; padding: 8px 11px; }
.rule-foot .btn-gold { padding: 8px 24px; }
.rule-foot .del { font-size: 14px; font-weight: 600; padding: 7px 8px; }
/* review step */
.rule-sum { max-width: none; margin: 0; background: var(--surface-2); border: 0; }
.rule-sum .rule-col-h { background: transparent; }
.rule-sum-b { padding: 12px 16px; font-size: 16px; line-height: 24px; }
.rule-sum-b > div { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.rule-ed .ie-body > .card.mt { max-width: none; margin: 14px 0 0; background: var(--surface-3); border: 0; border-radius: 12px; padding: 16px 16px 12px 12px; }
.rule-ed .ie-body > .card.mt label b.gold { font-size: 16px; font-weight: 600; }
.rule-ed .ie-body > .card.mt .right > b { font-size: 16px; font-weight: 450; }
.rule-ed .ie-body > .card.mt .right .muted.small { font-size: 12px; }
.rv-tbl { margin-top: 12px; }
.rv-tbl th { padding: 0 10px; height: 52px; font-size: 14px; font-weight: 450; color: var(--text); }
.rv-tbl td { padding: 0 10px; height: 52px; font-size: 14px; }
.rule-ed .ie-body > .card.mt .center.muted.small { font-size: 18px; color: var(--text); font-weight: 450; margin-top: 24px; }
.rule-ed .ie-body > .card.mt .center.muted.small b { font-weight: 450; }
/* rules: Simplifi spacing pass 2 */
.rule-ed .ie-body { padding-top: 75px; }
.rule-ed .ie-head.rule-foot { height: 80px; padding: 16px 32px 24px; }
.rule-foot .del { height: 36px; }
.rsec .rsec-b { padding: 16px 16px 24px; }
.rsec .hint.mt { margin-top: 16px; }
#kwGroups { margin-top: 18px; }
#acctList { margin-top: 12px; }
#catOne > .row, #catTwo > .cat-split-row:first-child { margin-top: 28px !important; }
.rule-ed .center { text-align: center; }
#rvApply { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }

/* rules: Simplifi structure pass 3 */
.rule-ed { background: var(--bg); }
.rule-ed .ie-head { background: var(--surface); }
.rule-ed .ie-head.rule-foot { justify-content: flex-end; background: var(--surface); border-top: 0; }
.rule-ed .ie-body { padding: 36px 40px 16px; display: flex; flex-direction: column; }
.rule-tip { align-self: center; margin: 0 0 24px; padding: 10px 16px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-2); font-size: 14px; }
.rule-tip b { margin-left: 4px; }
.rule-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--surface-2); border-radius: 12px; flex: 1; min-height: 0; max-width: none; margin: 0; }
.rule-col { background: transparent; border: 0; border-radius: 0; padding: 12px; }
.rule-col + .rule-col { border-left: 1px solid var(--border-2); }
.rule-col-h { height: auto; padding: 12px 12px 10px; font-size: 15px; font-weight: 700; background: transparent; border: 0; }
.rsec { margin: 0 0 12px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); }
.rsec:first-of-type { margin-top: 0; }
.rsec > header { min-height: 48px; padding: 10px 12px; font-size: 15px; font-weight: 700; }
.rsec.on > header { border-bottom: 1px solid var(--border-2); }
.rsec > header .rsec-cb { width: 18px; height: 18px; border-radius: 4px; }
.rsec .rsec-b { padding: 12px 12px 16px; }
.rsec .hint { font-size: 11.5px; line-height: 15px; }
.rsec-split .hint { border-left: 1px solid var(--border-2); padding-left: 12px; }
.rsec-split .hint > div { margin-bottom: 2px; }
.radios label { font-size: 14px; line-height: 20px; margin-bottom: 6px; }
.radios input[type=radio] { width: 16px; height: 16px; }
.rsec .hint.mt { margin-top: 12px; }
#kwGroups { margin-top: 12px; }
.kw-mode { width: 150px; height: 48px; font-size: 14px; }
.kw-box { min-height: 48px; border-radius: 10px; padding: 6px 0 6px 8px; }
.kw-in { font-size: 14px; }
.kw { font-size: 14px; font-weight: 600; padding: 3px 6px 3px 10px; border-radius: 16px; background: var(--surface-3); border: 0; line-height: 20px; gap: 6px; }
.kw .x { width: 14px; height: 14px; border-radius: 50%; background: var(--muted-2); color: #000; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.rules-tbl .kw { padding: 2px 8px; }
.rsec input:not([type=checkbox]):not([type=radio]):not(.kw-in):not(.catc-in), .rsec select, .rsec .catc, .acct-sel, .usage-btn { height: 48px; border-radius: 10px; font-size: 14px; }
.rsec .catc-in { height: 46px; font-size: 14px; } .rsec .catc-btn { height: 46px; }
.rsec textarea { font-size: 14px; border-radius: 10px; }
.usage-btn { border-radius: 10px 0 0 10px; width: 92px; }
.usage-btn + input + .catc-host .catc { border-radius: 0 10px 10px 0; }
.uav { width: 22px; height: 22px; } .uav svg { width: 13px; height: 13px; }
#catOne > .row, #catTwo > .cat-split-row:first-child { margin-top: 16px !important; }
.cat-split-l { font-size: 13.5px; }
.cat-split-row .rl-k { font-size: 13.5px; width: 190px; }
#acctList { margin-top: 10px; }
.kw-add { width: 22px; height: 22px; font-size: 16px; }
.kw-or { font-size: 13px; }
.rule-foot { gap: 16px; }
.rule-foot .btn { height: 40px; font-size: 15px; }
.rule-foot .muted.small { font-size: 13.5px; margin-right: 8px; }
.rule-foot .del { font-size: 14px; }
.rule-sum { background: var(--surface-2); }
.rule-sum .rule-col-h { padding: 14px 16px 6px; }

/* split editor */
.split-chip { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.split-chip a { color: var(--gold); font-weight: 600; font-size: 12.5px; margin-left: auto; }
.cat-split { color: var(--muted); font-weight: 600; cursor: help; white-space: nowrap; }
.split-ed .se-top { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.split-ed .se-top > b { font-size: 14px; }
.se-leftbox #seLeft { font-size: 16px; } #seLeft.ok { color: var(--pos); } #seLeft.neg { color: #e5484d; }
.se-line { padding: 10px 0 6px; border-top: 1px solid var(--border); }
.se-line:first-child { border-top: 0; }
.se-hd { margin-bottom: 8px; } .se-hd b { font-size: 13.5px; }
.se-row { gap: 6px; align-items: flex-end; margin-bottom: 8px; }
.se-row .usage-btn { height: 38px; width: 64px; border-radius: 8px; justify-content: center; gap: 6px; padding: 0 6px; flex-shrink: 0; font-size: 12px; }
.se-row .catc-host { flex: 1; min-width: 0; }
.se-row .se-amt { width: 112px; margin: 0; flex-shrink: 0; }
.se-row .se-amt input { text-align: right; }
.se-ex { gap: 12px; margin-bottom: 8px; }
.se-foot { width: 100%; }

/* ===================== lane: chrome (rail, top bar, avatar, notifications, help/guide, Ask AI, accounts panel, footer, appearance) ===================== */
/* Appearance: Light theme tokens (Dark stays the :root default). <html data-theme> is set by U.applyAppearance from DB.settings.appearance (auto/dark/light). */
:root[data-theme="light"] {
  --bg: #f6f4ee; --bg-2: #eeebe2; --surface: #ffffff; --surface-2: #f4f1e9; --surface-3: #e9e5da;
  --border: #e3ded1; --border-2: #d2ccbc; --text: #15130e; --muted: #5d594f; --muted-2: #8a857a;
  --gold: #a8841c; --gold-2: #c9a227; --gold-3: #866812; --gold-dim: rgba(168,132,28,.14);
  --neg: #15130e; --shadow: 0 10px 30px rgba(40,32,10,.14);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cfc9b9; }
:root[data-theme="light"] .rail-item .tip { background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="light"] .ai-card { background: linear-gradient(180deg, #fbf5df 0%, var(--surface) 45%); }
:root[data-theme="light"] .backdrop { background: rgba(20,18,10,.35); }
:root[data-theme="light"] .toggle.on::after { background: #fff; }

/* rail: Settings pinned at the bottom; Refresh All spins while busy */
.rail-item svg, .icon-btn svg { transition: transform .2s; }
.rail-item.spinning svg, .icon-btn.spinning svg { animation: spin 1s linear infinite; }
.icon-btn.spinning { color: var(--gold); border-color: var(--gold); cursor: progress; }
#topRefresh svg { display: block; }

/* page-title "?" */
.page-title .q[data-title-help]:hover { border-color: var(--gold); color: var(--gold); }

/* avatar menu */
.avatar-lg { width: 44px; height: 44px; font-size: 15px; display: grid; place-items: center; margin: 2px auto 6px; cursor: default; }
.appear-switch { display: inline-flex; gap: 2px; margin-left: 8px; padding: 2px; border: 1px solid var(--border-2); border-radius: 16px; background: var(--surface-2); }
.appear-switch button { width: 26px; height: 22px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.appear-switch button:hover { color: var(--gold); }
.appear-switch button.on { background: var(--gold); color: #000; }

/* notifications popover */
.notif-list { max-height: 380px; overflow: auto; width: 340px; max-width: calc(100vw - 32px); }
.notif-item { align-items: flex-start; }
.notif-item small { display: block; white-space: normal; }
.notif-item .when { white-space: nowrap; color: var(--muted); }
.notif-item.unread b { color: var(--gold); }

/* Help center + Guide */
.hc-list { display: flex; flex-direction: column; gap: 6px; }
.hc-topic { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px 12px; background: var(--surface-2); }
.hc-topic summary { cursor: pointer; font-weight: 700; }
.hc-topic[open] summary { color: var(--gold); margin-bottom: 6px; }
.hc-topic div { line-height: 1.55; }
.tour-hi { outline: 2px solid var(--gold) !important; outline-offset: 3px; border-radius: 8px; position: relative; z-index: 2; box-shadow: 0 0 0 6px var(--gold-dim); }
.tour-pop { padding: 4px 6px; }
.tour-pop b { display: block; margin: 2px 0 4px; color: var(--gold); }
.tour-pop p { margin: 0 0 10px; line-height: 1.5; font-size: 13px; }
.tour-pop .row { gap: 6px; }

/* Ask AI: full-height right drawer with avatar greeting */
.ai-card { top: 0; right: 0; bottom: 0; height: auto; max-height: none; border-radius: 0; border-top: 0; border-bottom: 0; border-right: 0; width: 440px; max-width: 100vw; }
.ai-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: #000; font-weight: 800; font-size: 17px; display: grid; place-items: center; margin: 40px auto 0; }
.ai-avatar + .hello { margin-top: 12px; }

/* accounts panel: "<" collapse button, active business band */
.ap-collapse { width: 24px; height: 24px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1; padding: 0 0 2px; }
.ap-collapse:hover { color: var(--gold); border-color: var(--gold); }
.ap-band [data-band-caret] { cursor: pointer; }
.ap-band .ap-band-name:hover { text-decoration: underline; }
.ap-band.active { box-shadow: 0 0 0 2px var(--gold); }
.biz-hero-name { text-transform: uppercase; letter-spacing: .5px; }

/* footer (every page) */
.app-footer { margin: 34px 0 0; padding: 14px 0 4px; border-top: 1px solid var(--border); text-align: center; color: var(--muted-2); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.app-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--gold); text-decoration: underline; }
.legal-text p { line-height: 1.6; margin: 0 0 10px; }

/* Sign Out splash */
.signout-splash { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.so-card { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 32px 28px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.so-card h2 { font-size: 22px; }
.so-card p { margin: 0; }
.so-card .btn { min-width: 160px; justify-content: center; margin: 8px 0; }
.so-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--gold); color: #000; font-weight: 800; font-size: 18px; display: grid; place-items: center; }
@media (max-width: 600px) { .ai-card { width: calc(100vw - var(--rail-w, 56px)); } .appear-switch { margin-left: 4px; } }

/* ===== Lane: core (dashboard, spending, net worth gap pass) ===== */
.tx-row.clickable { cursor: pointer; border-radius: 6px; }
.tx-row.clickable:hover { background: var(--surface-2); }
.tasks-list { max-height: 260px; overflow: auto; scroll-behavior: smooth; }
.task-scroll { display: block; margin: 4px auto 0; width: 34px; height: 24px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--gold); cursor: pointer; font-size: 16px; line-height: 1; }
.task-scroll:hover { border-color: var(--gold); }
.task-scroll[hidden] { display: none; }
.task.task-off { opacity: .6; }
.dash-link { color: var(--gold); }
.card-actions .kebab.card-open { display: inline-grid; place-items: center; text-decoration: none; font-size: 22px; }
.card-actions .kebab.card-open:hover, .card-actions #csRefresh:hover { color: var(--gold); }
.card-actions .sel-sm, select.sel-sm { padding: 4px 8px; font-size: 12.5px; height: 30px; }
.customize-list .ci[draggable="true"] { cursor: grab; }
.customize-list .ci .drag { user-select: none; letter-spacing: -2px; padding: 0 2px; }
.customize-list .ci.dragging { opacity: .4; }
.customize-list .ci.drop-before { box-shadow: inset 0 2px 0 var(--gold); }
.customize-list .ci.drop-after { box-shadow: inset 0 -2px 0 var(--gold); }
/* Spending */
.sp-usage { height: 34px; }
.sp-usage-name { font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .lbl .tile-go { color: var(--gold); font-size: 15px; margin-left: auto; }
.sp-layouts { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.sp-lay { width: 34px; height: 30px; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 15px; }
.sp-lay + .sp-lay { border-left: 1px solid var(--border-2); }
.sp-lay.active, .sp-lay:hover { color: var(--gold); background: var(--gold-dim); }
.sp-bar { height: 8px; border-radius: 4px; background: var(--gold); }
.sp-bar.bar-prior { margin-top: 3px; background: repeating-linear-gradient(135deg, var(--surface-3) 0 3px, var(--muted-2) 3px 5px); }
.sp-sort, .sp-cmp { cursor: pointer; user-select: none; }
.sp-sort:hover, .sp-cmp:hover { color: var(--gold); }
.sp-unit { width: 24px; height: 22px; font-size: 12px; font-weight: 700; margin-left: 4px; border: 1px solid var(--border-2); vertical-align: middle; }
.sp-unit:hover { color: var(--gold); border-color: var(--gold); }
.chip.sp-diff { white-space: nowrap; }
.sp-pie { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; padding-top: 10px; }
.sp-pie-chart { text-align: center; flex: 0 0 auto; margin: 0 auto; }
.sp-pie-legend { flex: 1 1 280px; min-width: 0; }
.sp-li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.sp-li:hover { background: var(--surface-2); }
.sp-li .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sp-li-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding-top: 10px; }
.sp-gtile { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px; background: var(--surface-2); cursor: pointer; min-width: 0; }
.sp-gtile:hover { border-color: var(--gold); }
.sp-gname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-gval { font-size: 18px; font-weight: 700; margin: 4px 0; }
/* Net Worth */
.nw-incl { cursor: pointer; }
.nw-incl:hover { color: var(--gold); }
.nw-ratio-chip { border-color: transparent; }
.nw-ratio-chip.crit { background: var(--danger-dim); color: var(--danger); }
.nw-ratio-chip.warn { background: rgba(245,158,11,.16); color: #f59e0b; }
.nw-ratio-chip.ok { background: rgba(52,199,89,.15); color: var(--pos); }
.ratio-bar.nw-ratio.warn > i { background: #f59e0b; }
.ratio-bar.nw-ratio.ok > i { background: var(--pos); }
@media (max-width: 640px) { .sp-pie { flex-direction: column; } .sp-usage-name { max-width: 90px; } }

/* ===================================================================
   LANE: planning (Spending Plan, Bills & Income) — appended block
   =================================================================== */
.plan-row { position: relative; }
.plan-row.active { background: var(--gold-dim); }
.plan-row.active::after { content: '▸'; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 16px; line-height: 1; }
@media (max-width: 1100px) { .plan-row.active::after { content: none; } }
.plan-legend { justify-content: center; margin-top: 8px; }
.plan-legend .item { font-size: 12px; text-align: left; }
.rr-info { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; font-size: 12px; font-weight: 400; color: var(--muted); cursor: pointer; vertical-align: middle; user-select: none; }
.rr-info:hover, .rr-info:focus { color: var(--gold); outline: none; }
.rr-info-pop { padding: 8px 10px; font-size: 13px; line-height: 1.5; color: var(--text); }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.pe-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-width: 0; cursor: pointer; }
.pe-tile:hover, .pe-row:hover { border-color: var(--gold); }
.pe-row { cursor: pointer; }
.pe-amt { font-size: 18px; font-weight: 700; margin-top: 4px; }
.pl-viewtog .subtab { padding: 4px 9px; }
.os-pie { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; padding: 6px 0 4px; }
.os-legend { flex-direction: column; flex-wrap: nowrap; gap: 6px; margin-top: 0; min-width: 180px; max-width: 320px; }
.os-legend .item { padding: 3px 6px; border-radius: 6px; cursor: default; }
.os-legend .item.hl { background: var(--gold-dim); }
.pl-split { display: inline-flex; }
.pl-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pl-split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid var(--border); padding-left: 8px; padding-right: 8px; }
th.pl-sort { cursor: pointer; user-select: none; }
th.pl-sort:hover { color: var(--gold); }
.tbl .check[data-plrev] { cursor: pointer; }
.rem-group { font-weight: 700; letter-spacing: .5px; margin-top: 6px; }
.rem-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--gold-dim); display: grid; place-items: center; flex-shrink: 0; }
.rem-chip { padding: 1px 6px; font-size: 10px; cursor: default; }
.rem-stmt { font-weight: 400; }
.cal .ev { cursor: pointer; }
.cal .ev.past { border-left: 2px solid var(--danger); }
.cf-group { margin-bottom: 6px; }
.cf-ghead { gap: 4px; padding: 4px 0 2px; }
.cf-tog { background: none; border: 0; color: var(--muted); cursor: pointer; width: 18px; padding: 0; font-size: 12px; }
.cf-tog:hover { color: var(--gold); }
.cf-acct { padding: 3px 0 3px 22px; gap: 6px; min-width: 0; }
.srow-hl { background: var(--gold-dim); border-radius: 8px; transition: background .6s; }
.rf-files { display: flex; flex-direction: column; gap: 6px; }
.rf-file { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.rf-file img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.rf-doc { width: 34px; text-align: center; font-size: 20px; }
.sr-check { align-items: flex-start; gap: 8px; margin: 6px 0 10px; }
.sr-check input { margin-top: 3px; }
.popover .menu-item.rm-chk { padding-left: 22px; }
.popover .menu-item.disabled { opacity: .45; pointer-events: none; }
.popover .menu-item.danger:hover { color: var(--danger); }

/* ===== lane: business — clients, sales & billing editor, expense receipts, mileage ===== */
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.th-sort:hover, .th-sort.on { color: var(--gold); }
th.num .th-sort { width: 100%; text-align: right; }
.tbl tr.inactive td { opacity: .5; }
.bz-btn { display: inline-flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px 0 6px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.bz-btn:hover { border-color: var(--gold); }
.bz-btn .bz-nm { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.bz-btn .caret { font-size: 11px; color: var(--muted); }
.bz-btn .uav, .popover .menu-item .uav { width: 22px; height: 22px; font-size: 11px; }
.ie-combo { position: relative; }
.ie-combo input { width: 100%; padding-right: 26px; }
.ie-combo .caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; cursor: pointer; }
.ie-cmenu { max-height: 320px; overflow-y: auto; margin: -2px; }
.popover .menu-item.hi { background: var(--surface-2); }
.popover .menu-item.sel { color: var(--gold); }
.ie-cmenu .ie-proj { padding-left: 28px; font-size: 13px; }
.ie-cmenu .ie-newc { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); color: var(--gold); font-weight: 600; margin-top: 4px; border-radius: 0 0 6px 6px; }
.ie-client { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 560px; }
.ie-items input:not([type=checkbox]) { width: 100%; }
.ie-items .ie-noitems td { text-align: center; color: var(--muted); padding: 22px 0; }
.ie-bottom { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.ie-totals .ie-tr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.ie-totals .ie-tr.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.ie-totals .ie-tr.total b { color: var(--gold); }
.ie-totals input.ie-disc { width: 84px; text-align: right; }
.ie-totals select.ie-disct { width: 58px; }
.invoice-editor .need, .invoice-editor .need:focus { border-color: var(--danger) !important; box-shadow: 0 0 0 2px var(--danger-dim); }
.invoice-editor .btn.need { color: var(--danger); }
/* slide-overs opened from the full-screen invoice editor (Add Client, settings, Send to…, Receive payment) sit above it */
body:has(.invoice-editor) #drawerLayer .backdrop { z-index: 310; }
body:has(.invoice-editor) #drawerLayer .drawer { z-index: 320; }
.rc-name { display: inline-flex; align-items: center; gap: 10px; }
.rc-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border-2); background: #fff; cursor: zoom-in; flex-shrink: 0; }
.rc-file { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-2); cursor: pointer; flex-shrink: 0; }
.chip.scan { border-color: var(--gold); color: var(--gold); cursor: default; padding: 1px 8px; font-size: 11px; }
.btn.ml-period { margin-top: 4px; gap: 6px; }
.kebab.veh-btn { font-size: 18px; width: 34px; height: 34px; }
@media (max-width: 760px) { .ie-bottom { grid-template-columns: 1fr; } }

/* ===== Lane: core (transactions register + detail) — reminders carousel, flag colours, Customize Columns, filter tree, row menu, tags chips, attachments ===== */
/* Reminders strip */
.rem-card .rem-arrow { width: 28px; height: 28px; font-size: 16px; }
.rem-card .rem-arrow:disabled { opacity: .35; cursor: default; }
.reminder-chip .rc-top { margin-bottom: 4px; min-height: 22px; }
.reminder-chip .rc-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--surface-3); }
.reminder-chip .rc-ic.rc-income { background: rgba(52,199,89,.15); }
.reminder-chip .rc-ic.rc-subscription { background: var(--gold-dim, rgba(212,175,55,.15)); color: var(--gold); }
.reminder-chip .rc-chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; }
.reminder-chip .rc-chip.past { background: rgba(229,72,77,.16); color: #e5484d; }
.reminder-chip .rc-chip.due { background: var(--gold-dim, rgba(212,175,55,.15)); color: var(--gold); }
.reminder-chip:hover { border-color: var(--gold); }
#remStrip { scroll-behavior: smooth; }
/* Flag colours */
.tx-flag { font-size: 13px; line-height: 1; }
.tx-flag.fl-black, .kebab[style*="#111111"], .btn[style*="#111111"] { -webkit-text-stroke: 1px #9a9a9a; }
.popover .menu-item .tx-flag { width: 16px; display: inline-block; text-align: center; }
/* Register: Business pill with avatar, ⚙ header cell, trailing actions cell */
.pill-tag.pill-av { padding: 2px 8px 2px 3px; max-width: 150px; }
.pill-tag.pill-av .uav { width: 18px; height: 18px; font-size: 10px; }
.pill-tag.pill-av .uav svg { width: 11px; height: 11px; }
.pill-tag.pill-av img.uav { object-fit: cover; }
.tbl th.col-gear { width: 1%; text-align: right; padding-right: 4px; }
.tbl th.col-gear .kebab { font-size: 15px; color: var(--muted); }
.tbl th.col-gear .kebab:hover { color: var(--gold); }
.tbl td.row-end { width: 1%; white-space: nowrap; padding-left: 0 !important; text-align: right; }
.tbl td.excl { max-width: 210px; }
/* Customize Columns */
.popover .col-row .col-eye { display: inline-flex; align-items: center; color: var(--muted); font-size: 12px; }
.popover .col-row.on .col-eye { color: var(--gold); }
.popover .col-row.locked { cursor: default; color: var(--muted); }
.popover .col-row.locked:hover { background: transparent; }
/* Row ⋮ menu */
.popover .rm-boxes { display: flex; gap: 4px; padding: 0 4px 4px; }
.popover .rm-box { flex: 1; gap: 8px; }
.popover .rm-cb { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--muted-2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #000; flex-shrink: 0; }
.popover .rm-cb.on { background: var(--gold); border-color: var(--gold); }
/* Filter panel: category tree, Show only pairs */
.fp-node { display: flex; align-items: center; gap: 2px; }
.fp-node .menu-item { flex: 1; min-width: 0; }
.fp-tw { width: 22px; height: 22px; flex-shrink: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; border-radius: 6px; }
.fp-tw:hover { color: var(--gold); background: var(--surface-3); }
.fp-tw-sp { width: 22px; flex-shrink: 0; }
.fp-kids.closed { display: none; }
.fp-list.searching .fp-kids.closed { display: block; }
.fp-all { border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.fp-pair { border-bottom: 1px solid var(--border); padding: 2px 0; }
/* Spending / Income figure tools */
.tx-figtools .kebab { width: 30px; height: 30px; font-size: 15px; }
/* Usage avatar fused to the Category combobox (detail / create drawers) */
.usage-fuse .usage-btn { height: auto; min-height: 38px; width: 64px; padding: 0 6px; gap: 6px; justify-content: center; }
.usage-fuse .catc-host { min-width: 0; }
/* Tags chip input */
.tagin { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 38px; padding: 4px 6px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); cursor: text; }
.tagin:focus-within { border-color: var(--gold); }
.tagin-chips { display: contents; }
.tagin-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 12px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; }
.tagin-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.tagin-x:hover { color: var(--gold); }
.tagin .tagin-in { flex: 1; min-width: 90px; width: auto !important; border: 0 !important; background: transparent !important; outline: none; padding: 4px 2px !important; height: auto !important; box-shadow: none !important; color: var(--text); }
/* Attachments */
.att-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.att-row .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.att-row .att-name:hover { color: var(--gold); }
.att-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-2); flex-shrink: 0; }
.att-ic { width: 36px; text-align: center; flex-shrink: 0; }
/* Link to existing series */
.ls-list { max-height: 340px; overflow: auto; }
.ls-row { gap: 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ls-row .ls-ic { width: 22px; text-align: center; }

/* =====================================================================
   LANE: planning (Planning Tools, Investments, Reports, Settings) — appended block
   ===================================================================== */
.cs-intro { text-align: center; padding: 34px 20px 30px; max-width: 560px; margin: 0 auto; }
.cs-intro .cs-illu { display: flex; justify-content: center; opacity: .85; margin-bottom: 8px; }
.cs-intro h3 { font-size: 18px; margin-bottom: 6px; }
.cs-intro p { margin: 0 auto 16px; max-width: 440px; }
.inv-toolbar { align-items: center; gap: 10px; }
.inv-nodata { align-items: flex-start; }
.tbl tr.tot td { border-top: 1px solid var(--border-2); }
.report-tiles .rt .rt-type, .report-tiles .rt span.rt-type { display: flex; width: fit-content; margin-top: 8px; padding: 1px 8px; font-size: 11px; color: var(--muted); border-radius: 10px; }
.rp-pal { max-height: 360px; overflow: auto; }
.rp-pal .menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.rp-pal .menu-item:hover, .rp-pal .menu-item.active { background: var(--gold-dim); }
.rp-pal .menu-item.active b { color: var(--gold); }
.rp-pal-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--gold-dim); color: var(--gold); display: grid; place-items: center; flex: none; }
.vchip { padding: 1px 8px !important; font-size: 11px; margin-left: 6px; vertical-align: middle; }
.appearance .ap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.appearance .ap:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.appearance .ap-prev { width: 100%; max-width: 86px; height: 46px; border-radius: 6px; border: 1px solid var(--border-2); display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 3px; padding: 4px; overflow: hidden; }
.appearance .ap-prev i { border-radius: 3px; display: block; }
.appearance .ap-prev i:first-child { grid-row: span 2; }
.appearance .ap-light .ap-prev { background: #f6f4ee; } .appearance .ap-light .ap-prev i { background: #e3ded1; } .appearance .ap-light .ap-prev i:last-child { background: #d4af37; }
.appearance .ap-dark .ap-prev { background: #0a0a0a; } .appearance .ap-dark .ap-prev i { background: #262626; } .appearance .ap-dark .ap-prev i:last-child { background: #d4af37; }
.appearance .ap-auto .ap-prev { background: linear-gradient(135deg, #f6f4ee 50%, #0a0a0a 50%); } .appearance .ap-auto .ap-prev i { background: rgba(128,128,128,.35); } .appearance .ap-auto .ap-prev i:last-child { background: #d4af37; }
.inst-card .logo[data-l]::before, .inst-logo[data-l]::before { content: attr(data-l); }
.inst-card .logo.has-img, .inst-logo.has-img { background: #fff; overflow: hidden; }
.inst-card .logo.has-img img, .inst-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.acct-row.is-hidden > div:first-child { opacity: .6; }
.tagcloud.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.inst-grid .inst-tile { flex-direction: column; justify-content: center; gap: 6px; border-radius: 10px; padding: 10px 6px; text-align: center; min-height: 84px; }
.inst-grid .inst-logo { width: 34px; height: 34px; border-radius: 50%; background: var(--white, #fff); color: #000; display: grid; place-items: center; font-weight: 800; flex: none; }
.inst-grid .inst-nm { font-size: 12px; line-height: 1.25; }
.biz-logo-prev { width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--border-2); overflow: hidden; display: inline-grid; place-items: center; }
.biz-logo-prev img, .biz-logo-sm img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.biz-logo-sm { width: 22px; height: 22px; border-radius: 5px; background: #fff; overflow: hidden; display: inline-grid; place-items: center; }
.avatar-lg { width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.cat-tbl .row-acts { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.cat-tbl tr:hover .row-acts, .cat-tbl .row-acts:focus-within { opacity: 1; }
@media (hover: none) { .cat-tbl .row-acts { opacity: 1; } }
.cat-tbl tr.cat-grp td { font-weight: 800; letter-spacing: .04em; font-size: 12.5px; color: var(--gold); background: var(--surface-2); }
.cat-tbl tr.is-hidden td:first-child { opacity: .6; }
.tag-chip { position: relative; padding-right: 10px; }
.tag-chip .tg-x { display: none; font-size: 10px; color: var(--muted); margin-left: 2px; padding: 0 2px; }
.tag-chip:hover .tg-x { display: inline; }
.tag-chip .tg-x:hover { color: var(--danger, #e5484d); }
.tag-input { border: 1px solid var(--gold); background: var(--surface-2); color: var(--text); border-radius: 16px; padding: 4px 10px; font-size: 13px; outline: none; min-width: 80px; }
/* accounts bubble: Investments + Assets cards inside the bubble, like Simplifi */
.ap-extras { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 4px; }
.ap-extras .ap-prompt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px; border-radius: 12px; border: 0; margin: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.16); background: transparent; cursor: pointer; }
.ap-extras .ap-prompt + .ap-prompt { border-top: 0; border-radius: 12px; margin-top: 0; }
.ap-extras .ap-prompt:hover { background: var(--surface-2); box-shadow: 0 0 0 1px var(--gold); }
.ap-extras .ap-prompt:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ap-extras .ap-prompt-t { flex: 1; min-width: 0; }
.ap-extras .ap-prompt b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.ap-extras .ap-prompt span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-extras .ap-plus { flex-shrink: 0; font-size: 18px; line-height: 1; color: var(--gold); }
:root[data-theme="light"] .ap-extras .ap-prompt { box-shadow: 0 0 0 1px rgba(0,0,0,.16); }

/* account-bar edge toggle (Simplifi): round chevron on the panel's right edge; closed, at the page's left edge */
.body { position: relative; }
.ap-toggle { position: absolute; top: 18px; left: calc(var(--accounts-w) - 15px); z-index: 40; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: left .18s ease, transform .18s ease, color .12s, border-color .12s; }
.ap-toggle:hover { color: var(--gold); border-color: var(--gold); }
.ap-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ap-toggle.closed { left: 4px; }
.ap-toggle.closed svg { transform: rotate(180deg); }
.ap-toggle[hidden] { display: none; }
.ap-collapse { display: none; }
@media (max-width: 760px) { .ap-toggle { top: 8px; left: auto; right: 10px; } .ap-toggle.closed { left: auto; right: 10px; } }
.body.ap-closed .main { padding-left: 46px; }
@media (max-width: 760px) { .body.ap-closed .main { padding-left: 18px; padding-top: 46px; } }

/* accounts column slide (225 ms, Simplifi's drawer curve) */
.accounts-panel { transition: width .225s cubic-bezier(.4, 0, .6, 1), padding .225s cubic-bezier(.4, 0, .6, 1), opacity .2s ease; will-change: width; }
.accounts-panel > .ap-card { min-width: calc(var(--accounts-w) - 14px); }
.accounts-panel.ap-slide { width: 0 !important; padding-left: 0 !important; padding-right: 0 !important; opacity: 0; }
.ap-toggle { transition: left .225s cubic-bezier(.4, 0, .6, 1), color .12s, border-color .12s; }
.ap-toggle svg { transition: transform .225s cubic-bezier(.4, 0, .6, 1); }
.main { transition: padding-left .225s cubic-bezier(.4, 0, .6, 1); }
@media (prefers-reduced-motion: reduce) { .accounts-panel, .ap-toggle, .ap-toggle svg, .main { transition: none; } }
@media (max-width: 760px) { .accounts-panel > .ap-card { min-width: 0; } }

/* hover rail (Simplifi): 56px icons in the layout, an overlay that grows to 230px with labels */
.rail { position: relative; width: var(--rail-w); padding: 0; display: block; background: var(--bg-2); border-right: 1px solid var(--border); flex-shrink: 0; z-index: 260; overflow: visible; }
.rail-in { position: absolute; top: 0; bottom: 0; left: 0; width: var(--rail-w); display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 0; background: var(--bg-2); border-right: 1px solid var(--border); overflow: hidden auto; scrollbar-width: none; transition: width .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s; }
.rail-in::-webkit-scrollbar { display: none; }
.rail.open .rail-in { width: 230px; box-shadow: 8px 0 24px rgba(0,0,0,.45); }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-bottom: 14px; cursor: pointer; min-height: 36px; }
.rail .rail-brand .logo { margin: 0; flex-shrink: 0; }
.rail-name { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.rail-name b { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.2px; }
.rail-name small { font-size: 11.5px; color: var(--muted); }
.rail .divider { width: auto; margin: 8px 10px; }
.rail .spacer { flex: 1 0 8px; }
.rail-item { width: auto; height: 34px; margin: 0 8px; padding: 0 0 0 11px; display: flex; align-items: center; justify-content: flex-start; gap: 14px; white-space: nowrap; text-align: left; font: inherit; flex-shrink: 0; }
.rail-item svg { flex-shrink: 0; }
.rail-item .tip { position: static; transform: none; opacity: 0; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 600; color: inherit; pointer-events: none; transition: opacity .15s; overflow: hidden; text-overflow: ellipsis; }
.rail-item:hover .tip { opacity: 0; }
.rail.open .rail-name, .rail.open .rail-item .tip, .rail.open .rail-item:hover .tip { opacity: 1; }
.rail-item .rail-new { opacity: 0; margin-left: 2px; padding: 1px 7px; border-radius: 8px; background: var(--gold-dim); color: var(--gold); font-size: 11px; font-weight: 700; transition: opacity .15s; }
.rail.open .rail-item .rail-new { opacity: 1; }
.rail.open .rail-item .new-dot { opacity: 0; }
.rail-item .rail-chev { opacity: 0; margin-left: auto; padding-right: 10px; font-size: 18px; color: var(--muted); transition: opacity .15s; }
.rail.open .rail-item .rail-chev { opacity: 1; }
.rail-item.sub-open { background: var(--surface-2); color: var(--text); }
.rail-fly { position: absolute; left: 234px; width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); z-index: 2; }
.rail-fly[hidden] { display: none; }
.rail:not(.open) .rail-fly { display: none; }
.rail-fly-item { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rail-fly-item:hover { background: var(--surface-2); }
.rail-fly-item.active { color: var(--gold); }
:root[data-theme="light"] .rail-item .tip { background: none; box-shadow: none; }
:root[data-theme="light"] .rail.open .rail-in { box-shadow: 8px 0 24px rgba(0,0,0,.12); }
@media (prefers-reduced-motion: reduce) { .rail-in, .rail-name, .rail-item .tip { transition: none; } }

/* dashboard like Simplifi: wider accounts card, >=420px columns, 344px cards */
.app.dash .accounts-panel { width: 424px; padding: 16px 0 16px 24px; }
.app.dash .accounts-panel > .ap-card { min-width: 400px; }
.app.dash .ap-toggle { display: none; }
.app.dash .main { padding: 16px 24px 40px 16px; }
.app.dash .hello { margin-bottom: 16px; min-height: 30px; }
.app.dash .grid-2.dash-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.app.dash .grid-2.dash-grid .span-2 { grid-column: 1 / -1; }
@container (min-width: 856px) { .app.dash .grid-2.dash-grid .span-2 { grid-column: span 2; } }
.app.dash .grid-2.dash-grid > .card.span-full { grid-column: 1 / -1; }
.app.dash .dash-grid > .card { height: 344px; margin: 0; padding: 16px; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.app.dash .dash-grid > .card.span-full { height: 357px; }
.app.dash .dash-grid > .card > .card-head { flex-shrink: 0; margin-bottom: 14px; min-height: 44px; }
.app.dash .dash-grid > .card > .card-head h3 { font-size: 16px; font-weight: 700; line-height: 24px; }
.app.dash .dash-grid > .card > .card-head .sub { font-size: 14px; line-height: 20px; margin-top: 0; }
.app.dash .dash-grid > .card > :not(.card-head) { flex-shrink: 0; }
.app.dash .dash-grid > .card > svg, .app.dash .dash-grid > .card > .chart { display: block; width: 100%; }
.app.dash .dash-grid .scroll-list, .app.dash .dash-grid .tasks-list { flex: 1 1 auto !important; min-height: 0; max-height: none; overflow: auto; }
.app.dash .dash-grid .tx-row { padding: 10px 0; min-height: 44px; }
.app.dash .dash-grid > .card > .review-tiles { flex: 1 1 auto; min-height: 0; grid-auto-rows: 1fr; gap: 8px; }
.app.dash .review-tiles .tile { background: transparent; border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 14px; overflow: hidden; }
.app.dash .review-tiles .tile:hover { border-color: var(--gold); }
.app.dash .review-tiles .tile b { font-size: 14px; }
.app.dash .dash-grid .empty { padding: 18px 12px 10px; }
.app.dash .dash-grid .empty .illu { font-size: 40px; }
.app.dash .dash-grid > .card > .mt:last-child { margin-top: auto; padding-top: 8px; }
@media (max-width: 1100px) { .app.dash .accounts-panel { width: 344px; } .app.dash .accounts-panel > .ap-card { min-width: 320px; } }
@media (max-width: 760px) { .app.dash .accounts-panel { width: auto; padding: 12px; } .app.dash .accounts-panel > .ap-card { min-width: 0; } .app.dash .grid-2.dash-grid { grid-template-columns: 1fr; } .app.dash .dash-grid > .card { height: auto; } }
.app.dash .main { padding-right: 29px; }
.app.dash .legend.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
.app.dash .legend.grid3 .item { display: flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 12.5px; }
.app.dash .legend.grid3 .sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.app.dash .legend.grid3 .amt { font-weight: 700; font-size: 12.5px; }
.app.dash .review-tiles .tile { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.app.dash .review-tiles .tile b { margin: 4px 0 0; }
.app.dash .review-tiles .tile > span:last-child { font-size: 12px; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app.dash .main { padding-top: 22px; }
/* Transactions accounts column like Simplifi: a flush full-height panel (square, thin edge line) beside the title bar */
@media (min-width: 761px) {
  .app.ap-drawer .frame { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); position: relative; min-height: 0; }
  .app.ap-drawer .body { display: contents; }
  .app.ap-drawer .topbar { grid-column: 2; grid-row: 1; padding-left: 24px; }
  .app.ap-drawer .accounts-panel { grid-column: 1; grid-row: 1 / span 2; width: 306px; padding: 0; gap: 0; min-height: 0; height: 100vh; }
  .app.ap-drawer .accounts-panel.ap-slide { width: 0 !important; }
  .app.ap-drawer .main { grid-column: 2; grid-row: 2; min-height: 0; padding: 16px 24px 40px; }
  .app.ap-drawer .body.ap-closed .main { padding-left: 46px; }
  .app.ap-drawer .accounts-panel > .ap-card { min-width: 306px; height: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; border-right: 1px solid rgba(255,255,255,.16); background: var(--surface); padding: 0 16px 16px; }
  .app.ap-drawer .ap-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 23px 8px 12px; margin: 0 -16px 4px; padding-left: 24px; padding-right: 24px; }
  .app.ap-drawer .ap-head h3 { font-size: 22px; font-weight: 600; line-height: 32px; }
  .app.ap-drawer .ap-total { padding: 10px 8px 12px; font-size: 16px; font-weight: 600; }
  .app.ap-drawer .ap-band { border-radius: 6px; }
  .app.ap-drawer .ap-toggle { top: 49px; left: calc(306px - 16px); }
  .app.ap-drawer .ap-toggle.closed { left: 0; }
}
:root[data-theme="light"] .app.ap-drawer .accounts-panel > .ap-card { border-right-color: rgba(0,0,0,.12); }
@media (min-width: 761px) {
  .app.ap-drawer #pageTitle { font-size: 22px; font-weight: 600; }
  .app.ap-drawer .ap-total { margin-top: 8px; }
}
@media (min-width: 761px) { .app.dash .accounts-panel { padding-top: 28px; } }
/* business bands like Simplifi: 8px from both panel edges, 36px tall, 8px corners, 4px apart, letter-spaced 12px text */
.ap-card.ap-scroll { padding-left: 16px; padding-right: max(4px, calc(16px - var(--ap-sb, 0px))); }
.ap-band { margin: 0 -8px 4px; min-height: 36px; padding: 0 16px 0 18px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; }
.ap-band .ap-band-name { margin-left: 2px; }
.app.ap-drawer .ap-band { border-radius: 8px; }
.ap-extras { margin: 14px -8px 0; }
@media (min-width: 761px) { .app.ap-drawer .accounts-panel > .ap-card { padding-left: 16px; padding-right: max(4px, calc(16px - var(--ap-sb, 0px))); } }
@media (min-width: 761px) { .app.ap-drawer .accounts-panel > .ap-card { border-right: 0; box-shadow: inset -1px 0 0 rgba(255,255,255,.16); } }
:root[data-theme="light"] .app.ap-drawer .accounts-panel > .ap-card { box-shadow: inset -1px 0 0 rgba(0,0,0,.12); }
.ap-band { padding-left: 16px; }

/* ===================== logins (only with a server started with --auth) ===================== */
/* step-up prompt (js/plaid.js Dialogs.stepUp): its own layer above any open modal, so the dialog that asked keeps its contents */
.stepup-layer { position: fixed; inset: 0; z-index: 500; }
.stepup-layer .modal { width: 420px; }
.stepup-lead { margin-top: 0; }
.stepup-error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.stepup-error:empty { display: none; }
.stepup-user { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -9999px; }
.popover .auth-who-item { cursor: default; }
.popover .auth-who-item:hover { background: transparent; }
.auth-who-email { color: var(--text); font-weight: 600; word-break: break-all; }

/* rows entered from a shop login (shop.html) */
.by-tag { display:inline-block; margin-left:6px; padding:0 6px; border-radius:6px; font-size:11px; line-height:17px; background:rgba(120,160,230,.16); color:#9cc2ff; vertical-align:1px; }
