/* webapp/css/app.css - the web app's own styles. Tokens only (lib/tokens.css + lib/tokens-pages.css): no raw colours.
   One app shell (232px sidebar, 56px top bar), one purple accent for in-product actions, yellow only for "pay / choose a plan".
   Light and dark follow the tokens. Desktop first; at 390px the sidebar becomes a drawer and tables become stacked rows. */

/* Web-app-only values, built from the shared tokens (the token file belongs to the extension). */
:root {
  --wa-side-w: 232px;
  --wa-top-h: 56px;
  --wa-demo-h: 32px;   /* the demo strip above the shell (one line on wide screens) */
  --wa-row-h: 40px;
  --wa-radius: 10px;
  --wa-radius-card: 14px;
  --wa-radius-tile: 20px;
  --wa-subtle: color-mix(in srgb, var(--bpd-paper) 70%, var(--bpd-card));
  --wa-hover: color-mix(in srgb, var(--bpd-purple-soft) 70%, transparent);
  --wa-row-hover: var(--bpd-yellow-soft);
  --wa-yellow-hover: color-mix(in srgb, var(--bpd-yellow) 88%, var(--bpd-ink));
  --wa-line-strong: color-mix(in srgb, var(--bpd-line) 60%, var(--bpd-field));
  --wa-ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bpd-paper); color: var(--bpd-ink);
  font-family: var(--bpd-f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--bpd-f-head); line-height: 1.2; margin: 0; color: var(--bpd-ink); }
h1 { font-size: 26px; letter-spacing: -0.015em; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -0.005em; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 8px; }
a { color: var(--bpd-purple-text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.muted, .sub, .hint { color: var(--bpd-muted); }
.sub { margin: 4px 0 0; }
.hint { font-size: 13px; }
.center { text-align: center; }
.strong { font-weight: 600; color: var(--bpd-ink); }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: block; }
.eyebrow { font-family: var(--bpd-f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--bpd-muted); margin: 0 0 6px; }
kbd { font-family: var(--bpd-f-mono); font-size: 12px; }

/* Focus: one clear ring everywhere */
:focus-visible { outline: 2px solid var(--bpd-focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--bpd-card); color: var(--bpd-ink); padding: 8px 12px; border: 1px solid var(--bpd-field); border-radius: 8px; z-index: 80; }
.skip-link:focus { top: 8px; }
main:focus, h1:focus { outline: none; }
h1:focus-visible { outline: 2px solid var(--bpd-focus); outline-offset: 4px; }

/* ── Demo strip: always there, quiet ─────────────────────────────────── */
.demo-banner {
  display: flex; align-items: center; justify-content: center; gap: 6px 14px; flex-wrap: wrap;
  padding: 6px 16px; background: var(--bpd-purple-soft); color: var(--bpd-purple-text);
  font-size: 13px; border-bottom: 1px solid var(--bpd-line); position: relative; z-index: 45;
}
/* Wide screens: the strip is one line and sticks, and the sidebar and top bar stick just under it. Before, the sidebar was
   100vh - 32px tall at top 0, so once the strip scrolled away a 32px gap of page showed under the plan block. */
body[data-mode="demo"] .demo-banner { position: sticky; top: 0; height: var(--wa-demo-h); flex-wrap: nowrap; white-space: nowrap; overflow: hidden; padding-top: 0; padding-bottom: 0; }
.demo-banner strong { font-weight: 700; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bpd-purple); flex: none; }
.banner-link { color: var(--bpd-purple-text); font-size: 13px; font-weight: 600; }

/* ── App shell ───────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--wa-side-w) minmax(0, 1fr); min-height: 100vh; }
body[data-mode="demo"] .shell { min-height: calc(100vh - var(--wa-demo-h)); }
.frame { min-width: 0; display: flex; flex-direction: column; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 12px;
  background: var(--bpd-card); border-right: 1px solid var(--bpd-line);
}
body[data-mode="demo"] .side { top: var(--wa-demo-h); height: calc(100vh - var(--wa-demo-h)); }
.side-top {   /* the left end of the purple header band: logo + "BenchPilot" in white, the same height as the top bar */
  flex: none; display: flex; align-items: center; justify-content: space-between; height: var(--wa-top-h);
  margin: -14px -12px 6px; padding: 0 18px; background: var(--bpd-purple); color: var(--bpd-on-purple);
}
.side-top .brand { color: var(--bpd-on-purple); }
.side-top .icon-btn { color: var(--bpd-on-purple); }
.side-top .icon-btn:hover { background: var(--bpd-stat-bg); color: var(--bpd-on-purple); }
.brand-link { text-decoration: none; border-radius: 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--bpd-f-head); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--bpd-ink); text-decoration: none; }
.brand-mark { display: block; border-radius: 8px; }
.icon-btn.side-close { display: none; }

/* Workspace switcher */
.ws-wrap { position: relative; }
.ws {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--wa-radius);
  background: var(--wa-subtle); border: 1px solid var(--bpd-line); color: var(--bpd-ink); font: inherit; text-align: left; cursor: pointer;
}
.ws:hover { border-color: var(--wa-line-strong); }
.ws-mark {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  background: var(--bpd-purple); color: var(--bpd-on-purple); font-family: var(--bpd-f-head); font-weight: 700; font-size: 13px;
}
.ws-mark-sm { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.ws-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ws-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-role { font-size: 12px; color: var(--bpd-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chev { color: var(--bpd-muted); }
.ws-pop {
  /* as wide as the sidebar: the sidebar scrolls (overflow auto), so a wider pop-up was cut off at its right edge */
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 6px;
  background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 12px; box-shadow: var(--bpd-shadow);
}
.ws-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--bpd-ink); text-decoration: none; min-width: 0; }
.ws-item:hover { background: var(--wa-hover); }
/* In the pop-up a name wraps rather than being cut to "Perso..."; a lock badge drops to its own line under the name. */
.ws-pop .ws-item { flex-wrap: wrap; row-gap: 4px; }
.ws-pop .ws-text { flex: 1 1 100px; }
.ws-pop .ws-name, .ws-pop .ws-role { white-space: normal; }
.ws-pop .ws-item > .lock-badge { margin-left: 40px; }
.ws-item.is-current { background: var(--bpd-purple-soft); }
.ws-item.is-create .ws-mark { background: var(--bpd-yellow); color: var(--bpd-on-yellow); }
.ws-item > .ico { color: var(--bpd-purple-text); }
.ws-mark .ico { color: inherit; }
.demo-role { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 12px; color: var(--bpd-muted); font-weight: 600; }
.demo-role select { min-height: 30px; padding: 2px 8px; font-size: 13px; flex: 1; }

/* Nav */
.side-nav { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-label { margin: 0 0 4px; padding: 0 10px; font-family: var(--bpd-f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bpd-muted); }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: 8px;
  color: var(--bpd-ink); text-decoration: none; font-weight: 500; font-size: 14px; position: relative;
}
.nav-link .ico { color: var(--bpd-muted); }
.nav-link:hover { background: var(--wa-hover); }
.nav-link[aria-current="page"] { background: var(--bpd-purple-soft); color: var(--bpd-purple-text); font-weight: 600; }
.nav-link[aria-current="page"] .ico { color: var(--bpd-purple-text); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bpd-purple); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--bpd-purple); color: var(--bpd-on-purple); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-count { font-family: var(--bpd-f-mono); font-size: 12px; color: var(--bpd-muted); font-variant-numeric: tabular-nums; }
.nav-link .lock-badge { margin-left: auto; }

/* Sidebar foot: plan block */
.side-foot { margin-top: auto; padding-top: 12px; }
.plan-block { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--wa-subtle); border: 1px solid var(--bpd-line); }
.plan-block-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; font-weight: 700; font-size: 14px; }
.plan-block-state { font-weight: 600; font-size: 12px; color: var(--bpd-muted); text-align: right; }
.plan-block-warn { background: var(--bpd-warn-soft); border-color: var(--bpd-warn-soft); }
.plan-block-warn .plan-block-state { color: var(--bpd-warn); }
.plan-block-link { font-size: 13px; font-weight: 600; }

/* Meter (pilot days, seats) */
.meter { height: 6px; border-radius: 999px; background: var(--bpd-line); overflow: hidden; }
.meter-sm { height: 4px; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--bpd-purple); }
.plan-block-warn .meter-fill { background: var(--bpd-warn); }

/* Top bar */
.topbar {   /* the purple header band (the extension's drawer and pages have the same one): white text, white icon buttons */
  position: sticky; top: 0; z-index: 20; height: var(--wa-top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: var(--bpd-purple); color: var(--bpd-on-purple);
}
.shell .topbar :focus-visible, .shell .side-top :focus-visible { outline-color: var(--bpd-focus-on-purple); }   /* white ring inside the band */
body[data-mode="demo"] .topbar { top: var(--wa-demo-h); }
.top-title { margin: 0; font-family: var(--bpd-f-head); font-weight: 700; font-size: 16px; color: var(--bpd-on-purple); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-fill { flex: 1; }
.icon-btn.menu-btn { display: none; }
.top-action { flex: none; }
/* On the band the in-product action is a white button with purple text (a purple fill would vanish into the band). */
.topbar .btn-primary { background: var(--bpd-on-purple); color: var(--bpd-purple-hover); box-shadow: none; }
.topbar .btn-primary:hover { background: var(--bpd-on-purple-2); }

/* Plan chip on the band: the extension's chip ("FREE · 2/3"), a mono caps pill on the darker plate; yellow when it is time to pay. */
.plan-chip {
  flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--bpd-stat-bg); color: var(--bpd-on-purple); font: 600 11px/1 var(--bpd-f-mono); letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
.plan-chip:hover { background: var(--bpd-stat-bg-hover); }
.plan-chip-warn, .plan-chip-warn:hover { background: var(--bpd-yellow); color: var(--bpd-on-yellow); }

/* Search */
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--bpd-on-purple-2); pointer-events: none; z-index: 1; }
/* The search box sits on the band: a darker plate with white text; once focused it is a normal white field with the one ring. */
.search .search-input { min-height: 36px; padding: 6px 36px 6px 34px; background: var(--bpd-stat-bg); border-color: transparent; color: var(--bpd-on-purple); border-radius: 9px; font-size: 14px; }
.search .search-input::placeholder { color: var(--bpd-on-purple-2); }
.search .search-input:hover { border-color: var(--bpd-stat-bg-hover); }
.search .search-input:focus { background: var(--bpd-card); color: var(--bpd-ink); }
.search .search-input:focus::placeholder { color: var(--bpd-muted); }
.search:focus-within .search-ico { color: var(--bpd-muted); }
.search-key { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0 6px; border: 1px solid var(--bpd-stat-bg-hover); border-radius: 5px; color: var(--bpd-on-purple-2); background: transparent; line-height: 18px; }
.search:focus-within .search-key { border-color: var(--bpd-line); color: var(--bpd-muted); }
.search-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none; max-height: 360px; overflow: auto;
  background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 12px; box-shadow: var(--bpd-shadow);
}
.search-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.search-item[aria-selected="true"], .search-item:hover { background: var(--bpd-purple-soft); }
.search-kind { grid-row: span 2; align-self: center; font-family: var(--bpd-f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--bpd-muted); }
.search-label { font-weight: 600; font-size: 14px; }
.search-sub { font-size: 12px; color: var(--bpd-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-none { padding: 10px; color: var(--bpd-muted); font-size: 14px; }

/* Account menu */
.account { position: relative; flex: none; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--bpd-on-purple); font: inherit; font-size: 14px; cursor: pointer; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--bpd-stat-bg); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--bpd-stat-bg); color: var(--bpd-on-purple); font-weight: 700; font-size: 12px; }
.avatar-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 270px; padding: 6px;
  background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 12px; box-shadow: var(--bpd-shadow);
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--bpd-line); }
.menu-head p { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-head .muted { font-size: 13px; }
.menu-group { padding: 6px 0; border-bottom: 1px solid var(--bpd-line); display: flex; flex-direction: column; gap: 1px; }
.menu-group:last-child { border-bottom: 0; padding-bottom: 0; }
.menu-label { margin: 2px 10px 6px; font-family: var(--bpd-f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bpd-muted); }
.menu-group .segmented { margin: 0 8px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--bpd-ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item .ico { color: var(--bpd-muted); }
.menu-item:hover { background: var(--wa-hover); }

/* Scrim (phone drawer) */
.scrim { position: fixed; inset: 0; z-index: 55; background: var(--bpd-scrim); }

.frame main#main { padding: 28px 32px 72px; min-width: 0; width: 100%; max-width: 1360px; }
.frame main#main.book-gate { max-width: 720px; margin: 0 auto; }
.page-narrow { max-width: 760px; }

/* ── Banners above a screen ──────────────────────────────────────────── */
.billing-banner { margin: 0 0 20px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 12px; border: 1px solid var(--bpd-line); }
.banner-warn { background: var(--bpd-warn-soft); border-color: color-mix(in srgb, var(--bpd-warn) 30%, transparent); color: var(--bpd-ink); }
.banner-ico { flex: none; color: var(--bpd-warn); display: grid; }
.banner-text { flex: 1; margin: 0; font-size: 14px; }
.banner-text strong { color: var(--bpd-warn); }

/* ── Layout helpers ──────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack > div:empty { display: none; }
.stack-tight { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.resume-body > .row-end { margin-top: 4px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cols-wide-left { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-bottom: 4px; }
.page-head .sub { font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }

/* ── Cards and tiles ─────────────────────────────────────────────────── */
.card { background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: var(--wa-radius-card); padding: 20px; box-shadow: var(--bpd-card-shadow); min-width: 0; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-sub { margin: 4px 0 0; color: var(--bpd-muted); font-size: 14px; }
.card-danger { border-color: color-mix(in srgb, var(--bpd-danger) 45%, var(--bpd-line)); }
.card-danger > h2 { color: var(--bpd-danger); }
.card-pinned { border-color: var(--bpd-purple); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--bpd-card);
  border: 1px solid var(--bpd-line); border-radius: var(--wa-radius-card); box-shadow: var(--bpd-card-shadow); color: var(--bpd-ink); text-decoration: none;
  transition: border-color .15s, transform .15s var(--wa-ease);
}
a.tile:hover { border-color: var(--bpd-purple); transform: translateY(-1px); }
.tile-num { font-family: var(--bpd-f-head); font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--bpd-ink); font-variant-numeric: tabular-nums; }
.tile-label { font-weight: 600; font-size: 14px; }
.tile-hint { font-size: 13px; color: var(--bpd-muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--bpd-muted); }
.facts dd { margin: 0; }

/* Empty states */
.empty { display: flex; align-items: center; gap: 8px; color: var(--bpd-muted); margin: 0; padding: 14px 4px; font-size: 14px; }
.empty .ico { color: var(--bpd-muted); }
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 20px;
  border: 1px dashed var(--wa-line-strong); border-radius: var(--wa-radius-card); background: var(--bpd-card);
}
.card .empty-state { border: 0; padding: 24px 12px; }
.empty-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--bpd-purple-soft); color: var(--bpd-purple-text); margin-bottom: 6px; }
.empty-title { margin: 0; font-family: var(--bpd-f-head); font-weight: 700; font-size: 17px; color: var(--bpd-ink); }
.empty-text { margin: 0; max-width: 46ch; color: var(--bpd-muted); }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Locks: shown, not hidden (brief C2) */
.lock-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; flex: none;
  background: var(--bpd-purple-soft); color: var(--bpd-purple-text); font-family: var(--bpd-f-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; line-height: 18px;
}
.lock-note { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--bpd-line); background: var(--wa-subtle); }
.lock-text { margin: 0; flex: 1 1 260px; font-size: 14px; color: var(--bpd-ink); }
.lock-who { font-size: 13px; color: var(--bpd-muted); }
.lock-note-danger { background: var(--bpd-danger-soft); border-color: color-mix(in srgb, var(--bpd-danger) 35%, transparent); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--wa-radius); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background-color .12s, border-color .12s, box-shadow .12s; white-space: nowrap;
}
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn-lg { min-height: 46px; font-size: 15px; }
.btn-primary { background: var(--bpd-purple); color: var(--bpd-on-purple); box-shadow: 0 1px 0 color-mix(in srgb, var(--bpd-ink) 15%, transparent); }
.btn-primary:hover { background: var(--bpd-purple-hover); }
.btn-primary:focus-visible { outline-color: var(--bpd-focus); }
.btn-money { background: var(--bpd-yellow); color: var(--bpd-on-yellow); }
.btn-money:hover { background: var(--wa-yellow-hover); }
.btn-secondary { background: var(--bpd-card); color: var(--bpd-ink); border-color: var(--wa-line-strong); }
.btn-secondary:hover { background: var(--wa-hover); border-color: var(--bpd-field); }
.btn-ghost { background: transparent; color: var(--bpd-purple-text); }
.btn-ghost:hover { background: var(--bpd-purple-soft); }
.btn-danger { background: var(--bpd-danger); color: var(--bpd-card); }
.btn-danger-ghost { background: transparent; color: var(--bpd-danger); }
.btn-danger-ghost:hover { background: var(--bpd-danger-soft); }
.btn-link { background: none; border: 0; min-height: 0; padding: 0; color: var(--bpd-purple-text); text-decoration: underline; font-weight: 500; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--bpd-muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--wa-hover); color: var(--bpd-ink); }

/* Segmented control (billing period, theme) */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--wa-subtle); border: 1px solid var(--bpd-line); align-self: flex-start; }
.seg-btn { border: 0; background: transparent; color: var(--bpd-muted); font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--bpd-card); color: var(--bpd-ink); box-shadow: var(--bpd-card-shadow); }
.segmented-sm { display: flex; }
.segmented-sm .seg-btn { flex: 1; font-size: 13px; padding: 5px 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Forms ───────────────────────────────────────────────────────────── */
/* One vertical rhythm inside every form: fields, fieldsets, checkboxes and the save row were stacked with no gap. */
form.form { display: flex; flex-direction: column; gap: 14px; }
form.form > .row-end { margin-top: 2px; }
.fieldset { display: flex; flex-direction: column; gap: 6px; }
.fieldset .hint { margin: 0; }
.form .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .fieldset legend { font-weight: 600; font-size: 13px; color: var(--bpd-ink); }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check label { font-weight: 500; font-size: 14px; }
.field.check input { width: 18px; height: 18px; accent-color: var(--bpd-purple); }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; font-size: 14px; color: var(--bpd-ink); background: var(--bpd-card);
  border: 1px solid var(--wa-line-strong); border-radius: 9px; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--bpd-field); }
/* Fields: ONE purple focus ring on click and on Tab (the extension's rule, lib/pages.css #366): a purple edge and a soft halo, never a
   second dark outline around it. Checkboxes and radios keep the keyboard ring. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--bpd-purple); box-shadow: 0 0 0 1px var(--bpd-purple), 0 0 0 4px var(--bpd-purple-soft); }
::placeholder { color: var(--bpd-muted); opacity: .8; }
textarea { resize: vertical; }
select:disabled, input:disabled, textarea:disabled { background: var(--wa-subtle); color: var(--bpd-muted); }
.fieldset { border: 1px solid var(--bpd-line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; }
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 12px; border-radius: var(--wa-radius-card);
  background: var(--bpd-card); border: 1px solid var(--bpd-line);
}
.filters .field label { font-size: 12px; color: var(--bpd-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--bpd-f-mono); font-weight: 500; }
.filters input, .filters select { min-height: 36px; padding: 6px 10px; }
.filters .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A checkbox in the filter bar reads as a sentence, sits on the inputs' line, and is not an uppercase field label. */
.filters .field.check { align-self: start; margin-top: 23px; min-height: 36px; }
.filters .field.check label { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--bpd-ink); white-space: normal; }
.inline-form { margin-top: 14px; }
.stage-select { min-width: 150px; min-height: 34px; padding: 4px 8px; }

/* ── Chips and notes ─────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 20px; }
.chip { max-width: 100%; }
.chip-long { white-space: normal; line-height: 1.4; padding: 3px 10px; border-radius: 10px; }   /* a chip that holds a sentence wraps instead of widening the page */
.chip-neutral { background: var(--wa-subtle); color: var(--bpd-muted); border-color: var(--bpd-line); }
.chip-accent { background: var(--bpd-purple-soft); color: var(--bpd-purple-text); }
.chip-ok { background: var(--bpd-ok-soft); color: var(--bpd-ok); }
.chip-warn { background: var(--bpd-warn-soft); color: var(--bpd-warn); }
.chip-danger { background: var(--bpd-danger-soft); color: var(--bpd-danger); }
.note { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--bpd-line); margin: 0 0 8px; font-size: 14px; }
.note-info { background: var(--bpd-purple-soft); color: var(--bpd-purple-text); border-color: var(--bpd-purple-soft); }
.note-ok { background: var(--bpd-ok-soft); color: var(--bpd-ok); border-color: var(--bpd-ok-soft); }
.note-warn { background: var(--bpd-warn-soft); color: var(--bpd-warn); border-color: var(--bpd-warn-soft); }
.note-danger { background: var(--bpd-danger-soft); color: var(--bpd-danger); border-color: color-mix(in srgb, var(--bpd-danger) 40%, transparent); }
.hint-danger { color: var(--bpd-danger); }

/* The guard's red block */
.guard-block { background: var(--bpd-danger-soft); border: 1px solid var(--bpd-danger); border-left-width: 6px; border-radius: 10px; padding: 14px 16px; color: var(--bpd-ink); }
.guard-block h3 { color: var(--bpd-danger); margin-bottom: 6px; }
.guard-block ul { margin: 0 0 8px; padding-left: 20px; }
.guard-block .why { display: block; color: var(--bpd-muted); font-size: 13px; }
.guard-box { margin-top: 14px; }

/* ── Tables: real tables on wide screens, stacked rows on a phone ───── */
.table-wrap { overflow-x: auto; border-radius: 10px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--bpd-muted); padding: 9px 12px; white-space: nowrap;
  background: var(--wa-subtle); border-bottom: 1px solid var(--bpd-line); font-family: var(--bpd-f-mono); text-transform: uppercase; letter-spacing: .06em;
}
.tbl th:first-child { border-top-left-radius: 9px; }
.tbl th:last-child { border-top-right-radius: 9px; }
.tbl td { height: var(--wa-row-h); padding: 8px 12px; border-bottom: 1px solid var(--bpd-line); vertical-align: middle; overflow-wrap: break-word; }
.tbl th.num, .tbl th.right { text-align: right; }
.tbl td.num { font-family: var(--bpd-f-mono); font-size: 13px; }
.tbl tbody tr { transition: background-color .1s; }
.tbl tbody tr:hover { background: var(--wa-row-hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td .row-end { margin-top: 0; flex-wrap: nowrap; }
.tbl td.right:not(:empty) { width: 1%; white-space: nowrap; overflow-wrap: normal; }
.tbl td.nowrap { white-space: nowrap; }
/* Row actions are compact: a 40px button per row made every table row 56px tall. */
.tbl td .btn { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.tbl td .stage-select { min-height: 32px; }
.tbl a.strong { text-decoration: none; }
.tbl a.strong:hover { text-decoration: underline; }
.card .table-wrap { margin: 0 -8px; }
/* A list table that is not inside a card gets the card surface, so a screen's main list never sits bare on the page. */
.table-wrap:not(.card .table-wrap) { background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: var(--wa-radius-card); box-shadow: var(--bpd-card-shadow); }
.table-wrap:not(.card .table-wrap) .tbl th:first-child { border-top-left-radius: 13px; }
.table-wrap:not(.card .table-wrap) .tbl th:last-child { border-top-right-radius: 13px; }
@media (min-width: 1100px) {
  /* A table that fits its box has no inner scroll box, so the header can stick under the top bar (ui.js watchFit sets .is-fit
     from the table's real width). A wider table keeps the sideways scroll box and never pushes the page wider. */
  .table-wrap.is-fit { overflow: visible; }
  .table-wrap.is-fit .tbl thead th { position: sticky; top: var(--wa-top-h); z-index: 2; }
  body[data-mode="demo"] .table-wrap.is-fit .tbl thead th { top: calc(var(--wa-top-h) + var(--wa-demo-h)); }
}
/* Three or more row actions sit in two columns instead of one long line, so a row's actions never set the table's width. */
@media (min-width: 721px) {
  .tbl td.right .row-end:has(> :nth-child(3)) { display: grid; grid-template-columns: repeat(2, auto); justify-content: end; justify-items: stretch; gap: 4px 6px; }
}

/* ── Sign in (split layout) ──────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
body[data-mode="demo"] .auth { min-height: calc(100vh - var(--wa-demo-h)); }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 30px; letter-spacing: -0.02em; }
.auth-card .sub { margin: 0; font-size: 15px; }
.auth-card p { margin: 0; }
.auth-brand { margin-bottom: 18px; }
.auth-brand .brand { font-size: 20px; }
.auth-safe { display: flex; align-items: center; gap: 6px; }
.auth-legal { font-size: 12px; color: var(--bpd-muted); margin: 0; }
.auth-panel {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 56px 56px;
  background: var(--bpd-purple); color: var(--bpd-on-purple);
}
.auth-panel::after { content: ""; position: absolute; right: -160px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: var(--bpd-stat-bg); pointer-events: none; }
.eyebrow-on-purple { color: var(--bpd-on-purple-2); margin: 0; }
.auth-panel-title { color: var(--bpd-on-purple); font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; max-width: 18ch; position: relative; z-index: 1; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 560px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; }
.auth-points li > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--bpd-on-purple-2); }
.auth-points strong { color: var(--bpd-on-purple); font-size: 15px; }
.auth-point-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--bpd-stat-bg); color: var(--bpd-yellow); }

/* The sample-data product picture */
.mock { position: relative; z-index: 1; max-width: 560px; border-radius: 16px; overflow: hidden; background: var(--bpd-card); color: var(--bpd-ink); box-shadow: var(--bpd-shadow); font-size: 13px; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--wa-subtle); border-bottom: 1px solid var(--bpd-line); }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bpd-line); }
.mock-url { margin-left: 8px; font-family: var(--bpd-f-mono); font-size: 11px; color: var(--bpd-muted); letter-spacing: .04em; }
.mock-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mock-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-tile { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--bpd-line); border-radius: 10px; }
.mock-num { font-family: var(--bpd-f-head); font-size: 22px; font-weight: 700; line-height: 1.1; }
.mock-label { font-size: 11px; color: var(--bpd-muted); }
.mock-table { border: 1px solid var(--bpd-line); border-radius: 10px; overflow: hidden; }
.mock-row { display: grid; grid-template-columns: 1.3fr 1.1fr .9fr; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--bpd-line); }
.mock-row small { display: block; color: var(--bpd-muted); font-size: 11px; }
.mock-head { border-top: 0; background: var(--wa-subtle); font-family: var(--bpd-f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--bpd-muted); }
.mock-guard { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; background: var(--bpd-danger-soft); color: var(--bpd-ink); border-left: 4px solid var(--bpd-danger); }
.mock-guard .ico { color: var(--bpd-danger); margin-top: 1px; }

/* Older single-card pages (create workspace, join, errors) */
.signin { min-height: calc(100vh - 34px); display: grid; place-items: center; padding: 32px 16px; }
body[data-mode="live"] .signin { min-height: 100vh; }
/* A standalone page's purple header band (consultant link): the same band as the app's top bar, logo + name in white. */
.band-head { height: var(--wa-top-h); display: flex; align-items: center; padding: 0 24px; background: var(--bpd-purple); color: var(--bpd-on-purple); }
.band-head .brand { color: var(--bpd-on-purple); }
.band-head + .signin { min-height: calc(100vh - var(--wa-top-h) - 34px); }
.signin-card { width: 100%; max-width: 440px; background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 18px; padding: 32px; box-shadow: var(--bpd-shadow); display: flex; flex-direction: column; gap: 14px; }
.signin-card p { margin: 0; }
.signin-wide { max-width: 560px; }
.signin-body { display: flex; flex-direction: column; gap: 12px; }
.signin-body .form, .signin-card > .form, .auth-card .form { display: flex; flex-direction: column; gap: 12px; }
.brand-lg { font-size: 22px; margin-bottom: 8px; }
.brand-sub { color: var(--bpd-purple-text); }
.divider { display: flex; align-items: center; gap: 12px; margin: 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--bpd-line); }
.rule { border: 0; border-top: 1px solid var(--bpd-line); margin: 4px 0; width: 100%; }
.demo-offer { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.code-input { font-size: 22px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.step { color: var(--bpd-muted); font-size: 13px; font-weight: 600; margin: 0; }
.invite-rows { display: flex; flex-direction: column; gap: 10px; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 6px 10px; align-items: center; }
.invite-row .hint { grid-column: 1 / -1; margin-top: -2px; }
.team-name { padding: 3px 12px; border-radius: 999px; background: var(--bpd-purple-soft); color: var(--bpd-purple-text); font-weight: 600; font-size: 13px; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--bpd-toast-bg); color: var(--bpd-toast-text); padding: 11px 18px; border-radius: 12px; box-shadow: var(--bpd-shadow);
  max-width: min(520px, calc(100vw - 32px)); font-size: 14px; font-weight: 500; transition: opacity .18s, transform .18s var(--wa-ease); z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Plan and billing (screens/billing.js) ───────────────────────────── */
.bill-part h2 { font-size: 18px; }
.plan-now { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px 32px; align-items: start; }
.plan-now-main { display: flex; flex-direction: column; gap: 8px; }
.plan-now-main p { margin: 0; }
.plan-now-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--bpd-f-head); font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.plan-facts { margin: 0; display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--wa-subtle); border: 1px solid var(--bpd-line); }
.plan-facts > div { display: grid; gap: 4px; }
.plan-facts dt { font-family: var(--bpd-f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--bpd-muted); }
.plan-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--wa-radius-card); border: 1px solid var(--bpd-line); background: var(--bpd-card); }
.plan-card.is-current { border-color: var(--bpd-purple); box-shadow: 0 0 0 1px var(--bpd-purple); }
.plan-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-card-head h3 { font-size: 17px; margin-right: auto; }
.plan-price { margin: 0; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.plan-amount { font-family: var(--bpd-f-head); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-unit { color: var(--bpd-muted); font-size: 14px; }
.plan-sub { margin: 0; color: var(--bpd-muted); font-size: 13px; }
.plan-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list .ico { color: var(--bpd-ok); margin-top: 2px; }
.plan-cta { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.plan-cta .lock-badge { align-self: flex-start; }
.plan-ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--bpd-line); border-radius: var(--wa-radius-card); background: var(--bpd-card); overflow: hidden; }
.ladder-step { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-left: 1px solid var(--bpd-line); }
.ladder-step:first-child { border-left: 0; }
.ladder-step.is-current { background: var(--bpd-purple-soft); }
.ladder-step h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.ladder-step p { margin: 0; font-size: 14px; color: var(--bpd-muted); }
.ladder-step .ladder-where { margin: 0; font-family: var(--bpd-f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--bpd-muted); }
.fact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fact-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.fact-list .ico { color: var(--bpd-purple-text); margin-top: 2px; }

/* ── Import and requirement tags ─────────────────────────────────────── */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 32px 16px; border: 2px dashed var(--wa-line-strong); border-radius: 14px; background: var(--bpd-card); cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--bpd-purple); background: var(--bpd-purple-soft); }
#import-file:focus-visible + .dropzone { outline: 2px solid var(--bpd-purple); outline-offset: 2px; }
.plain-list { margin: 0 0 8px; padding-left: 18px; }
.plain-list li { margin: 2px 0; }
.tag-row { margin-top: 6px; }
.tag-row .chip { font-size: 12px; font-weight: 500; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.same-role { margin-top: 6px; }
.same-role summary { cursor: pointer; list-style-position: inside; }
.same-role-list { margin: 6px 0 0; padding-left: 18px; color: var(--bpd-muted); font-size: 13px; }

/* ── Team inbox ──────────────────────────────────────────────────────── */
.inbox-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.inbox-subject { font-size: 17px; overflow-wrap: anywhere; }
.inbox-card .muted, .inbox-card .hint { overflow-wrap: anywhere; margin: 4px 0; }
.mail-view { margin-top: 12px; border-top: 1px solid var(--bpd-line); padding-top: 12px; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; margin: 8px 0 0; padding: 12px; background: var(--wa-subtle); border: 1px solid var(--bpd-line); border-radius: 10px; font-family: var(--bpd-f-mono); font-size: 13px; color: var(--bpd-ink); }
.board-jobs { margin-top: 8px; }
.board-job { border-top: 1px solid var(--bpd-line); padding-top: 10px; }
.board-job .inbox-subject { font-size: 15px; }
.code-text { font-family: var(--bpd-f-mono); font-size: 14px; color: var(--bpd-ink); overflow-wrap: anywhere; user-select: all; }
.link-text { overflow-wrap: anywhere; }
.inbox-line { margin: 0; font-weight: 600; }
.today-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: -8px; font-size: 14px; }
.today-meta p { margin: 0; }
.steps summary { cursor: pointer; font-weight: 600; color: var(--bpd-ink); padding: 4px 0; }
.steps ol { margin: 6px 0 8px; padding-left: 22px; }
.steps li { margin: 4px 0; }

/* ── My book ─────────────────────────────────────────────────────────── */
.book-detail { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.book-detail dt { color: var(--bpd-muted); font-size: 13px; font-weight: 600; }
.book-detail dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.book-conflicts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.book-conflicts li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 10px; }
.book-conflicts li > span { flex: 1 1 240px; overflow-wrap: anywhere; }

/* ── Bench -> Hotlist ────────────────────────────────────────────────── */
.hl { display: flex; flex-direction: column; gap: 14px; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.hl-people { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.hl-cols { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hl-col { display: flex; align-items: center; gap: 6px; }
.hl-col label { flex: 1; display: flex; align-items: center; gap: 8px; }
.hl textarea { width: 100%; }

/* ── Matches, templates, account ─────────────────────────────────────── */
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.match-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--bpd-line); }
.match-item:first-child { border-top: 0; }
.draft-panel textarea { width: 100%; }
.draft-preview { margin: 6px 0 0; padding: 10px 12px; background: var(--wa-subtle); border: 1px solid var(--bpd-line); border-radius: 8px; font-family: var(--bpd-f-mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.placeholder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.placeholder-list code { font-family: var(--bpd-f-mono); color: var(--bpd-purple-text); }
.del-steps { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 12px; }
.del-steps li > .btn { margin-top: 6px; }

/* ── Offline banner, feedback footer ─────────────────────────────────── */
.offline-banner {
  position: sticky; top: 0; z-index: 70; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 600;
  background: var(--bpd-warn-soft); color: var(--bpd-warn); border-bottom: 1px solid var(--bpd-line);
}
.site-footer { padding: 16px 20px 24px; text-align: center; font-size: 13px; color: var(--bpd-muted); }
/* Sign-in: the purple panel fills the window, so the feedback link sits at the foot of the form column, not in a strip under both. */
@media (min-width: 961px) {
  body:has(.auth) { position: relative; }
  #app:has(.auth) + .site-footer { position: absolute; left: 0; bottom: 0; width: calc(100% / 2.05); }
}
.shell ~ .site-footer, #app:has(.shell) + .site-footer { margin-left: var(--wa-side-w); }
.feedback-box { max-width: 560px; margin: 12px auto 0; text-align: left; background: var(--bpd-card); border: 1px solid var(--bpd-line); border-radius: 10px; padding: 14px 16px; }
.feedback-box textarea { width: 100%; }
input.mono { font-family: var(--bpd-f-mono); flex: 1 1 260px; min-width: 0; }

/* ── Tablet ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .plan-now { grid-template-columns: minmax(0, 1fr); }
  .avatar-name { display: none; }
}
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols-wide-left { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { display: none; }
  .plan-ladder { grid-template-columns: minmax(0, 1fr); }
  .ladder-step { border-left: 0; border-top: 1px solid var(--bpd-line); }
  .ladder-step:first-child { border-top: 0; }
}

/* Wide screens: the sidebar column is painted down the whole page, so the feedback footer under a long screen does not leave
   a strip of bare page under the sidebar. */
@media (min-width: 861px) {
  body:has(.shell) { background: linear-gradient(90deg, var(--bpd-card) calc(var(--wa-side-w) - 1px), var(--bpd-line) calc(var(--wa-side-w) - 1px), var(--bpd-line) var(--wa-side-w), var(--bpd-paper) var(--wa-side-w)); }
}

/* ── Phone: the sidebar becomes a drawer ─────────────────────────────── */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: min(300px, 86vw); height: 100vh; height: 100dvh;
    transform: translateX(-102%); transition: transform .22s var(--wa-ease); box-shadow: var(--bpd-shadow); visibility: hidden;
  }
  body[data-mode="demo"] .side { top: 0; height: 100vh; height: 100dvh; }
  /* Phone: the strip may wrap to two lines, so it scrolls away with the page and the top bar sticks at the very top. */
  body[data-mode="demo"] .demo-banner { position: relative; height: auto; flex-wrap: wrap; white-space: normal; padding: 6px 16px; }
  body[data-mode="demo"] .topbar { top: 0; }
  .side.open { transform: none; visibility: visible; }
  .icon-btn.side-close { display: inline-grid; }
  .icon-btn.menu-btn { display: inline-grid; color: var(--bpd-on-purple); }
  .icon-btn.menu-btn:hover { background: var(--bpd-stat-bg); color: var(--bpd-on-purple); }
  .topbar { padding: 0 12px; gap: 8px; }
  .search { max-width: none; }
  .search-key { display: none; }
  .top-action span { display: none; }
  .top-action { padding: 6px 9px; }
  .shell ~ .site-footer, #app:has(.shell) + .site-footer { margin-left: 0; }
}
@media (max-width: 720px) {
  .top-title { display: none; }
  .frame main#main { padding: 18px 14px 64px; }
  h1 { font-size: 22px; }
  .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile-num { font-size: 26px; }
  .tile-label { font-size: 13px; }
  .form .grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .signin-card { padding: 22px; }
  .auth-form { justify-content: flex-start; padding: 32px 18px; }
  .auth-card h1 { font-size: 26px; }
  .page-head { align-items: flex-start; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px; }
  .invite-row { grid-template-columns: minmax(0, 1fr); }
  .book-detail { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .book-detail dd { margin-bottom: 8px; }
  .banner { flex-wrap: wrap; align-items: flex-start; }
  /* Phone: the message gets the whole first line (icon, text, close) and the pay button sits under the text, instead of the
     text being squeezed into a narrow column beside the button. */
  .banner-text { flex: 1 1 calc(100% - 90px); min-width: 0; }
  .banner > .btn { order: 3; margin-left: 30px; }
  .banner > .icon-btn { order: 2; margin-top: -4px; }
  .demo-dot { display: none; }
  .tile { min-height: 96px; }

  .card .table-wrap { margin: 0; }
  .table-wrap:not(.card .table-wrap) { padding: 2px 14px; }
  .table-wrap { overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { padding: 10px 0; border-bottom: 1px solid var(--bpd-line); }
  .tbl tbody tr:hover { background: none; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 8px; border: 0; padding: 3px 0; height: auto; text-align: left; }
  .tbl td::before { content: attr(data-label); color: var(--bpd-muted); font-family: var(--bpd-f-body); font-size: 12px; font-weight: 600; letter-spacing: 0; }   /* a number cell's mono font is for the value, not its label */
  .tbl td[data-label=""]::before { content: none; }
  .tbl td[data-label=""] { display: block; }
  .tbl td.num, .tbl td.right { text-align: left; }
  .tbl td.right:not(:empty) { width: 100%; }   /* the desktop 1% would stack a row's buttons one per line */
  .tbl td:empty { display: none; }
  .tbl td > .chip { justify-self: start; }
  .tbl td .row-end { justify-content: flex-start; flex-wrap: wrap; }
  .stage-select { width: 100%; }
}
@media (max-width: 340px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
}

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

/* Vendor agreements (staffing P6): the Agreements card on a company (MSA, NDA and payment rows; the edit form three across), the summary in
   the vendor book's Agreement column (warning colour when one ends within 30 days or has ended). */
.agree-view { gap: 10px; }
.agree-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.agree-k { width: 72px; flex: none; font-weight: 600; color: var(--bpd-ink); }
.form .grid.agree-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agree-cell { font-size: 13px; color: var(--bpd-muted); }
.agree-due { color: var(--bpd-warn); font-weight: 600; }
@media (max-width: 720px) { .form .grid.agree-grid { grid-template-columns: minmax(0, 1fr); } .agree-k { width: auto; } }
/* P2 (0046): RTR and rate on submissions */
.rates-section { border-top: 1px solid var(--bpd-line); padding-top: 12px; margin-top: 4px; }
.rates-section > legend { margin-bottom: 4px; }
.rates-margin { margin: 4px 0 0; font-weight: 600; color: var(--bpd-ink); font-size: 13px; }
.rates-margin.is-loss, .margin-loss { color: var(--bpd-danger); font-weight: 600; }
.rtr-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
@media (min-width: 1200px) { .tiles.tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }   /* Today with the margin tile (P2): 4 + 3, no lone tile */
.override-note { margin-top: 4px; font-size: 12px; max-width: 220px; }
.rtr-rate { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.rate-line { white-space: nowrap; font-size: 13px; }
.rate-in { font-family: var(--bpd-f-mono); }
.draft-panel > .note { margin-top: 8px; }
/* ── Staffing P5: Consent and data, Contact log (js/consent-ui.js) ───────── */
input[type="datetime-local"] {
  width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; font-size: 14px; color: var(--bpd-ink); background: var(--bpd-card);
  border: 1px solid var(--wa-line-strong); border-radius: 9px;
}
.consent-head { align-items: flex-start; }
.consent-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; font-size: 14px; }
.consent-status .consent-note { flex-basis: 100%; margin: 0; font-size: 13px; }
.consent-tools { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--bpd-line); }
.consent-tools p { margin: 0; font-size: 14px; }
.consent-notice textarea { font-size: 13px; line-height: 1.5; }
.consent-notice .note { margin: 0; }
.erase-box { padding: 16px; border: 1px solid color-mix(in srgb, var(--bpd-danger) 45%, var(--bpd-line)); border-radius: 10px; background: var(--bpd-danger-soft); }
.erase-box h3 { color: var(--bpd-danger); }
.erase-box p { margin: 0; font-size: 14px; }
.erase-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.erase-cols ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.erase-cols li + li { margin-top: 2px; }
.erase-matches { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.erase-matches legend { padding: 0; margin-bottom: 2px; font-size: 14px; }
.erase-match { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: 8px; background: var(--bpd-card); border: 1px solid var(--bpd-line); cursor: pointer; font-size: 14px; }
.erase-match input { margin-top: 3px; }
.erase-match > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cl-add { border: 1px solid var(--bpd-line); border-radius: 10px; padding: 10px 14px; background: var(--bpd-paper); }
.cl-add > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--bpd-ink); }
.cl-add[open] > summary { margin-bottom: 10px; }
.cl-form .row-split { margin-top: 0; }
.cl-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cl-note { padding: 12px 0; border-top: 1px solid var(--bpd-line); }
.cl-note:first-child { border-top: 0; }
.cl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--bpd-ink); }
.cl-meta time { font-variant-numeric: tabular-nums; }
.cl-meta .cl-del { margin-left: auto; min-height: 30px; padding: 4px 10px; font-size: 13px; }
.cl-body { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.consent-nudge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.consent-nudge p { margin: 0; }
@media (max-width: 720px) {
  .erase-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ── Staffing P3 (js/p3-ui.js, screens/placements.js): interviews, placements, the funnel ── */
.p3-panel { display: flex; flex-direction: column; gap: 12px; }
.p3-panel h3 { margin: 8px 0 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.p3-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p3-head h2 { margin: 0; }
.p3-panel > .btn { align-self: flex-start; }   /* "Add interview" is a normal-width button, not a full-width bar */
.p3-iv-list, .p3-today, .p3-ending { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.p3-iv, .p3-today li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--bpd-line); border-radius: 12px; background: var(--bpd-card); }
.p3-today li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.p3-iv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p3-iv-main .muted { overflow-wrap: anywhere; }
.p3-feedback { white-space: pre-line; color: var(--bpd-ink); font-size: 13px; }
.p3-iv-acts { grid-column: 1 / -1; justify-content: flex-start; }
.p3-form textarea { width: 100%; resize: vertical; min-height: 56px; }
.p3-panel .p3-form.card { box-shadow: none; padding: 0; border: 0; }
.p3-ending li { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.p3-filters .field { flex: 0 1 240px; max-width: 240px; }
.p3-funnel { display: flex; flex-direction: column; gap: 10px; }
.p3-funnel-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.p3-funnel-bar { height: 10px; border-radius: 999px; background: var(--bpd-line); overflow: hidden; }
.p3-funnel-fill { display: block; height: 100%; border-radius: 999px; background: var(--bpd-purple); }
.p3-funnel-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 720px) { .p3-today li { grid-template-columns: 1fr; } }
/* Staffing P4: target progress, the leaderboard, the targets editor (Today and Reports) */
.p4-progress { display: flex; flex-direction: column; gap: 12px; }
.p4-progress-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 14px; }
.p4-progress-bar { height: 10px; border-radius: 999px; background: var(--bpd-line); overflow: hidden; }
.p4-progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--bpd-purple); transition: width .4s ease; }
.p4-progress-fill.is-met { background: var(--bpd-ok); }
.p4-progress-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--bpd-ink); }
.book-target-h { margin: 0; font-size: 13px; font-weight: 600; color: var(--bpd-muted); text-transform: uppercase; letter-spacing: .04em; }
.p4-rank { width: 40px; color: var(--bpd-muted); }
.tbl tr.is-me td { background: var(--bpd-purple-soft); }
.p4-err { margin: 0; font-size: 13px; color: var(--bpd-danger); }
.p4-err[hidden] { display: none; }
.form .grid.p4-target-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.p4-target-form { padding-top: 4px; }
.p4-filters .field { flex: 0 1 220px; max-width: 220px; }
.cols.p4-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.p4-leaderboard .tbl th { white-space: normal; }
.p4-inline-filter .field { max-width: 220px; }
@media (max-width: 1100px) { .cols.p4-cols { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .p4-progress-fill { transition: none; } }
@media (max-width: 720px) { .form .grid.p4-target-grid { grid-template-columns: minmax(0, 1fr); } .p4-progress-row { grid-template-columns: 84px minmax(0, 1fr) 56px; } }

/* ── Profile summary (js/profile-summary.js): the masked one-page profile. The same sheet is the preview and the printed page. ── */
.pf-opts { display: flex; gap: 8px 20px; align-items: flex-end; flex-wrap: wrap; }
.pf-opts > .field:first-child { flex: 0 1 300px; min-width: 0; }
.pf-check { align-self: end; min-height: 40px; }
.pf-preview { margin: 4px 0 12px; }
.pf-sheet { border: 1px solid var(--bpd-line); border-radius: var(--wa-radius-card); background: var(--bpd-card); padding: 22px 24px; color: var(--bpd-ink); max-width: 760px; }
.pf-top { border-bottom: 1px solid var(--bpd-line); padding-bottom: 12px; margin-bottom: 14px; }
.pf-kicker { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--bpd-muted); }
.pf-name { margin: 0; font-size: 22px; line-height: 1.25; }
.pf-headline { margin: 4px 0 0; color: var(--bpd-muted); font-size: 14px; }
.pf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0 0 14px; }
.pf-facts dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bpd-muted); }
.pf-facts dd { margin: 2px 0 0; font-size: 14px; }
.pf-skills h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bpd-muted); }
.pf-skills ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; }
.pf-skills li { border: 1px solid var(--bpd-line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.pf-note { margin: 0; font-size: 12px; color: var(--bpd-muted); }
@media (max-width: 560px) { .pf-facts { grid-template-columns: minmax(0, 1fr); } .pf-sheet { padding: 18px; } }
#print-sheet { display: none; }
@media print {
  body.printing-sheet > *:not(#print-sheet) { display: none !important; }
  body.printing-sheet #print-sheet { display: block; }
  body.printing-sheet .pf-sheet { border: 0; padding: 0; max-width: none; }
}

/* ── Consultant self-service link (js/link-ui.js, the consultant page) and its public page (consultant-link.html) ── */
.cl-make { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.cl-make .field { flex: 1 1 260px; min-width: 0; }
.cl-made { display: flex; flex-direction: column; gap: 8px; }
.cl-copy { display: flex; gap: 8px; align-items: center; }
.cl-copy input { flex: 1 1 auto; min-width: 0; font-family: var(--bpd-f-mono); font-size: 13px; }
.cl-h { margin: 6px 0 0; font-size: 14px; }
.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--bpd-line); border-radius: 12px; background: var(--bpd-card); }
.cl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-main .muted, .cl-answer { overflow-wrap: anywhere; font-size: 13px; }
.cl-answer { color: var(--bpd-ink); }
@media (max-width: 560px) { .cl-row { grid-template-columns: minmax(0, 1fr) auto; } .cl-row > .btn { grid-column: 1 / -1; justify-self: start; } .cl-copy { flex-direction: column; align-items: stretch; } }
.cl-page .signin-card { gap: 16px; }
.cl-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--bpd-purple-text); }
.cl-rate { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.cl-choice { border: 1px solid var(--bpd-line); border-radius: 12px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-choice legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 14px; }   /* inside the box: a two-line question no longer breaks the top border */
.cl-choice .hint { margin: 0; }
.cl-privacy { margin-top: 4px; }
.cl-choice .field.check input { flex: none; }

/* 0055: timesheets, invoices and commission (Back office). The printable invoice is .inv-doc; printing hides the app around it. */
.form-card { border-color: var(--bpd-purple-soft); }
.form-card .form-title { margin: 0 0 4px; font-size: 16px; }
.ts-form textarea, .inv-profile textarea { width: 100%; resize: vertical; min-height: 64px; }
.ts-weeks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tile-danger .tile-num { color: var(--bpd-danger); }
.inv-actions { flex-wrap: wrap; }
.inv-preview { margin: 4px 0 0; font-size: 14px; color: var(--bpd-ink); font-variant-numeric: tabular-nums; }
.inv-profile-box > summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--bpd-ink); padding: 2px 0; }
.inv-profile-box > summary .muted { font-weight: 400; font-size: 13px; }
.inv-profile-box[open] > summary { margin-bottom: 12px; }
.inv-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inv-toolbar .row-end { margin-left: auto; }
.inv-doc { max-width: 820px; width: 100%; margin: 0 auto; padding: 48px 56px; background: var(--bpd-card); color: var(--bpd-ink); border: 1px solid var(--bpd-line);
  border-radius: var(--wa-radius-card); box-shadow: var(--bpd-card-shadow); display: flex; flex-direction: column; gap: 28px; font-size: 14px; line-height: 1.5; }
.inv-doc p { margin: 0; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--bpd-ink); }
.inv-firm { font-family: var(--bpd-f-head); font-weight: 700; font-size: 18px; color: var(--bpd-ink); }
.inv-line { color: var(--bpd-muted); white-space: pre-line; overflow-wrap: anywhere; }
.inv-title { text-align: right; }
.inv-word { font-family: var(--bpd-f-head); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; text-transform: uppercase; }
.inv-num { color: var(--bpd-muted); }
.inv-parties { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.inv-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bpd-muted); margin-bottom: 4px !important; }
.inv-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.inv-meta dt { color: var(--bpd-muted); }
.inv-meta dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inv-lines { width: 100%; border-collapse: collapse; }
.inv-lines th, .inv-lines td { padding: 10px 8px; border-bottom: 1px solid var(--bpd-line); text-align: left; vertical-align: top; }
.inv-lines thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bpd-muted); font-weight: 600; }
.inv-lines .num { text-align: right; white-space: nowrap; }
.inv-lines tfoot th, .inv-lines tfoot td { border-bottom: 0; padding-top: 14px; font-weight: 700; color: var(--bpd-ink); }
.inv-total { font-size: 18px; }
.inv-desc { display: block; font-weight: 600; }
.inv-sub { display: block; color: var(--bpd-muted); font-size: 13px; }
.inv-pay { padding: 14px 16px; border-radius: 10px; background: var(--wa-subtle); }
.inv-note { color: var(--bpd-muted); }
@media (max-width: 720px) {
  .inv-doc { padding: 24px 18px; gap: 20px; }
  .inv-head, .inv-parties { display: flex; flex-direction: column; }
  .inv-title { text-align: left; }
}
@media print {
  .side, .topbar, .demo-banner, .banner, .no-print, .toast, .feedback-foot, footer, #toast { display: none !important; }
  .shell, .frame, #main { display: block !important; margin: 0 !important; padding: 0 !important; }
  .inv-print-page { gap: 0; }
  .inv-doc { border: 0; box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .inv-pay { border: 1px solid var(--bpd-line); }
  .inv-lines tr { break-inside: avoid; }
}
