/* Apex Fee — Console (working model). Builds on dashboard-concepts.css
   (.console / .ledger) + dashboard.css (pills/semantics). Adds the
   interactive exceptions panel, ledger expansion, and live states. */

html, body { background: var(--bg); margin: 0; padding: 0; min-height: 100vh; }
#root { min-height: 100vh; }
.cc-board { width: 100%; min-width: 0; min-height: 100vh; }
.cc-page { width: 100%; min-width: 0; max-width: 1440px; margin-left: auto; margin-right: auto; }

/* ── Modernize micro-typography ──
   The shared concept styles set tiny labels in IBM Plex Mono, which reads
   "terminal." Re-set them in the sans face, keeping the clean uppercase
   tracking. Numeric values keep tabular-nums for column alignment.
   (This file loads after dashboard-concepts.css, so equal-specificity wins.) */
.cc-head .eyebrow,
.cc-head .period .mono,
.console .fig .k,
.ledger-h,
.ledger .lr .col .sub,
.ledger .lr .lk {
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* command band becomes interactive */
.console .id .st { transition: opacity 0.2s; }
/* center each figure's number under its label */
.console .figs .fig { text-align: center; }
.console .figs .fig .s { margin-top: 4px; font-family: var(--font-sans); font-size: 11px; line-height: 1.4; color: var(--muted); }

/* tiny toast when navigating */
.con-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff;
  padding: 12px 20px; border-radius:var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  max-width: min(620px, calc(100vw - 32px));
}
.con-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.con-toast.error { background:#8d2d25; }
.con-toast.success { background:#1d6747; }
.con-toast .toast-mark { display:grid; place-items:center; width:20px; height:20px; flex:0 0 20px; border:1px solid rgba(255,255,255,.5); border-radius:50%; font-weight:800; }
.con-toast > button { display:grid; place-items:center; width:28px; height:28px; margin-left:6px; padding:0; border:0; background:transparent; color:#fff; cursor:pointer; }
.con-toast > button svg { width:16px; height:16px; }


/* ── Production-like clickable prototype routes ── */
.proto-page { padding-bottom: 42px; }
.proto-title { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin: 8px 0 22px; }
.proto-title .eyebrow { display:block; font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-500); margin-bottom:8px; }
.proto-title h1 { margin:0; font-family:var(--font-serif); font-size:28px; line-height:1.15; color: var(--heading-900); font-weight:500; letter-spacing:0; }
.proto-title p { margin:8px 0 0; color:var(--ink-600); font-size:15px; max-width:680px; }
.proto-grid { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:22px; margin:24px 0; align-items:start; }
.proto-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); overflow:hidden; }
.proto-card h2 { margin:0; padding:20px 24px 8px; font-family:var(--font-serif); color: var(--heading-900); font-weight:500; font-size:19px; }
.proto-card > p.muted { color:var(--ink-500); margin:0; padding:0 24px 16px; font-size:14px; }
.side-card { padding-bottom:20px; }
.readiness-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 24px; border-top:1px solid var(--divider); font-size:14px; color:var(--ink-700); }
.table-head, .table-row { display:grid; align-items:center; gap:18px; padding:0 24px; }
.table-head { min-height:46px; border-bottom:1px solid var(--divider); color:var(--ink-500); font:700 11px var(--font-sans); letter-spacing:.09em; text-transform:uppercase; }
.four { grid-template-columns:1.5fr .8fr 1fr .8fr; }
.six { grid-template-columns:1fr 1.45fr 1fr 1fr .8fr .8fr; }
.r { text-align:right; justify-self:end; }
.mono, .csv-preview { font-family:var(--font-mono); }
.tabs { display:flex; gap:6px; padding:6px; background:#F0F3F9; border:1px solid var(--border); border-radius:12px; margin-bottom:18px; width:max-content; }
.tabs a { text-decoration:none; color:var(--ink-600); padding:9px 13px; border-radius:var(--radius-control); font-size:13px; font-weight:600; }
.tabs a.active { background:var(--surface); color: var(--heading-900); box-shadow:var(--shadow-sm); }
.proto-card label { display:block; padding:0 24px 16px; color:var(--ink-600); font-size:13px; font-weight:600; }
.proto-card input { display:block; width:100%; box-sizing:border-box; margin-top:7px; border:1px solid var(--border); border-radius:var(--radius); padding:11px 12px; font:500 14px var(--font-sans); color: var(--heading-900); background:white; }
.timeline { padding:8px 24px 18px; }
.timeline p { display:grid; grid-template-columns:90px 1fr; gap:20px; margin:0; padding:16px 0; border-bottom:1px solid var(--divider); }
.timeline p:last-child { border-bottom:0; }
.timeline b { color: var(--heading-900); }
.timeline span { color:var(--ink-700); }

/* ── Console design contract ───────────────────────────────────────────────
   Keep new console UI on these roles instead of adding inline type/color rules. */
@media (max-width: 900px) { .proto-grid { grid-template-columns:1fr; } .four, .six, .rbr-head, .rbr-row { grid-template-columns:1fr; } .r { text-align:left; justify-self:start; } .tabs { width:auto; overflow:auto; } }


/* ── New customer / zero-data empty state ── */
.new-customer-grid { grid-template-columns:minmax(0,1fr) 380px; }
.empty-panel { min-height:300px; padding:34px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; }
.empty-panel .empty-icon { width:48px; height:48px; border-radius:var(--radius-lg); display:grid; place-items:center; background:#ECF0FB; color:var(--accent); margin-bottom:18px; }
.empty-panel .empty-icon svg { width:22px; height:22px; }
.empty-panel h2 { padding:0; margin:0; font-family:var(--font-serif); font-size:25px; color: var(--heading-900); }
.empty-panel p { max-width:620px; margin:10px 0 22px; color:var(--ink-600); font-size:15px; line-height:1.55; }
.empty-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.setup-steps { padding: 8px 20px 22px; }
.setup-step { display:grid; grid-template-columns:28px 1fr; gap:12px; padding:13px 0; border-top:1px solid var(--divider); }
.setup-step:first-child { border-top:0; }
.setup-step > span { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:#F0F3F9; color:var(--ink-600); font-size:12px; font-weight:700; }
.setup-step.current > span { background:var(--accent); color:white; }
.setup-step.done > span { background:var(--ready-bg); color:var(--ready-fg); }
.setup-step b { display:block; color: var(--heading-900); font-size:14px; margin-bottom:3px; }
.setup-step small { display:block; color:var(--ink-500); line-height:1.35; font-size:13px; }
.locked-card { padding-bottom:22px; }
.locked-card .setup-steps { max-width:760px; }
.empty-table-body { min-height:260px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:34px; }
.empty-table-body h2 { padding:0; margin:0; font-size:24px; }
.empty-table-body p { max-width:540px; color:var(--ink-600); line-height:1.55; margin:10px 0 22px; }
@media (max-width: 1000px) { .new-customer-grid, .help-grid { grid-template-columns:1fr; } }


/* ── Real Apex Fee brand mark in top-left ── */
.topbar .brand.brand-logo-link {
  width: 264px;
  min-width: 264px;
  height: 52px;
  display: flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
}
.brand-logo-img {
  display: block;
  height: 46px;
  width: auto;
  object-fit: contain;
  object-position: left center;
}
@media (max-width: 900px) {
  .topbar .brand.brand-logo-link { width: 205px; min-width: 205px; }
  .brand-logo-img { height: 36px; }
}


/* ── Functional light/dark theme toggle ── */
body.dark .proto-card,
body.dark .rbr-card,
body.dark .empty-panel,
body.dark .locked-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
body.dark .console {
  background: var(--surface);
  border-color: var(--border);
}
body.dark .proto-title h1,
body.dark .proto-card h2,
body.dark .empty-panel h2,
body.dark .section-head h2,
body.dark .setup-step b,
body.dark .help-grid b,
body.dark .table-row b,
body.dark .console .id .nm,
body.dark .console .fig .v,
body.dark .console .fig .v .ccy,
body.dark .rbr-title,
body.dark .rbr-row .per,
body.dark .rbr-row .fee,
body.dark .exc-inner .eh .t,
body.dark .exc-item .tx .t,
body.dark .summary-list b,
body.dark .timeline b,
body.dark .tabs a.active {
  color: var(--ink-900);
}
body.dark .proto-title p,
body.dark .empty-panel p,
body.dark .section-head p,
body.dark .help-grid span,
body.dark .setup-step small,
body.dark .empty-table-body p,
body.dark .proto-card > p.muted,
body.dark .table-row small,
body.dark .rbr-row .date,
body.dark .audit .label,
body.dark .cc-head .period {
  color: var(--ink-500);
}
body.dark .table-head,
body.dark .table-row,
body.dark .readiness-row,
body.dark .summary-list p,
body.dark .help-grid p,
body.dark .section-head,
body.dark .rbr-title,
body.dark .rbr-head,
body.dark .rbr-row,
body.dark .empty-table .table-head {
  border-color: var(--divider);
}
body.dark .tabs {
  background: var(--surface-alt);
  border-color: var(--border);
}
body.dark .tabs a { color: var(--ink-500); }
body.dark .tabs a.active {
  background: var(--surface);
  color: var(--ink-900);
}
body.dark .empty-icon,
body.dark .setup-step > span {
  background: var(--accent-soft);
  color: var(--accent);
}
body.dark .mdb-current .mdb-num, body.dark .setup-step.current > span { color: #08132B; }
body.dark .proto-card input {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--ink-900);
}
body.dark .brand-logo-img { filter: brightness(0) invert(1); }

/* appended live prototype integration styles */
.live-tenant-bar{max-width:1180px;margin:18px auto 0;padding:14px 18px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-sm);display:grid;grid-template-columns:1.2fr .8fr 1.4fr;gap:16px;align-items:center}.live-tenant-bar b{display:block;font-size:16px;color:var(--ink-900);margin-top:2px}.live-tenant-bar small{display:block;color:var(--ink-500);margin-top:2px}.live-tenant-bar label{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-500);font-weight:700}.live-tenant-bar select{display:block;width:100%;margin-top:6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-panel);color:var(--ink-900);padding:0 11px;font:inherit;text-transform:none;letter-spacing:0}.live-tenant-bar code{font-size:12px;color:var(--ink-500);background:var(--surface-alt);border:1px solid var(--border);border-radius:999px;padding:8px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.live-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0}.live-kpis p{margin:0;padding:14px;border:1px solid var(--border);background:var(--surface-alt);border-radius:var(--radius-lg)}.live-kpis b{display:block;color:var(--ink-900);font-size:24px}.live-kpis span{display:block;color:var(--ink-500);font-size:12px;text-transform:uppercase;letter-spacing:.06em;margin-top:3px}.empty-actions{display:flex;gap:10px;flex-wrap:wrap}body.dark .live-tenant-bar select{background:var(--surface-alt);color:var(--ink-900)}
.live-tenant-bar.production{grid-template-columns:1fr auto}
.live-tenant-bar select{height:var(--control-height);font:14px var(--font-sans)}
/* ── Pre-app auth frame (sign-in, invitation sign-up, MFA task) ──
   renderAuthFrame() in console-auth.js wraps all three states in .auth-shell,
   so the brand canvas is applied once, here. Base colour is the shared
   --bg-canvas porcelain (same value the public activation / console boot
   screens use), with a faint radial highlight in --navy-600 behind the card.
   The logo is the two-tone mark, drawn on light surfaces only, and the
   two-step card is white with a mist hairline and a soft shadow. The body rule
   keeps overscroll on the same canvas. */
body:has(.auth-shell){background:var(--bg-canvas)}
.auth-shell{min-height:100vh;display:grid;place-items:center;align-content:center;gap:24px;padding:32px;background:radial-gradient(1100px 620px at 50% 16%,rgba(39, 76, 155, .06),transparent 68%),var(--bg-canvas)}.auth-brand img{display:block;width:min(300px,72vw);height:auto}.auth-sign-in{min-height:430px}.auth-error{width:min(460px,100%);padding:28px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--surface);box-shadow:var(--shadow-md);text-align:center}.auth-error h1{margin:0 0 10px;font-family:var(--font-serif);font-size:28px;color:var(--ink-900)}.auth-error p{margin:0;color:var(--ink-500);line-height:1.55}
.auth-security-intro{width:min(460px,calc(100vw - 40px));padding:22px 24px;border:1px solid #DDE1EC;border-radius:18px;background:#FFFFFF;color:#28375A;box-shadow:0 1px 2px rgba(11, 18, 32, .05),0 18px 48px -18px rgba(11, 18, 32, .18)}.auth-security-intro h1{margin:7px 0 9px;color:#00205B;font:600 28px/1.15 var(--font-serif)}.auth-security-intro p,.auth-security-intro li{font:14px/1.5 var(--font-sans)}.auth-security-intro ul{margin:10px 0 0;padding-left:20px}.auth-security-intro .eyebrow{color:#8A6A3A}
[data-localization-key="signIn.start.actionLink__use_phone"]{display:none!important}
.auth-passkey-card{width:min(520px,calc(100vw - 40px));padding:30px;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:var(--shadow-md)}.auth-passkey-card .eyebrow{color:var(--accent)}.auth-passkey-card h1{margin:8px 0 12px;color:var(--heading-900);font:600 32px/1.15 var(--font-serif)}.auth-passkey-card>p{margin:0;color:var(--ink-600);font:15px/1.6 var(--font-sans)}.auth-passkey-benefit{display:grid;grid-template-columns:auto 1fr;gap:10px 14px;margin-top:22px;padding:15px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-alt)}.auth-passkey-benefit b{color:var(--ready-fg)}.auth-passkey-benefit span{color:var(--ink-700);font:14px/1.45 var(--font-sans)}.auth-passkey-card .auth-passkey-status{min-height:24px;margin-top:14px;color:var(--ink-500);font-size:13px}.auth-passkey-actions{display:flex;gap:10px;margin-top:10px}.auth-passkey-actions .btn{min-width:150px}.auth-passkey-actions .btn:disabled{opacity:.65;cursor:wait}@media(max-width:600px){.auth-passkey-card{padding:24px}.auth-passkey-benefit{grid-template-columns:1fr}.auth-passkey-actions{flex-direction:column}.auth-passkey-actions .btn{width:100%}}

/* Post-authentication workspace welcome and bounded recovery states. */
.workspace-welcome-shell{position:relative;min-height:100vh;display:grid;place-items:center;overflow:hidden;padding:32px;background:radial-gradient(circle at 50% 12%,rgba(39, 76, 155, .07),transparent 35%),#F3F4F8;color:#28375A}.workspace-welcome-shell::after{content:"";position:absolute;inset:0;opacity:.12;pointer-events:none;background-image:linear-gradient(rgba(0, 32, 91, .05) 1px,transparent 1px),linear-gradient(90deg,rgba(0, 32, 91, .05) 1px,transparent 1px);background-size:48px 48px;mask-image:linear-gradient(to bottom,black,transparent 86%)}.workspace-welcome-ambient{position:absolute;border-radius:999px;filter:blur(20px);opacity:.35}.workspace-welcome-ambient-one{width:420px;height:420px;top:-280px;left:8%;background:#DDE1EC}.workspace-welcome-ambient-two{width:380px;height:380px;right:4%;bottom:-260px;background:#E6EAF4}.workspace-welcome-card{position:relative;z-index:2;width:min(600px,calc(100vw - 40px));min-height:470px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:50px 54px;border:1px solid #DDE1EC;border-radius:30px;background:#FFFFFF;box-shadow:0 1px 2px rgba(11, 18, 32, .05),0 18px 48px -18px rgba(11, 18, 32, .18);backdrop-filter:blur(18px)}.workspace-welcome-logo{display:block;width:min(315px,75vw);height:auto;margin-bottom:28px}.workspace-welcome-orb{width:38px;height:38px;display:grid;place-items:center;margin-bottom:18px;border:1px solid rgba(39, 76, 155, .30);border-radius:50%;background:rgba(39, 76, 155, .08);animation:workspace-welcome-pulse 1.55s ease-in-out infinite}.workspace-welcome-orb i{width:8px;height:8px;border-radius:50%;background:#274C9B;box-shadow:0 0 0 6px rgba(39, 76, 155, .12)}.workspace-welcome-orb-slow{animation:none}.workspace-welcome-orb-slow i{background:#A2C0F8;box-shadow:0 0 0 6px rgba(162, 192, 248, .12)}.workspace-welcome-orb-error{animation:none}.workspace-welcome-orb-error i{background:#ef7b72;box-shadow:0 0 0 6px rgba(239,123,114,.12)}.workspace-welcome-eyebrow{margin:0 0 11px;color:#8A6A3A;font:800 12px/1.2 var(--font-sans);letter-spacing:.18em;text-transform:uppercase}.workspace-welcome-card h1{margin:0;color:#00205B;font:500 clamp(34px,5vw,49px)/1.1 var(--font-serif);letter-spacing:-.025em}.workspace-welcome-detail{min-height:48px;margin:16px 0 0;color:#5A6478;font:400 16px/1.55 var(--font-sans)}.workspace-welcome-progress{width:min(340px,100%);height:3px;overflow:hidden;margin-top:18px;border-radius:999px;background:rgba(0, 32, 91, .08)}.workspace-welcome-progress i{display:block;width:48%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#274C9B,#5279C1);animation:workspace-welcome-progress 1.55s ease-in-out infinite}.workspace-welcome-actions{display:flex;gap:10px;margin-top:24px}.workspace-welcome-actions .btn-secondary{color:var(--heading-800);border-color:var(--border-strong);background:var(--surface)}.workspace-welcome-security{margin:30px 0 0;color:#5A6478;font:400 12px/1.4 var(--font-sans)}.workspace-welcome-security b{color:#1F6B43;margin-right:5px}.workspace-welcome-card>.workspace-welcome-security:last-child{margin-bottom:0}@keyframes workspace-welcome-pulse{50%{transform:scale(1.08);border-color:rgba(39, 76, 155, .55)}}@keyframes workspace-welcome-progress{0%{transform:translateX(-105%)}70%,100%{transform:translateX(260%)}}@media(max-width:760px){.workspace-welcome-shell{padding:20px}.workspace-welcome-card{min-height:440px;padding:40px 24px}}@media(prefers-reduced-motion:reduce){.workspace-welcome-orb,.workspace-welcome-progress i{animation-duration:.01ms;animation-iteration-count:1}}
@media(max-width:900px){.live-tenant-bar{grid-template-columns:1fr}.live-kpis{grid-template-columns:1fr}}

/* Customer activation subsystem — Steps 1–4 */
.activation-admin{max-width:1180px}.activation-stage-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:0 0 20px}.activation-stage-grid>div{position:relative;min-height:92px;padding:16px 14px 14px 54px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}.activation-stage-grid>div>span{position:absolute;left:15px;top:16px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:var(--surface-alt);border:1px solid var(--border);font-weight:800;color:var(--ink-500)}.activation-stage-grid>div.complete>span{background:var(--ready-bg);border-color:var(--ready-fg);color:var(--ready-fg)}.activation-stage-grid b,.activation-stage-grid small{display:block}.activation-stage-grid b{font-size:14px;color:var(--ink-900)}.activation-stage-grid small{margin-top:7px;color:var(--ink-500);text-transform:capitalize}.activation-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.activation-commercial,.activation-actions,.activation-history,.activation-form{padding:24px}.activation-commercial h2,.activation-actions h2,.activation-history h2,.activation-form h2,.activation-empty h2{margin:0 0 18px;font:600 21px var(--font-serif);color: var(--heading-900)}.activation-commercial dl{margin:0}.activation-commercial dl>div{display:flex;justify-content:space-between;gap:20px;padding:13px 0;border-top:1px solid var(--border)}.activation-commercial dt{color:var(--ink-500)}.activation-commercial dd{margin:0;text-align:right;color:var(--ink-900);font-weight:700}.activation-commercial dd small{display:block;margin-top:3px;font-weight:400;color:var(--ink-500)}.activation-actions{display:flex;flex-direction:column;gap:14px;align-items:stretch}.activation-actions .btn{align-self:flex-start}.activation-link-box,.activation-success{padding:16px;border-radius:13px;background:var(--surface-alt);border:1px solid var(--border)}.activation-link-box>b,.activation-link-box>small{display:block}.activation-link-box>small{margin:5px 0 12px;color:var(--ink-500)}.activation-link-box>div{display:flex;align-items:center;gap:12px}.activation-link-box a{color:var(--accent);font-weight:700}.activation-success{background:var(--ready-bg);border-color:color-mix(in srgb,var(--ready-fg) 32%,transparent)}.activation-success>b{color:var(--ready-fg)}.activation-success p{margin:7px 0 0;color:var(--ink-700);line-height:1.5}.activation-history>div{display:grid;grid-template-columns:1.5fr .6fr 1.5fr auto;gap:14px;align-items:center;padding:12px 0;border-top:1px solid var(--border);text-transform:capitalize}.activation-history>div small{color:var(--ink-500);text-transform:none}.activation-form{margin-bottom:18px}.activation-form-head{display:flex;justify-content:space-between;gap:20px}.activation-form-head h2{margin:5px 0}.activation-form-head p{margin:0 0 24px;color:var(--ink-500)}.activation-form h3{margin:18px 0 12px;color: var(--heading-900);font-size:14px}.activation-form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.activation-submit{display:flex;justify-content:flex-end;margin-top:22px}.activation-empty{padding:24px;margin-bottom:18px}.activation-empty p{margin:0;color:var(--ink-500)}.activation-table{overflow:hidden}.activation-table-head,.activation-table>button{display:grid;grid-template-columns:2fr .8fr 1fr .8fr 24px;gap:15px;align-items:center;padding:14px 18px}.activation-table-head{background:var(--surface-alt);color:var(--ink-500);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.activation-table>button{width:100%;border:0;border-top:1px solid var(--border);background:var(--surface);color:var(--ink-700);font:inherit;text-align:left;cursor:pointer}.activation-table>button:hover{background:var(--surface-alt)}.activation-table>button b,.activation-table>button small{display:block}.activation-table>button b{color:var(--ink-900)}.activation-table>button small{margin-top:4px;color:var(--ink-500)}.activation-table>button>span:not(:first-child){text-transform:capitalize}.activation-empty-row{padding:28px;text-align:center;color:var(--ink-500)}.activation-public{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;background:var(--bg-canvas)}.activation-public>img{width:220px;max-height:72px;object-fit:contain;margin:0 0 24px}.activation-public>section{width:min(620px,100%);padding:36px}.activation-public h1{font:600 34px/1.15 var(--font-serif);letter-spacing:0;color: var(--heading-900);margin:8px 0 14px}.activation-public p{color:var(--ink-600);line-height:1.65}.activation-spinner{display:flex;gap:14px;align-items:center;padding:16px;margin:22px 0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-alt)}.activation-spinner>span{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:var(--ready-bg);color:var(--ready-fg);font-weight:900}.activation-spinner b,.activation-spinner small{display:block}.activation-spinner small{margin-top:4px;color:var(--ink-500)}.activation-note{padding:13px 15px;border-left:3px solid var(--accent);background:var(--surface-alt)}
.activation-profile{grid-column:1/-1;padding:24px}.activation-profile h2{margin:0 0 18px;font:600 21px var(--font-serif);color: var(--heading-900)}
@media(max-width:900px){.activation-stage-grid,.activation-detail-grid,.activation-form-grid{grid-template-columns:1fr}.activation-table-head{display:none}.activation-table>button{grid-template-columns:1fr 1fr}.activation-table>button>svg{display:none}.activation-history>div{grid-template-columns:1fr}.activation-public{padding:20px}.activation-public>section{padding:24px}}

.activation-review-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.activation-review-grid>div{padding:16px;border:1px solid var(--border);border-radius:13px;background:var(--surface-alt)}.activation-review-grid span,.activation-review-grid b,.activation-review-grid small{display:block}.activation-review-grid span{margin-bottom:5px;color:var(--ink-500);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.07em}.activation-review-grid b{color: var(--heading-900)}.activation-review-grid small{margin-top:5px;color:var(--ink-500);line-height:1.45}.activation-review .activation-submit{gap:10px}.activation-provider-records dd{max-width:58%;overflow-wrap:anywhere}.activation-timeline>div{grid-template-columns:1.35fr .55fr 1fr}.activation-timeline span b,.activation-timeline span small{display:block}.activation-timeline span small{margin-top:3px}.activation-table-head,.activation-table>button{grid-template-columns:1.7fr 1.15fr .65fr .8fr .7fr .8fr 24px}.activation-table>button>span:nth-child(2){overflow-wrap:anywhere;text-transform:none;font-size:12px}.activation-table>button>span:nth-child(6){text-transform:none}
.staff-impersonation-banner{max-width:1180px;margin:16px auto 0;padding:12px 16px;border:1px solid #728EC1;border-left:4px solid #728EC1;border-radius:var(--radius-md);background:#F3F9FF;display:flex;align-items:center;justify-content:space-between;gap:16px}.staff-impersonation-banner>div{display:flex;align-items:center;gap:11px}.staff-impersonation-banner svg{width:20px;height:20px;color:#526890;flex:0 0 auto}.staff-impersonation-banner b,.staff-impersonation-banner small{display:block}.staff-impersonation-banner b{color:#364562}.staff-impersonation-banner small{margin-top:2px;color:#485979}.admin-view-tabs{display:flex;gap:4px;margin:0 0 18px;border-bottom:1px solid var(--border)}.admin-view-tabs button{border:0;border-bottom:3px solid transparent;background:transparent;color:var(--ink-500);padding:10px 14px;font:700 14px var(--font-sans);cursor:pointer}.admin-view-tabs button.active{border-bottom-color:var(--accent);color:var(--ink-900)}.admin-view-tabs span{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-left:6px;padding:0 6px;border-radius:11px;background:var(--surface-alt);font-size:11px}.staff-customer-table{overflow:hidden}.staff-customer-head,.staff-customer-row{display:grid;grid-template-columns:minmax(210px,1.7fr) minmax(150px,1.15fr) .42fr .52fr .58fr .4fr minmax(105px,.8fr) minmax(128px,.85fr);gap:12px;align-items:center;padding:13px 16px}.staff-customer-head{background:var(--surface-alt);color:var(--ink-500);font-size:10px;font-weight:800;text-transform:uppercase}.staff-customer-row{border-top:1px solid var(--border);color:var(--ink-700)}.staff-customer-row:hover{background:var(--surface-alt)}.staff-customer-row b,.staff-customer-row small,.staff-customer-row code{display:block}.staff-customer-row b{color:var(--ink-900)}.staff-customer-row small{margin-top:3px;color:var(--ink-500)}.staff-customer-row code{max-width:210px;margin-top:5px;overflow:hidden;text-overflow:ellipsis;color:var(--ink-500);font-size:10px}.staff-customer-row .table-link{display:block;margin:5px 0 0;padding:0;border:0;background:transparent;color:var(--accent);font:700 12px var(--font-sans);cursor:pointer;text-align:left}.staff-customer-row .btn{white-space:nowrap}
.activation-action-fieldset{display:flex;flex-direction:column;gap:14px;min-width:0;margin:0;padding:0;border:0}.activation-action-fieldset:disabled{opacity:.72}
@media(max-width:900px){.proto-title{align-items:stretch;flex-direction:column;gap:14px}.proto-title>div:last-child .empty-actions{justify-content:flex-start}.activation-review-grid{grid-template-columns:1fr}.activation-table>button{grid-template-columns:1fr 1fr}.activation-provider-records dd{max-width:52%}.staff-impersonation-banner{margin:12px 14px 0;align-items:flex-start;flex-direction:column}.staff-customer-head{display:none}.staff-customer-row{grid-template-columns:1fr 1fr}.staff-customer-row>span:first-child,.staff-customer-row>span:nth-child(2),.staff-customer-row>span:last-child{grid-column:1/-1}.staff-customer-row>span:nth-child(n+3):nth-child(-n+7)::before{display:block;color:var(--ink-500);font-size:10px;font-weight:800;text-transform:uppercase}.staff-customer-row>span:nth-child(3)::before{content:"Users"}.staff-customer-row>span:nth-child(4)::before{content:"Accounts"}.staff-customer-row>span:nth-child(5)::before{content:"Households"}.staff-customer-row>span:nth-child(6)::before{content:"Runs"}.staff-customer-row>span:nth-child(7)::before{content:"Last approved"}}

/* Same canvas as the auth frame above, sourced from --bg-canvas so the two
   pre-app canvases cannot drift apart. */
.activation-public{background:var(--bg-canvas)}.activation-public>img{background:var(--bg-canvas);padding:8px 12px;border-radius:8px}

/* live-integration typography overrides: keep KPI cards consistent across screens */
.live-kpis p{padding:18px 16px 16px;background:var(--surface-alt)}
.live-kpis b{display:block;font-family:var(--font-serif);font-size:25px;line-height:1;font-weight:600;letter-spacing:0;color: var(--heading-900);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
.live-kpis span{display:block;margin-top:8px;font:700 11px/1.2 var(--font-sans);letter-spacing:.085em;text-transform:uppercase;color:var(--ink-500)}

/* billing-run downloads and onboarding upload state */
.drop-zone{margin:16px 0 0;border:1.5px dashed var(--border-strong);border-radius:var(--radius-lg);background:var(--surface-alt);padding:22px;display:grid;grid-template-columns:52px 1fr;gap:16px;align-items:center;cursor:pointer;transition:border-color .16s,background .16s,box-shadow .16s}
.drop-zone:hover,.drop-zone.active{border-color:var(--accent);background:#F5F8FE;box-shadow:inset 0 0 0 1px rgba(41, 103, 226, .08)}
.drop-zone.disabled{opacity:.62;cursor:default}
.drop-glyph{width:50px;height:50px;border-radius:var(--radius-lg);background:#ECF0FB;color:var(--accent);display:grid;place-items:center}
.drop-glyph svg{width:23px;height:23px}
.drop-copy h3{margin:0;color: var(--heading-900);font:600 17px/1.2 var(--font-sans)}
.drop-copy p{margin:6px 0 12px;color:var(--ink-500);font-size:14px;line-height:1.45}
.empty-panel .drop-zone{width:100%;box-sizing:border-box}
.cadence-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:6px 24px 18px}
.cadence-options button{min-height:142px;padding:18px;border:1px solid var(--border-strong);border-radius:var(--radius-control);background:var(--surface);color:var(--ink-700);text-align:left;cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;gap:8px;font-family:var(--font-sans);transition:border-color .16s,background .16s,box-shadow .16s}
.cadence-options button:hover{border-color:var(--accent)}
.cadence-options button.selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent)}
.cadence-options button:disabled{cursor:default;opacity:.62}
.cadence-options button.selected:disabled{opacity:1}
.cadence-options .cadence-name{font:600 20px/1.2 var(--font-serif);color: var(--heading-900)}
.cadence-options b{font-size:13px;color: var(--heading-800)}
.cadence-options small{font-size:13px;line-height:1.45;color:var(--ink-500)}
.policy-run-summary{display:grid;gap:4px;margin:14px 24px;padding:13px 15px;border-left:3px solid var(--accent);background:var(--surface-alt);color:var(--ink-600);font-size:13px;line-height:1.4;text-align:left;width:calc(100% - 48px);box-sizing:border-box}
.policy-run-summary b,.policy-run-summary strong{color: var(--heading-900)}
.policy-run-summary span{display:block}
.cadence-setting>span small,.cadence-setting>b small{display:block;margin-top:3px;color:var(--ink-500);font-size:12px;font-weight:500}
.cadence-setting>b{text-align:right;color: var(--heading-900)}
.form-error{margin:10px 24px 0;padding:10px 12px;border-left:3px solid var(--hold-fg);background:var(--hold-bg);color:var(--hold-fg);font-size:13px;line-height:1.45}
.high-rate-note{padding:11px 12px;border-left:3px solid var(--review-dot);background:var(--review-bg);color:var(--ink-700);font-size:13px;line-height:1.45}
.high-rate-note b,.high-rate-note span{display:block}
.high-rate-note b{color: var(--heading-900);margin-bottom:3px}
.confirm-backdrop{position:fixed;inset:0;z-index:140;background:rgba(6, 16, 43, .52);display:grid;place-items:center;padding:20px}
.confirm-dialog{width:min(560px,100%);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--surface);box-shadow:var(--shadow-lg);padding:22px;box-sizing:border-box}
.confirm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.confirm-head h2{margin:4px 0 0;color: var(--heading-900);font:500 23px/1.2 var(--font-serif)}
.icon-close{width:32px;height:32px;border:1px solid var(--border);border-radius:var(--radius-compact);background:var(--surface);color:var(--ink-500);display:grid;place-items:center;cursor:pointer;flex:none}
.icon-close svg{width:16px;height:16px}
.confirm-dialog>p{color:var(--ink-600);font-size:14px;line-height:1.55}
.confirm-list{border-top:1px solid var(--divider);border-bottom:1px solid var(--divider);margin:16px 0;padding:7px 0}
.confirm-list>div{display:flex;justify-content:space-between;gap:16px;padding:7px 0;color:var(--ink-700);font-size:13px}
.confirm-list strong{color: var(--heading-900);font-family:var(--font-mono)}
.confirm-list small{display:block;padding:7px 0;color:var(--ink-500)}
.rate-confirm-group h3{margin:14px 0 0;color:var(--heading-900);font-size:13px;font-weight:600}
.rate-confirm-group .confirm-list{margin-top:6px}
.confirm-list small.rate-message{padding:3px 0 0;line-height:1.4}
.rate-confirm-count{display:block;margin-top:2px;color:var(--ink-500);font-size:12px}
.rate-confirm-list{max-height:240px;overflow:auto;padding-right:6px}
.confirm-list small.rate-household{display:inline;padding:0;margin-left:6px}
.import-error-panel ul.import-rate-list{max-height:220px;overflow:auto}
.confirm-dialog .confirm-note{font-size:13px;color:var(--ink-500)}
.import-preview-dialog{width:min(680px,100%)}
.import-preview-summary{display:grid;grid-template-columns:repeat(3,1fr);margin:16px 0;border:1px solid var(--border)}
.import-preview-summary > span{display:grid;gap:3px;padding:12px 14px;border-right:1px solid var(--border);font-size:12px;color:var(--muted)}
.import-preview-summary > span:last-child{border-right:0}.import-preview-summary > b,.import-preview-summary > span > b{font-size:20px;color:var(--ink)}.import-preview-summary .bad b{color:var(--danger-fg)}
.import-preview-list{max-height:280px;overflow:auto;border:1px solid var(--border)}
.import-preview-list>div{display:flex;justify-content:space-between;gap:18px;padding:10px 12px;border-bottom:1px solid var(--divider)}
.import-preview-list>div:last-of-type{border-bottom:0}.import-preview-list span{display:grid}.import-preview-list small{color:var(--muted)}.import-preview-list strong{max-width:54%;font-size:12px;text-align:right;color:var(--ink-600);font-weight:600}
.import-error-panel{display:block}.import-error-panel>span{display:block;margin-top:4px}.import-error-panel ul{display:grid;gap:8px;margin:12px 0 0;padding:0;list-style:none}.import-error-panel li{display:grid;gap:2px;padding:9px 11px;background:rgba(255,255,255,.62);border:1px solid rgba(159,55,55,.18);border-radius:7px}.import-error-panel li>b{font:600 11px var(--font-mono);text-transform:none;letter-spacing:0}.import-error-panel li span,.import-error-panel li small{display:block}
.app-dialog .fld{margin:16px 0}
.confirm-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
body.dark .drop-zone{background:var(--surface-alt)}
body.dark .drop-zone:hover,body.dark .drop-zone.active{background:#112653}
body.dark .drop-glyph{background:#193364}
body.dark .cadence-options button{background:var(--surface-alt)}
body.dark .cadence-options button.selected{background:#112653}
@media(max-width:900px){.drop-zone{grid-template-columns:1fr}.cadence-options,.period-picker{grid-template-columns:1fr}}

/* Fable Billing Runs + Clients integration layer */
.fx-page { position: relative; }
.f-page-head { align-items: flex-start; margin-top: 8px; }
.f-page-head .actions { flex-wrap: wrap; justify-content: flex-end; }
.f-page-head .actions .btn {
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  border-radius:var(--radius-control);
  font-size: 15px;
}
.pillx { background: var(--accent-soft); color: var(--accent-ink); }
.pillx .dot { background: var(--accent); }
.f-summary.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.f-summary.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sum-card .value.sm { font-size: 22px; }
.toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.tab-group a.tab { text-decoration: none; }

.f-seg {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.f-seg button {
  border: 0;
  background: none;
  font: 500 13px var(--font-sans);
  color: var(--ink-500);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}
.f-seg button:hover { color: var(--heading-900); }
.f-seg button.on { background: var(--surface); color: var(--heading-900); box-shadow: var(--shadow-sm); }
.f-seg button .n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-400); }
.f-seg button.on .n { color: var(--accent-ink); }
.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font: 500 13px var(--font-sans);
  color: var(--ink-700);
  cursor: pointer;
}
.f-chip:hover { border-color: var(--accent); }
.f-chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.f-chip svg { width: 11px; height: 11px; }
.f-attn { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.f-attn .a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 500 13px var(--font-sans);
  color: var(--ink-700);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.f-attn .a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.f-attn .a .dot { width: 8px; height: 8px; border-radius: 50%; }
.f-attn .a.warn .dot { background: var(--review-dot); }
.f-attn .a.hold .dot { background: var(--hold-dot); }
.f-attn .a b { color: var(--heading-900); }
.f-attn .a .go { color: var(--accent-ink); font-weight: 600; }
.f-kpi { cursor: pointer; position: relative; transition: box-shadow .16s; }
.f-kpi:hover { box-shadow: var(--shadow-md); }
.f-kpi.on { outline: 2px solid var(--accent); outline-offset: -1px; }
.f-filter-ic { position: absolute; top: 12px; right: 12px; color: var(--ink-300); }
.f-kpi:hover .f-filter-ic, .f-kpi.on .f-filter-ic { color: var(--accent-ink); }
.f-filter-ic svg { width: 13px; height: 13px; }

table.tbl tbody tr.clk { cursor: pointer; }
.actions-col { width: 180px; }
.aum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-900); }
.muted-un { color: var(--ink-400); font-size: 14px; }
th.f-sortable { cursor: pointer; user-select: none; }
th.f-sortable .s { margin-left: 5px; opacity: .35; font-size: 10px; }
th.f-sortable:hover, th.f-sortable.on { color: var(--heading-900); }
th.f-sortable.on .s { opacity: 1; color: var(--accent-ink); }
.f-sticky thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--border); }
tr.f-row-on > td { background: var(--accent-soft); }
tr.f-group { cursor: pointer; }
tr.f-group td {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding: 8px 14px;
  font: 600 12px var(--font-sans);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--heading-800);
}
tr.f-group .gline { display: flex; align-items: center; gap: 9px; }
tr.f-group .gsum {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-500);
  letter-spacing: 0;
  text-transform: none;
}
tr.f-group .gtw { color: var(--ink-300); transition: transform .16s; display: inline-flex; }
tr.f-group.closed .gtw { transform: rotate(-90deg); }
.f-quick { display: inline-flex; gap: 6px; justify-content: flex-end; opacity: 0; transition: opacity .16s; }
tr:hover .f-quick, .f-quick.show { opacity: 1; }
.f-qbtn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius:var(--radius-compact);
  background: var(--surface);
  font: 500 13px var(--font-sans);
  color: var(--heading-800);
  cursor: pointer;
  white-space: nowrap;
}
.f-qbtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.acttail { display: flex; align-items: center; justify-content: flex-end; gap: 6px; position: relative; }
.kebab {
  width: 30px;
  height: 30px;
  border-radius:var(--radius-control);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-400);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.kebab:hover { background: var(--surface-alt); color: var(--ink-700); border-color: var(--border); }
.row-menu {
  z-index: 130;
  min-width: 214px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.row-menu.inline { position: absolute; right: 0; top: 34px; }
.row-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  font: 500 13px var(--font-sans);
  color: var(--ink-700);
  padding: 9px 10px;
  border-radius:var(--radius-control);
}
.row-menu button:hover { background: var(--surface-alt); color: var(--heading-900); }
.row-menu button.danger { color: var(--hold-fg); }
.row-menu button.danger:hover { background: var(--hold-bg); }
.row-menu .mdiv { height: 1px; background: var(--divider); margin: 4px 2px; }
.cb-minus { width: 10px; height: 2px; background: currentColor; border-radius: 999px; display: block; }

.bulk-bar .bb-act {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--heading-800);
  height: 30px;
  padding: 0 12px;
  border-radius:var(--radius-compact);
  font: 500 13px var(--font-sans);
  cursor: pointer;
}
.bulk-bar .bb-act:hover { background: var(--accent-soft); border-color: var(--accent); }
.bulk-bar .bb-clear {
  margin-left: 4px;
  background: none;
  border: 0;
  color: var(--ink-500);
  font: 500 13px var(--font-sans);
  cursor: pointer;
  padding: 4px;
}
.bulk-bar .bb-clear:hover { color: var(--heading-900); text-decoration: underline; }
.bulk-bar .bb-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bulk-bar .bb-scope { background: none; border: 0; color: var(--accent-ink); font: 600 13px var(--font-sans); cursor: pointer; padding: 0 2px; }
.bulk-bar .bb-scope:hover { text-decoration: underline; }

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(6, 15, 35, .42);
}
.drawer-layer { animation: drawer-fade .18s ease-out both; }
.drawer-layer .f-drawer { animation: drawer-slide .18s ease-out both; }
.drawer-layer.closing { animation: drawer-fade .15s ease-in reverse both; }
.drawer-layer.closing .f-drawer { animation: drawer-slide .15s ease-in reverse both; }
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-slide { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .drawer-layer, .drawer-layer .f-drawer, .drawer-layer.closing, .drawer-layer.closing .f-drawer { animation: none; }
}
.sum-card.attention .value { color: var(--hold-fg); }
.f-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 80;
}
.f-drawer-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.f-drawer-head .nm { font-family: var(--font-serif); font-size: 18px; color: var(--heading-900); line-height: 1.2; }
.f-drawer-head .mt { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); margin-top: 3px; }
.f-drawer-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--ink-400); font: 500 12px var(--font-sans); }
.f-drawer-nav button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius:var(--radius-compact);
  background: var(--surface);
  color: var(--ink-500);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.f-drawer-nav button:disabled { opacity: .45; cursor: default; }
.f-drawer-nav button:hover:not(:disabled) { color: var(--heading-900); border-color: var(--border-strong); }
.f-drawer-body { flex: 1; overflow: auto; padding: 4px 20px 16px; }
.f-drawer-foot { border-top: 1px solid var(--divider); padding: 12px 20px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer-badge { margin-top: 7px; }
.drawer-avatar { width: 38px; height: 38px; font-size: 13px; }
.drawer-pi {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font: 600 11px var(--font-mono);
  color: var(--heading-800);
  flex: none;
}
.f-kv {
  display: grid;
  grid-template-columns: 128px 1fr;
  row-gap: 11px;
  column-gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}
.f-kv .k { font: 600 11px var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-400); padding-top: 2px; }
.f-kv .v { font-size: 14px; color: var(--ink-700); min-width: 0; }
.f-kv .v.mono { font-family: var(--font-mono); font-size: 13px; color: var(--heading-800); }
.f-sec-t { font: 600 11px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); margin: 16px 0 8px; }
.f-log { display: flex; flex-direction: column; gap: 9px; }
.f-log .e { display: flex; gap: 10px; font-size: 13px; color: var(--ink-700); line-height: 1.45; }
.f-log .e .d { font-family: var(--font-mono); font-size: 12px; color: var(--ink-400); white-space: nowrap; padding-top: 1px; width: 74px; flex: none; }
.f-empty-note { margin: 14px 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius:var(--radius); background: var(--surface-alt); color: var(--ink-600); display: grid; gap: 4px; font-size: 14px; }
.f-empty-note b { color: var(--heading-900); }
.drawer-lines { border: 1px solid var(--border); border-radius:var(--radius); overflow: hidden; }
.drawer-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--divider); font-size: 13px; color: var(--ink-700); }
.drawer-line:last-child { border-bottom: 0; }
.drawer-line b { color: var(--heading-900); margin-right: 8px; }
.drawer-line em { font-style: normal; color: var(--hold-fg); font-size: 11px; font-weight: 700; }
.drawer-line small.drawer-line-name { display: block; margin-top: 2px; color: var(--ink-500); font-size: 12px; font-weight: 400; }
.drawer-line-balances { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 12px 8px; font-size: 11px; color: var(--ink-500); font-family: var(--font-mono); }
.drawer-line em.rate-review { color: var(--review-fg); margin-left: 7px; }
.drawer-more { padding: 10px 12px; font-size: 13px; color: var(--ink-500); background: var(--surface-alt); }
.exc {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.5;
}
.exc:last-child { border-bottom: 0; }
.exc .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--review-dot); margin-top: 5px; flex: none; }
.exc > span:not(.dot) { flex: 1; min-width: 0; }
.exc > button { border: 1px solid var(--border-strong); border-radius:var(--radius-compact); background: var(--surface); color: var(--accent); padding: 5px 8px; font: 600 12px var(--font-sans); cursor: pointer; white-space: nowrap; }
.exc > button:hover { border-color: var(--accent); background: var(--accent-soft); }
.exc.rate .dot { background: var(--hold-fg); }
.exc.rate [data-rate-review-reason] { display: block; margin-top: 3px; color: var(--ink-500); }
.run-period { display: flex; align-items: center; gap: 11px; }
.run-period .pi {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font: 600 10px var(--font-mono);
  color: var(--heading-800);
  flex: none;
}
.empty-cell { padding: 44px 20px; text-align: center; color: var(--ink-500); }
.empty-cell .t { font-weight: 600; color: var(--heading-900); margin-bottom: 5px; }
.empty-cell .s { font-size: 13px; }
.frm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding-top: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld label { font: 600 11px var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-500); padding: 0; }
.fld input, .fld select, .fld textarea {
  height: var(--control-height);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0 11px;
  font: 14px var(--font-sans);
  color: var(--heading-900);
  background: var(--surface);
  width: 100%;
  box-sizing: border-box;
}
.fld textarea {
  min-height: 94px;
  height: auto;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.fld input[readonly], .fld textarea[readonly] { background: var(--surface-alt); color: var(--ink-500); }
.fld .hint { font: 12px var(--font-sans); color: var(--ink-400); line-height: 1.45; }
.btn:disabled, .btn-primary:disabled, .btn-primary:disabled:hover { opacity: 1; cursor: default; background: #E4E4E4; border-color: #CECECE; color: #5D5D5D; }
body.dark .btn:disabled, body.dark .btn-primary:disabled, body.dark .btn-primary:disabled:hover { background: #333333; border-color: #484848; color: #A4A4A4; }

body.dark .f-seg, body.dark .f-chip, body.dark .row-menu, body.dark .f-drawer, body.dark .fld input, body.dark .fld select, body.dark .fld textarea { background: var(--surface); }
body.dark .f-seg button.on { color: var(--ink-900); }
body.dark tr.f-row-on > td { background: var(--accent-soft); }
body.dark .row-menu button:hover { background: var(--surface-alt); color: var(--ink-900); }
body.dark .drawer-pi, body.dark .run-period .pi, body.dark .f-empty-note { background: var(--surface-alt); }

@media (max-width: 1100px) {
  .f-summary.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-page-head { flex-direction: column; }
  .f-page-head .actions { justify-content: flex-start; }
}
@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 16px;
  }
  .topbar .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    box-shadow: inset -12px 0 8px -12px var(--ink-500);
    scrollbar-color: var(--border-strong) transparent;
    scrollbar-width: thin;
  }
  .topbar-right { gap: 8px; }
  .user-menu { padding-right: 4px; }
  .user-menu .user-meta, .user-menu > svg { display: none; }
  .cc-page { padding: 24px 16px 32px; }
  .audit {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 14px 16px;
  }
  .audit .right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .fx-page { padding-left: 16px; padding-right: 16px; }
  .f-summary.three, .f-summary.four { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-right { margin-left: 0; justify-content: flex-start; width: 100%; }
  .search { margin-left: 0; width: 100%; box-sizing: border-box; }
  .f-drawer { width: 100%; }
  .f-quick { opacity: 1; flex-wrap: wrap; }
  .acttail { justify-content: flex-start; }
  .actions-col { width: auto; }
  .bulk-bar { align-items: flex-start; flex-wrap: wrap; }
  .bulk-bar .bb-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .topbar .nav { flex-wrap: wrap; overflow-x: visible; box-shadow: none; gap: 4px 2px; }
  .topbar .nav a { height: 30px; padding: 0 10px; font-size: 13px; }
  .page-title { align-items: flex-start; flex-direction: column; gap: 8px; }
  .f-seg { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; box-sizing: border-box; }
  .f-seg button { min-width: 0; padding-left: 6px; padding-right: 6px; }
  .frm { grid-template-columns: 1fr; }
  .f-kv { grid-template-columns: 1fr; }
  .f-kv .k { padding-top: 0; }
}

/* Fee schedules */
.settings-stack { display: grid; gap: 18px; }
.account-security-settings{display:grid;grid-template-columns:minmax(260px,.8fr) minmax(300px,1.4fr) auto;gap:22px;align-items:center;padding:20px 22px}.account-security-settings>div:first-child{display:flex;align-items:center;gap:14px}.account-security-settings h2,.account-security-settings p{margin:0}.account-security-settings h2{color:var(--heading-900);font:600 20px/1.2 var(--font-serif)}.account-security-settings>div:first-child p{margin-top:4px;color:var(--ink-500);font-size:12px}.account-security-icon{width:40px;height:40px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:var(--surface-alt);color:var(--accent);font-weight:900}.account-security-icon.ready{background:var(--ready-bg);color:var(--ready-fg)}.account-security-copy p{color:var(--ink-700);font-size:13px;line-height:1.5}.account-security-copy small{display:block;margin-top:6px;color:var(--ready-fg);font-weight:700}.account-security-settings>.btn{white-space:nowrap}@media(max-width:900px){.account-security-settings{grid-template-columns:1fr;gap:14px}.account-security-settings>.btn{justify-self:start}}
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--divider); }
.card-title-row h2 { padding: 0; }
.card-title-row p { margin: 4px 0 0; color: var(--ink-500); font-size: 13px; }
.schedule-list { width: 100%; }
.schedule-list-head, .schedule-list-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 110px 60px 90px 72px minmax(140px, auto); gap: 12px; align-items: center; }
.schedule-list-head { padding: 9px 20px; background: var(--surface-alt); border-bottom: 1px solid var(--divider); color: var(--muted); font-family: var(--font-sans); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.schedule-list-row { min-height: 54px; padding: 8px 20px; border-bottom: 1px solid var(--divider); color: var(--ink-700); font-size: 13px; }
.schedule-list-row:last-child { border-bottom: 0; }
.schedule-list-row > b { color: var(--heading-900); font-size: 14px; }
.schedule-actions { display: flex; justify-content: flex-end; gap: 5px; }
.schedule-actions button { border: 0; background: transparent; color: var(--accent); padding: 6px 7px; font: 600 12px var(--font-sans); cursor: pointer; }
.schedule-actions button.danger { color: var(--hold-fg); }
.schedule-actions button:disabled { color: var(--ink-300); cursor: default; }
.schedule-empty { padding: 28px 20px; display: flex; align-items: flex-start; flex-direction: column; gap: 6px; color: var(--ink-500); font-size: 14px; }
.schedule-empty b { color: var(--heading-900); font-size: 15px; }
.schedule-empty button { margin-top: 7px; }
.schedule-drawer { width: min(520px, 100%); }
.schedule-form { grid-template-columns: 1fr; }
.schedule-method { padding: 0; }
.schedule-method button { min-height: 118px; padding: 14px; }
.schedule-method .cadence-name { font-size: 17px; }
.tier-editor { gap: 8px; }
.tier-head, .tier-row { display: grid; grid-template-columns: minmax(150px, 1.35fr) minmax(120px, 1fr) 34px; gap: 8px; align-items: center; }
.tier-head { color: var(--ink-400); font: 600 11px var(--font-sans); text-transform: uppercase; }
.tier-row label { height: 38px; display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius:var(--radius-control); background: var(--surface); color: var(--ink-400); overflow: hidden; padding: 0; }
.tier-row label span { padding: 0 9px; }
.tier-row label input { height: 36px; min-width: 0; border: 0; border-radius: 0; padding: 0 8px; background: transparent; }
.tier-row label:first-child input { border-left: 1px solid var(--divider); }
.tier-row label:last-of-type input { text-align: right; }
.tier-row label input:focus { outline: 0; }
.tier-row label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.tier-remove { width: 34px; height: 34px; border: 1px solid var(--border); border-radius:var(--radius-compact); background: var(--surface); color: var(--ink-500); display: grid; place-items: center; cursor: pointer; }
.tier-remove svg { width: 14px; height: 14px; }
.tier-remove:disabled { opacity: .35; cursor: default; }
.tier-row > small { grid-column: 2 / -1; margin-top: -4px; color: var(--review-fg); font-size: 11px; text-align: right; }
.tier-row > small.high { color: var(--hold-fg); }
.tier-row > small.low { grid-column: 1 / -1; color: var(--hold-fg); text-align: left; line-height: 1.4; }
.tier-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; }
.tier-add svg { width: 14px; height: 14px; }
.schedule-preview { padding: 13px; border: 1px solid var(--border); border-radius:var(--radius-control); background: var(--surface-alt); }
.schedule-preview > b { color: var(--heading-900); font-size: 13px; }
.schedule-preview > small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 11px; }
.schedule-preview > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.schedule-preview p { display: grid; gap: 3px; margin: 8px 0 0; padding: 9px; border-left: 2px solid var(--accent); background: var(--surface); }
.schedule-preview p span, .schedule-preview p small { color: var(--ink-500); font-size: 11px; }
.schedule-preview p strong { color: var(--heading-900); font: 600 12px var(--font-mono); }
.schedule-caution, .schedule-account-note { padding: 11px 12px; border-left: 3px solid var(--accent); background: var(--surface-alt); color: var(--ink-600); font-size: 13px; line-height: 1.45; }
.schedule-caution b, .schedule-caution span, .schedule-account-note b, .schedule-account-note span { display: block; }
.schedule-caution b, .schedule-account-note b { color: var(--heading-900); margin-bottom: 3px; }
.schedule-account-note a { color: var(--accent); font-weight: 600; margin-top: 5px; }
.schedule-error { margin: 0; }
.sched-chip { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border: 1px solid #C2CFEA; border-radius:var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font: 600 11px var(--font-sans); vertical-align: middle; }
.drawer-line-block { border-bottom: 1px solid var(--divider); }
.drawer-line-block:last-child { border-bottom: 0; }
.drawer-line-block .drawer-line { border-bottom: 0; }
.drawer-line em.schedule-tag { margin-left: 7px; color: var(--accent-ink); }
.drawer-line em + em { margin-left: 7px; }
.tier-breakdown { padding: 0 12px 10px; }
.tier-toggle { display: flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--accent); padding: 0; font: 600 12px var(--font-sans); cursor: pointer; }
.tier-toggle svg { width: 12px; height: 12px; transition: transform .15s; }
.tier-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tier-detail { margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius:var(--radius-control); background: var(--surface-alt); }
.tier-summary { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--divider); font-size: 12px; color: var(--ink-500); }
.tier-summary span, .tier-summary strong { color: var(--heading-900); }
.tier-detail-rows { padding: 5px 0; }
.tier-detail-rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 5px 6px; color: var(--ink-500); font-size: 11px; }
.tier-detail-rows > div.applied { background: var(--accent-soft); color: var(--heading-900); }
.tier-detail-rows b { font-family: var(--font-mono); }
.tier-detail-rows small { grid-column: 1 / -1; }
.tier-share { display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid var(--divider); color: var(--ink-500); font-size: 11px; }
.tier-share b { color: var(--ink-700); }
.tier-share strong { color: var(--heading-900); font-family: var(--font-mono); }
body.dark .schedule-list-head, body.dark .tier-detail, body.dark .schedule-preview, body.dark .schedule-caution, body.dark .schedule-account-note { background: var(--surface-alt); }
body.dark .tier-row label, body.dark .tier-remove, body.dark .schedule-preview p { background: var(--surface); }

@media (max-width: 900px) {
  .schedule-list-head { display: none; }
  .schedule-list-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; padding: 14px 16px; }
  .schedule-list-row > b { grid-column: 1 / -1; }
  .schedule-list-row .schedule-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .schedule-list-row > span[data-label] { display: grid; gap: 2px; }
  .schedule-list-row > span[data-label]::before { content: attr(data-label); color: var(--ink-400); font: 600 9px var(--font-sans); text-transform: uppercase; }
  .schedule-preview > div { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .card-title-row { align-items: flex-start; flex-direction: column; }
  .tier-head { display: none; }
  .tier-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .tier-row label { grid-column: 1; }
  .tier-row .tier-remove { grid-column: 2; grid-row: 1 / span 2; }
  .tier-row > small { grid-column: 1 / -1; text-align: left; }
}

/* Fee splitting */
.feature-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
}
.feature-setting-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.feature-setting-row > div:first-child b { color: var(--heading-900); font-size: 15px; }
.feature-setting-row > div:first-child span { color: var(--ink-700); font-size: 14px; }
.feature-setting-row > div:first-child small { color: var(--ink-500); font-size: 12px; line-height: 1.45; }
.feature-setting-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink-700);
  font-size: 13px;
}
.feature-switch {
  width: 42px;
  height: 24px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.feature-switch span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(8, 23, 43, .22);
  transition: transform .16s;
}
/* Off state reads as a real control: mid-grey track, white knob with a shadow. */
.feature-switch { border-color: var(--ink-400); background: var(--ink-400); }
.feature-switch span { box-shadow: 0 1px 2px rgba(0, 32, 91, .35); }
.feature-switch:hover:not(:disabled) { border-color: var(--ink-500); background: var(--ink-500); }
.feature-switch.on { border-color: var(--ready-fg); background: var(--ready-fg); }
.feature-switch.on:hover:not(:disabled) { border-color: var(--ready-fg); background: var(--ready-fg); }
.feature-switch.on span { transform: translateX(18px); }
.feature-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feature-switch:disabled { opacity: .55; cursor: default; }
.feature-setting-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--divider);
  background: var(--surface-alt);
}
.feature-setting-footer .btn { min-height: var(--control-height-compact); height: var(--control-height-compact); border-radius:var(--radius-compact); font-size: 13px; }
.feature-setting-footer span { color: var(--ink-500); font-size: 12px; }

.invoice-branding-settings { overflow: hidden; }
.invoice-branding-title { align-items: center; }
.invoice-branding-loading {
  padding: 42px 24px;
  border-top: 1px solid var(--divider);
  color: var(--ink-500);
  font-size: 13px;
  text-align: center;
}
.invoice-branding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  border-top: 1px solid var(--divider);
}
.invoice-branding-form {
  min-width: 0;
  padding: 2px 24px 24px;
}
.invoice-settings-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--divider);
}
.invoice-settings-section:last-of-type { border-bottom: 0; }
.invoice-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.invoice-settings-heading h3 {
  margin: 0;
  color: var(--heading-900);
  font: 600 14px var(--font-sans);
}
.invoice-settings-heading p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.45;
}
.invoice-logo-control {
  display: flex;
  align-items: center;
  gap: 14px;
}
.invoice-logo-control > div:last-child {
  min-width: 0;
  display: grid;
  gap: 7px;
}
.invoice-logo-control input[type="file"][hidden] { display: none; }
.invoice-logo-control small {
  max-width: 320px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invoice-logo-tile {
  width: 116px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius:var(--radius-control);
  background: var(--surface-alt);
  color: var(--ink-400);
}
.invoice-logo-tile.has-logo { border-style: solid; background: var(--surface); }
.invoice-logo-tile svg { width: 24px; height: 24px; }
.invoice-logo-tile img {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: contain;
  padding: 8px;
}
.invoice-logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invoice-logo-actions .btn { min-height: 34px; }
.invoice-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.invoice-settings-fields .fld,
.invoice-note-settings .fld { padding: 0; }
.invoice-note-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.invoice-note-settings .invoice-settings-heading { margin-bottom: 2px; }
.invoice-note-settings textarea { min-height: 88px; }
.invoice-branding-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 20px;
}
.invoice-branding-actions span {
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.4;
}
.invoice-branding-message { margin-top: 18px; }
.invoice-branding-saved,
.invoice-branding-readonly {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  border-left: 3px solid var(--ready-fg);
  background: var(--ready-bg);
  color: var(--ready-fg);
  font-size: 13px;
  font-weight: 600;
}
.invoice-branding-saved svg,
.invoice-branding-readonly svg { width: 15px; height: 15px; }
.invoice-branding-readonly {
  border-left-color: var(--border-strong);
  background: var(--surface-alt);
  color: var(--ink-600);
}
.invoice-settings-preview {
  min-width: 0;
  padding: 20px;
  border-left: 1px solid var(--divider);
  background: var(--surface-alt);
}
.invoice-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-500);
  font-size: 12px;
}
.invoice-preview-toolbar b {
  color: var(--ready-fg);
  font-size: 11px;
  text-transform: uppercase;
}
.invoice-preview-sheet {
  position: relative;
  width: 100%;
  min-height: 650px;
  box-sizing: border-box;
  padding: 32px 34px 78px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.invoice-preview-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.invoice-preview-letterhead {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 9px;
}
.invoice-preview-letterhead img {
  width: 110px;
  height: 46px;
  flex: none;
  object-fit: contain;
  object-position: left center;
}
.invoice-preview-letterhead > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.invoice-preview-letterhead strong {
  overflow-wrap: anywhere;
  color: var(--heading-900);
  font: 600 10px var(--font-sans);
}
.invoice-preview-letterhead span {
  overflow-wrap: anywhere;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.3;
}
.invoice-preview-title {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex: none;
}
.invoice-preview-title b {
  color: var(--heading-900);
  font: 600 23px var(--font-serif);
}
.invoice-preview-title span { color: var(--ink-500); font: 9px var(--font-mono); }
.invoice-preview-title small { color: var(--ink-500); font-size: 8px; }
.invoice-preview-rule {
  height: 2px;
  margin: 20px 0 15px;
  background: var(--navy-900);
}
.invoice-preview-meta-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 0 0 15px;
  border-bottom: 1px solid var(--divider);
}
.invoice-preview-meta-band > div { display: grid; align-content: start; gap: 3px; }
.invoice-preview-meta-band span { color: var(--ink-400); font-size: 7px; font-weight: 700; letter-spacing: .06em; }
.invoice-preview-meta-band b { color: var(--heading-900); font-size: 9px; }
.invoice-preview-meta-band small { color: var(--ink-600); font-size: 8px; line-height: 1.35; }
.invoice-preview-copy {
  color: var(--ink-700);
  font: italic 9px/1.55 var(--font-serif);
  line-height: 1.55;
  text-align: center;
}
.invoice-preview-copy p { margin: 14px 18px 8px; }
.invoice-preview-copy.closing { margin-top: 18px; }
.invoice-preview-table {
  margin-top: 17px;
}
.invoice-preview-table > div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 88px 45px 70px;
  align-items: center;
  gap: 7px;
  padding: 8px 3px;
  border-bottom: 1px solid var(--divider);
  color: var(--ink-600);
  font-size: 8px;
}
.invoice-preview-table > div:first-child {
  color: var(--ink-400);
  font-size: 7px;
  text-transform: uppercase;
}
.invoice-preview-table > div > :nth-child(n+3) { text-align: right; }
.invoice-preview-table span { display: grid; gap: 2px; color: var(--heading-900); }
.invoice-preview-table small { color: var(--ink-400); font-size: 7px; }
.invoice-preview-table strong { color: var(--heading-900); font-family: var(--font-mono); }
.invoice-preview-table > div.invoice-preview-total {
  grid-template-columns: 62px minmax(0, 1fr) 88px 45px 70px;
  border-bottom: 3px double var(--navy-900);
  color: var(--heading-900);
  font-size: 9px;
}
.invoice-preview-sheet footer {
  position: absolute;
  right: 34px;
  bottom: 24px;
  left: 34px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  color: var(--ink-400);
  font-size: 8px;
  line-height: 1.45;
}
.invoice-preview-sheet footer p { margin: 0 0 5px; }

.compensation-page { max-width: 1440px; box-sizing: border-box; }
.comp-distinction {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -7px 0 16px;
  padding: 11px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.45;
}
.comp-distinction b { color: var(--heading-900); white-space: nowrap; }
.comp-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.comp-tabs a {
  min-height: 38px;
  box-sizing: border-box;
  padding: 10px 14px 9px;
  border-bottom: 2px solid transparent;
  color: var(--ink-500);
  font: 600 13px var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.comp-tabs a:hover { color: var(--heading-900); }
.comp-tabs a.active { border-bottom-color: var(--accent); color: var(--heading-900); }
.comp-loading { padding: 36px; color: var(--ink-500); text-align: center; }
.comp-overview { display: grid; gap: 18px; }
.f-summary.five.comp-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.comp-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, .7fr);
  gap: 18px;
  align-items: start;
}
.comp-payee-summary { padding: 4px 24px 14px; }
.comp-payee-summary > div,
.comp-run-payees > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}
.comp-payee-summary > div:last-child,
.comp-run-payees > div:last-child { border-bottom: 0; }
.comp-payee-summary span,
.comp-run-payees span { display: grid; gap: 3px; min-width: 0; }
.comp-payee-summary b,
.comp-run-payees b { color: var(--heading-900); font-size: 14px; }
.comp-payee-summary small,
.comp-run-payees small { color: var(--ink-500); font-size: 12px; text-transform: capitalize; }
.comp-payee-summary strong,
.comp-run-payees strong {
  color: var(--heading-900);
  font: 600 13px var(--font-mono);
  white-space: nowrap;
}
.comp-reconcile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 24px 20px;
  padding: 11px 12px;
  border-left: 3px solid var(--ready-fg);
  background: var(--ready-bg);
  color: var(--ready-fg);
  font-size: 13px;
}
.comp-reconcile.bad { border-color: var(--hold-fg); background: var(--hold-bg); color: var(--hold-fg); }
.comp-reconcile b { font-family: var(--font-mono); white-space: nowrap; }
.comp-blocker-mini {
  display: flex;
  gap: 9px;
  padding: 9px 24px;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.4;
}
.comp-blocker-mini > span,
.comp-run-blockers > div > span {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--hold-dot);
  flex: none;
}
.comp-overview-grid aside .btn { margin: 16px 24px 20px; min-height: var(--control-height-compact); height: var(--control-height-compact); border-radius:var(--radius-compact); font-size: 13px; }
.comp-empty {
  display: grid;
  gap: 5px;
  padding: 28px 24px;
  color: var(--ink-500);
  font-size: 13px;
}
.comp-empty b { color: var(--heading-900); font-size: 14px; }
.comp-empty.table-empty { border-top: 1px solid var(--divider); }
.comp-empty.compact { width: 100%; box-sizing: border-box; padding: 14px 0; }
.comp-workspace { margin-top: 0; }
.comp-source {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  box-sizing: border-box;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius:var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-600);
  font: 600 11px var(--font-sans);
  white-space: nowrap;
}
.comp-source.account-override { border-color: #B1C6ED; background: #EFF3FF; color: #1B49A4; }
.comp-source.household-override { border-color: #B8D7C8; background: var(--ready-bg); color: var(--ready-fg); }
.comp-source.advisor-default { border-color: #C0CFE8; background: var(--review-bg); color: var(--review-fg); }
.comp-source.firm-default { color: var(--heading-800); }
.comp-allocation-cell { max-width: 360px; color: var(--ink-700); font-size: 13px; line-height: 1.45; }
.table-sub { display: block; margin-top: 3px; color: var(--ink-400); font-size: 12px; font-weight: 400; }
.table-select {
  width: min(190px, 100%);
  height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--border);
  border-radius:var(--radius-compact);
  background: var(--surface);
  color: var(--heading-900);
  font: 13px var(--font-sans);
}
.comp-row-actions button,
.comp-report-actions button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 600 12px var(--font-sans);
  cursor: pointer;
}
.comp-row-actions { text-align: right; }
.comp-coverage-text { color: var(--ink-500); font-size: 13px; }
.comp-report-actions { display: flex; align-items: center; gap: 4px; }
.comp-report-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; }
.comp-report-actions svg { width: 13px; height: 13px; }

.comp-drawer { width: min(520px, 100%); }
.comp-drawer.rule-drawer { width: min(620px, 100%); }
.comp-caution {
  padding: 11px 12px;
  border-left: 3px solid var(--review-dot);
  background: var(--review-bg);
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.45;
}
.comp-caution b,
.comp-caution span { display: block; }
.comp-caution b { margin-bottom: 3px; color: var(--heading-900); }
.comp-allocations {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius:var(--radius-control);
  background: var(--surface-alt);
}
.comp-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.comp-section-title > div { display: grid; gap: 2px; }
.comp-section-title b { color: var(--heading-900); font-size: 14px; }
.comp-section-title span { color: var(--ink-500); font-size: 12px; font-weight: 400; }
.comp-section-title button { min-height: 30px; padding: 0 9px; border-radius:var(--radius-sm); font-size: 12px; }
.comp-section-title svg { width: 13px; height: 13px; }
.comp-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 34px;
  gap: 8px;
  align-items: center;
}
.comp-allocation-row > select {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius:var(--radius-control);
  padding: 0 9px;
  background: var(--surface);
  color: var(--heading-900);
  font: 13px var(--font-sans);
}
.comp-allocation-row > label {
  display: flex;
  align-items: center;
  height: 38px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius:var(--radius-control);
  background: var(--surface);
  overflow: hidden;
}
.comp-allocation-row > label input {
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 5px 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: right;
}
.comp-allocation-row > label span { padding-right: 9px; color: var(--ink-500); font-weight: 500; }
.comp-allocation-row > select:focus,
.comp-allocation-row > label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.comp-allocation-row > label input:focus { outline: 0; }
.comp-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  padding: 10px 11px;
  border-left: 3px solid var(--hold-fg);
  background: var(--hold-bg);
  color: var(--hold-fg);
  font-size: 12px;
}
.comp-total.good { border-color: var(--ready-fg); background: var(--ready-bg); color: var(--ready-fg); }
.comp-total b { font: 600 13px var(--font-mono); }
.comp-allocations .form-error { margin: 0; }
.comp-dollar-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius:var(--radius-control);
}
.comp-dollar-preview > b,
.comp-dollar-preview > small { grid-column: 1 / -1; }
.comp-dollar-preview > b { color: var(--heading-900); font-size: 13px; }
.comp-dollar-preview > small { color: var(--ink-500); font-size: 12px; }
.comp-dollar-preview > div { display: contents; }
.comp-dollar-preview span { color: var(--ink-600); font-size: 12px; }
.comp-dollar-preview strong { color: var(--heading-900); font: 600 12px var(--font-mono); text-align: right; }
.comp-drawer .form-error { margin: 0; }
.drawer-comp-link { display: inline-block; margin-top: 12px; }

.comp-run-loading { padding: 28px 12px; color: var(--ink-500); font-size: 13px; text-align: center; }
.comp-run-callout {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border-left: 3px solid var(--ready-fg);
  background: var(--ready-bg);
  color: var(--ready-fg);
}
.comp-run-callout.review { border-color: var(--review-dot); background: var(--review-bg); color: var(--review-fg); }
.comp-run-callout.bad { border-color: var(--hold-fg); background: var(--hold-bg); color: var(--hold-fg); }
.comp-run-callout b { font-size: 13px; }
.comp-run-callout span { font-size: 12px; line-height: 1.45; }
.comp-run-review { display: grid; gap: 0; }
.comp-run-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--divider);
}
.comp-run-totals > div { display: grid; gap: 4px; padding: 11px; background: var(--surface); }
.comp-run-totals span { color: var(--ink-500); font-size: 11px; }
.comp-run-totals b { color: var(--heading-900); font: 600 13px var(--font-mono); }
.comp-run-payees { padding: 0 2px; }
.comp-run-blockers { border-top: 1px solid var(--divider); }
.comp-run-blockers > div { display: flex; gap: 9px; padding: 10px 2px; border-bottom: 1px solid var(--divider); }
.comp-run-blockers p { margin: 0; color: var(--ink-700); font-size: 12px; line-height: 1.4; }
.comp-run-blockers p b { color: var(--heading-900); }
.comp-run-blockers p small { display: block; color: var(--ink-500); }
.comp-run-lines { border-top: 1px solid var(--divider); }
.comp-run-lines > div { padding: 11px 2px; border-bottom: 1px solid var(--divider); }
.comp-run-lines > div > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comp-run-lines > div > div:first-child span { display: grid; gap: 2px; min-width: 0; }
.comp-run-lines b { color: var(--heading-900); font-size: 13px; }
.comp-run-lines small { color: var(--ink-500); font-size: 11px; }
.comp-run-lines strong { color: var(--heading-900); font: 600 12px var(--font-mono); }
.comp-run-line-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.4;
}
.invoice-line-list { border-top: 1px solid var(--divider); }
.invoice-line-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--divider);
}
.invoice-line-list span { min-width: 0; display: grid; gap: 2px; }
.invoice-line-list b { overflow-wrap: anywhere; color: var(--heading-900); font-size: 12px; }
.invoice-line-list small { color: var(--ink-500); font-size: 11px; }
.invoice-line-list strong { color: var(--heading-900); font: 600 12px var(--font-mono); }
.invoice-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink-600);
  font-size: 12px;
}
.invoice-subtotal strong { color: var(--heading-900); font: 700 14px var(--font-mono); }

body.dark .feature-setting-footer,
body.dark .comp-distinction,
body.dark .comp-allocations,
body.dark .invoice-empty-icon,
body.dark .invoice-file,
body.dark .invoice-subtotal,
body.dark .invoice-settings-preview,
body.dark .invoice-logo-tile { background: var(--surface-alt); }
body.dark .feature-switch span,
body.dark .table-select,
body.dark .comp-allocation-row > select,
body.dark .comp-allocation-row > label { background: var(--surface); color: var(--ink-900); }
body.dark .comp-source.account-override { border-color: #39578F; background: #112653; color: #AAC9FF; }
body.dark .comp-source.household-override { border-color: #2D684F; background: #102E25; color: #93D8B7; }
body.dark .comp-source.advisor-default { border-color: #55647D; background: #272C37; color: #B9CEF4; }

.invoice-hashes { display: grid; gap: 8px; padding: 12px; margin-top: 14px; background: var(--surface-alt); border: 1px solid var(--divider); border-radius:var(--radius-compact); }
.invoice-hashes span { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; align-items: start; color: var(--ink-500); font-size: 10px; }
.invoice-hashes code { overflow-wrap: anywhere; color: var(--ink-700); font-size: 10px; }
.invoice-responsibility-note { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--border-strong); background: var(--surface-alt); color: var(--ink-600); font-size: 12px; line-height: 1.45; }
.form-divider { padding-top: 12px !important; border-top: 1px solid var(--divider); display: grid; gap: 3px; }
.form-divider b { color: var(--heading-900); font-size: 13px; }
.form-divider span { color: var(--ink-500); font-size: 12px; }

@media (max-width: 1100px) {
  .invoice-branding-grid { grid-template-columns: 1fr; }
  .invoice-settings-preview { border-top: 1px solid var(--divider); border-left: 0; }
  .invoice-preview-sheet { max-width: 720px; margin: 0 auto; }
  .f-summary.five.comp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comp-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .f-summary.five.comp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-distinction { align-items: flex-start; flex-direction: column; gap: 3px; }
  .comp-distinction b { white-space: normal; }
  .comp-tabs { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .comp-workspace .tbl-wrap { overflow-x: auto; }
  .comp-workspace .tbl { min-width: 940px; }
}
@media (max-width: 560px) {
  .feature-setting-row { align-items: flex-start; flex-direction: column; padding: 16px; }
  .feature-setting-action { width: 100%; justify-content: space-between; }
  .feature-setting-footer { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .invoice-branding-title { align-items: flex-start; }
  .invoice-branding-form { padding: 0 16px 20px; }
  .invoice-settings-fields { grid-template-columns: 1fr; }
  .invoice-logo-control { align-items: flex-start; flex-direction: column; }
  .invoice-logo-tile { width: 100%; height: 86px; }
  .invoice-branding-actions { align-items: flex-start; flex-direction: column; }
  .invoice-branding-actions .btn { width: 100%; }
  .invoice-settings-preview { padding: 16px; }
  .invoice-preview-sheet { min-height: 560px; padding: 20px; }
  .invoice-preview-sheet > header { align-items: flex-start; flex-direction: column; }
  .invoice-preview-title { justify-items: start; }
  .invoice-preview-rule { margin-top: 16px; }
  .invoice-preview-table > div { grid-template-columns: minmax(0, 1fr) 78px 62px; }
  .f-summary.five.comp-kpis { grid-template-columns: 1fr; }
  .comp-payee-summary { padding-left: 16px; padding-right: 16px; }
  .comp-reconcile { align-items: flex-start; flex-direction: column; margin-left: 16px; margin-right: 16px; }
  .comp-allocation-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .comp-allocation-row > select { grid-column: 1; }
  .comp-allocation-row > label { grid-column: 1; }
  .comp-allocation-row > button { grid-column: 2; grid-row: 1 / span 2; }
  .comp-section-title { align-items: flex-start; flex-direction: column; }
  .comp-dollar-preview { grid-template-columns: 1fr auto; }
  .comp-run-totals { grid-template-columns: 1fr; }
  .comp-run-line-source { align-items: flex-start; flex-direction: column; }
}

/* The two-tone logo sits in a white box with a mist hairline on the porcelain canvas. */
.activation-public > img {
  width: 260px;
  max-height: 88px;
  box-sizing: border-box;
  object-fit: contain;
  padding: 12px 20px;
  border-radius:var(--radius-lg);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px #DDE1EC;
}

/* Guided onboarding and tenant access */
.cc-board > .topbar { position: sticky; top: 0; z-index: 40; }
.onboarding-banner { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px) auto; gap: 22px; align-items: center; margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--ready-dot); border-left: 4px solid var(--ready-fg); background: var(--ready-bg); }
.tenant-onboarding-banner { position: sticky; top: 64px; z-index: 30; margin: 0; box-shadow: 0 5px 14px rgba(20, 38, 78, .08); }
.onboarding-banner > div:first-child { display: grid; gap: 3px; }
.onboarding-banner-title { display: flex; align-items: center; gap: 8px; color: var(--ready-fg); font-size: 15px; font-weight: 700; }
.onboarding-step-pill { display:inline-flex; align-items:center; min-height:24px; padding:0 10px; border:1px solid var(--ready-dot); border-radius:var(--radius-sm); color:var(--ready-fg); background:var(--surface); font-size:12px; font-weight:600; white-space:nowrap; }
.onboarding-banner small { color: var(--ink-700); }
.onboarding-banner-progress-wrap { min-width: 0; }
.onboarding-banner-progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--ink-700); font-size: 12px; }
.onboarding-banner-progress, .onboarding-progress, .staff-onboarding-progress { height: 6px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; }
.onboarding-banner-progress span, .onboarding-progress span, .staff-onboarding-progress span { display: block; height: 100%; background: var(--ready-dot); transition: width .2s ease; }
.onboarding-status { align-items: center; display: inline-flex; min-height: 30px; padding: 0 10px; border: 1px solid var(--review-dot); border-radius:var(--radius-sm); color: var(--review-fg); background: var(--review-bg); font-size: 12px; font-weight: 700; }
.onboarding-status.completed { border-color: var(--ready-dot); color: var(--ready-fg); background: var(--ready-bg); }
.onboarding-progress { margin: -8px 0 20px; height: 7px; }
.onboarding-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 22px; align-items: start; }
.onboarding-nav { display: grid; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.onboarding-nav button { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; min-height: 64px; padding: 11px 12px; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--ink-900); cursor: pointer; }
.onboarding-nav button:last-child { border-bottom: 0; }
.onboarding-nav button.active { background: var(--ready-bg); box-shadow: inset 3px 0 var(--ready-fg); }
.onboarding-nav button > span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--ink-500); }
.onboarding-nav button.complete > span { border-color: var(--ready-fg); background: var(--ready-fg); color: var(--surface); }
.onboarding-nav button:disabled,.onboarding-nav button.locked{cursor:not-allowed;opacity:.52;background:var(--surface-alt)}
.filter-result-heading{margin:0;padding:13px 16px;border:1px solid var(--border);border-bottom:0;background:var(--ready-bg);color:var(--ink-900);font:700 14px/1.3 var(--font-sans)}.filter-result-heading:focus{outline:3px solid color-mix(in srgb,var(--accent) 35%,transparent);outline-offset:2px}.onboarding-stage .import-preview-summary{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:12px;padding:14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-alt)}.onboarding-stage .import-preview-summary > *{min-width:0}.onboarding-stage .import-preview-summary > b,.onboarding-stage .import-preview-summary > span{display:block}.onboarding-stage .import-preview-summary > span{padding:0;border:0;color:var(--ink-500)}
.onboarding-nav button > span svg { width: 15px; height: 15px; }
.onboarding-nav b { font-size: 13px; line-height: 18px; }
.onboarding-nav small { font-size: 11px; color: var(--muted); }
.onboarding-stage { min-width: 0; }
.onboarding-stage > .proto-card { margin: 0; }
.onboarding-form, .onboarding-policy, .onboarding-data, .onboarding-run, .onboarding-review { padding: 22px; }
.onboarding-readonly { display: grid; grid-template-columns: 1fr 180px; gap: 1px; margin: 18px 0; background: var(--line); border: 1px solid var(--line); }
.onboarding-readonly > div { display: grid; gap: 3px; padding: 13px 15px; background: #f7f8f7; }
.onboarding-readonly span, .signed-policy span, .first-run-summary span { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.onboarding-readonly b { font-size: 14px; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.signed-policy { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0; border: 1px solid var(--line); background: #fff; }
.signed-policy > div { display: grid; gap: 5px; min-height: 76px; padding: 15px; border-right: 1px solid var(--line); }
.signed-policy > div:last-child { border-right: 0; }
.signed-policy b { font-size: 16px; }
.policy-confirm-check { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border: 1px solid var(--review-dot); background: var(--review-bg); cursor: pointer; }
.proto-card .policy-confirm-check input { display:block; width:18px; height:18px; flex:0 0 18px; margin:2px 0 0; padding:0; accent-color:var(--brand); }
.policy-confirm-check span { display: grid; gap: 3px; }
.policy-confirm-check small { color: #596985; }
.receipt-hash { display: inline; overflow-wrap: anywhere; word-break: break-all; font-size: 11px; }
.exc.excluded .dot { background: var(--ink-400); }
.exc.excluded small { display: block; margin-top: 3px; color: var(--ink-500); }
.onboarding-readiness { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.onboarding-readiness > div { display: grid; gap: 4px; padding: 14px; border-right: 1px solid var(--line); }
.onboarding-readiness > div:last-child { border-right: 0; }
.onboarding-readiness b { font-size: 20px; }
.onboarding-readiness span { color: var(--muted); font-size: 12px; }
.onboarding-readiness .blocked { background: #fff4f1; color: #9e3427; }
.onboarding-template { display: grid; gap: 8px; justify-items: start; padding: 20px; border: 1px dashed #aab9b0; background: #f7faf8; }
.onboarding-template p { margin: 0; color: var(--muted); }
.onboarding-logo-heading { display: grid; gap: 6px; margin-top: 18px; }
.onboarding-logo-heading p { margin: 0; color: var(--muted); }
.onboarding-template.onboarding-logo-upload {
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 20px;
  margin-top: 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.onboarding-logo-upload:hover,
.onboarding-logo-upload.active,
.onboarding-logo-upload:focus-visible {
  border-color: var(--accent);
  background: #F5F8FE;
  box-shadow: inset 0 0 0 1px rgba(41, 103, 226, .08);
  outline: none;
}
.onboarding-logo-upload.disabled { opacity: .62; cursor: default; }
.onboarding-logo-upload input[type="file"][hidden] { display: none; }
.onboarding-logo-preview {
  width: 100%;
  height: 118px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-400);
}
.onboarding-logo-preview.has-logo { border-style: solid; }
.onboarding-logo-preview span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-alt); }
.onboarding-logo-preview svg { width: 24px; height: 24px; }
.onboarding-logo-preview img { width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; display: block; box-sizing: border-box; object-fit: contain; padding: 10px; }
.onboarding-logo-copy { min-width: 0; display: grid; justify-items: start; gap: 9px; }
.onboarding-logo-copy > div:first-child { display: grid; gap: 4px; }
.onboarding-logo-copy > div:first-child > b { color: var(--heading-900); font-size: 15px; }
.onboarding-logo-copy p { font-size: 13px; line-height: 1.45; }
.onboarding-logo-copy > small { color: var(--muted); font-size: 11px; }
.onboarding-logo-filename { max-width: 100%; overflow: hidden; color: var(--ink) !important; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.onboarding-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body.dark .onboarding-logo-upload:hover,
body.dark .onboarding-logo-upload.active,
body.dark .onboarding-logo-upload:focus-visible { background: #112653; }
@media(max-width:700px) {
  .onboarding-template.onboarding-logo-upload { grid-template-columns: 1fr; }
  .onboarding-logo-preview { max-width: 240px; }
}
.onboarding-csv-guide { margin-top: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.onboarding-csv-guide-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.onboarding-csv-guide-head > div { display: grid; gap: 3px; }
.onboarding-csv-guide-head > div > b { color: var(--ink); font-size: 14px; }
.onboarding-csv-guide-actions { display: flex !important; grid-auto-flow: column; gap: 8px !important; align-items: center; }
.onboarding-csv-guide-head small, .onboarding-csv-guide p { color: var(--muted); font-size: 11px; }
.csv-sheet-scroll { margin-top: 12px; overflow-x: auto; border: 1px solid #aeb7b1; border-radius: 5px; background: #fff; box-shadow: 0 1px 3px rgba(15,45,31,.12); }
.csv-sheet { min-width: 930px; color: #202124; background: #fff; font-family: Arial, sans-serif; }
.csv-sheet-titlebar { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 11px; color: #fff; background: #217346; }
.csv-sheet-titlebar b { flex: 1; font-size: 12px; font-weight: 600; }
.csv-sheet-titlebar > span:last-child { padding: 2px 6px; border: 1px solid rgba(255,255,255,.5); border-radius: 2px; font-size: 9px; letter-spacing: .08em; }
.csv-sheet-app-mark { display: grid; place-items: center; width: 22px; height: 22px; background: #185c37; font-size: 12px; font-weight: 800; }
.csv-sheet-formula { display: grid; grid-template-columns: 58px 36px minmax(0,1fr); min-height: 29px; border-bottom: 1px solid #b7b7b7; background: #fafafa; font-size: 11px; }
.csv-sheet-formula > * { display: flex; align-items: center; padding: 0 9px; border-right: 1px solid #d0d0d0; }
.csv-sheet-formula > b { justify-content: center; color: #666; font-family: Georgia, serif; font-style: italic; font-weight: 400; }
.csv-sheet-grid { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.csv-sheet-grid .csv-sheet-row-number { width: 38px; }
.csv-sheet-grid .csv-sheet-account { width: 136px; }
.csv-sheet-grid .csv-sheet-name { width: 132px; }
.csv-sheet-grid .csv-sheet-household { width: 145px; }
.csv-sheet-grid .csv-sheet-rate { width: 132px; }
.csv-sheet-grid .csv-sheet-schedule { width: 190px; }
.csv-sheet-grid .csv-sheet-hold { width: 82px; }
.csv-sheet-grid th, .csv-sheet-grid td { height: 30px; padding: 5px 8px; overflow: hidden; border-right: 1px solid #d4d4d4; border-bottom: 1px solid #d4d4d4; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.csv-sheet-grid tr > *:last-child { border-right: 0; }
.csv-sheet-column-letters th { height: 23px; padding: 2px 6px; color: #4a4a4a; background: #f0f0f0; text-align: center; font-size: 10px; font-weight: 500; }
.csv-sheet-column-letters th:first-child, .csv-sheet-field-header th:first-child, .csv-sheet-grid tbody th { color: #555; background: #f0f0f0; text-align: center; font-weight: 500; }
.csv-sheet-field-header th:not(:first-child) { color: #fff; background: #548235; font-size: 10px; font-weight: 700; letter-spacing: .01em; }
.csv-sheet-field-header th:nth-child(2) { position: relative; box-shadow: inset 0 0 0 2px #107c41; }
.csv-sheet-field-header th:nth-child(2)::after { position: absolute; right: -2px; bottom: -2px; width: 5px; height: 5px; background: #107c41; content: ""; }
.csv-sheet-grid tbody tr:nth-child(even) td { background: #f7fbf4; }
.csv-sheet-grid tbody td:nth-child(5), .csv-sheet-grid tbody td:last-child { font-variant-numeric: tabular-nums; }
.csv-sheet-tabs { display: flex; align-items: flex-end; gap: 14px; height: 31px; padding: 0 12px; border-top: 1px solid #c9c9c9; background: #f3f3f3; }
.csv-sheet-tabs button { height: 30px; padding: 0 18px; border: 0; border-bottom: 3px solid #217346; color: #1e1e1e; background: #fff; font-size: 10px; font-weight: 600; }
.csv-sheet-tabs span { padding-bottom: 7px; color: #555; font-size: 16px; }
.statement-address-list { display: grid; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.statement-address-list > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.statement-address-list > div:last-child { border-bottom: 0; }
.statement-address-list > div > div { display: grid; gap: 3px; }
.statement-address-list b { color: var(--ink); font-size: 13px; }
.statement-address-list small { color: var(--review-fg); font-size: 11px; }
.household-profile-conflict-note { margin-top: 4px; }
.household-profile-conflicts { display: grid; gap: 12px; }
.household-profile-conflicts fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--review-dot); border-radius: var(--radius-md); background: var(--review-bg); }
.household-profile-conflicts legend { padding: 0 6px; color: var(--review-fg); font-size: 13px; font-weight: 800; }
.household-profile-conflicts fieldset > small { color: var(--review-fg) !important; font-size: 11px; }
.household-profile-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.household-profile-options label { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; min-width: 0; padding: 13px 14px; border: 1px solid var(--review-dot); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.household-profile-options label:hover { border-color: var(--accent); }
.household-profile-options label.selected { border-color: var(--accent); background: #f2f6ff; box-shadow: inset 0 0 0 1px var(--accent); }
.household-profile-options label:focus-within { outline: 2px solid color-mix(in srgb,var(--accent) 35%,transparent); outline-offset: 2px; }
.household-profile-options input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.household-profile-option-body { display: grid; gap: 10px; min-width: 0; }
.household-profile-option-body > div { display: grid; gap: 2px; }
.household-profile-option-body b { color: var(--ink); font-size: 13px; }
.household-profile-option-body small { color: var(--muted); font-size: 10px; }
.household-profile-option-body address { color: var(--ink-700); font-size: 12px; font-style: normal; line-height: 1.55; white-space: pre-line; }
@media(max-width:700px) {
  .onboarding-csv-guide-head, .statement-address-list > div { align-items: stretch; flex-direction: column; }
  .onboarding-csv-guide-actions { display: flex !important; flex-direction: column; align-items: stretch; width: 100%; }
  .household-profile-options { grid-template-columns: 1fr; }
}
.onboarding-csv-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; border: 1px solid var(--line); }
.onboarding-csv-guide-grid > div { display: grid; grid-template-columns: 122px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.onboarding-csv-guide-grid > div:nth-child(2n) { border-right: 0; }
.onboarding-csv-guide-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.onboarding-csv-guide code { color: var(--accent); font-size: 11px; font-weight: 700; }
.onboarding-csv-guide-grid span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.onboarding-csv-guide p { margin: 10px 0 0; }
.onboarding-data-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.household-review { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; border: 1px solid #B4C9EF; background: #F6FBFF; }
.household-review > div { display: grid; gap: 3px; }
.household-review > div:last-child { display: flex; grid-auto-flow: column; }
.household-review span { color: #556178; font-size: 12px; }
.first-run-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.first-run-summary > div { display: grid; gap: 4px; padding: 15px; border-right: 1px solid var(--line); }
.first-run-summary > div:last-child { border-right: 0; }
.first-run-summary b { text-transform: capitalize; }
.onboarding-run-result, .settings-review-state { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #b8d2c2; background: #f3f9f5; }
.onboarding-run-result > svg, .settings-review-state > svg { width: 21px; height: 21px; color: var(--ready-fg); }
.onboarding-run-result > div, .settings-review-state > div { display: grid; gap: 3px; }
.onboarding-run-result span, .settings-review-state span { color: var(--muted); font-size: 12px; }
.onboarding-invoice-preview { display: grid; gap: 14px; margin: 18px 0; padding: 18px; border: 1px solid var(--line); background: var(--surface-alt); }
.onboarding-invoice-presentation { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.onboarding-invoice-presentation-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.onboarding-invoice-presentation-head > div { display: grid; gap: 4px; }
.onboarding-invoice-presentation-head b { color: var(--ink); font-size: 16px; }
.onboarding-invoice-presentation-head small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.onboarding-invoice-presentation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.onboarding-invoice-presentation-grid .fld { padding: 0; }
.onboarding-invoice-presentation-grid textarea { min-height: 88px; }
.onboarding-invoice-presentation-actions { display: flex; align-items: center; gap: 14px; }
.onboarding-invoice-presentation-actions span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.onboarding-invoice-preview-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.onboarding-invoice-preview-head > div { display: grid; gap: 4px; max-width: 620px; }
.onboarding-invoice-preview-head > div > b { color: var(--ink); font-size: 16px; }
.onboarding-invoice-preview-head small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.onboarding-invoice-preview-head > label { display: grid; gap: 5px; min-width: 260px; }
.onboarding-invoice-preview-head > label > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.onboarding-invoice-preview-head select { width: 100%; height: var(--control-height); padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); }
.onboarding-invoice-preview-meta { display: grid; grid-template-columns: minmax(0, 1fr) 130px 150px; border: 1px solid var(--line); background: var(--surface); }
.onboarding-invoice-preview-meta > span { display: grid; gap: 3px; min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.onboarding-invoice-preview-meta > span:last-child { border-right: 0; }
.onboarding-invoice-preview-meta b { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.onboarding-invoice-preview-meta small { color: var(--muted); font-size: 10px; }
.onboarding-invoice-preview-frame { min-height: 680px; padding: 22px; border: 1px solid var(--border-strong); background: #EAECF2; box-sizing: border-box; }
.onboarding-invoice-preview-frame .onboarding-invoice-document { max-width: 760px; min-height: 680px; margin: 0 auto; }
.onboarding-invoice-document .invoice-preview-draft { color: var(--warning-strong, #516B9C); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.onboarding-invoice-preview-frame > .empty-panel { min-height: 680px; display: grid; align-content: center; }
.onboarding-invoice-preview-actions, .onboarding-invoice-confirm { display: grid; justify-items: start; gap: 12px; }
.onboarding-invoice-preview-actions > .settings-review-state { width: 100%; box-sizing: border-box; }
.onboarding-invoice-confirm { width: 100%; }
.onboarding-invoice-confirm .policy-confirm-check { width: 100%; box-sizing: border-box; margin: 0; background: var(--surface); }
.onboarding-checklist, .staff-onboarding-milestones { display: grid; margin-top: 18px; border: 1px solid var(--line); }
.onboarding-checklist > div, .staff-onboarding-milestones > div { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; min-height: 46px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.onboarding-checklist > div:last-child, .staff-onboarding-milestones > div:last-child { border-bottom: 0; }
.onboarding-checklist > div > span, .staff-onboarding-milestones > div > span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #b8c0bb; border-radius: 50%; }
.onboarding-checklist > div.complete > span, .staff-onboarding-milestones > div.complete > span { border-color: var(--ready-fg); background: var(--ready-fg); color: var(--surface); }
.onboarding-checklist svg, .staff-onboarding-milestones svg { width: 13px; height: 13px; }
.onboarding-checklist small, .staff-onboarding-milestones small { color: var(--muted); }
.staff-onboarding-card { margin-top: 18px; padding: 20px; }
.staff-onboarding-progress { margin: 14px 0; }
.staff-onboarding-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.tenant-user-settings { overflow: hidden; }
.tenant-user-settings > .card-title-row { padding: 18px; }
.tenant-user-head, .tenant-user-row { display: grid; grid-template-columns: minmax(210px, 1.4fr) minmax(150px, .7fr) minmax(135px, .6fr) 120px; gap: 14px; align-items: center; padding: 10px 18px; }
.tenant-user-head { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-alt); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.tenant-user-row { min-height: 62px; border-bottom: 1px solid var(--line); }
.tenant-user-row > span:first-child, .tenant-user-row > span:nth-child(3) { display: grid; gap: 3px; }
.tenant-user-row small { color: var(--muted); font-size: 11px; }
.tenant-user-row select { min-width: 0; width: 100%; height: var(--control-height); padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--ink-900); font-size: 14px; }
.tenant-user-actions { display: flex !important; justify-content: flex-end; gap: 6px; }
.tenant-user-actions > button:not(.btn) { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); cursor: pointer; }
.tenant-user-actions svg { width: 15px; height: 15px; }
.tenant-invite-dialog { max-width: 480px; }
.invite-role-summary { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); background: #f6f8f7; }
.invite-role-summary span { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .onboarding-layout { grid-template-columns: 1fr; }
  .onboarding-nav { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
  .onboarding-nav button { border-right: 1px solid var(--line); border-bottom: 0; }
}

@media (max-width: 900px) {
  .cc-board > .topbar { position: relative; }
  .tenant-onboarding-banner { top: 0; }
  .onboarding-banner { grid-template-columns: 1fr auto; }
  .onboarding-banner-progress-wrap { grid-column: 1 / 3; grid-row: 2; }
  .onboarding-layout { grid-template-columns: 1fr; }
  .onboarding-nav { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
  .onboarding-nav button { border-right: 1px solid var(--line); border-bottom: 0; }
  .onboarding-invoice-preview-head { align-items: stretch; flex-direction: column; }
  .onboarding-invoice-presentation-grid { grid-template-columns: 1fr; }
  .onboarding-invoice-preview-head > label { min-width: 0; }
  .onboarding-invoice-preview-meta { grid-template-columns: 1fr 110px 130px; }
  /* The size guard (2026-09-24): on a tablet the team list stacks into two columns instead of scrolling the whole card. */
  .tenant-user-head { display: none; }
  .tenant-user-row { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 14px; }
}
@media (max-width: 600px) {
  .tenant-onboarding-banner { top: 0; }
  .onboarding-banner { grid-template-columns: 1fr; align-items: stretch; }
  .onboarding-invoice-preview { padding: 13px; }
  .onboarding-invoice-presentation { padding: 13px; }
  .onboarding-invoice-presentation-head, .onboarding-invoice-presentation-actions { align-items: stretch; flex-direction: column; }
  .onboarding-invoice-preview-meta { grid-template-columns: 1fr; }
  .onboarding-invoice-preview-meta > span { border-right: 0; border-bottom: 1px solid var(--line); }
  .onboarding-invoice-preview-meta > span:last-child { border-bottom: 0; }
  .onboarding-invoice-preview-frame, .onboarding-invoice-preview-frame > .empty-panel { min-height: 520px; }
  .onboarding-invoice-preview-frame { padding: 10px; }
  .onboarding-invoice-preview-frame .onboarding-invoice-document { min-height: 560px; }
  .onboarding-banner-title { align-items: flex-start; flex-wrap: wrap; }
  .onboarding-banner-progress-wrap { grid-column: 1; grid-row: auto; }
  .onboarding-banner .btn { width: 100%; }
  .onboarding-form, .onboarding-policy, .onboarding-data, .onboarding-run, .onboarding-review { padding: 16px; }
  .onboarding-nav { grid-template-columns: repeat(5, 150px); }
  .signed-policy, .onboarding-readiness, .first-run-summary, .onboarding-readonly { grid-template-columns: 1fr; }
  .signed-policy > div, .onboarding-readiness > div, .first-run-summary > div, .onboarding-readonly > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .signed-policy > div:last-child, .onboarding-readiness > div:last-child, .first-run-summary > div:last-child, .onboarding-readonly > div:last-child { border-bottom: 0; }
  .onboarding-actions, .staff-onboarding-actions { align-items: stretch; flex-direction: column-reverse; }
  .onboarding-csv-guide-head { align-items: stretch; flex-direction: column; }
  .onboarding-csv-guide-head .btn { width: 100%; }
  .onboarding-csv-guide-grid { grid-template-columns: 1fr; }
  .onboarding-csv-guide-grid > div, .onboarding-csv-guide-grid > div:nth-child(2n), .onboarding-csv-guide-grid > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .onboarding-csv-guide-grid > div:last-child { border-bottom: 0; }
  .onboarding-actions .btn, .staff-onboarding-actions .btn { width: 100%; }
  .household-review { align-items: flex-start; flex-direction: column; }
  .tenant-user-settings { overflow: visible; }
  .tenant-user-settings > .card-title-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .tenant-user-settings > .card-title-row .btn { width: 100%; }
  .tenant-user-head { display: none; }
  .tenant-user-row { min-width: 0; grid-template-columns: 1fr; gap: 9px; padding: 14px 16px; }
  .tenant-user-actions { justify-content: flex-start; }
}

/* Household mapping workspace */
.hm-page { max-width: 1500px; }
.stage-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:0 0 18px; }
.stage-intro h2 { margin:0; color: var(--heading-900); font:600 24px/1.2 var(--font-serif); }
.stage-intro p { margin:6px 0 0; color:var(--ink-500); font-size:14px; }
.hm-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 24px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.hm-steps > div { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); }
.hm-steps > div:not(:last-child)::after { content: ""; position: absolute; left: 31px; right: 8px; top: 14px; height: 2px; background: var(--line); }
.hm-steps > div.complete:not(:last-child)::after { background: var(--ready-fg); }
.hm-steps span { position: relative; z-index: 1; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 11px; font-weight: 800; }
.hm-steps b { position: relative; z-index: 1; min-width: 0; padding-right: 8px; overflow: hidden; background: var(--surface); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hm-steps .active { color: var(--brand); }
.hm-steps .active span { border-color: var(--brand); background: var(--accent-soft); color: var(--accent-ink); }
.hm-steps .complete { color: var(--ready-fg); }
.hm-steps .complete span { border-color: var(--ready-fg); background: var(--ready-fg); color: var(--surface); }
.hm-steps svg { width: 13px; height: 13px; }
.hm-stage { min-height: 390px; padding: 42px; }
.hm-stage h2 { margin: 0 0 8px; color: var(--heading-900); font: 600 22px/1.25 var(--font-serif); }
.onboarding-run .empty-panel h3 { margin: 0 0 6px; color: var(--heading-900); font: 600 18px/1.3 var(--font-serif); }
.onboarding-run-picker { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.onboarding-run-picker select { min-width: 240px; height: var(--control-height); padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--ink-900); font-size: 14px; }
.hm-import { display: grid; justify-items: center; align-content: center; text-align: center; }
.hm-import h2 { margin: 5px 0; }
.hm-import p { max-width: 620px; margin: 0 0 20px; color: var(--muted); }
.hm-import > small { margin-top: 18px; color: var(--muted); }
.hm-file-icon { width: 58px; height: 58px; margin-bottom: 16px; display: grid; place-items: center; border: 1px solid var(--line); background: #f5f7f8; color: var(--brand); }
.hm-file-icon svg { width: 26px; height: 26px; }
.hm-import-actions { display: flex; gap: 9px; }
.hm-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.hm-summary > div { padding: 15px 17px; border: 1px solid var(--line); background: var(--surface); }
.hm-summary span, .hm-summary small { display: block; color: var(--muted); }
.hm-summary b { display: block; margin: 3px 0; font-size: 23px; }
.hm-summary small { font-size: 11px; }
.hm-match-list { overflow: hidden; }
.hm-list-head, .hm-match-row { display: grid; grid-template-columns: minmax(220px, 1.25fr) minmax(170px, .8fr) minmax(180px, .85fr) 120px; gap: 14px; align-items: center; padding: 11px 16px; }
.hm-list-head { background: var(--navy); color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.hm-match-row { min-height: 63px; border-bottom: 1px solid var(--line); }
.hm-match-row:last-child { border-bottom: 0; }
.hm-match-row > div:first-child, .hm-review-card > div { display: grid; gap: 3px; min-width: 0; }
.hm-match-row small, .hm-review-card small { color: var(--muted); font-size: 11px; }
.hm-source { width: fit-content; max-width: 100%; padding: 4px 8px; border-radius: 999px; overflow: hidden; font-size: 10px; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.hm-source.prior { background: var(--ready-bg); color: var(--ready-fg); }
.hm-source.schwab { background: #EDF1FB; color: #375B9D; }
.hm-source.similar { background: #EBF5FF; color: #4E6388; }
.hm-source.none { background: #EEEFF2; color: #5E6475; }
.hm-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.hm-footer > div { display: flex; align-items: center; gap: 12px; }
.hm-footer > div > span { color: var(--muted); font-size: 12px; }
.hm-review-list { display: grid; gap: 10px; }
.hm-review-card { display: grid; grid-template-columns: minmax(230px, 1.1fr) minmax(230px, 1fr) minmax(250px, 1fr); gap: 18px; align-items: center; padding: 16px; }
.hm-review-card.reviewed { background: #f8fbf9; border-color: #bad1c1; }
.hm-review-card > div:nth-child(2) > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.hm-review-actions { grid-template-columns: auto minmax(150px, 1fr); display: grid !important; align-items: center; }
.hm-review-actions select { width: 100%; }
.hm-empty, .hm-success { padding: 42px; text-align: center; }
.hm-empty > svg, .hm-success > span { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--ready-bg); color: var(--ready-fg); }
.hm-success > span svg { width: 22px; height: 22px; }
.hm-success p { color: var(--muted); }
.hm-toolbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 4px 14px rgba(22, 37, 72, .06); }
.hm-toolbar > div { display: flex; align-items: center; gap: 8px; }
.hm-toolbar > div:first-child button { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-weight: 700; }
.hm-toolbar select { min-width: 205px; }
.hm-organize { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(600px, 2.25fr); gap: 12px; align-items: start; }
.hm-unassigned { overflow: hidden; border-color: #A6BBE2; }
.hm-household-board { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 12px; }
.hm-household-column { overflow: hidden; }
.hm-column-head { min-height: 65px; padding: 13px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 1px solid var(--line); background: #f7f8f8; }
.hm-column-head b, .hm-column-head small { display: block; }
.hm-column-head small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.hm-column-head > button { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 11px; font-weight: 800; }
.hm-drop-body { min-height: 150px; padding: 9px; }
.hm-drop-body:has(.hm-account-card.dragging) { background: #F0F3FA; }
.hm-drop-empty { min-height: 120px; display: grid; place-items: center; border: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.hm-account-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 7px; align-items: center; min-height: 64px; margin-bottom: 7px; padding: 9px; border: 1px solid var(--line); background: var(--surface); cursor: grab; box-shadow: 0 2px 5px rgba(22, 37, 72, .04); }
.hm-account-card:last-child { margin-bottom: 0; }
.hm-account-card.selected { border-color: var(--brand); background: #F6F7FC; }
.hm-account-card.dragging { opacity: .45; }
.hm-account-card input { width: 15px; height: 15px; accent-color: var(--brand); }
.hm-account-card > div { min-width: 0; }
.hm-account-card b, .hm-account-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-account-card small { color: var(--muted); font-size: 10px; }
.hm-account-card strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.hm-dialog { max-width: 450px; }
.hm-reconcile { overflow: hidden; }
.hm-reconcile-head, .hm-reconcile-row { display: grid; grid-template-columns: minmax(220px, 1.15fr) minmax(180px, .9fr) 130px 105px 90px; gap: 12px; align-items: center; padding: 11px 15px; }
.hm-reconcile-head { background: var(--navy); color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.hm-reconcile-row { min-height: 58px; border-bottom: 1px solid var(--line); }
.hm-reconcile-row > div:first-child { display: grid; gap: 2px; }
.hm-reconcile-row small { color: var(--muted); font-size: 10px; }
.hm-reconcile-row > strong { text-align: right; font-size: 12px; }
.hm-reconcile-total { display: flex; justify-content: flex-end; gap: 35px; padding: 15px; background: #f7f8f8; }
.hm-reconcile-total span { color: var(--muted); }
.danger-text { color: #a33a3a; }

@media (max-width: 950px) {
  .hm-steps b { display: none; }
  .hm-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-review-card { grid-template-columns: 1fr 1fr; }
  .hm-review-actions { grid-column: 1 / -1; }
  .hm-organize { grid-template-columns: 1fr; }
  .hm-reconcile-head, .hm-reconcile-row { grid-template-columns: minmax(190px, 1fr) minmax(160px, .8fr) 120px 90px; }
  .hm-reconcile-head > :nth-child(4), .hm-reconcile-row > :nth-child(4) { display: none; }
}
@media (max-width: 620px) {
  .stage-intro { align-items:flex-start; flex-direction:column; }
  .hm-stage { min-height: 350px; padding: 24px 16px; }
  .hm-import-actions, .hm-footer, .hm-footer > div { align-items: stretch; flex-direction: column; width: 100%; }
  .hm-import-actions .btn, .hm-footer .btn { width: 100%; }
  .hm-list-head { display: none; }
  .hm-match-row { grid-template-columns: 1fr; gap: 7px; }
  .hm-review-card { grid-template-columns: 1fr; }
  .hm-review-actions { grid-column: auto; grid-template-columns: 1fr; }
  .hm-toolbar { position: static; align-items: stretch; flex-direction: column; }
  .hm-toolbar > div { width: 100%; flex-wrap: wrap; }
  .hm-toolbar select { flex: 1; min-width: 160px; }
  .hm-household-board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .hm-household-column { flex: 0 0 calc(100vw - 48px); scroll-snap-align: start; }
  .hm-reconcile-head { display: none; }
  .hm-reconcile-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .hm-reconcile-row > :nth-child(2) { grid-column: 1; }
  .hm-reconcile-row > :nth-child(3) { grid-column: 2; grid-row: 1; }
  .hm-reconcile-row > :nth-child(5) { grid-column: 2; grid-row: 2; }
  .onboarding-run-picker { align-items: stretch; flex-direction: column; }
  .onboarding-run-picker select, .onboarding-run-picker .btn { width: 100%; min-width: 0; }
}

/* Support access: customer Settings panel + Help drawer, and staff support sessions */
.support-access-panel .card-title-row{align-items:flex-start;gap:16px}
.support-access-panel .f-sec-t{margin-top:18px}
.support-pin-issued{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 16px;padding:18px 20px;border:1px solid #728EC1;border-left:4px solid #728EC1;border-radius:var(--radius-md);background:#F3F9FF}
.support-pin-issued .eyebrow{display:block;margin-bottom:6px}
.support-pin-code{display:block;font:700 34px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.14em;color:#364562;font-variant-numeric:tabular-nums}
.support-pin-issued>div:last-child{text-align:right}.support-pin-issued b,.support-pin-issued small{display:block}.support-pin-issued b{color:#364562}.support-pin-issued small{margin-top:4px;max-width:280px;color:#485979}
.support-session-list>div{display:grid;grid-template-columns:1.6fr 1fr auto;gap:14px;align-items:center;padding:12px 0;border-top:1px solid var(--border)}
.support-session-list b,.support-session-list small{display:block}.support-session-list small{margin-top:2px;color:var(--ink-500)}
.support-access-history{padding:0}.support-access-history>div{text-transform:none;grid-template-columns:1.8fr .9fr auto}.support-access-history>div:first-child{border-top:0}
.staff-session-cell{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.staff-session-cell small{color:var(--ink-500)}.staff-session-cell .table-link{margin:0}
.support-drawer .support-access-panel{padding:16px;margin-top:14px}.support-drawer .support-access-panel h2{font-size:17px}.support-drawer .support-pin-code{font-size:28px}
@media(max-width:900px){.support-pin-issued{flex-direction:column;align-items:flex-start}.support-pin-issued>div:last-child{text-align:left}.support-session-list>div,.support-access-history>div{grid-template-columns:1fr}}

/* Add an unmatched Schwab row to billing from the run drawer */
.unmatched-add { margin: 6px 0 12px 18px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-alt); display: grid; gap: 10px; }
.unmatched-add-head { display: grid; gap: 3px; }
.unmatched-add-head b { font-size: 13px; color: var(--ink); }
.unmatched-add-head small { font-size: 11px; line-height: 1.45; color: var(--muted); }
.unmatched-add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.unmatched-add-grid .fld { padding: 0; }
.unmatched-add-grid label.check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.unmatched-add-actions { display: flex; gap: 8px; }
.exc button.primary { color: var(--accent-ink); font-weight: 600; }


/* Onboarding cannot lock (2026-09-09) */
.onboarding-blocker-callout, .onboarding-notice { margin: 14px 0 0; }
.onboarding-blocker-callout .table-link { padding: 0; border: 0; background: transparent; color: var(--accent); font: 700 12px var(--font-sans); cursor: pointer; }
.onboarding-blocker-rest { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12px; }
.onboarding-blocker-rest li b { font-size: 12px; }
.onboarding-blocker-rest li .table-link { margin-left: 6px; }
.onboarding-fix-list { display: grid; gap: 10px; margin: 0 0 16px; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.onboarding-fix-row { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(0, 2.2fr) auto; gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--review-dot); background: var(--surface-alt); }
.onboarding-fix-account { display: grid; gap: 3px; }
.onboarding-fix-account b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.onboarding-fix-account small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.onboarding-fix-missing { font-size: 11px; font-weight: 700; color: var(--review-fg); }
.onboarding-fix-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }
.onboarding-fix-fields .fld { padding: 0; }
.onboarding-fix-fields label.check { display: flex; align-items: center; gap: 6px; min-height: 34px; font-size: 12px; color: var(--ink); }
.onboarding-fix-actions { display: grid; gap: 6px; justify-items: end; align-self: end; }
.onboarding-fix-error { max-width: 260px; color: var(--hold-fg); font-size: 11px; line-height: 1.4; text-align: right; }
.onboarding-logo-nudge { border-bottom: 0; }
.onboarding-undo { margin-top: 16px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.onboarding-undo-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.onboarding-undo-actions .drop-zone { margin: 0; }
.onboarding-undo-startover { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--hold-fg); background: var(--surface-alt); }
.onboarding-undo-startover b { font-size: 13px; color: var(--ink); }
.onboarding-undo-startover p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.staff-blockers { display: grid; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.staff-blockers-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.staff-blockers-head > div { display: grid; gap: 3px; }
.staff-blockers-head b { font-size: 14px; color: var(--ink); }
.staff-blockers-head small { font-size: 11px; color: var(--muted); }
.staff-blocker-list { display: grid; border: 1px solid var(--line); }
.staff-blocker-list > div { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.staff-blocker-list > div:last-child { border-bottom: 0; }
.staff-blocker-list > div.staff { background: var(--surface-alt); }
.staff-blocker-list > div > div { display: grid; gap: 4px; justify-items: start; }
.staff-blocker-list b { font-size: 13px; color: var(--ink); }
.staff-blocker-list small { font-size: 11px; color: var(--muted); line-height: 1.45; }
.staff-blocker-milestone { display: grid; place-items: center; width: 34px; height: 24px; border: 1px solid var(--border-strong); border-radius: 12px; font-size: 11px; font-weight: 800; color: var(--ink-500); }
.staff-blocker-owner { padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--review-bg); color: var(--review-fg); }
.staff-blocker-owner.staff { background: var(--ready-bg); color: var(--ready-fg); }
.staff-blocker-items { display: grid; gap: 2px; margin-top: 2px; }
.staff-blocker-items .table-link, .staff-inline-upload .btn { cursor: pointer; }
.staff-blocker-items .table-link { padding: 0; border: 0; background: transparent; color: var(--accent); font: 700 12px var(--font-sans); text-align: left; }
.staff-inline-upload { display: inline-block; margin-top: 4px; }
.staff-inline-upload input[hidden] { display: none; }
.staff-remediation { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--hold-fg); background: var(--surface-alt); }
.staff-remediation > div { display: grid; gap: 3px; }
.staff-remediation b { font-size: 12px; color: var(--ink); }
.staff-remediation small { font-size: 11px; color: var(--muted); line-height: 1.45; }
.staff-edit-form { margin-left: 0; }
/* Staff exits beside each onboarding blocker (registry-backed, 2026-09-14). */
.staff-exit-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.staff-exit-controls .staff-blocker-items { width: 100%; }
.staff-exit-none, .staff-exit-role { font-style: italic; }
.staff-exit-screen { width: 100%; margin: 8px 0 2px; box-sizing: border-box; }
.staff-exit-screen .fld.full { grid-column: 1 / -1; }
.staff-exit-screen .fld input { width: 100%; box-sizing: border-box; }
.staff-exit-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
.staff-exit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.staff-exit-table th { text-align: left; padding: 6px 8px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.staff-exit-table td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink); }
.staff-exit-table td small { display: block; }
.staff-exit-table tr:last-child td { border-bottom: 0; }
.staff-exit-households summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--accent); }
.staff-exit-households ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.staff-exit-rows { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); background: var(--surface); }
.staff-exit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.staff-exit-row:last-child { border-bottom: 0; }
.staff-exit-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.staff-exit-row b { font-size: 12px; color: var(--ink); }
.staff-exit-row span, .staff-exit-row small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.staff-exit-row.conflict { border-left: 3px solid var(--review-fg); }
.staff-exit-row-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.staff-exit-row-act select { max-width: 240px; font: 12px var(--font-sans); padding: 4px 6px; }
.staff-exit-result { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--ready-fg); background: var(--ready-bg); }
.staff-exit-result.bad { border-left-color: var(--review-fg); background: var(--review-bg); }
.staff-exit-result b { font-size: 12px; color: var(--ink); }
.staff-exit-result small { font-size: 11px; color: var(--ink-500, var(--muted)); line-height: 1.45; }
.staff-exit-actions { margin-top: 0; }
/* Last-resort staff exits (2026-09-14): a step the customer normally does itself. They look
   different from the routine overrides: a warning edge on the blocker row, a dashed control, and
   a banner plus a "the firm cannot" tick on the screen. */
.staff-blocker-list > div.last-resort { background: var(--review-bg); box-shadow: inset 3px 0 0 var(--hold-fg); }
.staff-blocker-list small.staff-last-resort-note { color: var(--hold-fg); }
.staff-blocker-list small.staff-last-resort-note b { font-size: inherit; color: inherit; }
.btn.staff-last-resort-control { border: 1px dashed var(--hold-fg); background: var(--surface); color: var(--hold-fg); }
.btn.staff-last-resort-control:hover { box-shadow: inset 0 0 0 1px var(--hold-fg); }
.staff-last-resort-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--hold-fg); border-left-width: 3px; background: var(--hold-bg); font-size: 12px; line-height: 1.45; color: var(--ink); }
.staff-last-resort-tick { width: 100%; box-sizing: border-box; border-color: var(--hold-fg); }
.staff-exit-screen label.staff-last-resort-tick { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; color: var(--ink); }
.staff-exit-screen .staff-last-resort-tick input { display: block; width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; padding: 0; accent-color: var(--hold-fg); }
.staff-first-draft-note { font-size: 12px; line-height: 1.45; }
.staff-first-draft-note b { font-size: inherit; }
.staff-exit-screen .staff-last-resort-submit { background: var(--hold-fg); border-color: var(--hold-fg); }
.staff-exit-open-steps { margin: 4px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.staff-first-draft-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 14px; width: 100%; margin: 0; }
.staff-first-draft-figures div { display: grid; gap: 1px; }
.staff-first-draft-figures dt { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.staff-first-draft-figures dd { margin: 0; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.staff-statement-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; width: 100%; }
.staff-statement-pick select { max-width: 360px; font: 12px var(--font-sans); padding: 4px 6px; }
.staff-statement-frame { display: grid; gap: 6px; width: 100%; max-height: 560px; overflow: auto; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); background: var(--surface-alt); }
/* The firm is told what ApexFee did as a last resort, beside the step concerned. */
.staff-action-notice { display: grid; gap: 6px; }
.comp-run-callout.staff-action-notice.quiet { border-color: var(--line); background: var(--surface-alt); color: var(--ink); }
.staff-action-notice .og-notice-actions { display: flex; gap: 10px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  .staff-exit-row { grid-template-columns: 1fr; }
  .staff-exit-row-act { justify-content: flex-start; }
  .staff-blocker-list > div { grid-template-columns: 1fr; }
}
.staff-stall-summary { margin: 12px 16px 0; }
.staff-stall-flag { display: block; margin-top: 3px; color: var(--hold-fg) !important; font-weight: 700; }
@media(max-width:900px) {
  .onboarding-fix-row, .onboarding-undo-actions { grid-template-columns: 1fr; }
  .onboarding-fix-actions { justify-items: start; }
  .staff-blockers-head, .staff-remediation { flex-direction: column; align-items: flex-start; }
}

/* C1: household arrows in the heading ink, as a real button; Expand all / Collapse all */
tr.f-group .gtw.gtw-btn { padding: 2px; border: 0; border-radius: 4px; background: none; color: var(--ink-900); cursor: pointer; }
tr.f-group .gtw.gtw-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.dark tr.f-group .gtw.gtw-btn { color: var(--ink-100, #E8EAF2); }
.f-expand-all { display: inline-flex; gap: 6px; }
.f-expand-all .f-chip:disabled { opacity: .5; cursor: default; }
/* S6 (2026-09-24): unsaved invoice presentation changes keep their Save bar in view. */
.invoice-branding-actions-sticky { position: sticky; bottom: 0; z-index: 5; margin: 0 -4px; padding: 12px 4px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(16, 24, 40, .08); }
.proto-card.invoice-branding-settings { overflow: clip; }

/* A9 (Astra RC3): between 901 and 1100 px the signed-in name and firm do not fit beside the navigation; the avatar stays. */
@media (max-width: 1100px) { .user-menu .user-meta, .user-menu > svg { display: none; } .user-menu { padding-right: 4px; } }
@media (min-width: 901px) and (max-width: 1100px) { .topbar { gap: 24px; } }
.household-change-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--review-dot); background: var(--review-bg); color: var(--review-fg); font-size: 13px; line-height: 1.5; }
