/* BizGrips portal — design tokens from the 2026 redesign previews
   (bizgrips_phase1_redesign_preview.html, bizgrips_client_portal_preview.html).
   Change them here, not inline.

   The variable NAMES are the ones the portal has always used — the screens'
   JavaScript refers to many of them in inline styles — so the values change
   and every screen follows. Two names now mean something new:
     --serif  headings were a serif; they are Inter now, heavier and tighter.
     --mono   small uppercase labels were monospace; they are Inter now.
              Real code (ids, URLs, placeholders, snippets) uses --code. */

:root {
  /* Per-client accent. setAccent() in api.js overrides --ac at runtime with
     the colour a client was given; every tint below is derived from it. */
  --ac: #6467f2;
  --ac-2: color-mix(in srgb, var(--ac) 70%, #fff);
  --ac-soft: color-mix(in srgb, var(--ac) 10%, #fff);
  --ac-soft-2: color-mix(in srgb, var(--ac) 5%, #fff);
  --ac-line: color-mix(in srgb, var(--ac) 22%, #fff);
  --ac-ink: color-mix(in srgb, var(--ac) 82%, #000);
  --ac-wash: var(--ac-soft);

  --ink: #16171a;
  --canvas: #f6f7fb;
  --shell: #f6f7fb;
  --panel: #fff;
  --panel-2: #fbfbfd;
  --sidebar: #fff;
  --sidebar-ink: #16171a;

  --line: #e8eaf0;
  --line-soft: #f0f1f4;
  --line-strong: #dfe1e7;
  --muted: #717682;
  --muted-2: #5f6470;
  --faint: #9da2ad;

  --green: #2f9b68;
  --yellow: #ad741b;
  --amber: #ad741b;
  --red: #cc5353;
  --blue: #3d7ce7;
  --lav: #865bd8;
  --grey: #c9ccd4;
  --green-bg: #eaf8f0;
  --yellow-bg: #fff6e5;
  --amber-bg: #fff6e5;
  --amber-line: #f2dfb5;
  --red-bg: #fff0f0;
  --red-line: #f2cfcf;
  --blue-bg: #edf4ff;
  --lav-bg: #f4efff;
  --grey-bg: #f2f3f6;
  --teal-wash: var(--ac-soft-2);

  --sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: var(--sans);
  --mono: var(--sans);
  --code: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 2px 10px rgba(31, 36, 55, .025);
  --shadow-sm: 0 4px 16px rgba(27, 35, 58, .06);
  --shadow-lift: 0 12px 34px rgba(27, 35, 58, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Phone bottom navigation: its height, plus the home-indicator inset. */
  --tabbar-h: 64px;
  --tabbar-space: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

/* The browser's own [hidden] rule loses to any class that sets display, so a
   .btn with the hidden attribute would still render. Restated with priority. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.45 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ac); text-decoration: none; }
a:hover { filter: brightness(.88); }

button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* Line icons (assets/icons.js). Sized by the font size of their parent unless
   told otherwise; the stroke follows the text colour. */
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ layout */
/* The shell (assets/shell.js): sidebar | top bar + page on a desktop; on a
   phone, a compact top bar, the page, and a bottom tab bar. The document
   scrolls, not an inner box, so the top bar can stay put above it. */

.app { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); background: var(--canvas); }
.app--client { grid-template-columns: 226px minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 13px 14px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 9px 20px; }
/* The BizGrips wordmark (bizgrips-logo.svg, 1531×782). Its height sets its
   size; the width follows the artwork's proportions. */
.brand-logo { display: block; height: 32px; width: auto; flex: none; }
.brand-sub {
  padding-left: 12px; border-left: 1px solid var(--line-strong);
  font: 700 9.5px/1.35 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  white-space: nowrap;
}
.brandmark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(145deg, #17191d, #323640); color: #fff;
  display: grid; place-items: center;
  font: 800 11.5px/1 var(--sans); letter-spacing: -.04em; box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-text b { font: 760 15px/1.1 var(--sans); letter-spacing: -.025em; }
.brand-text small { font: 700 9.5px/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }

.account-chip {
  margin: 0 4px 16px; padding: 10px 11px; display: flex; gap: 10px; align-items: center;
  background: #f7f8fb; border: 1px solid #eef0f4; border-radius: 13px;
}
.account-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--ac-soft), var(--ac-line)); color: var(--ac-ink);
  display: grid; place-items: center; font: 800 10.5px/1 var(--sans);
}
.account-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-text b { font: 700 12.5px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { font: 400 11px/1.25 var(--sans); color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px; }
.nav-label { padding: 6px 11px 5px; font: 700 10px/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: #a2a6af; }
.nav-item {
  width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 11px;
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: transparent; color: #5f6470; font: 600 13.5px/1.2 var(--sans);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f5f6fa; color: #2b2e35; }
.nav-item.is-on { background: var(--ac-soft); color: var(--ac-ink); font-weight: 720; }
.nav-icon { font-size: 17px; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 2px 7px; border-radius: 999px; text-align: center;
  background: var(--grey-bg); color: #8a8f99; font: 650 11px/1.3 var(--sans);
}
.nav-item.is-on .nav-count { background: #fff; color: var(--ac); }

.sidebar-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.contact-card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: #f8f9fb; border: 1px solid #eceef3; border-radius: 14px;
}
.contact-card .label { font: 800 9.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #a3a8b1; }
.contact-card .who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: #252932; color: #fff; font: 800 10.5px/1 var(--sans);
}
.avatar--soft { background: linear-gradient(145deg, #e9eaff, #cdd0ff); color: #484bc8; }
.contact-card .name { font: 700 12.5px/1.2 var(--sans); }
.contact-card .role { font: 400 11px/1.25 var(--sans); color: var(--muted); }
.contact-actions { display: flex; gap: 6px; }
.contact-btn {
  flex: 1; min-height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; text-decoration: none;
  color: #4a4f59; font: 650 11.5px/1 var(--sans);
}
.contact-btn:hover { background: var(--grey-bg); filter: none; }

.utility { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 1px; }
.utility-item, .sidebar-link {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-decoration: none; text-align: left;
  color: #6f7480; font: 500 12.5px/1.2 var(--sans);
}
.utility-item:hover, .sidebar-link:hover { background: #f5f6f9; color: var(--ink); filter: none; }
.utility-item .ico { font-size: 15px; color: #9aa0aa; }
.utility-who { padding: 5px 8px 2px; font: 400 11.5px/1.35 var(--sans); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row { display: flex; align-items: center; gap: 9px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.user-row .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-row b { font: 700 12.5px/1.2 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row small { font: 400 11px/1.2 var(--sans); color: var(--muted); }

/* Who you are, and how to stop being them (kept for any screen that uses it). */
.session { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; border-top: 1px solid var(--line); }
.session .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session .who b { font: 600 12px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session .who span { font: 700 9.5px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.session button { margin-left: auto; flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted-2); font: 650 11.5px/1 var(--sans); padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 30px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(246, 247, 251, .86);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 234, 240, .9);
}
.topbar-brand { display: none; align-items: center; }
.topbar-brand .brand-logo { height: 27px; }
.topbar-context { flex: 1; min-width: 0; font: 500 12.5px/1.3 var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context b { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.avatar-btn {
  width: 38px; height: 38px; border: 0; border-radius: 11px; cursor: pointer; flex: none;
  background: #242831; color: #fff; font: 800 10.5px/1 var(--sans);
}
.page { width: 100%; max-width: 1540px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 64px; display: flex; flex-direction: column; min-width: 0; }

.pagehead { display: flex; align-items: flex-start; gap: 18px; padding: 0 0 22px; flex-wrap: wrap; }
.pagehead .titles { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 320px; }
.pagehead .actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pagehead p.lede { margin: 0; color: var(--muted); font: 400 14px/1.5 var(--sans); max-width: 720px; }

.tabbar { display: none; }

/* An admin looking at a client's portal. Dark and fixed to the top: the
   mistake it guards against is screen-sharing a client's portal thinking it is
   your own account. */
.viewbar {
  position: sticky; top: 0; z-index: 65; grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 44px; padding: 8px 20px;
  background: #2c2e36; color: #fff; font: 500 12.5px/1.3 var(--sans);
}
.viewbar strong { font-weight: 700; }
.viewbar .read { background: #fff; color: #32343b; padding: 3px 8px; border-radius: 999px; font: 800 10px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.viewbar span.note { opacity: .75; }
.viewbar-exit {
  margin-left: auto; padding: 6px 11px; border-radius: 8px; white-space: nowrap; text-decoration: none;
  background: rgba(255, 255, 255, .12); color: #fff; font: 650 12px/1 var(--sans);
}
.viewbar-exit:hover { background: rgba(255, 255, 255, .22); filter: none; }
.is-viewing-as .sidebar { top: 44px; height: calc(100vh - 44px); }
.is-viewing-as .topbar { top: 44px; }

/* The phone "More" menu: a panel rising from the bottom. */
.sheet-backdrop.more-backdrop { align-items: flex-end; justify-content: center; }
.sheet.more-panel { width: min(520px, 100vw); max-height: 86vh; border-radius: 22px 22px 0 0; animation: more-in .22s var(--ease); }
@keyframes more-in { from { transform: translateY(28px); opacity: .6; } }
.more-panel > header { padding: 16px 16px 10px; border-bottom: 0; }
.more-panel > header h2 { font-size: 19px; }
.more-panel .body { padding: 0 12px calc(16px + env(safe-area-inset-bottom)); gap: 4px; }
.more-section + .more-section { border-top: 1px solid var(--line-soft); padding-top: 6px; margin-top: 4px; }
.more-section .nav-label { padding: 8px 6px 4px; }
.more-item {
  width: 100%; min-height: 54px; padding: 6px; display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; text-decoration: none; color: var(--ink);
}
.more-item:hover { background: #f5f6f9; filter: none; }
.more-icon { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; background: #f2f3f8; color: #616774; font-size: 17px; }
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.more-text b { font: 650 14.5px/1.25 var(--sans); }
.more-text small { font: 400 12px/1.3 var(--sans); color: var(--muted); }
.more-chev { color: #b4b8c0; font-size: 16px; }

.kicker {
  font: 800 10px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: #9ba0aa;
}
.kicker--ac { color: var(--ac); }

h1.display { margin: 0; font: 760 32px/1.05 var(--sans); letter-spacing: -.042em; }
h1.display--sm { font-size: 28px; }

.scroll { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.scroll--narrow { max-width: 1220px; }

.section { display: flex; flex-direction: column; gap: 16px; }
.section > header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section h2 { margin: 0; font: 760 15px/1.2 var(--sans); letter-spacing: -.015em; }
.section .sub { font: 400 13px/1.3 var(--sans); color: var(--muted); }
.section .right { margin-left: auto; font: 500 13px/1 var(--sans); color: var(--muted); }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card--pad { padding: 20px 22px 22px; }
.card--flush { overflow: visible; }
.card > header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.card > header h2 { margin: 0; font: 760 14.5px/1.2 var(--sans); letter-spacing: -.01em; }
.card > header .sub { font: 400 12.5px/1.3 var(--sans); color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 22px; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel);
  font: 650 13px/1.15 var(--sans); color: #31343a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s;
}
.btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: var(--shadow-sm); filter: none; }
.btn--primary { background: var(--ac); border-color: var(--ac); color: #fff; }
.btn--primary:hover:not([disabled]) { filter: brightness(1.06); border-color: var(--ac); }
.btn--soft { background: var(--ac-soft); border-color: transparent; color: var(--ac-ink); }
.btn--sm { min-height: 31px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted-2); }
.btn--ghost:hover:not([disabled]) { background: var(--grey-bg); box-shadow: none; }
.btn--danger { color: var(--red); border-color: var(--red-line); background: var(--panel); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .ico { font-size: 15px; }
.icon-btn { width: 38px; min-height: 38px; padding: 0; }
.icon-btn .ico { font-size: 17px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 31px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  font: 500 12px/1 var(--sans); color: #6d727d; white-space: nowrap;
}
.chip:hover:not(.is-on) { border-color: var(--line-strong); color: var(--ink); }
.chip.is-on { background: #23262c; border-color: #23262c; color: #fff; font-weight: 600; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f0f1f5; }
.seg button {
  min-height: 28px; padding: 0 11px; border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: #7d828c; font: 500 12px/1 var(--sans);
}
.seg .is-on { background: #fff; color: #333740; font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }

/* Underlined tabs: the preview's page-level sections (client workspace,
   prospects, calendar). */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 42px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: #737883; font: 650 13px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ac); border-bottom-color: var(--ac); }

/* ------------------------------------------------------------------- pills */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  font: 720 11px/1.1 var(--sans);
  color: #747984; background: var(--grey-bg);
}
.pill--done  { color: var(--green);  background: var(--green-bg); }
.pill--soon  { color: var(--amber);  background: var(--amber-bg); }
.pill--over  { color: var(--red);    background: var(--red-bg); }
.pill--idle  { color: #747984; background: var(--grey-bg); }
.pill--ac    { color: var(--ac-ink); background: var(--ac-soft); }
.pill--blue  { color: var(--blue);   background: var(--blue-bg); }
.pill--lav   { color: var(--lav);    background: var(--lav-bg); }

.owner {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
  font: 800 10px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  background: var(--grey-bg); color: #707580;
}
.owner--client { background: #272a31; color: #fff; }

.blocking {
  display: inline-flex; align-items: center;
  font: 800 10px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--red-bg); color: var(--red);
}
.blocking--off { background: var(--grey-bg); color: var(--faint); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--grey); }
.dot--done { background: #52b880; }
.dot--soon { background: #e5a746; }
.dot--over { background: #e36a6a; }
.dot--idle { background: var(--grey); }
.dot--blue { background: #628ee8; }

/* -------------------------------------------------------------- progress */

.bar { height: 7px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ac), var(--ac-2)); transition: width .3s ease; }
.bar--over > span { background: var(--red); }

/* ----------------------------------------------------------------- tables */

.rows { display: flex; flex-direction: column; }
.row {
  display: grid; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.rows .row:last-child { border-bottom: none; }
.row .title { font: 680 14px/1.3 var(--sans); letter-spacing: -.005em; }
.row .meta { font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.row.is-done .title { color: var(--muted); }

.row--task { grid-template-columns: 8px minmax(0, 1fr) auto auto auto; }
.row--check { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 15px; }
.row--check.is-done { background: transparent; }

.checkbox {
  width: 26px; height: 26px; border-radius: 50%; padding: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 var(--sans); cursor: pointer;
  background: #fff; border: 1.5px solid #d6d9e0; color: transparent;
  transition: background .15s, border-color .15s;
}
.checkbox:hover:not([disabled]) { border-color: var(--green); }
.checkbox.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.checkbox[disabled] { cursor: default; opacity: .8; }

.strike { text-decoration: line-through; text-decoration-color: rgba(22, 23, 26, .25); }

/* ------------------------------------------------------------------ forms */

label.field { display: flex; flex-direction: column; gap: 6px; font: 700 12px/1.3 var(--sans); color: var(--muted-2); }
label.field > span.hint { font-weight: 400; font-size: 12px; line-height: 1.45; color: var(--faint); }

input[type=text], input[type=email], input[type=url], input[type=number], input[type=date],
input[type=search], input[type=password], input[type=time], input[type=tel], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: #fff; color: var(--ink);
  font: 400 14px/1.4 var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
/* Markdown and code editors keep a fixed-width face; everything else reads as text. */
textarea.code, textarea[data-kind="markdown"] { font: 400 13px/1.6 var(--code); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ----------------------------------------------------------------- dialog */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(23, 25, 31, .28);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: stretch; justify-content: flex-end;
  animation: sheet-fade .18s var(--ease);
}
.sheet {
  width: min(620px, 94vw); background: var(--panel);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(22, 25, 35, .16);
  animation: sheet-in .22s var(--ease);
}
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateX(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }
.sheet > header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sheet > header h2 { margin: 0; font: 760 23px/1.15 var(--sans); letter-spacing: -.035em; }
.sheet .body { flex: 1; overflow: auto; padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 18px; background: var(--panel); }
.sheet > footer {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel);
}
.sheet .close {
  margin-left: auto; flex: none; width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  font: 400 15px/1 var(--sans); color: var(--muted-2);
}
.sheet .close:hover { background: var(--grey-bg); color: var(--ink); }
/* On a phone a sheet is the whole screen, as the mobile preview has it. */
@media (max-width: 780px) {
  .sheet { width: 100vw; }
  .sheet > header { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
  .sheet > header h2 { font-size: 21px; }
  .sheet .body { padding: 18px 16px 28px; }
  .sheet > footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .sheet > footer .btn { min-height: 44px; }
}

/* --------------------------------------------------------------- markdown */

.md { font: 400 14.5px/1.65 var(--sans); color: #3d414a; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h2 { margin: 26px 0 10px; font: 600 15px/1.3 var(--sans); color: var(--ink); }
.md h3 { margin: 20px 0 8px; font: 600 13.5px/1.3 var(--sans); color: var(--ink); }
.md p { margin: 0 0 12px; text-wrap: pretty; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 22px; }
.md li { margin-bottom: 6px; }
.md strong { font-weight: 600; color: var(--ink); }
.md code {
  font: 500 12.5px/1 var(--code);
  background: var(--grey-bg); padding: 2px 5px; border-radius: 5px;
}
.md hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* ------------------------------------------------------------------ misc */

.empty {
  padding: 40px 22px; text-align: center;
  font: 400 13.5px/1.6 var(--sans); color: var(--muted);
}
.placeholder {
  background-color: var(--panel-2);
  background-image: repeating-linear-gradient(135deg, rgba(22, 23, 26, .04) 0 1px, transparent 1px 9px);
  display: flex; align-items: center; justify-content: center;
}
.mono { font-family: var(--code); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stack--lg { gap: 9px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spread { display: flex; align-items: center; gap: 12px; }
/* Global, not scoped to .spread: right-aligned items appear inside plain
   anchors, <header> and <footer> too, and scoping it silently broke those. */
.push { margin-left: auto; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 150; padding: 12px 16px; border-radius: 13px; max-width: min(520px, calc(100vw - 24px));
  background: #20242d; color: #fff;
  font: 600 13px/1.35 var(--sans);
  box-shadow: 0 12px 34px rgba(20, 24, 38, .22);
  animation: toast-in .2s var(--ease);
}
.toast--err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
/* Above the phone tab bar, never under it. */
@media (max-width: 780px) { .toast { bottom: calc(var(--tabbar-space) + 12px); } }

.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 18px; background: var(--canvas);
}
.gate .box {
  max-width: 460px; display: flex; flex-direction: column; gap: 16px;
  padding: 34px 34px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lift);
}
.gate h1 { margin: 0; font: 760 27px/1.12 var(--sans); letter-spacing: -.035em; }
.gate p { margin: 0; font: 400 14.5px/1.6 var(--sans); color: var(--muted-2); text-wrap: pretty; }
.gate img { height: 26px; width: auto; align-self: flex-start; }

@media (max-width: 1080px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: minmax(0, 1fr); }
}
/* Phone: no sidebar, a compact top bar, and the bottom tab bar. */
@media (max-width: 780px) {
  .app, .app--client { display: block; }
  .sidebar { display: none; }
  .topbar { height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; }
  .topbar-brand { display: flex; }
  .topbar-context { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .hide-phone { display: none; }
  .topbar .btn.icon-btn, .avatar-btn { width: 38px; height: 38px; }
  .page { padding: 20px 14px calc(var(--tabbar-space) + 24px); }
  .pagehead { flex-direction: column; gap: 14px; padding-bottom: 18px; }
  .pagehead .titles { flex-basis: auto; }
  .pagehead .actions { margin-left: 0; }
  h1.display { font-size: 27px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .viewbar { position: static; padding: 8px 14px; }
  .is-viewing-as .topbar { top: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: var(--tabbar-space); padding: 4px 8px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(24, 30, 48, .05);
  }
  .tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 52px; border: 0; background: transparent; cursor: pointer;
    color: #858a95; font: 700 11px/1 var(--sans);
  }
  .tabbar-item.is-on { color: var(--ac); }
  .tabbar-icon { position: relative; display: inline-flex; font-size: 22px; }
  .tabbar-badge {
    position: absolute; top: -6px; left: 13px; min-width: 18px; height: 18px; padding: 0 4px;
    display: grid; place-items: center; border-radius: 999px; border: 2px solid #fff;
    background: #ef6b70; color: #fff; font: 800 9.5px/1 var(--sans);
  }
}

/* ------------------------------------------------------------------ intake */
/* The first-login screen. Kept in CSS rather than inline styles specifically so
   it has breakpoints — a fixed two-column grid squeezed the form to zero width
   on phones, and a Typeform sizes to its container, so it rendered nothing. */

.intake-shell {
  min-height: 100vh;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}

.intake-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  flex: none;
}
.intake-bar .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font: 400 12.5px/1 var(--sans);
  color: var(--muted);
}

.intake {
  flex: 1;
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  gap: 56px;
  padding: 56px 40px 64px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.intake-aside { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.intake-lead { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.intake-timing { display: flex; flex-direction: column; gap: 7px; }
.intake-aside h1 {
  margin: 0;
  font: 780 40px/1.06 var(--sans);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.intake-aside p.lede {
  margin: 0;
  font: 400 15.5px/1.6 var(--sans);
  color: var(--muted-2);
  max-width: 34ch;
  text-wrap: pretty;
}
.intake-covers {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.intake-help {
  margin-top: auto;
  padding: 14px 16px;
  background: var(--ac-soft-2);
  border: 1px solid var(--ac-line);
  border-radius: 14px;
  font: 400 13px/1.5 var(--sans);
  color: var(--muted-2);
}

.intake-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.intake-panel > header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
  flex: none;
}

/* Typeform reads the container's height. `flex: 1` alone can resolve to zero,
   so an explicit min-height is what actually makes the embed appear. */
.intake-form {
  flex: 1;
  width: 100%;
  min-height: 640px;
  border: none;
  display: block;
}

@media (max-width: 1024px) {
  .intake {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 28px 22px 48px;
  }
  /* Dissolve the aside so its children become grid items in their own right,
     which lets the form jump above the supporting copy. On a phone the form is
     the entire purpose of this screen; it should not sit below a screenful of
     explanation nobody scrolls past. */
  .intake-aside { display: contents; }
  .intake-lead   { order: 1; }
  .intake-panel  { order: 2; }
  .intake-covers { order: 3; }
  .intake-timing { order: 4; }
  .intake-help   { order: 5; margin-top: 0; }

  .intake-aside h1 { font-size: 34px; }
  .intake-aside p.lede { max-width: none; }
  /* Viewport-relative so the form fills the screen rather than a fixed box that
     may be taller or shorter than the device. */
  .intake-form { min-height: 72vh; }
}

@media (max-width: 560px) {
  .intake-bar { padding: 14px 18px; gap: 12px; }
  .intake-bar .who { width: 100%; margin-left: 0; justify-content: space-between; }
  .intake { padding: 22px 14px 36px; gap: 22px; }
  .intake-aside h1 { font-size: 29px; }
  .intake-panel { border-radius: 9px; }
  .intake-form { min-height: 78vh; }
}

/* ------------------------------------------------------- destructive actions */

/* Brief flash when jumped to from the header, so it is obvious where you landed. */
@keyframes danger-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 58, 32, 0); }
  30%      { box-shadow: 0 0 0 5px rgba(168, 58, 32, .22); }
}
.danger-zone.is-flashed { animation: danger-flash 1.1s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) {
  .danger-zone.is-flashed { animation: none; box-shadow: 0 0 0 4px rgba(168, 58, 32, .22); }
}

.danger-zone {
  scroll-margin-top: 20px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.danger-zone > header {
  padding: 14px 20px;
  background: var(--red-bg);
  border-bottom: 1px solid var(--red-line);
}
.danger-zone > header h2 {
  margin: 0;
  font: 600 13px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--red);
}
.danger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.danger-row:last-child { border-bottom: none; }
.danger-row b { display: block; font: 600 14px/1.3 var(--sans); margin-bottom: 3px; }
.danger-row span { font: 400 13px/1.5 var(--sans); color: var(--muted); }

/* The confirm dialog itself. Red is reserved for genuinely irreversible things,
   so it means something when it appears. */
.confirm-list {
  margin: 0; padding: 14px 18px 14px 34px;
  background: var(--red-bg);
  border: 1px solid var(--red-line);
  border-radius: 8px;
}
.confirm-list li {
  font: 400 13.5px/1.6 var(--sans);
  color: var(--ink);
  margin-bottom: 4px;
}
.confirm-list li:last-child { margin-bottom: 0; }

.confirm-phrase {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--grey-bg);
  font: 500 14px/1.4 var(--code);
  color: var(--ink);
  user-select: all;
  word-break: break-word;
}

.btn--destroy {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn--destroy:hover:not([disabled]) { filter: brightness(1.08); border-color: var(--red); }
.btn--destroy[disabled] { background: rgba(22, 23, 26, .12); border-color: transparent; color: var(--faint); }

/* The always-available way out of the intake screen. Sits under the form so it
   reads as "after you finish", not as a way to skip it. */
.intake-done {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-2);
  flex: none;
}
.intake-done span { font: 400 13.5px/1.4 var(--sans); color: var(--muted-2); }
.intake-done button { margin-left: auto; }
@media (max-width: 560px) {
  .intake-done { padding: 12px 14px; }
  .intake-done button { margin-left: 0; width: 100%; justify-content: center; }
}

/* A task's "we need something from you" field. */
.task-response {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--ac);
  border-radius: 9px;
  background: var(--teal-wash, rgba(26, 106, 114, .06));
}
.task-response label.field > span:first-child { color: var(--ink); font-weight: 600; font-size: 13px; }

/* ------------------------------------------------- task input list editor */

.fieldlist-wrap { display: flex; flex-direction: column; gap: 10px; }
.fieldlist { display: flex; flex-direction: column; gap: 10px; }
.fieldlist-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
}
.fieldlist-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
.fieldlist-sub  { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.fieldlist-req {
  display: flex; align-items: center; gap: 6px;
  font: 400 12.5px/1 var(--sans); color: var(--muted-2); white-space: nowrap;
}
.fieldlist-req input { width: auto; }
.fieldlist-empty {
  margin: 0; padding: 12px 14px; border-radius: 7px;
  background: rgba(22, 23, 26, .04);
  font: 400 13px/1.5 var(--sans); color: var(--muted);
}
@media (max-width: 640px) {
  .fieldlist-main { grid-template-columns: minmax(0, 1fr); }
  .fieldlist-sub  { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Multiple inputs on one task in the client portal. */
.task-response { gap: 16px; }
.task-response .tr-field { display: flex; flex-direction: column; gap: 6px; }
.task-response .tr-field > span.lab {
  font: 600 13px/1.3 var(--sans); color: var(--ink);
}

/* ===========================================================================
   Leads, lead detail, appointments (leadsui.js) — shared by the client
   portal and the admin's Master leads. bizgrips_client_portal_preview.html.
   =========================================================================== */

/* utilities the leads views lean on (and others) */
.dim { color: var(--muted); }
.center { text-align: center; }
.min0 { min-width: 0; }
.gap { gap: 13px; }
.gap-sm { gap: 10px; }
.gap-lg { gap: 28px; }
.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--muted); text-align: left;
}
.linkish:hover { color: var(--ink); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--ac-soft); color: var(--ac); font-size: 21px; }

/* ------------------------------------------------------------------- list */
.leads-body { gap: 16px; }
.leads-embed, .leads-embed-box { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lead-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lead-stat { display: flex; flex-direction: column; gap: 4px; padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.lead-stat .label { font: 700 12px/1.2 var(--sans); color: var(--muted); }
.lead-stat .value { margin-top: 6px; font: 820 26px/1 var(--sans); letter-spacing: -.04em; }
.lead-stat .value.is-accent { color: var(--ac); }
.lead-stat .value.is-booked { color: var(--lav); }
.lead-stat .meta { font: 400 11.5px/1.3 var(--sans); color: var(--faint); }

.lead-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.lead-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.searchbox {
  display: flex; align-items: center; gap: 8px; min-width: 250px; height: 38px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--faint); cursor: text;
}
.searchbox:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.searchbox input, .searchbox input[type=search] { border: 0; outline: 0; box-shadow: none; padding: 0; min-height: 0; height: 100%; background: transparent; font: 400 13.5px/1 var(--sans); }
.searchbox input:focus { box-shadow: none; }
.lead-clientfilter { width: auto; min-width: 190px; height: 38px; min-height: 38px; }

.lead-table { background: #fff; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.lead-head, .lead-row {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(150px, 1.25fr) 140px minmax(170px, 1.1fr) 150px 110px;
}
.lead-head.is-admin, .lead-row.is-admin {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, .9fr) 135px minmax(160px, 1fr) 140px 110px;
}
.lead-head {
  min-height: 40px; padding: 0 18px; background: #fafbfc; border-bottom: 1px solid var(--line-soft);
  font: 800 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9da2ac;
}
.lead-row {
  width: 100%; min-height: 56px; padding: 0 18px; background: #fff;
  border: none; border-bottom: 1px solid var(--line-soft);
  font: inherit; text-align: left; cursor: pointer; transition: background .12s;
}
.lead-row:last-child { border-bottom: none; }
.lead-row:hover { background: #fbfbfd; }
.lead-name { font: 720 14px/1.3 var(--sans); }
.lead-client { font: 650 13px/1.3 var(--sans); color: var(--ac); }
.lead-cell { font-size: 13.5px; color: #4f5460; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-cell.is-dim { color: var(--muted); }
.lead-row .push, .lead-head .push { justify-self: end; }

.lead-empty {
  padding: 56px 30px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 17px;
}
.lead-empty h2 { margin: 0 0 8px; font: 760 18px/1.3 var(--sans); letter-spacing: -.02em; }
.lead-empty p { margin: 0 auto; max-width: 46ch; color: var(--muted); line-height: 1.6; }

@keyframes lead-shimmer { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.sk { display: block; height: 12px; border-radius: 6px; background: #eceef3; animation: lead-shimmer 1.4s ease-in-out infinite; }
.sk-pill { width: 72px; height: 22px; border-radius: 999px; justify-self: end; }
.lead-row.is-skeleton { cursor: default; }
.lead-row.is-skeleton:hover { background: #fff; }
.lead-row.is-deleted { cursor: default; }
.lead-row.is-deleted:hover { background: #fff; }
.lead-removed { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.lead-removed .by { font-size: 11px; opacity: .72; }

/* ----------------------------------------------------------------- detail */
.back-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; margin-bottom: 12px; cursor: pointer; color: var(--muted); font: 650 13px/1 var(--sans); }
.back-link:hover { color: var(--ink); }
.lead-detail-head { margin-bottom: 18px; }
.lead-detail-top { display: flex; align-items: flex-start; gap: 16px; }
.lead-detail-head h1 { margin: 0; font: 780 30px/1.1 var(--sans); letter-spacing: -.045em; overflow-wrap: anywhere; }
.lead-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.lead-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.lead-sub-client { color: var(--ac); font-weight: 650; }
.lead-address { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--ac); font: 650 13.5px/1.35 var(--sans); text-decoration: none; }
.lead-address:hover { text-decoration: underline; filter: none; }
.dirhint { margin-left: 2px; padding: 3px 7px; border-radius: 999px; background: var(--ac-soft); color: var(--ac-ink); font: 800 9.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.lead-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; flex: none; }

.lead-detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 16px; align-items: start; }
.lead-side { display: flex; flex-direction: column; min-width: 0; }
.lead-card { border-radius: 16px; }
.lead-card-head { display: flex; align-items: center; gap: 10px; padding: 15px 17px 11px; }
.lead-card-head h2 { margin: 0; font: 780 14px/1.2 var(--sans); }
.lead-card-head .card-link { margin-left: auto; }
.lead-card-empty { margin: 0; padding: 0 17px 16px; font-size: 13.5px; }
.followup-status { margin: 0; padding: 0 17px 10px; font: 400 13.5px/1.5 var(--sans); }
.followup-act { padding: 0 17px 16px; }
.followup-act .hint { margin: 0; }
.followup-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.followup-btns + .hint { margin-top: 8px; }
.saved-flag { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1 var(--sans); color: var(--muted); }
.saved-flag.is-on { color: var(--green); }

.copy-rows { display: flex; flex-direction: column; }
/* The whole row is the button. On a phone that is one tap instead of a
   long-press-and-drag selection, which is the actual job someone is doing
   while a homeowner is on the line. */
.copy-row {
  display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 9px 17px; background: none; border: none; border-top: 1px solid var(--line-soft);
  font: inherit; text-align: left; cursor: pointer;
}
.copy-row:hover { background: #fbfbfd; }
.copy-row:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.copy-label { font: 600 12px/1.3 var(--sans); color: #9ba0aa; }
.copy-value {
  /* Wrap rather than truncate. An ellipsised address still copies in full, but
     you cannot read it — and reading it is half of why it is on screen. */
  font: 650 14px/1.4 var(--sans); color: var(--ink); overflow-wrap: anywhere;
}
.copy-hint { display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px/1 var(--sans); color: var(--faint); opacity: 0; transition: opacity .12s; }
.copy-row:hover .copy-hint, .copy-row:focus-visible .copy-hint { opacity: 1; }
@media (hover: none) { .copy-hint { opacity: .7; } }

/* Notes: the form's answers, then written notes, then the box to add one. */
.intake-notes, .written-notes { display: flex; flex-direction: column; }
.qa, .note { display: flex; flex-direction: column; gap: 3px; padding: 11px 17px; border-top: 1px solid var(--line-soft); }
.qa .q { font: 500 12px/1.4 var(--sans); color: #9ba0aa; }
.qa .a { font: 500 14px/1.5 var(--sans); }
.note-body { margin: 0; font: 400 14px/1.55 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-by { font: 400 11.5px/1.4 var(--sans); color: var(--faint); }
.note-link { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-link .btn { white-space: nowrap; }
.note-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 17px 15px; border-top: 1px solid var(--line-soft); }
/* A fixed starting height: a box that grew on focus moved the Add note button
   out from under the pointer as focus left it, so the click missed. */
.note-form textarea { flex: 1; min-height: 44px; height: 64px; resize: vertical; }
.note-form .btn { flex: none; min-height: 40px; }

/* Appointment. */
.appt-block { padding: 2px 17px 16px; display: flex; flex-direction: column; gap: 12px; }
.appt-main { display: flex; align-items: center; gap: 12px; }
.appt-main .appt-badge { margin-left: auto; }
.date-tile { width: 46px; height: 46px; border-radius: 13px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--ac-soft); color: var(--ac); line-height: 1; }
.date-tile b { font: 800 16px/1 var(--sans); }
.date-tile small { margin-top: 3px; font: 800 9px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.appt-when { font: 720 14.5px/1.3 var(--sans); }
.appt-rep { display: flex; align-items: baseline; gap: 8px; font: 600 13px/1.35 var(--sans); color: var(--ink); }
.appt-rep .linkish { font-weight: 500; font-size: 13px; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.appt-where { display: flex; align-items: baseline; gap: 7px; font-size: 13.5px; line-height: 1.4; }
.appt-where > svg { flex: none; align-self: center; color: var(--muted); }
.appt-where a { color: inherit; overflow-wrap: anywhere; }
.appt-where .linkish { flex: none; font-size: 13px; }

/* Outcome and appointment badges: soft semantic washes, as the previews' pills. */
.lead-badge, .appt-badge {
  display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px;
  font: 720 11px/1.1 var(--sans); white-space: nowrap;
}
.lead-badge.is-new       { background: var(--ac-soft); color: var(--ac-ink); }
.lead-badge.is-contacted { background: var(--amber-bg); color: var(--amber); }
.lead-badge.is-booked    { background: var(--lav-bg); color: var(--lav); }
.lead-badge.is-won       { background: var(--green-bg); color: var(--green); }
.lead-badge.is-lost      { background: var(--grey-bg); color: #747984; }
.appt-badge.is-scheduled { background: var(--lav-bg); color: var(--lav); }
.appt-badge.is-completed { background: var(--green-bg); color: var(--green); }
.appt-badge.is-no_show   { background: var(--red-bg); color: var(--red); }
.appt-badge.is-cancelled { background: var(--grey-bg); color: #747984; }

/* Outcome. */
.outcome-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 0 17px; }
.outcome {
  min-height: 38px; padding: 0 6px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: #737883;
  font: 700 12.5px/1 var(--sans); transition: border-color .12s, background .12s;
}
.outcome:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.outcome:disabled { opacity: .6; cursor: default; }
.outcome.is-on.is-new       { background: var(--ac-soft); border-color: var(--ac-line); color: var(--ac-ink); }
.outcome.is-on.is-contacted { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.outcome.is-on.is-booked    { background: var(--lav-bg); border-color: #e2d6fa; color: var(--lav); }
.outcome.is-on.is-won       { background: var(--green-bg); border-color: #c9ebd8; color: var(--green); }
.outcome.is-on.is-lost      { background: var(--grey-bg); border-color: var(--line-strong); color: #5f6470; }
.outcome-hint { padding: 10px 17px 14px; }
.lead-remove { display: flex; align-items: center; gap: 12px; padding: 12px 17px; border-top: 1px solid var(--line-soft); }
.lead-remove .hint { flex: 1; margin: 0; }

/* ------------------------------------------------------------ conversation */
.card.thread {
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
  position: sticky; top: 84px; height: calc(100vh - 116px); min-height: 520px; border-radius: 18px;
}
.thread-head { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 17px; border-bottom: 1px solid var(--line-soft); }
.thread-head h2 { margin: 0; font: 780 14px/1.2 var(--sans); }
.thread-count { font: 400 12px/1.3 var(--sans); color: var(--muted); }
.thread-head .pill { margin-left: auto; }
.thread-body {
  flex: 1; overflow-y: auto; padding: 18px 19px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #fbfbfd, #fff);
}
.thread-empty { margin: auto; max-width: 34ch; text-align: center; color: var(--muted); }
.thread-empty .ico { color: var(--faint); }
.thread-empty p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; }
.day-label { align-self: center; margin: 4px 0; font: 700 10.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #a0a5ae; }
.bubble-row { display: flex; flex-direction: column; gap: 4px; max-width: 76%; }
.bubble-row.is-outbound { align-self: flex-end; align-items: flex-end; }
.bubble-row.is-inbound { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 9px 12px; border-radius: 15px; font: 400 14px/1.45 var(--sans); white-space: pre-wrap; word-break: break-word; }
.is-outbound .bubble { background: var(--ac); color: #fff; border-bottom-right-radius: 5px; }
.is-inbound .bubble { background: #f0f1f4; color: #2f333b; border-bottom-left-radius: 5px; }
.bubble-time { font: 500 11px/1.3 var(--sans); color: #aaafb8; }
.bubble-failed { color: var(--red); }
.thread-compose { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: #fff; }
.thread-compose textarea {
  flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 140px;
  padding: 11px 13px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
  font: 400 14px/1.4 var(--sans); color: var(--ink);
}
.send-btn {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 13px; cursor: pointer;
  display: grid; place-items: center; background: var(--ac); color: #fff; font-size: 18px;
  transition: filter .15s, opacity .15s;
}
.send-btn:hover:not([disabled]) { filter: brightness(1.06); }
.send-btn[disabled] { opacity: .45; cursor: not-allowed; }
.send-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thread-note { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.thread-note:empty { display: none; }
.thread-note.is-err { color: var(--red); }
.thread-compose.is-off { align-items: center; color: var(--muted); font-size: 12.5px; line-height: 1.45; background: #fafbfc; }

/* ------------------------------------------------------------ appointments */
.appts-screen { display: flex; flex-direction: column; min-width: 0; }
.appt-list { background: #fff; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 16px; background: #fafbfc; border-top: 1px solid var(--line-soft); }
.day-head:first-child { border-top: 0; }
h2.day { margin: 0; font: 800 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #8f95a0; }
.day-head span { font: 500 11.5px/1 var(--sans); color: var(--faint); }
.appt-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line-soft); background: #fff; }
.day-head + .appt-row { border-top: 0; }
.appt-time { width: 92px; flex: none; }
.appt-time .t { font: 800 14px/1.2 var(--sans); }
.tzhint { font-size: 11px; }
.appt-name { font: 720 14px/1.3 var(--sans); }
.appt-row .appt-badge { margin-left: auto; }
.appt-row.is-skeleton { gap: 20px; }
.appt-row.is-clickable { cursor: pointer; }
.appt-row.is-clickable:hover { background: #fbfbfd; }
.appt-row.is-clickable:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.appt-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.appt-address { display: inline-flex; align-items: center; gap: 5px; color: var(--ac); font: 600 12.5px/1.35 var(--sans); text-decoration: none; }
.appt-address:hover { text-decoration: underline; filter: none; }

/* ===========================================================================
   Phone — the primary experience for the leads views. The table becomes
   cards; the detail becomes one column with the conversation last.
   =========================================================================== */
@media (max-width: 1100px) {
  .lead-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .card.thread { position: static; height: 640px; }
}
@media (max-width: 860px) {
  .lead-stats { gap: 8px; }
  .lead-stat { padding: 12px 12px; }
  .lead-stat .value { font-size: 21px; }
  .lead-stat .meta { display: none; }
  .lead-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  /* min-width:0 is load-bearing: a nowrap strip must scroll inside itself
     rather than widen the whole page. */
  .lead-chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .lead-chips::-webkit-scrollbar { display: none; }
  .lead-chips .chip { flex: none; }
  .lead-tools { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .searchbox { flex: 1 1 100%; min-width: 0; height: 44px; }
  .lead-clientfilter { flex: 1 1 100%; }

  .lead-table { background: none; border: none; overflow: visible; display: flex; flex-direction: column; gap: 9px; }
  .lead-head { display: none; }
  .lead-row, .lead-row.is-admin {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; min-height: 0;
    padding: 14px 15px; border: 1px solid var(--line); border-radius: 15px;
  }
  .lead-row > * { min-width: 0; }
  .lead-row .lead-name { grid-column: 1; font-size: 15.5px; overflow-wrap: anywhere; }
  .lead-row .push { grid-column: 2; grid-row: 1; }
  .lead-row .lead-client, .lead-row .lead-cell { grid-column: 1 / -1; }
  .lead-row .lead-cell { font-size: 13px; }
  .lead-row.is-skeleton { grid-template-columns: 1fr; }

  .lead-detail-top { flex-direction: column; align-items: stretch; gap: 14px; }
  .lead-detail-head h1 { font-size: 27px; }
  .lead-actions { margin-left: 0; display: grid; grid-template-columns: 1.4fr 1fr 1fr; }
  .lead-actions .btn { min-height: 46px; padding: 0 8px; }
  .outcome-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outcome { min-height: 46px; }
  .copy-row { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .lead-remove { flex-wrap: wrap; }
  .card.thread { height: 70vh; min-height: 460px; }
  .bubble-row { max-width: 86%; }

  .appt-row { flex-wrap: wrap; gap: 6px 12px; }
  .appt-time { width: auto; }
  .appt-row > .btn, .appt-row > .appt-acts { margin-left: auto; }
  .appt-row .btn { min-height: 40px; }
}
@media (max-width: 430px) {
  .lead-actions { grid-template-columns: 1fr 1fr; }
  .lead-actions .btn--primary { grid-column: 1 / -1; }
}

/* Read-only key/value list, used by the task view sheet. A grid rather than
   flowed text so the labels line up down the left and long values wrap under
   their own column instead of under the label. */
.facts {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 9px 18px;
  margin: 0;
  align-items: baseline;
}
.facts dt { font: 500 12px/1.5 var(--sans); color: var(--muted); }
.facts dd { margin: 0; font: 400 13.5px/1.5 var(--sans); color: var(--ink); overflow-wrap: anywhere; }

/* Section heading inside a view sheet. Quieter than the sheet's own <h2>,
   which is the thing being read. */
.view-head {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font: 600 12px/1.3 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 560px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
}

/* Install prompt — a bar across the bottom, where a thumb already is. Fixed
   rather than in the flow so it never shifts the list somebody is reading, and
   padded for the home indicator on a notched phone. */
.install-bar {
  position: fixed; left: 10px; right: 10px; z-index: 60;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px;
  background: #17181a; color: #f5f3ef;
  border-radius: 13px;
  box-shadow: 0 10px 34px -10px rgba(22, 23, 26, .5);
}
.install-icon { border-radius: 8px; flex: none; display: block; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.install-text > span { font: 400 13.2px/1.4 var(--sans); }
.install-steps {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font: 400 12.5px/1.4 var(--sans); color: rgba(245, 243, 239, .62);
}
.install-steps b { font-weight: 600; color: rgba(245, 243, 239, .9); }
.install-share { width: 15px; height: 15px; display: inline-flex; color: rgba(245, 243, 239, .85); }
.install-share svg { width: 100%; height: 100%; }
.install-bar .btn { flex: none; }
/* On the dark bar the outlined button would read as disabled. */
.install-bar .btn--primary { background: var(--ac); border-color: var(--ac); color: #fff; }
.install-close {
  flex: none; width: 30px; height: 30px; padding: 0;
  background: none; border: none; cursor: pointer;
  color: rgba(245, 243, 239, .45); font-size: 15px; line-height: 1;
}
.install-close:hover { color: rgba(245, 243, 239, .9); }

/* Desktop never sees it, but a wide phone in landscape might. */
@media (min-width: 620px) {
  .install-bar { left: auto; right: 16px; max-width: 460px; }
}

/* The QR and its instructions. Stacks under the code on a narrow sheet. */
.qr-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr {
  flex: none; width: 190px; height: 190px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.qr-side { flex: 1; min-width: 200px; }
.qr-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.qr-step .n {
  width: 24px; height: 24px; border-radius: 8px; margin-top: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ac-soft); color: var(--ac);
  font: 800 11px/1 var(--sans);
}
.qr-step b { display: block; font: 600 13.5px/1.4 var(--sans); margin-bottom: 1px; }
.qr-step span { font: 400 13px/1.5 var(--sans); color: var(--muted); }

/* Lead alerts. A single row: state, one line of why, one action. */
.alerts-card {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
}
.alerts-icon { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 18px; background: var(--grey-bg); color: var(--muted); }
.alerts-card.is-on .alerts-icon { background: var(--green-bg); color: var(--green); }
.alerts-card.is-blocked .alerts-icon,
.alerts-card.is-need_install .alerts-icon { background: var(--amber-bg); color: var(--amber); }
.alerts-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alerts-text b { font: 720 14px/1.35 var(--sans); }
.alerts-text span { font: 400 12.8px/1.45 var(--sans); color: var(--muted); text-wrap: pretty; }
.alerts-card .btn { flex: none; }

@media (max-width: 560px) {
  .alerts-card { flex-wrap: wrap; align-items: flex-start; }
  .alerts-card .btn { width: 100%; min-height: 44px; }
}

/* Room for the fixed install bar, so it never covers the last row of a list. */
body.has-install-bar .page { padding-bottom: 110px; }
@media (max-width: 780px) {
  body.has-install-bar .install-bar { bottom: calc(var(--tabbar-space) + 10px); }
  body.has-install-bar .page { padding-bottom: calc(var(--tabbar-space) + 110px); }
}

/* The push self-test, in the admin alerts sheet. */
.push-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-test-out { font: 400 12.5px/1.5 var(--code); color: var(--muted); overflow-wrap: anywhere; }
.push-test-out.is-ok { color: var(--green); }
.push-test-out.is-part { color: var(--yellow); }
.push-test-out.is-bad { color: var(--red); }

/* Notifications: what you hear about, per channel. */
.notif-loading { margin: 0; font: 400 13.5px/1.6 var(--sans); color: var(--muted); }
.notif-note { margin: 0; font: 400 12.8px/1.55 var(--sans); color: var(--muted); text-wrap: pretty; }
.notif-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px 62px;
  align-items: center; gap: 0; padding: 4px 12px 0;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.notif-head {
  font: 800 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: #9ca1aa; text-align: center; padding: 12px 0 10px;
}
.notif-what {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 12px 11px 0; border-top: 1px solid var(--line-soft);
}
.notif-what b { font: 600 13.5px/1.35 var(--sans); }
.notif-what span { font: 400 12.5px/1.45 var(--sans); color: var(--muted); text-wrap: pretty; }
/* The whole cell is the target, not just the box — this gets used on a phone. */
.notif-check {
  display: flex; align-items: center; justify-content: center;
  align-self: stretch; min-height: 48px; cursor: pointer;
  border-top: 1px solid var(--line-soft);
}
.notif-check input { width: 19px; height: 19px; accent-color: var(--ac); cursor: pointer; }
.notif-check input:disabled { opacity: .5; }

@media (max-width: 460px) {
  .notif-grid { grid-template-columns: minmax(0, 1fr) 46px 46px 46px; }
  .notif-what { padding-right: 6px; }
}

/* A channel that is switched on but cannot reach anybody. Kept legible rather
   than hidden: the reason is the whole message. */
.notif-check input:disabled + span { opacity: .3; cursor: not-allowed; }
.notif-consent {
  font: 400 12px/1.5 var(--sans); color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 11px; margin: 2px 0 0;
}
.notif-consent b { color: var(--ink); font-weight: 600; }

/* A text alert's title is the whole message, newlines and all. Show the first
   few lines and keep the row a row; the full text is in the tooltip. */
.alert-title {
  font: 400 13.5px/1.35 var(--sans); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Why a row failed. Wraps to two lines and then clips: a Twilio or Resend
   message can be long, and the first clause is always the useful one. */
.alert-why {
  font: 400 12px/1.35 var(--sans); color: var(--red);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Alerts & notifications. Six columns, same shape as the design's table. */
.alert-head, .alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.4fr) 74px 128px 84px;
  gap: 14px; align-items: center;
}
.alert-head {
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  border-radius: var(--radius) var(--radius) 0 0;
  font: 700 11px/1 var(--sans); letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.alert-row { padding: 13px 20px; }
.alert-row:hover { background: var(--panel-2); }
.alert-name { font: 650 13.5px/1.3 var(--sans); }
.alert-handle { font: 400 12px/1.3 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.alert-when { font: 400 12.5px/1.3 var(--sans); color: var(--muted); white-space: nowrap; }
.alert-status { justify-self: end; }
.alert-row .alert-title { -webkit-line-clamp: 2; }
.alert-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.channel-tag {
  display: inline-flex; align-items: center; gap: 5px; justify-self: start; white-space: nowrap;
  padding: 4px 8px; border-radius: 999px; background: var(--grey-bg); color: var(--muted-2);
  font: 650 11.5px/1 var(--sans);
}
.rows .alert-row + .alert-row { border-top: 1px solid var(--line-soft); }
.alert-row a { color: var(--ink); text-decoration: none; }
.alert-row a:hover { color: var(--ac); text-decoration: underline; }

.alert-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft); background: var(--canvas);
}
.alert-mini {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px; align-items: center; padding: 11px 18px;
}
.rows .alert-mini + .alert-mini { border-top: 1px solid var(--line-soft); }
.alert-card-foot { padding: 11px 18px; border-top: 1px solid var(--line-soft); }

/* The table does not survive being squeezed; let it scroll rather than crush. */
@media (max-width: 1100px) {
  .alert-head, .alert-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 70px 84px; }
  .alert-head > :nth-child(3), .alert-row > :nth-child(3),
  .alert-head > :nth-child(5), .alert-row > :nth-child(5) { display: none; }
}
/* Contact cards need more room than the client tiles — three columns of
   name, address, alert title and status do not fit at 268px. */
.grid--alerts { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); align-items: start; }


/* ------------------------------------------------------------- prospects */
/* Our own pipeline. Board columns, cards, the list, the detail sheet's stage
   grid and timeline, analytics tables, the log and the setup page. */

.pro-search {
  font: 400 13px/1 var(--sans); padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel); min-width: 160px;
}
/* The admin search boxes: long enough to read their own placeholder. */
.search-wide { min-width: 300px; }
@media (max-width: 720px) { .search-wide { min-width: 0; width: 100%; } }

.pboard { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.pcol {
  flex: 0 0 248px; background: rgba(22, 23, 26, .035); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 10px 10px; min-height: 180px;
  transition: background .12s, border-color .12s;
}
.pcol--mobile { flex: none; width: 100%; }
.pcol.is-over { background: rgba(22, 23, 26, .07); border-color: var(--line-strong); }
.pcol-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.pcol-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pcol-title { font: 500 13.5px/1 var(--sans); }
.pcol-count { margin-left: auto; font: 400 12px/1 var(--mono); color: var(--muted); }
.pcol-avg { font: 400 10px/1 var(--mono); letter-spacing: .1em; color: var(--muted); padding: 8px 4px 10px; display: flex; align-items: center; }
.pcol-body { display: flex; flex-direction: column; gap: 8px; }
.pcol-empty { font: 400 12.5px/1.4 var(--sans); color: var(--faint); padding: 18px 6px; text-align: center; }

.pcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 4px;
  cursor: grab; box-shadow: var(--shadow);
}
.pcard:hover { border-color: var(--line-strong); }
.pcard.is-flag { border-color: var(--red-line); background: linear-gradient(0deg, var(--panel), var(--panel)), var(--red-bg); }
.pcard.is-dragging { opacity: .45; }
.pcard-name { font: 500 14px/1.3 var(--sans); }
.pcard-sub { font: 400 12.5px/1.3 var(--sans); color: var(--muted); }
.pcard-appt { font: 400 12px/1.4 var(--sans); color: var(--muted); padding: 4px 0 2px; border-bottom: 1px solid var(--line-soft); }
.pcard-portals { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.pcard-portals a { font: 500 12px/1.4 var(--sans); }
/* A client's shared Drive and research, wherever their card or row is. */
.doc-links { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.doc-links a { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/1.5 var(--sans); color: var(--ac-ink); text-decoration: none; }
.doc-links a:hover { text-decoration: underline; }
.pro-stage {
  flex: 1; min-width: 0; font: 400 12px/1 var(--sans); padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel);
}

/* The list. */
.pro-head, .pro-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) 96px 130px 76px minmax(0, 1fr) 90px 100px;
  gap: 12px; align-items: center; padding: 12px 18px;
}
.pro-head { border-bottom: 1px solid var(--line); }
.pro-th { font: 500 10px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.pro-th.is-on { color: var(--ink); }
.pro-row { border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.pro-row:last-child { border-bottom: none; }
.pro-row:hover { background: rgba(22, 23, 26, .02); }

/* Detail sheet. */
.pro-stages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pro-stage-btn {
  text-align: left; padding: 11px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); display: flex; flex-direction: column; gap: 3px;
}
.pro-stage-btn b { font: 500 13.5px/1.2 var(--sans); }
.pro-stage-btn span { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }
.pro-stage-btn:hover:not(:disabled) { border-color: var(--ink); }
.pro-stage-btn.is-current { border: 1.5px solid var(--ac); background: rgba(22, 23, 26, .03); }
.pro-stage-btn.is-current b { color: var(--ac); }
.pro-stage-btn.is-current span { color: var(--ac); }
.pro-stage-btn.is-illegal { opacity: .5; cursor: not-allowed; background: rgba(22, 23, 26, .02); }
.pro-kv { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font: 400 13.5px/1.4 var(--sans); }
.pro-kv:last-child { border-bottom: none; }
.pro-kv > span:first-child { color: var(--muted); flex: none; }
.pro-kv > *:last-child { text-align: right; word-break: break-word; }
.pro-tl { display: flex; flex-direction: column; gap: 14px; }
.pro-tl-row { display: flex; gap: 12px; align-items: flex-start; }
.pro-tl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }

/* Analytics. */
.pro-bar { height: 8px; border-radius: 999px; background: rgba(22, 23, 26, .07); overflow: hidden; margin-top: 6px; }
.pro-bar-fill { height: 100%; border-radius: 999px; }
.pro-tbl { display: flex; flex-direction: column; }
.pro-tbl-head, .pro-tbl-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 64px 72px minmax(0, 1fr);
  gap: 12px; align-items: center; padding: 11px 22px;
}
.pro-tbl-head { font: 500 10px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.pro-tbl-row { border-bottom: 1px solid var(--line-soft); font: 400 13.5px/1.3 var(--sans); }
.pro-tbl-row:last-child { border-bottom: none; }

/* The log. */
.pro-log-head, .pro-log-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.6fr) 150px;
  gap: 14px; align-items: center; padding: 12px 18px;
}
.pro-log-head { font: 500 10px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.pro-log-row { border-bottom: 1px solid var(--line-soft); }
.pro-log-row:last-child { border-bottom: none; }

/* Booking picker: a real date field, day chips, a grid of times, and the
   answer in words. */
.book-date {
  font: 400 16px/1 var(--sans); padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); width: 100%; max-width: 280px;
}
.book-days { display: flex; gap: 6px; flex-wrap: wrap; }
.book-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.book-slot {
  font: 400 13px/1 var(--sans); padding: 10px 6px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
}
.book-slot:hover { border-color: var(--ink); }
.book-slot.is-on { background: var(--ac); border-color: var(--ac); color: #fff; font-weight: 500; }
.book-preview {
  font: 400 15px/1.4 var(--sans); padding: 12px 14px; border-radius: 8px;
  background: rgba(22, 23, 26, .04); border: 1px solid var(--line);
}

/* Attribution table: wide by nature, scrolls inside its card. */
.pro-attr { border-collapse: collapse; width: 100%; min-width: 900px; }
.pro-attr th {
  text-align: left; padding: 11px 14px; white-space: nowrap;
  font: 500 10px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0;
}
.pro-attr td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.pro-attr tbody tr { cursor: pointer; }
.pro-attr tbody tr:hover td { background: rgba(22, 23, 26, .02); }
.pro-attr tbody tr:last-child td { border-bottom: none; }

/* Conversations: list on the left, thread on the right, bubbles, composer. */
.msg-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; min-height: 60vh; }
.msg-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; max-height: 75vh; overflow-y: auto; }
.msg-row { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.msg-row:last-child { border-bottom: none; }
.msg-row:hover { background: rgba(22, 23, 26, .02); }
.msg-row.is-on { background: rgba(22, 23, 26, .05); }
.msg-unread { font: 600 10.5px/1 var(--mono); color: #fff; background: var(--ac); border-radius: 999px; padding: 4px 7px; }
.msg-thread { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-height: 60vh; max-height: 75vh; }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.msg-bubbles { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.msg-bubble { max-width: 78%; padding: 9px 12px; border-radius: 12px; font: 400 13.5px/1.45 var(--sans); display: flex; flex-direction: column; gap: 4px; }
.msg-bubble.is-in { align-self: flex-start; background: rgba(22, 23, 26, .06); border-bottom-left-radius: 4px; }
.msg-bubble.is-out { align-self: flex-end; background: var(--ac); color: #fff; border-bottom-right-radius: 4px; }
.msg-meta { font: 400 10.5px/1.3 var(--mono); opacity: .7; }
.msg-composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.msg-compose { flex: 1; resize: vertical; font: 400 13.5px/1.45 var(--sans); padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; min-height: 42px; }
@media (max-width: 720px) {
  .msg-layout { grid-template-columns: 1fr; }
}

/* Setup page. */
.pro-p { margin: 0; font: 400 14px/1.6 var(--sans); color: var(--muted-2); }
.pro-p b { color: var(--ink); font-weight: 600; }
.pro-ul { margin: 0; padding-left: 18px; font: 400 13.5px/1.6 var(--sans); color: var(--muted-2); }
.pro-ul b { color: var(--ink); font-weight: 600; font-family: var(--code); font-size: 12.5px; }
.pro-code {
  margin: 0; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
  background: #1d2027; color: #eef0f6; font: 400 12.5px/1.55 var(--code);
}

@media (max-width: 720px) {
  .pro-head, .pro-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .pro-head > :nth-child(n+3), .pro-row > :nth-child(n+3) { display: none; }
  .pro-stages { grid-template-columns: 1fr; }
  .pro-log-head, .pro-log-row { grid-template-columns: minmax(0, 1fr); }
  .pro-log-head { display: none; }
}

/* ===========================================================================
   Booking calendar — bookingui.js
   The "Booking" screen in the client portal and the "Booking calendar" tab on
   a client in the admin. Everything is prefixed .bc- so it cannot collide with
   the prospects booking picker (.book-*) above.
   =========================================================================== */

.bc { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bc-panel { gap: 18px; }

/* The global input rule predates these types; same look. */
.bc input[type=time], .bc input[type=tel], .sheet input[type=time], .sheet input[type=tel] {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--ink); font: 400 13.5px/1.4 var(--sans);
}
.bc textarea.bc-plain, .bc textarea.bc-msg, .sheet textarea.bc-msg {
  font: 400 13.5px/1.5 var(--sans); min-height: 0;
}
.bc input:disabled, .bc select:disabled, .bc textarea:disabled {
  background: rgba(22, 23, 26, .03); color: var(--muted-2); cursor: not-allowed;
}

.bc-note {
  padding: 10px 14px; border-radius: 8px;
  background: var(--yellow-bg); color: var(--amber);
  font: 500 13px/1.45 var(--sans);
}
.bc-warn { color: var(--red); }
.bc-bad { color: var(--red); }
.bc-error {
  padding: 11px 14px; border-radius: 7px;
  background: var(--red-bg); border: 1px solid var(--red-line);
  color: var(--red); font: 400 13px/1.5 var(--sans);
}
.bc-switch { max-width: 320px; }
.bc-tabs { align-self: stretch; }

.bc-setup { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.bc-setup h2, .bc-form > h2, .bc-preview h2, .bc-status h2 { margin: 0; font: 600 15px/1.25 var(--sans); }
.bc-setup .field { max-width: 360px; }

/* ------------------------------------------------------------ status bar */
.bc-status {
  padding: 19px; display: flex; flex-direction: column; gap: 12px; border-radius: 19px;
  background: linear-gradient(145deg, #fff, var(--ac-soft-2));
}
.bc-status-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bc-status-top h2 { font-size: 16px; }
.bc-cal-icon { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--ac-soft); color: var(--ac); font-size: 20px; }
.bc-mode { margin-left: auto; }
.bc-mode button { min-height: 30px; padding: 0 13px; font-size: 12.5px; }
.bc-mode .is-on.is-live { color: var(--green); }
.bc-mode .is-on.is-test { color: var(--amber); }
.bc-mode .is-on.is-off { color: var(--ink); }
.bc-link { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.bc-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-url {
  font: 500 13px/1.4 var(--code); overflow-wrap: anywhere;
  padding: 7px 10px; border-radius: 9px; background: var(--grey-bg);
  min-width: 0; flex: 0 1 auto;
}

/* ------------------------------------------------------------------ forms */
.bc-form { display: flex; flex-direction: column; gap: 16px; }
.bc-savebar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 0; background: var(--canvas);
  border-top: 1px solid var(--line);
}
.bc-slug { display: flex; align-items: stretch; min-width: 0; }
.bc-slug > span {
  display: flex; align-items: center; padding: 0 9px;
  border: 1px solid var(--line-strong); border-right: none; border-radius: 6px 0 0 6px;
  background: rgba(22, 23, 26, .04); color: var(--muted);
  font: 400 12.5px/1 var(--code); white-space: nowrap;
  flex: 0 0 auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis;
}
.bc-slug > input { border-radius: 0 6px 6px 0; min-width: 0; }
.bc-host > input { border-radius: 6px 0 0 6px; }
.bc-host > span { border-radius: 0 6px 6px 0; border-right: 1px solid var(--line-strong); border-left: none; }
.bc-range { display: flex; align-items: center; gap: 8px; }
.bc-range input { max-width: 150px; }
.bc-days { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-check, .bc-toggle, .bc-radio {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 400 13.5px/1.35 var(--sans); color: var(--ink);
}
.bc-check {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel);
}
.bc-check input, .bc-toggle input, .bc-radio input { width: 16px; height: 16px; accent-color: var(--ac); margin: 0; }
.bc-radio--top { align-items: flex-start; }
.bc-linkbox { width: 100%; min-width: 0; font: 400 12.5px/1.4 var(--code); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--grey-bg, #f6f7f9); color: var(--ink); }
.bc-radio--top input { margin-top: 2px; }

/* -------------------------------------------------------------- messages */
.bc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bc-chips .chip { font: 400 11.5px/1 var(--code); padding: 0 9px; min-height: 27px; border-radius: 7px; }
.bc-chips .chip:hover:not(:disabled) { border-color: var(--ac); color: var(--ac); }
.bc-msgblock {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas);
}
.bc-msgfoot { display: flex; gap: 12px; flex-wrap: wrap; font: 400 12px/1.4 var(--sans); }
.bc-count { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.bc-count.is-long { color: var(--yellow); }
.bc-rules { gap: 10px; }
.bc-rule.is-off textarea, .bc-rule.is-off .bc-amount, .bc-rule.is-off .bc-unit { opacity: .55; }
.bc-rule-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-rule-top .bc-amount { width: 80px; }
.bc-rule-top .bc-unit { width: auto; min-width: 140px; }

/* --------------------------------------------------------------- preview */
.bc-preview { display: flex; flex-direction: column; gap: 14px; border-color: var(--ac); }
.bc-preview-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.bc-preview-form .field { width: 180px; }
.bc-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.bc-thead, .bc-trow {
  display: grid; grid-template-columns: 170px 230px minmax(0, 1fr); gap: 14px;
  padding: 11px 14px; align-items: start;
}
.bc-thead {
  font: 500 10px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.bc-trow + .bc-trow { border-top: 1px solid var(--line-soft); }
.bc-trow b { font: 600 13.5px/1.4 var(--sans); }
.bc-trow .pill { align-self: flex-start; }
.bc-body { font: 400 13px/1.5 var(--sans); color: var(--muted-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.bc-trow .bc-body { margin: 0; }

/* ------------------------------------------------------------------ team */
.bc-member {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
}
.rows .bc-member:last-child { border-bottom: none; }
.bc-member-main { flex: 1; min-width: 240px; gap: 5px; }
.bc-member-main .meta { font: 400 12.5px/1.45 var(--sans); color: var(--muted); }
.bc-member-main .meta.bc-bad { color: var(--red); }
.bc-name { font: 600 14.5px/1.3 var(--sans); }
.bc-order { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 26px; padding-top: 1px; }
.bc-order-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--line-soft); font: 600 12px/1 var(--sans); color: var(--ink);
}
.bc-order-btn {
  border: 0; background: none; padding: 1px 4px; cursor: pointer;
  font: 400 10px/1 var(--sans); color: var(--muted);
}
.bc-order-btn:hover:not(:disabled) { color: var(--ink); }
.bc-order-btn:disabled { opacity: .25; cursor: default; }
.bc-member-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bc-g { display: inline-flex; align-items: center; gap: 7px; }
.bc-g.is-bad { color: var(--red) !important; }
.bc-addrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--canvas);
}
.bc-addrow select { width: auto; min-width: 240px; flex: 0 1 320px; }
.bc-gnote { max-width: 72ch; }

/* The weekly hours sheet and the days-off sheet. */
.bc-week { display: flex; flex-direction: column; }
.bc-day {
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.bc-day-name { display: flex; align-items: center; gap: 8px; padding-top: 8px; font: 600 13.5px/1 var(--sans); cursor: pointer; }
.bc-day-name input { width: 16px; height: 16px; accent-color: var(--ac); margin: 0; }
.bc-blocks > .dim { display: inline-block; padding-top: 8px; font-size: 13px; }
.bc-block { display: flex; align-items: center; gap: 8px; }
.bc-block input { max-width: 140px; }
.bc-addblock { color: var(--ac); font-size: 12.5px; font-weight: 500; }
/* "Copy to other days" in the weekly hours sheet. */
.bc-linkbtn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ac); font: 500 12.5px/1.4 var(--sans);
}
.bc-linkbtn:hover { text-decoration: underline; }
.bc-copy-open { display: block; margin-top: 8px; }
.bc-copy {
  margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(22, 23, 26, .025); display: flex; flex-direction: column; gap: 10px;
}
.bc-copy-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font: 600 13px/1.3 var(--sans); }
.bc-copy-head span { margin-right: auto; }
.bc-copy-days { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-copy-day {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 7px; font: 500 13px/1 var(--sans); background: var(--panel);
}
.bc-copy-day input { width: 15px; height: 15px; margin: 0; accent-color: var(--ac); }
.bc-copy-actions { display: flex; gap: 8px; }
.bc-copy .hint { margin: 0; }
.bc-emailtoggle { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 6px; font: 400 13.5px/1.5 var(--sans); color: var(--muted-2); cursor: pointer; }
.bc-emailtoggle input { margin-top: 3px; accent-color: var(--ac); }
.bc-emailtoggle b { color: var(--ink); font-weight: 600; }
.bc-ovform { display: flex; flex-direction: column; gap: 12px; }
.bc-ovform .field { max-width: 220px; }
.bc-ov { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bc-ov b { font: 600 13.5px/1.3 var(--sans); }
.bc-ov .meta { font: 400 12.5px/1.4 var(--sans); color: var(--muted); }

/* ---------------------------------------------------------- appointments */
.bc-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-n { font-weight: 500; opacity: .6; }
.chip.is-on .chip-n { opacity: .75; }
.bc-appt .meta { font: 400 12px/1.4 var(--sans); color: var(--faint); }
.bc-timeline { display: flex; flex-direction: column; }
.bc-tl { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 10px 0; position: relative; }
.bc-tl + .bc-tl { border-top: 1px solid var(--line-soft); }
.bc-tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--grey); }
.bc-tl.is-sent .bc-tl-dot { background: var(--green); }
.bc-tl.is-pending .bc-tl-dot { background: var(--yellow); }
.bc-tl.is-failed .bc-tl-dot { background: var(--red); }
.bc-tl b { font: 600 13.5px/1.3 var(--sans); }
.bc-tl .meta { font: 400 12px/1.45 var(--sans); color: var(--muted); }
.bc-tl-status {
  font: 600 10.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; background: rgba(22, 23, 26, .06); color: var(--muted);
}
.bc-tl.is-sent .bc-tl-status { background: var(--green-bg); color: var(--green); }
.bc-tl.is-pending .bc-tl-status { background: var(--yellow-bg); color: var(--yellow); }
.bc-tl.is-failed .bc-tl-status { background: var(--red-bg); color: var(--red); }
.bc-tl summary { cursor: pointer; margin-top: 2px; }

/* The staff time picker: who is free is part of each time. */
.bc-picker { display: flex; flex-direction: column; gap: 12px; }
.bc-weeknav { display: flex; align-items: center; gap: 10px; }
.bc-weeknav > span { flex: 1; text-align: center; font: 600 13.5px/1 var(--sans); }
.bc-daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.bc-daychip {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font: 400 11px/1 var(--sans);
}
.bc-daychip b { font: 600 16px/1 var(--sans); }
.bc-daychip small { font-size: 10px; color: var(--muted); }
.bc-daychip.is-on { background: var(--ac); border-color: var(--ac); color: #fff; }
.bc-daychip.is-on small { color: rgba(255, 255, 255, .8); }
.bc-daychip:disabled { opacity: .4; cursor: not-allowed; }
.bc-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.bc-slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer; text-align: left;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
}
.bc-slot b { font: 600 13.5px/1 var(--sans); }
.bc-slot small { font: 400 11px/1.3 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.bc-slot:hover { border-color: var(--ac); }
.bc-slot.is-on { background: var(--ac); border-color: var(--ac); color: #fff; }
.bc-slot.is-on small { color: rgba(255, 255, 255, .85); }
.bc-assignees { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.bc-assignee.is-free:not(.is-on) small { color: var(--green); }
.bc-assignee:disabled { opacity: .55; cursor: default; }
.bc-assignee:disabled:hover { border-color: var(--line-strong); }

@media (max-width: 760px) {
  .bc-mode { margin-left: 0; width: 100%; }
  .bc-mode button { flex: 1; }
  .bc-thead { display: none; }
  .bc-thead, .bc-trow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bc-member { padding: 14px 16px; }
  .bc-member-actions { justify-content: flex-start; }
  .bc-addrow { padding: 12px 16px; }
  .bc-addrow select { flex: 1 1 100%; min-width: 0; }
  .bc-addrow .push { margin-left: 0; }
  .bc-day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .bc-day-name { padding-top: 0; }
  .bc-preview-form .field { width: calc(50% - 5px); }
  .bc-preview-form .btn { width: 100%; justify-content: center; }
  .bc-slug > span { max-width: 45%; }
}
.bc textarea::placeholder, .sheet textarea.bc-msg::placeholder { color: var(--faint); }
.bc-trow > .stack > span { font: 400 13.5px/1.4 var(--sans); }
.bc-trow > .stack > span.meta { font-size: 12px; color: var(--muted); }
.bc-appt .appt-badge { margin-left: auto; }

/* ------------------------------------------------------------ form pieces */
.form-error {
  padding: 11px 14px; border-radius: var(--radius-xs);
  background: var(--red-bg); border: 1px solid var(--red-line);
  color: var(--red); font: 500 13px/1.5 var(--sans);
}
/* A checkbox field: box and label on one line, any hint underneath. */
label.field.field--check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; cursor: pointer; }
.field--check > input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ac); cursor: pointer; }
.field--check .field-check-label { font: 600 13.5px/1.35 var(--sans); color: var(--ink); flex: 1; min-width: 0; }
.field--check > .hint { flex-basis: 100%; padding-left: 28px; }
.sheet:focus { outline: none; }
/* Phones: 16px stops iOS zooming the page when a field is tapped. */
@media (max-width: 780px) {
  input[type=text], input[type=email], input[type=url], input[type=number], input[type=date],
  input[type=search], input[type=password], input[type=time], input[type=tel], select, textarea { font-size: 16px; min-height: 44px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ===========================================================================
   Client portal screens (client.js) — bizgrips_client_portal_preview.html
   =========================================================================== */

/* Card header shared by the home and setup cards. */
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 17px 19px 13px; }
.card-head > div { min-width: 0; }
.card-head h3 { margin: 0; font: 760 14.5px/1.25 var(--sans); letter-spacing: -.01em; }
.card-head p { margin: 3px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.card-link {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 4px 0; cursor: pointer;
  color: var(--ac); font: 750 12px/1.2 var(--sans);
}
.card-link .ico { font-size: 13px; }
.card-pad-x { padding: 0 19px 12px; }
.linkish.title { font: 680 14px/1.3 var(--sans); padding: 0; text-align: left; color: var(--ink); }
.linkish.title:hover { text-decoration: none; color: var(--ac) !important; }
.task-need { font: 650 12px/1.4 var(--sans); color: var(--ac); }
.task-given { display: inline-flex; align-items: center; gap: 3px; font: 400 12px/1.4 var(--sans); color: var(--muted); }
.task-given .ico { color: var(--green); }

.home { gap: 16px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 16px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.task-rows .row { padding: 13px 19px; }

/* The launch hero: where the build stands, from real progress. */
.launch-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 27px 29px 24px; border-radius: 24px;
  background: linear-gradient(132deg, var(--ac) 0%, color-mix(in srgb, var(--ac) 82%, #8a82f6) 57%, color-mix(in srgb, var(--ac) 55%, #a08ef3) 100%);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--ac) 20%, transparent);
}
.launch-hero::before, .launch-hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .12);
}
.launch-hero::before { width: 360px; height: 360px; right: -120px; top: -150px; }
.launch-hero::after { width: 240px; height: 240px; right: 40px; bottom: -190px; border-color: rgba(255, 255, 255, .09); }
.launch-kicker { font: 750 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.launch-hero h2 { margin: 10px 0 9px; max-width: 600px; font: 780 30px/1.08 var(--sans); letter-spacing: -.045em; }
.launch-hero p { margin: 0; max-width: 520px; font: 400 13.5px/1.5 var(--sans); color: rgba(255, 255, 255, .78); }
.launch-bar { width: min(560px, 72%); height: 7px; margin-top: 22px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.launch-bar > span { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .4s var(--ease); }
.launch-stats { position: relative; z-index: 1; display: flex; gap: 30px; flex-wrap: wrap; margin-top: 14px; }
.launch-stats b { display: block; font: 780 19px/1.15 var(--sans); letter-spacing: -.03em; }
.launch-stats span { font: 500 11.5px/1.3 var(--sans); color: rgba(255, 255, 255, .68); }

/* Waiting on you: directly under the hero, warm but not alarming. */
.waiting-panel {
  padding: 17px 18px; border-radius: 17px;
  background: linear-gradient(145deg, #fffdfa, #fff9ed); border: 1px solid var(--amber-line);
}
.waiting-head { display: flex; align-items: center; gap: 11px; }
.waiting-icon { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--amber-bg); color: var(--amber); font-size: 16px; }
.waiting-head h3 { margin: 0; font: 760 14.5px/1.25 var(--sans); }
.waiting-head p { margin: 2px 0 0; font: 500 12px/1.3 var(--sans); color: #8a6a2c; }
.waiting-items { display: flex; flex-direction: column; margin-top: 10px; }
.waiting-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid rgba(173, 116, 27, .14); }
.waiting-item:first-child { border-top: 0; }
.waiting-item > .stack { flex: 1; min-width: 0; }
.waiting-title { font: 700 14px/1.3 var(--sans); color: var(--ink); text-align: left; }
.waiting-item .meta { font: 400 12px/1.4 var(--sans); color: #8a7b61; }

/* What BizGrips is handling. */
.handling-card { padding: 17px 19px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(145deg, #fff, var(--ac-soft-2)); border-color: var(--ac-line); }
.handling-head { display: flex; gap: 11px; align-items: flex-start; }
.handling-icon { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--ac-soft); color: var(--ac); font-size: 16px; }
.handling-head h3 { margin: 0; font: 760 14.5px/1.25 var(--sans); }
.handling-head p { margin: 3px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--muted); max-width: 62ch; }
.handling-list { display: flex; flex-direction: column; gap: 2px; padding-left: 45px; }
.handling-item { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: 550 13px/1.3 var(--sans); color: var(--ink); min-width: 0; }
.handling-item:hover .truncate { color: var(--ac); }
.handling-item .meta { margin-left: auto; flex: none; font: 400 11.5px/1 var(--sans); color: var(--muted); }
.handling-more { font: 500 12px/1.4 var(--sans); color: var(--muted); padding-top: 2px; }
.handling-card .card-link { margin-left: 45px; align-self: flex-start; }

/* Recent activity, quick resources, explore. */
.activity-list { padding: 0 19px 10px; display: flex; flex-direction: column; }
.activity-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.activity-row:first-child { border-top: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #f5f6fa; color: var(--green); }
.activity-row b { font: 680 13px/1.3 var(--sans); }
.activity-row .stack span { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }
.activity-time { font: 500 11px/1.6 var(--sans); color: var(--faint); white-space: nowrap; }
.res-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 19px 19px; }
.res-tile { display: flex; flex-direction: column; padding: 12px; border: 1px solid #eceef3; border-radius: 13px; background: #fff; color: var(--ink); text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s; min-width: 0; }
.res-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); filter: none; }
.res-tile b { margin-top: 9px; font: 700 12.5px/1.3 var(--sans); overflow-wrap: anywhere; }
.res-tile small { margin-top: 2px; font: 400 11.5px/1.3 var(--sans); color: var(--muted); }
.res-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: #f4f5fa; color: #6d7380; font-size: 15px; }
.explore-list { display: flex; flex-direction: column; padding: 0 10px 10px; }
.explore-item { display: flex; align-items: center; gap: 11px; padding: 9px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.explore-item:hover { background: #f6f7fa; }
.explore-item b { font: 680 13px/1.3 var(--sans); color: var(--ink); }
.explore-item small { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }

/* Setup & progress. */
.setup-progress { padding: 21px; }
.setup-top { display: flex; align-items: flex-start; gap: 14px; }
.setup-top h2 { margin: 0; font: 760 19px/1.2 var(--sans); letter-spacing: -.03em; }
.setup-top p { margin: 4px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.setup-top .pill { margin-left: auto; }
.stage-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.stage { position: relative; padding-top: 22px; min-width: 0; }
.stage::before { content: ""; position: absolute; top: 7px; left: -5px; right: -5px; height: 2px; background: #e8eaf0; }
.stage:first-child::before { left: 50%; }
.stage:last-child::before { right: 50%; }
.stage.is-done::before, .stage.is-current::before { background: var(--ac-line); }
.stage-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid #d8dbe3; color: #fff;
}
.stage.is-done .stage-dot { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.stage.is-current .stage-dot { border: 4px solid var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.stage-card { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 12px; border-radius: 13px; background: #f9fafc; border: 1px solid #eef0f4; }
.stage.is-current .stage-card { background: var(--ac-soft-2); border-color: var(--ac-line); }
.stage-num { font: 800 10px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #9ca1ab; }
.stage-card b { font: 720 13.5px/1.25 var(--sans); }
.stage-card span:last-child { font: 400 12px/1.35 var(--sans); color: var(--muted); }
.stage-card span.is-ac { color: var(--ac); font-weight: 600; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(300px, .72fr); gap: 16px; align-items: start; }
.phase-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 14px 18px; background: #fafbfc; border-bottom: 1px solid var(--line-soft); }
.phase-head b { font: 760 14px/1.3 var(--sans); }
.phase-head span { font: 400 12px/1.3 var(--sans); color: var(--muted); }
.phase-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 13px 18px; }
.phase-row > .stack { align-items: flex-start; }
.next-card { padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: linear-gradient(145deg, #fff, var(--ac-soft-2)); }
.next-title { font: 800 18px/1.25 var(--sans); letter-spacing: -.03em; }
.next-meta { font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.next-card .btn { margin-top: 10px; }

/* Resources. */
.group-head { align-items: baseline; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.resource-card {
  display: flex; flex-direction: column; align-items: flex-start; padding: 15px;
  background: #fff; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); filter: none; }
.resource-card .res-icon { width: 35px; height: 35px; font-size: 17px; }
.resource-card b { margin-top: 12px; font: 720 13.5px/1.3 var(--sans); overflow-wrap: anywhere; }
.resource-card p { margin: 4px 0 11px; font: 400 12px/1.4 var(--sans); color: var(--muted); }
.resource-card .open { margin-top: auto; display: inline-flex; align-items: center; gap: 3px; font: 750 12px/1 var(--sans); color: var(--ac); }

/* FAQ: one card per question, plus turns to a cross when open. */
.faq { max-width: 900px; gap: 8px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.faq-q { min-height: 52px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; font: 700 14px/1.4 var(--sans); }
.faq-q::-webkit-details-marker { display: none; }
.faq-q > span { flex: 1; }
.faq-toggle { color: var(--faint); font-size: 17px; transition: transform .2s var(--ease); }
.faq-item[open] .faq-toggle { transform: rotate(45deg); color: var(--ac); }
.faq-a { padding: 0 16px 16px; font-size: 14px; color: #5f6470; }
.faq-foot { margin: 8px 0 0; font: 400 13.5px/1.6 var(--sans); color: var(--muted); }

/* The task sheet. */
.task-summary { margin: 0; font: 400 15px/1.6 var(--sans); color: var(--muted-2); }
.task-response { border: 1px solid var(--ac-line); background: var(--ac-soft-2); border-radius: 14px; padding: 16px; }
.task-response-head { display: flex; align-items: center; gap: 8px; color: var(--ac-ink); }
.task-response-head b { font: 750 13px/1.3 var(--sans); color: var(--ink); }
.task-saved { font: 400 12.5px/1.5 var(--sans); color: var(--muted); }

@media (max-width: 1100px) {
  .home-grid, .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .launch-hero { padding: 22px 20px; }
  .launch-hero h2 { font-size: 26px; }
  .launch-bar { width: 100%; }
  .launch-stats { gap: 20px; }
  .stage-track { display: flex; overflow-x: auto; gap: 9px; padding-bottom: 4px; scrollbar-width: none; }
  .stage-track::-webkit-scrollbar { display: none; }
  .stage { min-width: 170px; padding-top: 0; }
  .stage::before, .stage-dot { display: none; }
  .resource-grid, .res-mini { grid-template-columns: minmax(0, 1fr); }
  .waiting-item { flex-wrap: wrap; }
  .waiting-item .btn { width: 100%; min-height: 44px; }
  .task-rows .row { padding: 12px 14px; }
  .phase-row { grid-template-columns: minmax(0, 1fr) auto; }
  .phase-row .owner { display: none; }
}

/* Long answers (a pasted URL, say) wrap inside their row rather than run out of the card. */
.row--check > .stack, .phase-row > .stack { min-width: 0; }
.task-given, .task-need { overflow-wrap: anywhere; word-break: break-word; }

/* The client Calendar page: the appointments list is a section of the page,
   so its heading is a section heading, not a second page title. */
.cal-appts { margin-top: 4px; }
.cal-appts > .pagehead { padding-bottom: 14px; align-items: center; }
.cal-appts > .pagehead .kicker { display: none; }
.cal-appts > .pagehead h1.display { font: 760 17px/1.2 var(--sans); letter-spacing: -.015em; }
.cal-feed .card { border-radius: 16px; }

/* A dropdown of secondary actions (shell.js popoverMenu). */
.popover {
  position: absolute; z-index: 80; min-width: 230px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(20, 24, 38, .16);
  display: flex; flex-direction: column; animation: toast-in-pop .14s var(--ease);
}
@keyframes toast-in-pop { from { opacity: 0; transform: translateY(-4px); } }
.popover-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left;
  font: 600 13px/1.2 var(--sans); color: var(--ink);
}
.popover-item:hover, .popover-item:focus-visible { background: #f5f6f9; outline: none; }
.popover-item .ico { font-size: 16px; color: var(--muted); }
.popover-item.is-danger, .popover-item.is-danger .ico { color: var(--red); }

/* ===========================================================================
   Admin: the client workspace (admin.js clientScreen) — preview "account"
   =========================================================================== */
.account-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px; padding: 20px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.logo-tile {
  width: 52px; height: 52px; border-radius: 15px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #e7e9ff, #f4f5ff); color: #5559dd; font: 850 15px/1 var(--sans); letter-spacing: -.04em;
}
.account-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.account-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-title h1 { margin: 0; font: 780 25px/1.15 var(--sans); letter-spacing: -.035em; overflow-wrap: anywhere; }
.account-meta { font: 400 12.5px/1.45 var(--sans); color: var(--muted); }
.client-id {
  align-self: flex-start; padding: 2px 8px; border-radius: 7px; background: var(--grey-bg);
  font: 400 11.5px/1.6 var(--code); color: var(--muted); user-select: all;
}
.account-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.ws-tabs { margin-bottom: 18px; }
.ws-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 16px; align-items: start; }
.ws-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-card .card-head h3 { font-size: 14.5px; }
.ws-card-foot { padding: 4px 19px 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 17px 14px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 2px 8px rgba(32, 36, 50, .025); min-width: 0; }
.kpi-label { font: 700 12px/1.25 var(--sans); color: var(--muted); }
.kpi-value { margin: 6px 0 2px; font: 780 26px/1.05 var(--sans); letter-spacing: -.04em; }
.kpi-meta { font: 500 11.5px/1.35 var(--sans); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-meta.is-good { color: var(--green); }
.kpi-meta.is-warn { color: var(--amber); }
.kpi-meta.is-bad { color: var(--red); }

.snapshot { display: flex; flex-direction: column; padding: 2px 10px 10px; }
.snapshot-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 9px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left;
}
.snapshot-row:hover { background: #f6f7fa; }
.snapshot-row b { font: 680 13.5px/1.3 var(--sans); display: block; }
.snapshot-row small { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }

.ws-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ws-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font: 500 12px/1 var(--sans); color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ws-leads-link { align-self: flex-start; }

.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 19px 12px; }
.mini { display: flex; flex-direction: column; gap: 5px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.mini .k { font: 800 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #969ba5; }
.mini .v { font: 700 13px/1.35 var(--sans); overflow-wrap: anywhere; }
.mini .v.code { font: 500 12.5px/1.45 var(--code); }

.route-list { display: flex; flex-direction: column; gap: 9px; padding: 0 19px 19px; }
.route-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.route-card .stack { flex: 1; }
.route-card b { font: 700 13px/1.3 var(--sans); }
.route-card small { font: 400 11.5px/1.4 var(--sans); color: var(--muted); }
.route-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: #f1f2f7; color: #646a76; font-size: 16px; }

/* The existing cards on these tabs (notes, activity, responses, sources…) */
.ws-body .card.card--pad { padding: 18px 19px 19px; }
.ws-body .card.card--pad > .spread:first-child h2,
.ws-body .card.card--pad > h2 { font: 760 14.5px/1.25 var(--sans) !important; letter-spacing: -.01em; }

/* Phase panels on the Setup tab. */
.row--task { grid-template-columns: 9px minmax(0, 1fr) auto auto auto; padding: 12px 18px; }
.row--task .title { font: 600 13.8px/1.35 var(--sans) !important; }

/* Danger zone, at the foot of Overview. */
.danger-zone { border-radius: 18px; }
.danger-zone > header { padding: 13px 19px; }
.danger-zone > header h2 { font: 800 11px/1 var(--sans); letter-spacing: .12em; }
.danger-row { padding: 15px 19px; }

@media (max-width: 1240px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ws-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 780px) {
  .account-head { flex-wrap: wrap; align-items: flex-start; padding: 16px; }
  .logo-tile { width: 44px; height: 44px; border-radius: 13px; }
  .account-title h1 { font-size: 21px; }
  .account-actions { margin-left: 0; width: 100%; }
  .account-actions .btn:not(.icon-btn) { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { padding: 13px; }
  .kpi-value { font-size: 22px; }
  .ws-tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .row--task { grid-template-columns: 9px minmax(0, 1fr) auto; }
  .row--task > :nth-child(3), .row--task > :nth-child(4) { display: none; }
  .danger-row { grid-template-columns: minmax(0, 1fr); }
}

/* Admin home: the command center. */
.cc-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  padding: 26px 30px; border-radius: 24px; border: 1px solid #e6e7fb;
  background: linear-gradient(120deg, #fff 0%, #f8f8ff 52%, #f1f4ff 100%); box-shadow: var(--shadow-sm);
}
.cc-hero::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -45px; top: -95px; background: radial-gradient(circle, color-mix(in srgb, var(--ac) 13%, transparent), transparent 66%); pointer-events: none; }
.cc-hero h2 { margin: 6px 0 6px; font: 780 28px/1.1 var(--sans); letter-spacing: -.04em; }
.cc-hero p { margin: 0; color: var(--muted); }
.cc-hero b { color: var(--ink); }
.cc-health { margin-left: auto; position: relative; z-index: 1; }
.kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attention-list { display: flex; flex-direction: column; padding: 0 19px 16px; }
.attention-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.attention-row:first-child { border-top: 0; }
.attention-row .stack { flex: 1; }
.attention-row b { font: 700 13.5px/1.3 var(--sans); }
.attention-row small { font: 400 12px/1.4 var(--sans); color: var(--muted); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 19px 19px; }
.quick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.quick-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quick-btn .ico { color: var(--ac); font-size: 16px; margin-bottom: 4px; }
.quick-btn b { font: 720 13px/1.3 var(--sans); }
.quick-btn small { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }
@media (max-width: 1100px) { .kpi-grid--4, .kpi-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .cc-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .cc-health { margin-left: 0; }
  .quick { grid-template-columns: 1fr; }
  .attention-row { flex-wrap: wrap; }
  .attention-row .btn { margin-left: 21px; }
}

/* Admin: the onboarding / all clients table. */
.client-table { background: #fff; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.client-tr {
  display: grid; grid-template-columns: minmax(170px, 1.4fr) minmax(120px, 1fr) 110px minmax(120px, .9fr) minmax(70px, .5fr) 84px 72px;
  align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-soft); cursor: pointer; transition: background .12s;
}
.client-tr:first-child { border-top: 0; }
.client-tr:hover:not(.is-head) { background: #fbfbfd; }
.client-tr:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.client-tr.is-head { cursor: default; min-height: 42px; padding-top: 0; padding-bottom: 0; background: #fafbfc; font: 800 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9196a0; }
.client-name { font: 720 14px/1.3 var(--sans); }
.client-tr small { font: 400 12px/1.35 var(--sans); color: var(--muted); }
.client-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.client-tasks { display: flex; gap: 10px; flex-wrap: wrap; }
.client-tasks > span { display: inline-flex; align-items: center; gap: 5px; }
.client-tasks .dot { width: 7px; height: 7px; }
.client-open { justify-self: end; }
@media (max-width: 1100px) {
  .client-tr { grid-template-columns: minmax(160px, 1.5fr) minmax(120px, 1fr) 106px 84px 72px; }
  .client-tr > :nth-child(4), .client-tr > :nth-child(5) { display: none; }
}
@media (max-width: 780px) {
  .client-table { background: none; border: none; overflow: visible; display: flex; flex-direction: column; gap: 9px; }
  .client-tr.is-head { display: none; }
  .client-tr { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
  .client-tr > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .client-tr > :nth-child(3) { grid-column: 2; grid-row: 1; }
  .client-tr > :nth-child(4) { display: flex; grid-column: 1 / -1; }
  .client-tr > :nth-child(5), .client-tr > :nth-child(7) { display: none; }
  .client-tr > :nth-child(6) { display: none; }
}

/* Admin top bar: global search and Create. */
.topbar-search {
  width: min(340px, 34vw); height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; cursor: text; color: #8a8f99; font: 400 13px/1 var(--sans);
}
.topbar-search span { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-search kbd { background: #f2f3f6; border: 1px solid #e6e7eb; border-bottom-color: #d8dae0; border-radius: 6px; padding: 2px 6px; font: 600 10px/1 var(--sans); color: #8f949d; }
.topbar-search:hover { border-color: var(--line-strong); }
.search-backdrop { align-items: flex-start; justify-content: center; padding-top: 10vh; }
.sheet.search-panel { width: min(620px, 94vw); height: auto; max-height: 72vh; border-radius: 18px; animation: more-in .18s var(--ease); }
.search-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 18px; }
.search-field input { flex: 1; border: 0; box-shadow: none !important; min-height: 40px; padding: 0; font-size: 16px; }
.search-results { overflow-y: auto; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.search-results > .hint { padding: 8px 6px; }
.search-group .nav-label { padding: 8px 6px 4px; }
.search-item { width: 100%; min-height: 50px; padding: 5px 6px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.search-item:hover, .search-item:focus-visible { background: #f5f6f9; outline: none; }
@media (max-width: 1100px) { .topbar-search { width: 38px; padding: 0; justify-content: center; } .topbar-search span, .topbar-search kbd { display: none; } }
@media (max-width: 780px) {
  .create-btn { width: 38px; padding: 0; } .create-btn span { display: none; }
  .search-backdrop { padding-top: 0; }
  .sheet.search-panel { width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; }
  .search-field { padding-top: calc(12px + env(safe-area-inset-top)); }
}

.search-field input::-webkit-search-cancel-button { display: none; }

/* ===========================================================================
   Prospects (prospects.js) — preview "Prospects": board, list, detail,
   messages, follow-ups, analytics, attribution, log, setup.
   =========================================================================== */
.pro-tabs { margin-bottom: 18px; }
.pro-body { gap: 14px; }
.pro-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pro-filters .lead-tools { margin-left: auto; }
.pro-window { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 0; }
.pro-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.pro-foot a { display: inline-flex; align-items: center; gap: 5px; }
.flag { display: inline-flex; align-items: center; flex: none; padding: 3px 6px; border-radius: 6px; background: var(--red-bg); color: var(--red); font: 780 9.5px/1.2 var(--sans); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.stage-pill { font-weight: 700; }
.owner-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #f0f1f8; color: #5f6370; font: 800 9.5px/1 var(--sans); }

/* Board. */
.pboard { gap: 12px; padding-bottom: 6px; }
.pcol { flex: 0 0 252px; background: #f2f3f7; border: 1px solid #e9eaf0; border-radius: 16px; padding: 10px; min-height: 200px; }
.pcol.is-over { background: var(--ac-soft); border-color: var(--ac-line); }
.pcol-head { padding: 4px 4px 0; gap: 7px; }
.pcol-title { font: 760 12.5px/1.2 var(--sans); }
.pcol-count { font: 600 12px/1 var(--sans); color: #979ca5; }
.pcol-avg { font: 700 10px/1 var(--sans); letter-spacing: .08em; color: var(--faint); padding: 7px 4px 10px; }
.pcol-body { gap: 8px; }
.pcol-empty { color: var(--faint); }
.pcard {
  background: #fff; border: 1px solid #e5e6eb; border-radius: 14px; padding: 13px; gap: 3px;
  box-shadow: 0 2px 7px rgba(33, 38, 57, .025); cursor: grab; transition: transform .15s var(--ease), box-shadow .15s;
}
.pcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: #e5e6eb; }
.pcard.is-flag { border-color: #f1dada; background: #fff; }
.pcard-name { font: 720 13.5px/1.3 var(--sans); }
.pcard-sub { font: 400 12px/1.3 var(--sans); color: var(--muted); }
.pcard-days { font: 600 11px/1 var(--sans); color: var(--muted); }
.pcard-days.is-flag { color: var(--red); }
.pcard-appt { font: 400 12px/1.4 var(--sans); color: var(--muted); padding: 7px 0 6px; border-bottom: 1px solid var(--line-soft); }
.pro-stage { min-height: 34px; padding: 0 8px; font: 500 12.5px/1 var(--sans); border-radius: 9px; }

/* List. */
.pro-head, .pro-row { padding: 12px 16px; }
.pro-head { background: #fafbfc; border-bottom: 1px solid var(--line-soft); }
.pro-th { font: 800 10.5px/1 var(--sans); letter-spacing: .08em; color: #9196a0; }
.pro-th.is-on { color: var(--ac); }
.pro-row:hover { background: #fbfbfd; }

/* Detail sheet. */
.pro-stages { gap: 8px; }
.pro-stage-btn { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.pro-stage-btn:hover:not(:disabled) { border-color: var(--line-strong); }
.pro-stage-btn b { font: 720 13.5px/1.25 var(--sans); }
.pro-stage-btn.is-current { border: 1.5px solid var(--ac); background: var(--ac-soft-2); }
.pro-stage-btn.is-illegal { background: #fafbfc; opacity: .55; }
.pro-kv { font: 400 13.5px/1.4 var(--sans); }
.pro-kv > span:first-child { color: var(--muted); }

/* Analytics, log, attribution tables. */
.pro-tbl-head, .pro-log-head { font: 800 10.5px/1 var(--sans); letter-spacing: .08em; color: #9196a0; background: #fafbfc; }
.pro-attr th { font: 800 10.5px/1 var(--sans); letter-spacing: .08em; color: #9196a0; background: #fafbfc; }
.pro-bar { height: 8px; background: #eef0f5; }

/* Messages: a list of conversations and the thread, as the client lead thread. */
.msg-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 14px; }
.msg-list, .msg-thread { border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.msg-row { padding: 12px 15px; }
.msg-row:hover { background: #fbfbfd; }
.msg-row.is-on { background: var(--ac-soft-2); box-shadow: inset 3px 0 0 var(--ac); }
.msg-unread { font: 800 10.5px/1 var(--sans); padding: 4px 7px; }
.msg-head { padding: 14px 17px; border-bottom: 1px solid var(--line-soft); }
.msg-bubbles { background: linear-gradient(180deg, #fbfbfd, #fff); padding: 18px; gap: 9px; }
.msg-bubble { border-radius: 15px; font: 400 14px/1.45 var(--sans); padding: 9px 12px; }
.msg-bubble.is-in { background: #f0f1f4; color: #2f333b; border-bottom-left-radius: 5px; }
.msg-bubble.is-out { border-bottom-right-radius: 5px; }
.msg-meta { font: 500 11px/1.3 var(--sans); opacity: .75; }
.msg-composer { padding: 11px 12px; border-top: 1px solid var(--line-soft); }
.msg-compose { border-radius: 14px; border-color: var(--line); min-height: 44px; font-size: 14px; }

/* Setup page code blocks. */
.pro-code { border-radius: 13px; }

@media (max-width: 780px) {
  .pro-tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .pro-filters { flex-direction: column; align-items: stretch; }
  .pro-filters .lead-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pro-filters .lead-chips::-webkit-scrollbar { display: none; }
  .pro-filters .lead-chips .chip { flex: none; }
  .pro-filters .lead-tools { margin-left: 0; flex-direction: column-reverse; align-items: stretch; }
  .pro-filters .searchbox { flex: none; width: 100%; min-width: 0; height: 44px; }
  .pro-window .kicker { white-space: nowrap; flex: none; }
  .pro-foot > span:first-child { display: none; }
  .pro-window { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pro-window::-webkit-scrollbar { display: none; }
  .pro-window .chip { flex: none; }
  .pro-stage-chips { flex-wrap: nowrap; overflow-x: auto; }
  .pro-stage-chips .chip { flex: none; }
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .pro-attr-wrap, .card:has(> .pro-attr) { overflow-x: auto; }
}
.pro-row > .pill { justify-self: start; }
@media (max-width: 780px) { .msg-thread.is-empty { display: none; } .msg-thread { min-height: 70vh; } }

/* Portal templates. */
.tpl-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 84px; }
.tpl-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 13px; text-align: left; cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 13px; }
.tpl-item:hover { background: #fff; }
.tpl-item.is-on { background: #fff; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.tpl-item b { font: 700 13.5px/1.3 var(--sans); }
.tpl-item small { font: 400 11.5px/1.3 var(--sans); color: var(--muted); }
.tpl-row { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
.tpl-row .title { font: 600 13.8px/1.35 var(--sans); }
.blocking { border: 0; }
button.blocking { cursor: pointer; min-height: 24px; }
@media (max-width: 780px) {
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .tpl-list { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .tpl-list::-webkit-scrollbar { display: none; }
  .tpl-item { flex: none; max-width: 70vw; }
  .tpl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; }
  .tpl-row > .stack { grid-column: 1 / -1; }
  .tpl-row > :nth-child(2) { justify-self: start; }
  .card > header { flex-wrap: wrap; }
}

/* Resources, FAQ, team and metric rows: on a phone the title takes the full
   width and the tags and actions wrap underneath. */
@media (max-width: 780px) {
  .cfg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .cfg-row > :first-child { flex: 1 1 100%; min-width: 0; }
  .cfg-row > :last-child { margin-left: auto; }
  .metric-row .bar { flex: 1 1 80px; width: auto !important; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Alerts on a phone: each row becomes a small card. Who and the status on top,
   the message under it, then the account, channel and time. */
@media (max-width: 780px) {
  .alert-head { display: none; }
  .alert-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who status" "what what" "acct acct" "chan when";
    gap: 8px 12px; padding: 14px 16px;
  }
  .alert-row > :nth-child(1) { grid-area: who; }
  .alert-row > :nth-child(2) { grid-area: acct; }
  .alert-row > :nth-child(3) { grid-area: what; display: flex; }
  .alert-row > :nth-child(4) { grid-area: chan; }
  .alert-row > :nth-child(5) { grid-area: when; display: block; justify-self: end; }
  .alert-row > :nth-child(6) { grid-area: status; align-self: start; }
  .alert-row > :nth-child(2) { flex-direction: row; gap: 6px; flex-wrap: wrap; align-items: baseline; }
  .alert-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .alert-filters::-webkit-scrollbar { display: none; }
  .alert-filters .chip { flex: none; }
  .grid--alerts { grid-template-columns: minmax(0, 1fr); }
}

/* A long form split into sections, with links to each at the top. */
.form-section { padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.form-grid > .form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section h3 { margin: 0; font: 750 15px/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.form-section p { margin: 3px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--muted); }
.form-jump { display: flex; flex: none; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.field-static { display: flex; flex-direction: column; gap: 6px; font: 700 12px/1.3 var(--sans); color: var(--muted-2); }
@media (max-width: 780px) {
  .form-jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .form-jump::-webkit-scrollbar { display: none; }
  .form-jump .chip { flex: none; }
}

/* ------------------------------------------------------------------------
   Meta access on sign-in. Desktop: the why on the left, the action card on
   the right. Phone: the card straight after the heading, then the rest.
   ------------------------------------------------------------------------ */
.ma-shell {
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(60% 50% at 100% 0%, var(--ac-soft) 0%, transparent 70%),
    radial-gradient(50% 40% at 0% 100%, var(--ac-soft-2) 0%, transparent 70%),
    var(--canvas);
}
.ma-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px); background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.ma-bar .brand-logo { height: 30px; width: auto; display: block; }
.ma-who { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; font: 500 13.5px/1.2 var(--sans); color: var(--muted-2); }
.ma-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ac-soft); color: var(--ac-ink); font: 700 13px/1 var(--sans);
}
.ma-signout {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; padding: 8px 4px 8px 14px;
  border: 0; border-left: 1px solid var(--line); background: none; cursor: pointer;
  font: 600 13.5px/1 var(--sans); color: var(--muted-2);
}
.ma-signout:hover { color: var(--ink); }

.ma {
  max-width: 1240px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 48px) 56px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: start;
}
.ma-kicker { font: 800 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ac); }
.ma-kicker--muted { color: var(--muted-2); }
.ma-intro h1 { margin: 14px 0 16px; font: 850 clamp(34px, 4.4vw, 52px)/1.06 var(--sans); letter-spacing: -.04em; color: var(--ink); text-wrap: balance; }
.ma-lede { margin: 0; max-width: 34em; font: 400 clamp(16px, 1.6vw, 19px)/1.55 var(--sans); color: var(--muted-2); }

.ma-why { margin-top: 34px; }
.ma-why ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.ma-why li { display: flex; align-items: center; gap: 14px; font: 500 15.5px/1.45 var(--sans); color: var(--ink); }
.ma-why-icon {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ac-soft); color: var(--ac);
}

.ma-warning {
  display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 20px 22px;
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 16px; color: #e08a00;
}
.ma-warning b { font: 750 15.5px/1.4 var(--sans); color: var(--ink); }
.ma-warning .ico { flex: none; }

.ma-help {
  display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 18px 22px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 16px;
}
.ma-help-icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--ac-soft); color: var(--ac); }
.ma-help b { display: block; font: 750 15px/1.3 var(--sans); color: var(--ink); }
.ma-help span { font: 400 13.5px/1.5 var(--sans); color: var(--muted-2); }
.ma-help a { color: var(--ac); font-weight: 650; text-decoration: none; }
.ma-help a:hover { text-decoration: underline; }

.ma-card {
  display: flex; flex-direction: column; gap: 20px; padding: clamp(22px, 3vw, 36px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: 0 30px 70px -40px rgba(40, 48, 90, .35), var(--shadow-sm);
}
.ma-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.ma-logo {
  width: 96px; height: 96px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.ma-head h2 { margin: 4px 0 10px; font: 850 clamp(26px, 2.8vw, 36px)/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.ma-head p { margin: 0; font: 400 15.5px/1.6 var(--sans); color: var(--muted-2); }

.ma-grant {
  display: flex; align-items: center; justify-content: center; gap: 14px; position: relative;
  min-height: 64px; border-radius: 16px; font: 750 18px/1 var(--sans); text-decoration: none;
  box-shadow: 0 16px 30px -16px var(--ac);
}
.ma-grant .ma-chev { position: absolute; right: 22px; }
.ma-time { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: -6px; font: 500 14px/1 var(--sans); color: var(--muted-2); }
.ma-checks {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ma-checks span { display: flex; align-items: center; gap: 9px; padding: 0 12px; font: 500 13.5px/1.35 var(--sans); color: var(--muted-2); }
.ma-checks span + span { border-left: 1px solid var(--line); }
.ma-checks .ico { color: #fff; fill: var(--green); flex: none; }

.ma-how { display: flex; flex-direction: column; gap: 16px; }
.ma-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ma-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; position: relative; }
.ma-step-n {
  position: absolute; top: -4px; left: calc(50% - 44px); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--ac-soft); color: var(--ac-ink); font: 800 13px/1 var(--sans);
}
.ma-step-icon { width: 60px; height: 60px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ac-soft-2); color: var(--ac); }
.ma-steps b { display: block; font: 750 15px/1.3 var(--sans); color: var(--ink); }
.ma-steps div > span { display: block; margin-top: 6px; font: 400 13.5px/1.45 var(--sans); color: var(--muted-2); }

.ma-next { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: var(--ac-soft-2); border: 1px solid var(--ac-line); }
.ma-next-icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--ac); color: #fff; }
.ma-next-icon .ico { color: #fff; stroke: #fff; stroke-width: 2.6; }
.ma-next b { display: block; font: 750 15px/1.35 var(--sans); color: var(--ink); }
.ma-next span { font: 400 13.5px/1.5 var(--sans); color: var(--muted-2); }

.ma-confirm { min-height: 52px; font-size: 15.5px; }
.ma-confirm.is-ready { box-shadow: 0 0 0 5px var(--ac-soft); }

.ma-phone-only { display: none; }

@media (max-width: 900px) {
  .ma { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 26px; }
  .ma-why, .ma-desktop-only { display: none; }
  .ma-phone-only { display: block; }
  .ma-phone-only .ma-warning, .ma-phone-only .ma-help { margin-top: 0; }
  .ma-head { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .ma-logo { width: 72px; height: 72px; border-radius: 18px; }
  .ma-logo svg { width: 38px; height: 38px; }
  .ma-head h2 { margin-top: 0; font-size: 24px; }
  .ma-head p { font-size: 14.5px; }
  .ma-checks { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 0; }
  .ma-checks span { padding: 0; }
  .ma-checks span + span { border-left: 0; }
  .ma-steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ma-steps li { flex-direction: row; align-items: center; text-align: left; gap: 12px; }
  .ma-step-n { position: static; flex: none; }
  .ma-step-icon { width: 46px; height: 46px; flex: none; }
  .ma-who .truncate { display: none; }
  .ma-signout { margin-left: 0; }
}

/* ------------------------------------------------------------------------
   Metrics → Ad performance (adperf.js). Meta spend, leads and bookings.
   ------------------------------------------------------------------------ */
.ap { gap: 18px; }
.ap-head .ap-actions { align-items: center; flex-wrap: nowrap; }
.ap-head .ap-range { width: auto; }
.ap-card > header h2 { white-space: nowrap; }
.ap-scope button { white-space: nowrap; }
.ap-range {
  appearance: none; min-height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff linear-gradient(45deg, transparent 50%, #8b909a 50%) calc(100% - 16px) 16px / 4px 4px no-repeat;
  background-image: linear-gradient(45deg, transparent 50%, #8b909a 50%), linear-gradient(135deg, #8b909a 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 12px) 16px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
  color: #41454e; font: 650 12.5px/1 var(--sans); cursor: pointer;
}
.ap-tabs { margin-bottom: 18px; }
.ap-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--blue-bg); color: var(--blue); font: 500 12.5px/1.4 var(--sans); }
.ap-kpis .kpi-meta { white-space: normal; }
.ap-split { gap: 18px; }
.ap-card { overflow: hidden; }
.ap-card > header { display: flex; align-items: center; gap: 12px; }
.ap-empty { padding: 26px 18px; text-align: center; color: var(--muted); font: 400 12.5px/1.5 var(--sans); }
.ap-foot { margin: 0; color: var(--muted); font: 400 12px/1.6 var(--sans); }
.ap-link { border: 0; background: none; padding: 0; color: var(--ac); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* the chart */
.ap-chart { padding: 15px 18px 0; }
.ap-chart-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ap-chart-title { font: 760 14.5px/1.2 var(--sans); }
.ap-chart-sub { margin-top: 3px; font: 400 12px/1.4 var(--sans); color: var(--muted); }
.ap-chart-pills { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.ap-pill { min-height: 29px; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: #777c86; font: 650 11.5px/1 var(--sans); cursor: pointer; }
.ap-pill.is-on { background: var(--ac-soft); border-color: var(--ac-line); color: var(--ac-ink); }
.ap-chart-box { position: relative; height: 240px; margin: 0 -4px; }
.ap-chart-box svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.ap-chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font: 400 12.5px/1.4 var(--sans); }
.ap-grid { stroke: #eceef3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ap-line { fill: none; stroke: var(--ac); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ap-area { fill: url(#apArea); }
.ap-dot { fill: #fff; stroke: var(--ac); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ap-cursor { stroke: var(--ac-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ap-axis { font: 500 10px var(--sans); fill: #a3a8b1; }
.ap-tip {
  position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 8px));
  background: #242831; color: #fff; padding: 6px 9px; border-radius: 8px; font: 650 11px/1.2 var(--sans);
  white-space: nowrap; box-shadow: var(--shadow-sm); transition: opacity .1s;
}
.ap-media { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px -18px 0; border-top: 1px solid var(--line-soft); }
.ap-media-metric { padding: 13px 18px; border-right: 1px solid var(--line-soft); min-width: 0; }
.ap-media-metric:last-child { border-right: 0; }
.ap-media-metric span { display: block; font: 600 10.5px/1.3 var(--sans); color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.ap-media-metric b { display: block; margin-top: 3px; font: 740 15px/1.2 var(--sans); letter-spacing: -.015em; }

/* needs attention */
.ap-attn { display: flex; flex-direction: column; }
.ap-attn-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%;
  padding: 13px 18px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.ap-attn-row:last-child { border-bottom: 0; }
.ap-attn-row:hover { background: #fbfbfd; }
.ap-dot-mark { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--amber); }
.ap-dot-mark.is-bad { background: var(--red); }
.ap-attn-copy b { display: block; font: 700 12.8px/1.3 var(--sans); }
.ap-attn-copy small { display: block; margin-top: 3px; font: 400 11.5px/1.45 var(--sans); color: var(--muted); }

/* tables (desktop) and cards (phone) */
.ap-table-wrap { overflow-x: auto; }
.ap-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.ap-table th {
  text-align: right; padding: 10px 13px; background: #fafbfc; border-bottom: 1px solid var(--line-soft);
  font: 800 9.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9196a0; white-space: nowrap;
}
.ap-table th:first-child { text-align: left; padding-left: 18px; }
.ap-table td { text-align: right; padding: 12px 13px; border-bottom: 1px solid var(--line-soft); font: 500 12.5px/1.25 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-table td:first-child { text-align: left; padding-left: 18px; white-space: normal; }
.ap-table tbody tr { cursor: pointer; }
.ap-table tbody tr:hover, .ap-table tbody tr:focus-visible { background: #fbfbfd; outline: none; }
.ap-table tbody tr:last-child td { border-bottom: 0; }
.ap-acct { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.ap-logo { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--ac-soft); color: var(--ac-ink); font: 800 9.5px/1 var(--sans); letter-spacing: .02em; }
.ap-acct-copy { min-width: 0; }
.ap-acct-copy b { display: block; font: 700 12.8px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; }
.ap-acct-copy small { display: block; margin-top: 3px; font: 400 10.8px/1.5 var(--sans); color: var(--muted); }
.ap-acct-copy .pill { vertical-align: middle; }
.ap-trend { font: 650 11px/1 var(--sans); }
.ap-trend.is-good { color: var(--green); }
.ap-trend.is-bad { color: var(--red); }
.ap-cards { display: none; }
.ap-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-count { margin-left: auto; font: 800 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* funnel and rankings */
.ap-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 18px 18px; }
.ap-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font: 500 13px/1.35 var(--sans); }
.ap-facts dt { color: var(--muted); }
.ap-facts dd { margin: 0; color: var(--ink, #1b1d22); }
.ap-focus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 0; }
.ap-focus-pick { display: inline-flex; align-items: center; gap: 8px; }
.ap-focus-pick span { font: 600 12px/1 var(--sans); color: var(--muted); }
.ap-focus-pick select { width: auto; max-width: 100%; min-width: 220px; }
.ap-funnel--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-funnel--6 .ap-step:nth-child(3n)::after { display: none; }
.ap-funnel:not(.ap-funnel--6) .ap-step:nth-child(4n)::after { display: none; }
.ap-step { position: relative; padding: 12px 13px; border: 1px solid var(--line-soft); background: #fafbfc; border-radius: 12px; min-width: 0; }
.ap-step:not(:last-child)::after { content: "›"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); z-index: 1; color: #b5bac3; font-size: 19px; }
.ap-step span { font: 700 9.5px/1.2 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: #9ba0aa; }
.ap-step b { display: block; margin-top: 7px; font: 760 21px/1 var(--sans); letter-spacing: -.03em; }
.ap-step small { display: block; margin-top: 6px; font: 400 11px/1.35 var(--sans); color: var(--muted); }
.ap-rank { display: flex; flex-direction: column; }
.ap-rank-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font: inherit; color: inherit;
}
button.ap-rank-row { cursor: pointer; }
button.ap-rank-row:hover { background: #fbfbfd; }
.ap-rank-row:last-child { border-bottom: 0; }
.ap-rank-num { font: 760 11px/1 var(--sans); color: #a2a6af; text-align: center; }
.ap-rank-copy { min-width: 0; }
.ap-rank-copy b { display: block; font: 680 12.5px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-rank-copy small, .ap-rank-val small { display: block; margin-top: 2px; font: 400 11px/1.25 var(--sans); color: var(--muted); }
.ap-rank-val { text-align: right; white-space: nowrap; }
.ap-rank-val b { display: block; font: 700 12.5px/1.25 var(--sans); }
.ap-rank-val small.is-good { color: var(--green); }
.ap-thumb-sm { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; background: var(--grey-bg); }

/* ads */
.ap-ads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ap-ad { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.ap-ad:hover { box-shadow: var(--shadow-sm); }
.ap-ad-visual {
  height: 150px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, var(--ac-soft), #f8f8fd); border-bottom: 1px solid var(--line-soft);
}
.ap-ad-visual img { width: 100%; height: 100%; object-fit: cover; }
.ap-ad-visual--big { height: 240px; border: 1px solid var(--line); border-radius: 14px; }
.ap-ad-visual--big img { object-fit: contain; background: #fff; }
.ap-ad-mock { padding: 14px 18px; border-radius: 10px; background: #fff; border: 1px solid var(--ac-line); color: var(--ac); font: 800 16px/1 var(--sans); }
.ap-ad-copy { padding: 13px; min-width: 0; }
.ap-ad-copy > b { display: block; font: 700 12.8px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-ad-copy > small { display: block; margin-top: 2px; font: 400 11.5px/1.3 var(--sans); color: var(--muted); }
.ap-ad-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.ap-ad-meta div, .ap-mgrid div { padding: 7px 8px; background: #fafbfc; border-radius: 8px; min-width: 0; }
.ap-ad-meta span, .ap-mgrid span { display: block; font: 600 9px/1.2 var(--sans); color: #9ba0aa; text-transform: uppercase; letter-spacing: .06em; }
.ap-ad-meta strong, .ap-mgrid b { display: block; margin-top: 3px; font: 650 12px/1.2 var(--sans); }

/* sheets */
.ap-dkpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-dkpi { padding: 12px; border: 1px solid var(--line-soft); background: #fafbfc; border-radius: 11px; min-width: 0; }
.ap-dkpi span { font: 700 9px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #9ba0aa; }
.ap-dkpi b { display: block; margin-top: 7px; font: 760 18px/1 var(--sans); }
.ap-sheet-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font: 500 12.5px/1.5 var(--sans); }
.ap-sheet-note.is-bad { background: var(--red-bg); color: var(--red); }
.ap-read { margin: 9px 0 0; color: var(--muted); font: 400 13px/1.55 var(--sans); }
.ap-settings { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.ap-settings h3 { margin: 0; font: 760 13.5px/1.2 var(--sans); }

/* not connected, first sync, a key Meta refused */
.ap-connect { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 680px; }
.ap-connect h2 { margin: 0; font: 760 17px/1.25 var(--sans); }
.ap-connect p { margin: 0; color: var(--muted); font: 400 13.5px/1.6 var(--sans); }
.ap-connect-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ac-soft); color: var(--ac); }
.ap-code { margin: 4px 0 0; padding: 10px 12px; max-width: 100%; overflow-x: auto; border-radius: 10px; background: #f4f5f8; font: 500 12px/1.5 var(--code); }
.ap-banner { display: flex; gap: 12px; align-items: flex-start; border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.ap-banner b { font: 700 13px/1.3 var(--sans); }
.ap-banner p { margin: 4px 0 0; color: var(--ink); font: 400 12.5px/1.5 var(--sans); }

@media (max-width: 1240px) {
  .ap-ads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ap-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .ap-head .ap-actions { margin-left: 0; width: 100%; display: grid; flex-wrap: wrap; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ap-head .ap-scope { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .ap-head .ap-range, .ap-head .ap-refresh { width: 100%; justify-content: center; }
  .ap-hide-phone { display: none; }
  .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ap-chart-head { flex-direction: column; }
  .ap-chart-pills { margin-left: 0; justify-content: flex-start; }
  .ap-chart-box { height: 190px; }
  .ap-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-media-metric:nth-child(2) { border-right: 0; }
  .ap-media-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .ap-table-wrap { display: none; }
  .ap-cards { display: flex; flex-direction: column; }
  .ap-mcard { display: block; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
  .ap-mcard:last-child { border-bottom: 0; }
  .ap-mcard-head { display: flex; align-items: center; gap: 10px; }
  .ap-mcard-head .ap-acct-copy { flex: 1; }
  .ap-mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
  .ap-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; }
  .ap-step:not(:last-child)::after { display: none; }
  .ap-ads { grid-template-columns: minmax(0, 1fr); }
  .ap-dkpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------------------
   Operations → Ad Set Replication (assets/adreplication.js)
   --------------------------------------------------------------------------- */
.ar-builder { display: flex; flex-direction: column; gap: 18px; }
.ar-card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ar-grid3 { padding: 0 18px 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ar-grid3 .field { min-width: 0; }
.ar-grid3 select { width: 100%; }
.ar-summary { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; }
.ar-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.ar-facts > div { display: flex; flex-direction: column; gap: 3px; min-width: 70px; }
.ar-facts b { font: 760 16px/1.1 var(--sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.ar-facts small { font: 500 10.5px/1.3 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ar-fact-wide b { font-size: 13px; text-transform: none; letter-spacing: 0; }
.ar-list { margin: 0; padding-left: 18px; font: 400 12.5px/1.55 var(--sans); color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.ar-list code { font: 500 11px/1 var(--code); background: var(--grey-bg); padding: 2px 5px; border-radius: 5px; }
.ar-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 12px; }
.ar-toolbar .pro-search { flex: 1 1 220px; min-width: 160px; }
.ar-table th, .ar-table td { text-align: left; }
.ar-table td { white-space: normal; vertical-align: middle; }
.ar-table tbody tr { cursor: default; }
.ar-table tr.is-on { background: var(--ac-soft); }
.ar-table td:nth-child(5) { max-width: 210px; font: 400 11.5px/1.4 var(--sans); }
.ar-table td:nth-child(5) .hint { display: block; max-width: 210px; }
.ar-table .ar-select { max-width: 240px; }
.ar-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ac); }
.ar-select { width: 100%; min-width: 180px; max-width: 320px; min-height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: 500 12.5px/1 var(--sans); }
.ar-select:disabled { opacity: .5; }
.ar-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.ar-actionbar b { font: 700 14px/1.3 var(--sans); }
.ar-actionbar small { font: 400 12.5px/1.45 var(--sans); color: var(--muted); }
.ar-banner { display: flex; align-items: flex-start; gap: 12px; font: 400 13px/1.5 var(--sans); }
.ar-banner svg { flex: none; margin-top: 2px; color: var(--blue); }
.ar-banner--warn svg { color: var(--amber); }
.ar-banner--warn { background: var(--amber-bg); border-color: var(--amber-line); }
.ar-banner--critical { background: var(--red-bg); border-color: var(--red-line); }
.ar-banner--critical svg { color: var(--red); }
.ar-banner .btn { margin-left: auto; flex: none; }
.ar-runhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 18px 8px; }
.ar-card > p.hint { padding: 0 18px 16px; margin: 0; }
.ar-targets { display: flex; flex-direction: column; }
.ar-target { border-top: 1px solid var(--line-soft); position: relative; }
.ar-target-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ar-target-head:hover { background: #fbfbfd; }
.ar-target-head:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.ar-chev { color: var(--faint); display: inline-flex; }
.ar-target-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.ar-target-name b { font: 700 13px/1.25 var(--sans); }
.ar-target-name small { font: 400 11.5px/1.4 var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-target-count { font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-target-note { font: 400 12px/1.3 var(--sans); color: var(--muted); flex: 1 1 200px; min-width: 0; }
.ar-target-link { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.ar-target.is-open .ar-target-head { background: #fbfbfd; }
.ar-detail { display: flex; flex-direction: column; gap: 14px; padding: 4px 18px 18px 46px; }
.ar-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); border: 1px solid var(--red-line); font: 400 12.5px/1.5 var(--sans); }
.ar-error svg { color: var(--red); flex: none; margin-top: 2px; }
.ar-notes b, .ar-ads > b { display: block; margin-bottom: 6px; font: 700 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ar-adtable { min-width: 640px; }
.ar-aderr { margin-top: 6px; font: 400 11.5px/1.45 var(--sans); color: var(--red); max-width: 360px; }
.ar-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ar-logo { align-items: flex-start; }
.ar-edits { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; color: var(--ink-2, #555); }
.ar-logo-img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: repeating-conic-gradient(#e6e8ee 0 25%, #f6f7fb 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line, #e6e8ee); flex: none; }
.ar-events summary { cursor: pointer; font: 600 12.5px/1.2 var(--sans); color: var(--muted); }
.ar-eventbox { padding: 10px 0 0; }
.ar-eventlist li.is-error, .ar-eventlist li.is-critical { color: var(--red); }
.ar-eventlist li.is-warning { color: var(--amber); }
.ar-eventlist small { color: var(--faint); }
.ar-pre { margin: 6px 0 0; padding: 10px; border-radius: 8px; background: var(--grey-bg); font: 400 11px/1.45 var(--code); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.ar-diff { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: 400 12.5px/1.5 var(--sans); }
.ar-diff code { font: 500 11px/1 var(--code); }
.ar-diff-before { padding: 6px 8px; border-radius: 6px; background: var(--red-bg); text-decoration: line-through; color: #8a4a4a; }
.ar-diff-after { padding: 6px 8px; border-radius: 6px; background: var(--green-bg); }
@media (max-width: 780px) {
  .ar-grid3 { grid-template-columns: 1fr; }
  .ar-target-head { flex-wrap: wrap; }
  .ar-target-link { position: static; transform: none; margin: 0 18px 12px 46px; }
  .ar-detail { padding-left: 18px; }
}

/* ---------------------------------------------------------------------------
   Operations → Ad Creative Generation (assets/creativegen.js)
   --------------------------------------------------------------------------- */
.cg-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cg-nav .chip { display: inline-flex; align-items: center; gap: 6px; }
.cg-card { margin-bottom: 18px; }
.cg-card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 10px; }
.cg-card .card-head h3 { margin: 0 0 3px; font: 760 14.5px/1.2 var(--sans); }
.cg-card .card-head p { margin: 0; font: 400 12.5px/1.45 var(--sans); color: var(--muted); }
.cg-card > p.hint, .cg-card > .hint { padding: 0 18px 16px; margin: 0; }
.cg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 16px; }
.cg-select { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: 500 12.5px/1 var(--sans); max-width: 100%; }
.cg-select:disabled { opacity: .5; }
.cg-num { width: 64px; min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; font: 600 13px/1 var(--sans); text-align: center; }
.cg-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0 18px 14px; }
.cg-facts > div { display: flex; flex-direction: column; gap: 3px; min-width: 70px; }
.cg-facts b { font: 760 16px/1.1 var(--sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.cg-facts small { font: 500 10.5px/1.3 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cg-readylist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding: 0 18px 14px; }
.cg-ready { display: grid; grid-template-columns: 10px auto; column-gap: 8px; align-items: baseline; font: 400 12.5px/1.4 var(--sans); }
.cg-ready b { font-weight: 650; }
.cg-ready small { grid-column: 2; color: var(--muted); }
.cg-grid3 { padding: 0 18px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cg-grid3 .field { min-width: 0; }
.cg-grid3 select, .cg-grid3 input { width: 100%; }
.cg-preflight { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; }
.cg-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding: 0 18px 14px; }
.cg-preflight .cg-kv { padding: 0; }
.cg-kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font: 400 12.5px/1.4 var(--sans); }
.cg-kv small { font: 500 10.5px/1.3 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cg-kv span { overflow-wrap: anywhere; }
.cg-list { margin: 0; padding: 0 18px 14px 36px; font: 400 12.5px/1.55 var(--sans); display: flex; flex-direction: column; gap: 4px; }
.cg-preflight .cg-list { padding: 0 0 0 18px; }
.cg-error { display: flex; gap: 10px; align-items: flex-start; margin: 0 18px 14px; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); border: 1px solid var(--red-line); font: 400 12.5px/1.5 var(--sans); }
.cg-preflight .cg-error { margin: 0; }
.cg-error svg { color: var(--red); flex: none; margin-top: 2px; }
.cg-banner { display: flex; align-items: flex-start; gap: 12px; font: 400 13px/1.5 var(--sans); margin-bottom: 14px; }
.cg-banner svg { flex: none; margin-top: 2px; color: var(--blue); }
.cg-banner--warn { background: var(--amber-bg); border-color: var(--amber-line); }
.cg-banner--warn svg { color: var(--amber); }
.cg-banner--critical { background: var(--red-bg); border-color: var(--red-line); }
.cg-banner--critical svg { color: var(--red); }
.cg-banner .btn { margin-left: auto; flex: none; }
.cg-angles { display: flex; flex-direction: column; }
.cg-angle { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.cg-angle.is-on { background: var(--ac-soft-2); }
.cg-angle-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.cg-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: var(--grey-bg); }
.cg-thumb--empty { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.cg-angle-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cg-angle-main b { font: 700 13px/1.25 var(--sans); }
.cg-angle-main small { font: 400 12px/1.4 var(--sans); color: var(--muted); }
.cg-meta { color: var(--muted); }
.cg-warn { color: var(--amber); }
.cg-angle-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cg-angle-extra .field { min-width: 0; }
.cg-angle-extra input, .cg-angle-extra select { width: 100%; }
.cg-stepper { display: inline-flex; align-items: center; gap: 4px; }
.cg-copygrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 18px 12px; }
.cg-copycol { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cg-copycol b { font: 700 13px/1.2 var(--sans); }
.cg-modes { display: flex; gap: 4px; flex-wrap: wrap; }
.cg-card > .form-grid { padding: 0 18px 16px; }
.cg-override { margin: 0 18px 16px; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); border: 1px solid var(--amber-line); display: flex; flex-direction: column; gap: 8px; font: 400 12.5px/1.5 var(--sans); }
.cg-override .field { flex-direction: row; align-items: center; gap: 8px; }
.cg-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 18px; }
.cg-actionbar b { font: 700 14px/1.3 var(--sans); }
.cg-actionbar small { font: 400 12.5px/1.45 var(--sans); color: var(--muted); }
.cg-runhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 18px 8px; }
.cg-runhead .cg-facts { padding: 0; }
.cg-stages { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 18px 14px; }
.cg-stage { font: 600 11px/1 var(--sans); padding: 6px 9px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); }
.cg-stage.is-done { background: var(--green-bg); color: var(--green); }
/* Brand New Campaign: the mode switch on the generate screen and the QA check list on a run. */
.cg-modebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 18px 12px; }
.cg-modebar .hint { flex: 1 1 260px; margin: 0; }
.cg-qa { list-style: none; margin: 0; padding: 4px 18px 14px; display: flex; flex-direction: column; gap: 4px; font: 400 12.5px/1.45 var(--sans); }
.cg-qa li { display: flex; align-items: baseline; gap: 8px; }
.cg-qa li .dot { flex: none; position: relative; top: -1px; }
.cg-qa li.is-fail { color: var(--red); }
.cg-qa li small { color: var(--muted); }
.cg-events .cg-qa { padding-left: 4px; }
.cg-stage.is-on { background: var(--blue-bg); color: var(--blue); }
.cg-pack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 18px 16px; }
.cg-packcol b { display: block; margin-bottom: 6px; font: 700 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cg-packcol ol { margin: 0; padding-left: 18px; font: 400 12.5px/1.5 var(--sans); display: flex; flex-direction: column; gap: 6px; white-space: pre-wrap; }
.cg-slots { display: flex; flex-direction: column; }
.cg-slot { display: grid; grid-template-columns: 24px 96px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.cg-slot.is-on { background: var(--ac-soft-2); }
.cg-slot input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ac); margin-top: 2px; }
.cg-slot-img { width: 96px; height: 96px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: var(--grey-bg); cursor: zoom-in; }
.cg-slot-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; font: 400 12.5px/1.45 var(--sans); }
.cg-slot-main b { font: 700 13px/1.25 var(--sans); }
.cg-packline { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.cg-packline input { margin-top: 3px; flex: none; }
.cg-pack li.is-on { background: var(--brand-soft, rgba(26,95,180,.12)); border-radius: 6px; }
.cg-attempts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cg-attempt { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 68px; }
.cg-attempt img { width: 64px; height: 64px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: var(--grey-bg); cursor: zoom-in; opacity: .8; }
.cg-attempt.is-current img { opacity: 1; border-color: var(--brand, #1a5fb4); box-shadow: 0 0 0 2px var(--brand-soft, rgba(26,95,180,.25)); }
.cg-attempt small { font: 500 10.5px/1.2 var(--sans); color: var(--muted); }
.cg-attempt .btn { padding: 2px 6px; font-size: 10.5px; }
.cg-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cg-count { font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cg-table th, .cg-table td { text-align: left; }
.cg-table td { white-space: normal; vertical-align: middle; }
.cg-events summary { cursor: pointer; font: 600 12.5px/1.2 var(--sans); color: var(--muted); padding: 0 18px 14px; }
.cg-eventbox { padding: 0 18px 14px; }
.cg-eventlist { margin: 0; padding-left: 18px; font: 400 12px/1.5 var(--sans); display: flex; flex-direction: column; gap: 4px; }
.cg-eventlist li.is-error, .cg-eventlist li.is-critical { color: var(--red); }
.cg-eventlist li.is-warning { color: var(--amber); }
.cg-eventlist small { color: var(--faint); }
.cg-pre { margin: 6px 0 0; padding: 10px; border-radius: 8px; background: var(--grey-bg); font: 400 11px/1.45 var(--code); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.cg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.cg-anglelist { display: flex; flex-direction: column; }
.cg-anglerow { display: flex; align-items: center; gap: 8px; padding: 6px 18px 6px 8px; border-top: 1px solid var(--line-soft); }
.cg-anglerow.is-on { background: var(--ac-soft-2); }
.cg-anglebtn { flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 8px 10px; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; }
.cg-anglebtn:hover { background: #fbfbfd; }
.cg-anglebtn b { font: 700 13px/1.25 var(--sans); }
.cg-anglebtn small { font: 400 11.5px/1.4 var(--sans); color: var(--muted); }
.cg-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.cg-asset { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: 400 12px/1.4 var(--sans); }
.cg-asset.is-off { opacity: .55; }
.cg-asset-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--grey-bg); }
.cg-asset small { color: var(--muted); }
@media (max-width: 780px) {
  .cg-readylist, .cg-kv, .cg-grid3, .cg-copygrid, .cg-pack, .cg-angle-extra { grid-template-columns: 1fr; }
  .cg-angle { grid-template-columns: 1fr; }
  .cg-angle-thumbs { order: 2; }
  .cg-slot { grid-template-columns: 24px 72px minmax(0, 1fr); }
  .cg-slot-img { width: 72px; height: 72px; }
}

/* ------------------------------------------------------- pre-call sequence */
/* The Pre-call tab: three track columns of touches, the event touches below,
   and the card on a prospect with every touch's standing. */
.pc-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pc-col { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: rgba(22, 23, 26, .03); border: 1px solid var(--line-soft); border-radius: 16px; min-width: 0; }
.pc-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; font: 500 13.5px/1.2 var(--sans); flex-wrap: wrap; }
.pc-col-head .hint { flex-basis: 100%; margin: 0; padding-left: 16px; font-size: 11.5px; }
.pc-touch { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; min-width: 0; }
.pc-touch.is-click { cursor: pointer; }
.pc-touch.is-click:hover { border-color: var(--line-strong); }
.pc-touch.is-dim { opacity: .55; }
.pc-ico { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--grey-bg); }
.pc-name { font: 600 13px/1.3 var(--sans); overflow-wrap: anywhere; }
.pc-when { font: 400 12px/1.35 var(--sans); color: var(--ac-ink); }
.pc-preview { font: 400 12px/1.4 var(--sans); color: var(--muted); white-space: pre-line; }
.pc-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.pc-pill { font: 500 10.5px/1 var(--sans); padding: 4px 7px; border-radius: 999px; background: var(--grey-bg); color: #5f6470; }
.pc-pill.is-deadline { background: var(--red-bg); color: var(--red); }
.pc-pill.is-once { background: var(--lav-bg); color: var(--lav); }
.pc-pill.is-mode { background: var(--blue-bg); color: var(--blue); }
.pc-pill.is-ok { background: var(--green-bg); color: var(--green); }
.pc-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pc-settings { display: flex; flex-direction: column; }
.pc-run { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pc-run-row { display: flex; gap: 10px; align-items: flex-start; }
.pc-run-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }
.pc-run-row.is-pending .pc-run-dot { box-shadow: 0 0 0 3px var(--blue-bg); }
.pc-sent { font: 400 12px/1.4 var(--sans); color: var(--muted); white-space: pre-line; border-left: 2px solid var(--line); padding-left: 8px; margin-top: 2px; }
.pc-task { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.pc-task:first-child { border-top: none; }
.pc-check { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--green); padding: 0; }
.pc-check:hover { border-color: var(--ink); }
.pc-task.is-done .pc-check { background: var(--green-bg); border-color: var(--green); }
.pc-copy { margin: 4px 0 0; padding: 8px 10px; background: var(--grey-bg); border-radius: 9px; font: 400 12.5px/1.45 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; }
.pcard-tasks { color: var(--amber); font-weight: 600; }
.card.thread.thread--inline { position: static; height: 420px; min-height: 0; }
.pro-page .lead-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); }
@media (max-width: 1080px) { .pc-board { grid-template-columns: 1fr; } }
