/* HQ wears the website's colours, light version (James, 12 Sep 2026: "too dark, brighten it up"):
   cream page, white cards, ink text, emerald for numbers and buttons; only the sidebar stays green-black. */
:root {
  --bg: #F4F1EB;
  --surface: #FFFFFF;
  --surface-2: #ECE9E3;
  --card: #FFFFFF;
  --tint: rgba(9, 9, 11,.04);
  --line: rgba(9, 9, 11,.10);
  --line-strong: rgba(9, 9, 11,.20);
  --fg: #09090B;
  --fg-2: #505050;
  --fg-3: #808080;
  --accent: #10A5B0;
  --accent-deep: #0F407B;
  --accent-tint: #E2F4F5;
  --on-accent: #09090B;
  --ink: #09090B;
  --cream: #F8F3ED;
  --chalk: #D9D6CF;
  --red: #B42318;
  --amber: #8F5B00;
  --blue: #1D5FD1;
  --font-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* one type scale, one spacing unit, one radius, one shadow (20 Sep 2026 design pass, match tools/spaces restraint) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px; --sp-5: 32px;
  --text-sm: 12.5px; --text-base: 14px; --text-md: 16px; --text-lg: 20px; --text-xl: 28px;
  --text-meta: 13px;   /* the grey line under a row (the Kit's enquiry rows, 21 Sep 2026): 12.5 is too small in a van */
  --radius: 10px; --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(9,9,11,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}
button, input, select { font-family: inherit; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand .hq-tag { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 8px; line-height: 1.3; }
.nav-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
}
.sidebar .nav-item { color: rgba(248,243,237,.78); }
.nav-item .nav-label { color: inherit; }
.sidebar .nav-item:hover { background: rgba(248,243,237,.07); color: var(--cream); }
.sidebar .nav-item.active { background: rgba(248,243,237,.09); color: var(--cream); border-left-color: var(--accent); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar .who { color: var(--fg-2); }
.topbar .who { font-size: 13px; color: var(--fg-3); }
/* the search box (A2, 17 Sep 2026): one box, / focuses it, Esc clears it */
.search-box { position: relative; flex: 1; max-width: 420px; margin: 0 16px; }
.search-box input {
  width: 100%; height: 40px; padding: 0 38px 0 12px; box-sizing: border-box;
  font: inherit; font-size: 14px; color: var(--fg);
  background: var(--surface-2, #F4F1EB); border: 1px solid var(--line); border-radius: 8px;
  -webkit-appearance: none; appearance: none;
}
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,165,176,.18); }
.search-box .search-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; color: var(--fg-3); font-size: 18px; line-height: 1;
}
.search-box .search-x:hover { background: var(--line); color: var(--fg); }
.search-box .search-x[hidden] { display: none; }
/* the bell (A5, 17 Sep 2026; reshaped 20 Sep 2026): tap opens its own dropdown in place */
.bell-wrap { position: relative; margin-right: 12px; }
.bell {
  position: relative; flex: none; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2, #F4F1EB);
  color: var(--fg-3); cursor: pointer; font: inherit;
}
.bell:hover { color: var(--fg); border-color: var(--fg-3); }
.bell.has-alerts { color: var(--amber); border-color: rgba(233,180,76,.6); }
.bell.has-bad { color: var(--red); border-color: rgba(180,35,24,.5); }
.bell-n {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.bell.has-alerts:not(.has-bad) .bell-n { background: var(--amber); color: #1a1a1a; }
.bell-n[hidden] { display: none; }
.bell-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; z-index: 40;
}
@media (max-width: 480px) {
  .bell-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-width: none; }
}
.bell-panel[hidden] { display: none; }

/* The "..." overflow menu (20 Sep 2026) - a row's quieter, more destructive actions. */
.row-more { position: relative; display: inline-block; }
.btn-more {
  width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent;
  color: var(--text-dim); font-size: 16px; line-height: 1; cursor: pointer;
}
.btn-more:hover { background: var(--surface-hover, rgba(0,0,0,.04)); }
.row-more.open .btn-more { background: var(--surface-hover, rgba(0,0,0,.06)); color: var(--text); }
.row-more-pop {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; z-index: 30; display: flex; flex-direction: column; gap: 2px;
}
.row-more-pop[hidden] { display: none; }
.row-more-pop .btn { width: 100%; text-align: left; justify-content: flex-start; }
@media (max-width: 480px) {
  .row-more-pop { right: 0; left: auto; max-width: calc(100vw - 32px); }
}

/* Skeleton rows (20 Sep 2026) - three grey bars instead of the word "Loading" anywhere it printed. */
.skeleton-rows { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-row { display: flex; flex-direction: column; gap: 8px; }
.skeleton-bar {
  height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--surface-hover, rgba(0,0,0,.06)) 37%, var(--line) 63%);
  background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite;
}
.skeleton-bar.w1 { width: 60%; }
.skeleton-bar.w2 { width: 90%; }
.skeleton-bar.w3 { width: 40%; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton-bar { animation: none; } }
.bell-panel-list { max-height: 320px; overflow-y: auto; }
.bell-panel-list .empty { padding: 14px 8px; }
.bell-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.bell-row:last-child { border-bottom: none; }
.bell-row.bad .bell-row-text { color: var(--red); }
.bell-row.warn .bell-row-text { color: var(--amber); }
.bell-row-text { flex: 1; line-height: 1.35; }
.bell-row-actions { flex: none; display: flex; gap: 6px; }
.bell-row-actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; text-decoration: none; }
.bell-setting {
  display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; margin-top: 4px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-2); cursor: pointer;
}
.alerts .strip { margin-bottom: 10px; }
.alerts .strip:last-of-type { margin-bottom: 18px; }
.alert-strip .strip-actions { flex: none; display: flex; gap: 6px; align-items: center; }
.alert-strip .strip-actions .btn { height: 36px; padding: 0 12px; font-size: 13.5px; color: inherit; border: 1px solid currentColor; opacity: .85; text-decoration: none; }
.alert-strip .strip-actions .btn:hover { opacity: 1; background: rgba(255,255,255,.4); }
/* 17 Sep 2026: every alert strip is three lines - bold title, one plain sentence, the action line -
   and never more than 160 characters of one text; the rest opens with "Show the detail". */
.strip-title { display: block; font-weight: 700; line-height: 1.3; }
.strip-action { color: var(--fg); opacity: .8; }
.alert-strip .strip-sub { color: var(--fg); opacity: .78; font-size: 14px; }
.clamp-btn { border: none; background: transparent; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; opacity: .9; min-height: 24px; }
.clamp-btn:hover { opacity: 1; }
@media (max-width: 640px) {
  .alert-strip { flex-wrap: wrap; }
  .alert-strip .strip-actions { width: 100%; justify-content: flex-end; }
}
.alert-note { margin: -6px 0 18px; font-size: 13.5px; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.alert-note .btn { height: 36px; }
/* the Download button beside a section title (A9) */
h2.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
h2.section-head .head-tools { margin-left: auto; font-family: var(--font-body, inherit); font-weight: 500; letter-spacing: 0; }
.btn-export { font-size: 13px; padding: 4px 10px; }
.content { max-width: 1120px; margin: 0 auto; padding: 32px; }

h1 { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.subtitle { color: var(--fg-2); font-size: 14px; margin: 0 0 24px; }

h2.section-head {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 32px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
h2.section-head:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
h2.section-head .count { color: var(--fg-3); font-weight: 400; font-size: 15px; }

/* ---------- KPI row ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  text-decoration: none;
}
button.kpi-tile, a.kpi-tile { cursor: pointer; }
button.kpi-tile:hover, a.kpi-tile:hover { border-color: var(--accent); background: var(--surface); }
button.kpi-tile:focus-visible, a.kpi-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-tile .label, .kpi-tile .value, .kpi-tile .note { display: block; }
.kpi-tile .label { font-size: 13px; font-weight: 500; color: var(--fg-2); }
.kpi-tile .value { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; line-height: 1.1; color: var(--accent-deep); }
.kpi-tile .value.bad { color: var(--red); }
.kpi-tile .note { font-size: 12px; font-weight: 400; margin-top: 4px; color: var(--fg-3); line-height: 1.35; }

/* ---------- month-over-month compare chart, 14 Sep 2026 ---------- */
.hq-compare {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px 12px; margin: 14px 0;
}
.hq-compare-row { margin-bottom: 12px; }
.hq-compare-row:last-of-type { margin-bottom: 8px; }
.hq-compare-label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 5px; }
.hq-compare-track { position: relative; height: 20px; margin-bottom: 3px; background: var(--cream, #F8F3ED); border-radius: var(--radius-sm); overflow: hidden; }
.hq-compare-bar { height: 100%; width: 100%; transform-origin: left; border-radius: var(--radius-sm); transition: transform .3s ease; }
.hq-compare-bar.now { background: var(--accent-deep); }
.hq-compare-bar.last { background: var(--accent); opacity: .45; }
.hq-compare-num { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--ink); }
.hq-compare-num.muted { color: var(--fg-3); font-weight: 600; }
.hq-compare-key { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--fg-3); }
.hq-compare-key i { display: inline-block; width: 9px; height: 9px; border-radius: var(--radius-sm); margin-right: 5px; vertical-align: middle; }
.hq-compare-key i.now { background: var(--accent-deep); }
.hq-compare-key i.last { background: var(--accent); opacity: .45; }

.hq-trend-card {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px 12px; margin: 14px 0;
}
.hq-trend-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.hq-trend { width: 100%; height: 150px; display: block; }
.hq-trend-line { stroke-width: 2; }
.hq-trend-line.spend { stroke: var(--accent); }
.hq-trend-line.brought { stroke: var(--accent-deep); }
.hq-trend-dot.spend { fill: var(--accent); }
.hq-trend-dot.brought { fill: var(--accent-deep); }
.hq-trend-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.hq-trend-card .hq-compare { border: 0; padding: 0; margin: 0; }
.hq-trend-key { display: flex; gap: 16px; margin-top: 4px; font-size: 12px; color: var(--fg-3); }
.hq-trend-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.hq-trend-key i.now, .hq-trend-key i.brought { background: var(--accent-deep); }
.hq-trend-key i.spend { background: var(--accent); }
/* B1 (17 Sep 2026), the Numbers screen: leads in (grey), booked a call (teal), won (deep blue) */
.hq-trend-line.leads { stroke: var(--fg-3); stroke-dasharray: 4 3; }
.hq-trend-line.booked { stroke: var(--accent); }
.hq-trend-line.won { stroke: var(--accent-deep); }
.hq-trend-dot.leads { fill: var(--fg-3); }
.hq-trend-dot.booked { fill: var(--accent); }
.hq-trend-dot.won { fill: var(--accent-deep); }
.hq-trend-key i.leads { background: var(--fg-3); }
.hq-trend-key i.booked { background: var(--accent); }
.hq-trend-key i.won { background: var(--accent-deep); }
/* the Numbers screen's tables are all numbers: no wide action column on the right */
table.data.numbers th:last-child, table.data.numbers td:last-child { width: 110px; }
table.data.numbers th.num, table.data.numbers td.num { width: 90px; }
table.data.numbers tr.strong td { font-weight: 700; }

/* ---------- accounts card (14 Sep 2026) ---------- */
.hq-accounts-card {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px; margin: 14px 0;
}
.hq-accounts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.hq-accounts-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.hq-accounts-ask:disabled { opacity: .45; cursor: default; }
.hq-accounts-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-top: 1px solid var(--border, #E2DFD6);
}
.hq-accounts-row:first-of-type { border-top: none; }
.hq-accounts-check { width: 16px; height: 16px; accent-color: var(--accent-deep); flex-shrink: 0; }
.hq-accounts-name { font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 150px; }
.hq-accounts-state { font-size: 13px; color: var(--fg-3); flex: 1; }
.hq-accounts-state.good { color: var(--accent-deep); font-weight: 600; }
.hq-accounts-state.amber { color: var(--amber); font-weight: 600; }
.hq-accounts-state.red { color: var(--red); font-weight: 600; }
.hq-accounts-state.muted { color: var(--fg-3); }
.hq-accounts-checknow { padding: 4px 10px; font-size: 12.5px; }
.hq-accounts-summary { margin-top: 10px; font-size: 12.5px; color: var(--fg-3); }

/* ---------- table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.data td, table.data th { overflow-wrap: anywhere; }
table.data th:first-child, table.data td:first-child { width: 34%; }
table.data th:last-child, table.data td:last-child { width: 200px; }
table.data th.num, table.data td.num { width: 130px; }
table.data th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}
table.data tr:hover td { background: var(--surface); }
table.data td.num, table.data th.num { text-align: right; }
table.data .row-title { font-weight: 600; }
table.data .row-sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }

/* ---------- status dot ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.green, .dot.won, .dot.paid, .dot.approved { background: var(--accent-deep); }
.dot.amber, .dot.due, .dot.pending, .dot.claimed { background: var(--amber); }
.dot.red, .dot.late, .dot.rejected, .dot.lost { background: var(--red); }
.dot.blue, .dot.new, .dot.booked { background: var(--blue); }
.dot.grey, .dot.called, .dot.open, .dot.skipped { background: var(--fg-3); }

/* ---------- buttons ---------- */
.btn {
  height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #19c0c9; }
.btn-secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg); }
.btn-secondary:hover { border-color: var(--accent-deep); color: var(--accent-deep); }
.btn-quiet { background: transparent; color: var(--fg-2); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { border-color: rgba(180,35,24,.35); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- cards / rows ---------- */
.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.row-card .left { min-width: 0; flex: 1 1 200px; }
.row-card .sub { overflow-wrap: break-word; }
.row-card .title { font-weight: 600; font-size: 14px; }
.row-card .sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.row-card .right { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }

.empty {
  color: var(--fg-2);
  font-size: 13px;
  padding: 16px;
  margin: 4px 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}
.empty .empty-title { font-weight: 600; color: var(--fg); font-size: 14px; }
.empty .empty-next { margin-top: 4px; color: var(--fg-3); }

input[type="text"], input[type="email"], select {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  padding: 0 10px;
  font-size: 14px;
}

/* ---------- mobile tabbar ---------- */
.tabbar { display: none; }

@media (max-width: 767px) {
  .sidebar { display: none; }
  .content { padding: 16px; padding-bottom: 80px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .search-box { flex: 1 1 100%; max-width: none; margin: 0; order: 1; }
  .bell { margin-left: auto; margin-right: 8px; height: 44px; width: 44px; }
  .alert-strip { flex-wrap: wrap; }
  .alert-strip .strip-actions { width: 100%; justify-content: flex-end; }
  .alert-strip .strip-actions .btn { height: 44px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-tile { min-height: 92px; padding: 12px 14px; }
  .kpi-tile .value { font-size: 24px; }
  .table-wrap { display: none; }
  table.data { display: none; }
  .row-card { flex-wrap: wrap; }
  .row-card .left { flex-basis: 100%; }
  /* 21 Sep 2026: flex-shrink 0 from the desktop rule let a card with five buttons (a document: Sent,
     Viewed, Signed, Edit, Remove) run off the right edge of a phone; the strip now wraps inside the card. */
  .row-card .right { flex-direction: row; flex-wrap: wrap; margin-top: 8px; flex-shrink: 1; min-width: 0; max-width: 100%; }
  .btn { height: 44px; }

  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--ink);
    border-top: 1px solid rgba(248,243,237,.12);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
  }
  .tabbar .tab {
    flex: 1 1 auto; /* B1: nine tabs on a 375 phone - a long label like Numbers takes the room it needs, the spare is shared */
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 2px;
    min-width: 40px; /* the Kit check refuses a tap target under 40px */
    color: rgba(248,243,237,.6);
    font-size: 12px; /* never under 12px - the Kit check refuses smaller text */
    line-height: 1.15;
    white-space: normal; /* "Settings"/"Numbers" wrap to a second line instead of clipping */
    overflow-wrap: break-word;
    cursor: pointer;
    text-decoration: none;
  }
  .tabbar .tab.active { color: var(--accent); }
  .tabbar .tab-more { border: 0; background: transparent; font-family: inherit; }
}
/* the More sheet (20 Sep 2026, BRIEF #2): the four tabs that don't fit the bar at 375. */
.tab-more-sheet { position: fixed; inset: 0; z-index: 50; }
.tab-more-sheet[hidden] { display: none; }
.tab-more-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.tab-more-box {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 8px calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-bottom)) 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.tab-more-item {
  display: flex; align-items: center; min-height: 48px; padding: 6px 14px;
  font-size: 15px; color: var(--fg); text-decoration: none; border-radius: 10px;
}
.tab-more-item:hover, .tab-more-item.active { background: var(--surface-2, #F4F1EB); }
@media (min-width: 768px) { .tab-more-sheet { display: none !important; } }

@media (min-width: 768px) {
  .cards-view { display: none; }
}

#app.pre-auth .sidebar,#app.pre-auth .topbar,#app.pre-auth .tabbar{display:none}
#app.pre-auth .main{width:100%}#app.pre-auth .content{display:flex;justify-content:center;align-items:flex-start;min-height:100vh;padding-top:8vh}
.signin .signin-mark{display:block;width:150px;margin:0 0 26px}
.signin{width:100%;max-width:420px;margin:6vh auto 0;padding:0 20px}
.signin h1{margin:0 0 8px}.signin p{opacity:.8;margin:0 0 16px}
.signin .signin-where{font-size:13px;letter-spacing:.02em;opacity:.7;margin:0 0 10px}
/* 22 Sep 2026: Sign in with Google - Google's own button shape (white, their mark, their wording),
   above the password form, with a plain "or" line between the two ways in. */
.signin .btn-google{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;
  background:#fff;color:#1f1f1f;border:1px solid #dadce0;border-radius:8px;padding:12px 16px;
  font-size:15px;font-weight:600;cursor:pointer}
.signin .btn-google:hover{background:#f7f8f8}
.signin .btn-google:disabled{opacity:.6;cursor:default}
.signin .signin-or{display:flex;align-items:center;gap:12px;margin:16px 0;font-size:13px;opacity:.6}
.signin .signin-or::before,.signin .signin-or::after{content:"";flex:1;height:1px;background:var(--line)}
.signin .signin-other{margin-top:22px;padding-top:14px;border-top:1px solid var(--line-strong)}
.signin form{display:flex;flex-direction:column;gap:10px}
.signin input{flex:0 0 auto;display:block;width:100%;height:48px;padding:0 12px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface);color:inherit;font:inherit}
.signin .btn{width:100%;justify-content:center}
.signin .note{margin-top:12px;font-size:14px}
.signin .note a{color:inherit;opacity:.8;display:inline-flex;align-items:center;min-height:44px}

/* ---------- sign out ---------- */
.signout-link {
  display: block;
  padding: 10px 12px;
  margin-top: 16px;
  border-top: 1px solid rgba(248,243,237,.12);
  color: rgba(248,243,237,.55);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.signout-link:hover { color: var(--cream); }
.tabbar .signout-link { border-top: none; padding: 10px 0 8px; flex: 1; text-align: center; }

/* ---------- client page ---------- */
.back-link { display: inline-block; color: var(--fg-3); font-size: 13px; text-decoration: none; margin-bottom: 12px; cursor: pointer; }
.back-link:hover { color: var(--fg); }
.client-meta { color: var(--fg-2); font-size: 13px; margin: 0 0 24px; }
.inline-note { color: var(--fg-3); font-size: 12px; margin-left: 8px; }
.inline-note.bad { color: var(--red); }
/* Phase 2 (18 Sep 2026): "See the email" - the held email exactly as it will land, in a sandboxed frame. */
.held-note { margin: 4px 0 0; display: block; min-height: 0; }
.held-note:empty { display: none; }
.held-modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 11, 13, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.held-modal-box { background: #fff; border-radius: var(--radius); width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.held-modal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, #e6e3dc); }
.held-modal-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.held-modal-frame { border: 0; width: 100%; flex: 1 1 auto; min-height: 60vh; background: #fff; }
.held-modal-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line, #e6e3dc); }
@media (max-width: 600px) { .held-modal { padding: 0; } .held-modal-box { border-radius: 0; max-height: 100vh; height: 100vh; } .held-modal-frame { min-height: 0; } }
/* ---------- p13 ideas 7-14 (20 Sep 2026): the slot picker, My hours, reassign/type, notes, ics ---------- */
.slot-modal-box, .hours-modal-box { max-width: 640px; }
.slot-modal-body, .hours-modal-body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.slot-day { border-bottom: 1px solid var(--line, #e6e3dc); padding-bottom: 10px; }
.slot-day:last-child { border-bottom: 0; }
.slot-day-head { font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
.slot-day-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-btn { border: 1px solid var(--border, #E2DFD6); background: var(--surface, #fff); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.slot-btn:hover { border-color: var(--accent, #10A5B0); }
.slot-none { color: var(--fg-3); font-size: 12px; }
.hours-days { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.hours-day-toggle { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.call-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.reassign-pick { padding: 5px 6px; border-radius: 8px; border: 1px solid var(--border, #E2DFD6); background: var(--surface, #fff); font-size: 13px; }
.type-toggle { display: inline-flex; border: 1px solid var(--border, #E2DFD6); border-radius: 8px; overflow: hidden; }
.type-toggle .btn { border-radius: 0; border: 0; }
.type-toggle .btn.active { background: var(--accent, #10A5B0); color: #fff; }
.call-notes-row { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.call-notes-box { width: 100%; resize: vertical; border: 1px solid var(--border, #E2DFD6); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
.call-notes-next { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.call-notes-details { margin-top: 8px; }
.call-notes-details > summary { cursor: pointer; font-size: 13px; color: var(--fg-3); min-height: 40px; display: flex; align-items: center; }
.row-more-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); padding: 2px 0; }
/* B2 (17 Sep 2026): the Money screen's cost lanes and the lane-cost table */
.section-note { color: var(--fg-2); font-size: 13px; margin: -8px 0 14px; max-width: 720px; }
.lane-select { max-width: 220px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border, #E2DFD6); background: var(--surface, #fff); color: var(--fg); font-size: 13px; }
.lane-select:disabled { opacity: .6; }
.section-foot { color: var(--fg-3); font-size: 12.5px; margin: 10px 0 0; }
.row-card .right.right-lane { flex-shrink: 1; min-width: 0; flex-wrap: wrap; max-width: 100%; }
.row-card .right.right-lane .lane-select { max-width: 100%; }
.row-card .right.right-lane .lane-note { flex-basis: 100%; margin: 4px 0 0; white-space: normal; }
/* B9: the webhook line on the Accounts card sits after the summary, so it gets its own top rule */
.hq-accounts-webhook { border-top: 1px solid var(--border, #E2DFD6); margin-top: 6px; }
.dot.found{background:#8a8f98}

/* ---------- lead quality pill ---------- */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: default;
}
.pill.hot { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.pill.warm { background: rgba(233,180,76,.22); color: var(--amber); }
.pill.cold { background: var(--surface-2); color: var(--fg-3); }
.pill.found { background: rgba(29,95,209,.10); color: var(--blue); }

/* ---------- filter bar ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 8px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters-toggle { flex: none; height: 40px; }
.filters-drawer { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2, #F4F1EB); }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-group .flabel {
  font-size: 13px;
  color: var(--fg-3);
  width: 84px;
  flex-shrink: 0;
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--fg-2);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { color: var(--fg); }
.chip.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.chip.on .n { color: var(--on-accent); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .55; }
.chip.on .n { opacity: .7; }

@media (max-width: 767px) {
  .filter-group .flabel { width: 100%; }
}


/* ---------- one line, the rest opens when you tap ---------- */
.expando { min-width: 0; }
.expando .row-open {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}
.expando.can-open .row-open { cursor: pointer; }
.expando .row-open .row-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expando.open .row-open .row-title { white-space: normal; overflow: visible; }
.expando .chev {
  flex: 0 0 auto;
  color: var(--fg-3);
  font-size: 16px;
  line-height: 18px;
  transition: transform .12s ease;
}
.expando.can-open:hover .chev { color: var(--fg); }
.chip.on{color:var(--on-accent)}
.expando.open .chev { transform: rotate(180deg); }
.expando .more-body { display: none; padding: 2px 0 6px; }
.expando.open .more-body { display: block; }
.expando .more-body .row-sub {
  color: var(--fg-2);
  font-size: 13px;
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.expando .peek {
  color: var(--fg-2);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 4px;
}
.expando.open .peek { display: none; }

/* ---------- small tap targets ---------- */
.back-link { min-height: 44px; display: inline-flex; align-items: center; }
.signout-link { min-height: 44px; display: flex; align-items: center; }
@media (max-width: 767px) { .chip { height: 44px; } }

/* A row's buttons, side by side, wrapping on a phone rather than squashing. */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* In a table the buttons sit on one line and stay small, so a row is one line tall. */
td .btn-row { margin-top: 0; flex-wrap: nowrap; white-space: nowrap; }
td .btn-row .btn { padding: 6px 10px; font-size: 12.5px; flex: 0 0 auto; }
table.data td:last-child { width: 1%; }
.btn-row .btn { text-decoration: none; }
/* A phone number or email you can tap. */
.link { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--accent-deep); }
.row-card.wide { flex-direction: column; align-items: stretch; }
.done-note { color: var(--fg-2); font-size: 13px; }

/* ---------- Agents screen ---------- */
/* One card per helper. Reads top to bottom like a note left on the desk. */
.run-card{
  border:1px solid var(--line); border-radius:12px; background:var(--card);
  padding:16px 18px; margin-bottom:12px;
}
.run-top{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px}
.run-name{font-weight:650; font-size:15px}
.run-when{color:var(--fg-2); font-size:13px; margin-left:auto}
.run-out{font-size:19px; font-weight:600; line-height:1.3; margin-bottom:12px}
.run-line{
  display:grid; grid-template-columns:170px 1fr; gap:12px;
  padding:7px 0; border-top:1px solid var(--line); font-size:14px;
}
.run-line .k{color:var(--fg-2)}
.run-line.warn .v{color:var(--amber)}
.run-line.bad .v{color:var(--red); font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px}
.run-wants{
  display:grid; grid-template-columns:170px 1fr; gap:12px;
  margin-top:12px; padding:10px 12px; border-radius:6px;
  background:var(--tint, rgba(0,0,0,.035)); font-size:14px;
}
.run-wants .k{color:var(--fg-2)}
.run-chip{
  height:auto; font-size:12px; letter-spacing:.06em; text-transform:uppercase; font-weight:700;
  padding:3px 9px; border-radius:99px; border:1px solid var(--line); color:var(--fg-2);
}
.run-chip.ok{background:rgba(16,165,176,.16); border-color:transparent; color:var(--accent-deep)}
.run-chip.warn{background:rgba(233,180,76,.22); border-color:transparent; color:var(--amber)}
.run-chip.bad{background:rgba(180,35,24,.12); border-color:transparent; color:var(--red)}
@media (max-width:640px){
  .run-line, .run-wants{grid-template-columns:1fr; gap:2px}
  .run-line .k, .run-wants .k{font-size:12px}
}

/* ---------- the morning strip ---------- */
/* First thing on Today. One line, and it is either green or it names what broke. */
.strip{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding:12px 16px; border-radius:12px; margin-bottom:18px;
  font-size:15px; font-weight:600; border:1px solid var(--line); background:var(--card);
}
.strip.ok{background:rgba(16,165,176,.14); border-color:transparent; color:var(--accent-deep)}
.strip.bad{background:rgba(180,35,24,.10); border-color:transparent; color:var(--red)}
.strip-text{flex:1}
.strip-sub{display:block; font-weight:400; font-size:13.5px; color:var(--fg-2); margin-top:3px}
.strip-x{
  flex:none; border:none; background:transparent; color:inherit; opacity:.55; cursor:pointer;
  font-size:20px; line-height:1; width:40px; height:40px; margin:-10px -8px -10px 0; border-radius:8px;
}
.strip-x:hover{opacity:1}

/* 16 Sep 2026: a tap that failed to save says so on the button itself - see commit() in app.js */
.save-failed{ color: var(--red) !important; border-color: var(--red) !important; }

/* ---------- the lanes, 12 Sep 2026 ---------- */
/* Same cards as everywhere else: white on cream, one job per card, 44px taps. */
.strip.warn { background: rgba(233,180,76,.22); border-color: transparent; color: var(--amber); }
.btn[hidden] { display: none; }

/* Your 15 messages today */
.dm-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.dm-card .dm-name { font-weight: 600; font-size: 15px; }
.dm-card .dm-why { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.opener {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

/* the collapsed line at the bottom of a section */
.done-today {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 16px;
  margin: 8px 0 4px;
}
.done-today > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  list-style-position: inside;
}
.done-today[open] > summary { border-bottom: 1px solid var(--line); }
.done-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.done-row:last-child { border-bottom: none; }
.done-row .done-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.done-row .done-what { color: var(--fg-2); flex-shrink: 0; }

/* Answer - one card per reply */
.reply-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.reply-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.reply-top .reply-name { font-weight: 650; font-size: 15px; }
.reply-top .reply-to { color: var(--fg-2); font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.clock {
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.clock.ok { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.clock.over { background: rgba(180,35,24,.12); color: var(--red); }
.quote {
  border-left: 2px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sent-detail { margin-top: 10px; }
.sent-detail > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  list-style-position: inside;
}
.sent-subject { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.sent-text {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-bottom: 6px;
}
.reply-link { margin-top: 8px; font-size: 13px; }
textarea.reply-draft {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}
textarea.reply-draft:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Leads - the two small pills and the line saying where they came from */
.pill.started { background: rgba(29,95,209,.10); color: var(--blue); }
.pill.quick { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.pill.slow { background: rgba(180,35,24,.12); color: var(--red); }
.dot.started { background: var(--blue); }
.source-detail { color: var(--fg-3); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }

/* Partners - add one */
.client-actions { margin: -12px 0 20px; }
.client-actions:empty { margin: 0; }
.add-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  margin-top: 12px;
}
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.add-form .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.add-form label { font-size: 13px; color: var(--fg-2); }
.add-form input, .add-form select {
  height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  padding: 0 10px;
  font-size: 14px;
}

/* A tall card (a lead, a partner) stacks - it must never wrap into a second
   column, or the line sizes itself to the longest sentence and the card spills
   off the side of a phone. */
.row-card.wide { flex-wrap: nowrap; }
.reply-link .btn { text-decoration: none; }

/* A collapsed line says it can be opened, the same way a row title does. */
.done-today > summary, .sent-detail > summary { justify-content: space-between; list-style: none; }
.done-today > summary::-webkit-details-marker, .sent-detail > summary::-webkit-details-marker { display: none; }
.done-today > summary::after, .sent-detail > summary::after {
  content: "\25BE";
  color: var(--fg-3);
  font-size: 16px;
  line-height: 18px;
  transition: transform .12s ease;
}
.done-today[open] > summary::after, .sent-detail[open] > summary::after { transform: rotate(180deg); }

/* ---------- the client's plan (Steps, Client info, Money, Metrics, Jobs), 16 Sep 2026 ---------- */
.lc-wrap { margin-bottom: 28px; }
.lc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.lc-save { font-size: 12.5px; color: var(--fg-3); min-height: 16px; }
.lc-save.saved { color: var(--accent-deep); }
.lc-save.failed { color: var(--red); font-weight: 600; }

.lc-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--fg-2); }
.lc-pill.ok { background: rgba(15,64,123,.10); color: var(--accent-deep); }
.lc-pill.warn { background: rgba(143,91,0,.12); color: var(--amber); }
.lc-pill.bad { background: rgba(180,35,24,.10); color: var(--red); }
.lc-pill.none { background: var(--surface-2); color: var(--fg-3); }

.lc-undo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2);
  padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--fg-2);
}
.lc-small { height: 34px; padding: 0 12px; font-size: 13px; }

.lc-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; margin-bottom: 12px; }
.lc-card.dim { opacity: .62; }
.lc-h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.lc-h4 { font-size: 12.5px; font-weight: 600; color: var(--fg-2); margin: 0 0 6px; }
.lc-note { color: var(--fg-2); font-size: 13px; margin: 0 0 10px; }
.lc-note:last-child { margin-bottom: 0; }
.lc-note b.warn { color: var(--amber); }

.lc-setup { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; margin-bottom: 14px; }
.lc-setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.lc-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lc-field.wide { grid-column: 1 / -1; }
.lc-field > span { font-size: 12px; color: var(--fg-2); }
.lc-field input, .lc-field select, .lc-field textarea {
  height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--fg); padding: 0 10px; font-size: 14px; width: 100%; font-family: inherit;
}
.lc-field textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.lc-field input:focus, .lc-field select:focus, .lc-field textarea:focus,
.lc-table input:focus, .lc-table select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lc-field input[readonly], .lc-field input:disabled { background: var(--surface-2); color: var(--fg-2); }

.lc-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-seg-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 36px;
}
.lc-seg-btn.on { background: rgba(16,165,176,.14); border-color: var(--accent); color: var(--ink); }
.lc-seg-btn.on.ok { background: rgba(15,64,123,.12); border-color: var(--accent-deep); color: var(--accent-deep); }
.lc-seg-btn.on.wait { background: rgba(143,91,0,.12); border-color: var(--amber); color: var(--amber); }

.lc-access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.lc-access-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.lc-access-name span { display: block; font-size: 12px; font-weight: 400; color: var(--fg-3); }

.lc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 14px; overflow-x: auto; }
.lc-tab {
  padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--fg-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; display: flex; align-items: center;
}
.lc-tab:hover { color: var(--ink); }
.lc-tab.on { color: var(--ink); border-bottom-color: var(--accent); }

.lc-next {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-tint); padding: 16px; margin-bottom: 12px;
}
.lc-next-label { font-size: 12px; font-weight: 600; color: var(--accent-deep); }
.lc-next-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); }
.lc-next-sub { font-size: 13px; color: var(--fg-2); margin-top: 2px; }

.lc-step { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.lc-step.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,165,176,.10); }
.lc-step.done { opacity: .74; }
.lc-step-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; }
.lc-num { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--fg-2); }
.lc-step.current .lc-num { border-color: var(--accent); color: var(--accent-deep); }
.lc-step.done .lc-num { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.lc-step-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.lc-step-title small { display: block; font-weight: 400; color: var(--fg-2); font-size: 12.5px; margin-top: 2px; }
.lc-step-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.lc-step-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; margin-top: 12px; }
.lc-tag { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.lc-tag.ok { background: rgba(15,64,123,.10); color: var(--accent-deep); }
.lc-tag.late { background: rgba(143,91,0,.12); color: var(--amber); }
.lc-tag.due { background: rgba(16,165,176,.14); color: var(--accent-deep); }

.lc-check { list-style: none; padding: 0; margin: 0; }
.lc-check li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.lc-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent-deep); flex: none; }
.lc-check label { font-size: 13.5px; cursor: pointer; }
.lc-check li.tick label { color: var(--fg-3); text-decoration: line-through; }

.lc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.lc-actions .lc-note { margin: 0; }
.lc-who { height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); padding: 0 10px; font-size: 14px; width: 160px; }
.lc-viewas { height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); padding: 0 10px; font-size: 14px; }

.lc-money-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.lc-mbox { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 14px; }
.lc-mbox.floor { border-color: rgba(143,91,0,.45); }
.lc-mbox.target { border-color: rgba(15,64,123,.45); }
.lc-mbox .l { font-size: 12.5px; color: var(--fg-2); }
.lc-mbox .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); margin: 2px 0; }
.lc-mbox .s { font-size: 12.5px; color: var(--fg-3); }

.lc-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 999px; margin: 18px 0 30px; }
.lc-track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.lc-track .mark { position: absolute; top: -6px; width: 2px; height: 26px; background: var(--fg-3); }
.lc-track .mark span { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--fg-2); white-space: nowrap; }
.lc-track .mark.floor { background: var(--amber); }
.lc-track .mark.target { background: var(--accent-deep); }
.lc-verdict { font-size: 15px; margin: 6px 0 0; color: var(--ink); }
.lc-verdict b.bad { color: var(--red); }
.lc-verdict b.warn { color: var(--amber); }
.lc-verdict b.ok { color: var(--accent-deep); }

.lc-rules { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.lc-rules div { display: grid; grid-template-columns: 210px 1fr; gap: 12px; }
.lc-rules div span { color: var(--fg-2); }

.lc-scroll { width: 100%; overflow-x: auto; }
table.lc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
table.lc-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 8px; border-bottom: 1px solid var(--line); }
table.lc-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.lc-table input, table.lc-table select {
  height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--fg); padding: 0 8px; font-size: 13.5px; width: 100%; min-width: 70px;
}
table.lc-table input[readonly] { background: var(--surface-2); color: var(--fg-2); }
table.lc-table input.lc-now.ok { border-color: var(--accent-deep); color: var(--accent-deep); }
table.lc-table input.lc-now.amber { border-color: var(--amber); color: var(--amber); }
table.lc-table input.lc-now.red { border-color: var(--red); color: var(--red); }
table.lc-table td:first-child, table.lc-table th:first-child { min-width: 190px; }
table.lc-table td:nth-last-child(2), table.lc-table th:nth-last-child(2) { min-width: 130px; }
table.lc-table tr.lc-row-done td { opacity: .55; }
.lc-trend { font-size: 12px; color: var(--fg-3); margin-top: 3px; }

@media (max-width: 767px) {
  .lc-step-grid { grid-template-columns: 1fr; }
  .lc-money-row { grid-template-columns: 1fr; }
  .lc-rules div { grid-template-columns: 1fr; }
  .lc-scroll { display: block; }
  table.lc-table { display: table; }
}

/* A3 (17 Sep 2026): the Who to talk to card on the client page's Client info tab. */
.contact-save-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.contact-save-row .lc-save { flex: 1 1 200px; }
.contact-hold-note { margin-top: 10px; }

/* ---- Money: Heads up (A7, 17 Sep 2026) - what is coming before it bites ---- */
.heads-up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.heads-up-block h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--fg); }
.heads-up-block h3 .count { color: var(--fg-3); font-weight: 500; }
.heads-up-row { margin-bottom: 8px; flex-wrap: wrap; }
.heads-up-row .left { flex: 1 1 150px; }
.heads-up-row .title a { color: inherit; text-decoration: none; }
.heads-up-row .title a:hover { text-decoration: underline; }
.heads-up-empty { color: var(--fg-3); font-size: 13px; margin: 0 0 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
@media (max-width: 767px) { .heads-up-grid { grid-template-columns: 1fr; } }

/* A1 (17 Sep 2026): the audit line under a decided approval, and the frozen card behind it */
.row-card .sub.audit-line { color: var(--fg-3); }
.expando.snap { margin-top: 4px; }
.expando.snap .row-open .row-title { font-size: 13px; color: var(--fg-2); }
.expando.snap .snapshot {
  margin: 0; padding: 8px 10px; border-radius: 8px;
  background: var(--tint); border: 1px solid var(--line); color: var(--fg-2);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- the Keys card on the Agents screen (A4, 17 Sep 2026) ---------- */
.keys-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; margin-top: 18px; }
.keys-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.keys-note { color: var(--fg-2); font-size: 13px; margin: 0 0 12px; }
.key-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(240px, 1.4fr); gap: 10px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.key-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.key-label { font-weight: 600; color: var(--fg); font-size: 14px; }
.key-why { font-size: 12px; color: var(--fg-3); }
.key-state { font-size: 12.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.key-state.saved { color: var(--accent-deep); }
.key-state.waiting { color: var(--amber); font-weight: 600; }
.key-state.failed { color: var(--red); font-weight: 600; }
.key-form { display: flex; gap: 8px; align-items: center; min-width: 0; }
.key-input { flex: 1 1 140px; min-width: 0; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); padding: 0 10px; font-size: 14px; }
.key-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,165,176,.15); }
.key-input:disabled { background: var(--surface-2); color: var(--fg-2); }
@media (max-width: 767px) {
  .key-row { grid-template-columns: 1fr; gap: 6px; }
  .key-form .btn { flex: 0 0 auto; }
}

/* ---- A8 (17 Sep 2026): ticking leads and the bar along the bottom ---- */
table.data th.pick, table.data td.pick { width: 44px; padding-left: 8px; padding-right: 0; }
table.data th.pick + th, table.data td.pick + td { width: 30%; }
.pick-box { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer; border-radius: 8px; flex: 0 0 40px; }
.pick-box:hover { background: var(--surface-2); }
.pick-box input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
table.data tr.picked td { background: var(--surface); }
table.data tr.picked td.pick { box-shadow: inset 3px 0 0 var(--accent); }
.row-card.picked { border-color: var(--accent); background: var(--accent-tint); }
.pick-group .pick-count { font-size: 13px; color: var(--accent-deep); font-weight: 600; align-self: center; }
.bulk-bar {
  position: fixed; left: 236px; right: 0; bottom: 0; z-index: 9;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 12px 24px; background: var(--ink); color: var(--cream);
  border-top: 1px solid rgba(248,243,237,.16); box-shadow: 0 -6px 20px rgba(9,9,11,.18);
}
.bulk-bar .bulk-count { font-weight: 700; font-size: 14px; white-space: nowrap; }
.bulk-bar .bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-bar .bulk-give { display: inline-flex; align-items: stretch; }
.bulk-bar .bulk-give select { border-radius: 22px 0 0 22px; border: 1px solid rgba(248,243,237,.3); background: var(--surface); color: var(--fg); padding: 0 8px 0 14px; font: inherit; font-size: 14px; }
.bulk-bar .bulk-give .btn { border-radius: 0 22px 22px 0; }
.bulk-bar .btn-secondary, .bulk-bar .btn-quiet { background: rgba(248,243,237,.10); color: var(--cream); border-color: rgba(248,243,237,.25); }
.bulk-bar .btn-secondary:hover, .bulk-bar .btn-quiet:hover { background: rgba(248,243,237,.2); color: var(--cream); }
.bulk-bar .bulk-note { flex: 1 1 200px; font-size: 13px; color: rgba(248,243,237,.85); min-width: 0; }
.bulk-bar .bulk-note:empty { display: none; }
.bulk-bar .bulk-clear { margin-left: auto; }
.content.has-bulk { padding-bottom: 140px; }
@media (max-width: 767px) {
  .bulk-bar { left: 0; bottom: var(--tabbar-h, 56px); padding: 10px 12px; gap: 8px 10px; }
  .bulk-bar .btn { min-height: 44px; }
  .bulk-bar .bulk-actions { width: 100%; }
  .bulk-bar .bulk-actions .btn, .bulk-bar .bulk-give { flex: 1 1 45%; }
  .bulk-bar .bulk-give select { flex: 1; min-width: 0; }
  .bulk-bar .bulk-give .btn { flex: 0 0 auto; }
  /* count and Clear share the first line, the buttons sit under them - the bar stays short */
  .bulk-bar .bulk-count { order: 0; }
  .bulk-bar .bulk-clear { order: 1; min-height: 40px; }
  .bulk-bar .bulk-note { order: 2; flex-basis: 100%; }
  .bulk-bar .bulk-actions { order: 3; }
  .content.has-bulk { padding-bottom: 260px; }
  /* the tick box sits beside the card's words, not on a line of its own */
  .row-card .pick-box { align-self: flex-start; margin: -6px 0 0 -8px; }
  .row-card.wide { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .row-card .pick-box + .left { flex: 1 1 calc(100% - 44px); }
}

/* ---------- Calls (A6, 17 Sep 2026): the week grid, the Next 3 calls list on Today, the phone's day list ---------- */
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.cal-bar .cal-label { font-family: var(--font-display); font-weight: 700; font-size: 16px; flex: 1 1 auto; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cal-bar .cal-today { height: 32px; padding: 0 10px; font-size: 13px; }
.cal-count { color: var(--fg-2); font-size: 13px; margin: 0 0 14px; }
.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden;
}
.cal-head { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line-strong); border-left: 1px solid var(--line); background: var(--surface-2); }
.cal-head.today { background: rgba(16,165,176,.12); }
.cal-head .cal-dow { display: block; font-size: 12px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; }
.cal-head .cal-dom { display: block; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.cal-head.today .cal-dom { color: var(--accent-deep); }
.cal-corner { border-left: 0; }
.cal-time-col { font-size: 12px; color: var(--fg-3); padding: 4px 6px 0; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cal-time-col.half { color: transparent; border-top-color: transparent; }
.cal-time-col.other { color: var(--fg-2); font-size: 12px; border-top: 1px solid var(--line-strong); padding-top: 8px; }
.cal-cell { min-height: 28px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 2px; }
.cal-cell.half { border-top-style: dashed; }
.cal-cell.today { background: rgba(16,165,176,.05); }
.cal-cell.other { border-top: 1px solid var(--line-strong); min-height: 36px; }
.cal-card { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 6px 8px; font-size: var(--text-sm); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-card.past { opacity: .55; }
.cal-card .btn-row, .next-call .btn-row { margin-top: 4px; gap: 6px; }
.cal-card .btn-row .btn, .next-call .btn-row .btn { padding: 5px 9px; font-size: 12px; }
.cal-card.past .btn-row { opacity: 1; }
.cal-card .cal-biz, .next-call .cal-biz { background: none; border: 0; padding: 0; margin: 0; text-align: left; font: inherit; font-weight: 700; color: var(--fg); cursor: pointer; overflow-wrap: anywhere; line-height: 1.25; }
.cal-card .cal-biz:hover, .next-call .cal-biz:hover { color: var(--accent-deep); text-decoration: underline; }
.cal-card .cal-who { color: var(--fg-2); font-size: 12px; overflow-wrap: anywhere; }
.cal-card .cal-time { font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.owner-badge { display: inline-block; align-self: flex-start; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.owner-badge.none { background: var(--surface-2); color: var(--fg-2); }
.cal-links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.cal-link { color: var(--accent-deep); font-weight: 600; text-decoration: none; font-size: 12px; overflow-wrap: anywhere; }
.cal-link:hover { text-decoration: underline; }
.cal-busy { background: var(--surface-2); color: var(--fg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere; min-height: 24px; }
.cal-busy.cont { border-radius: 0; padding: 0; min-height: 24px; margin-top: -2px; }
.cal-busy.spans { border-radius: 8px 8px 0 0; }
.cal-busy.past { opacity: .55; }
.cal-busy .cal-time { font-weight: 700; margin-right: 4px; }
.cal-busy.ours { border-style: dashed; }
.cal-busy .cal-unblock { display: block; margin-top: 4px; padding: 2px 6px; font-size: 11px; }
.hb-modes { display: flex; gap: 8px; margin-bottom: 12px; }
.hb-modes .btn.is-on { background: var(--ink, #111); color: #fff; border-color: var(--ink, #111); }
.cal-days { display: none; }
/* Today: the next three */
.next-calls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.next-call { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.next-call::before { content: ""; position: absolute; top: 14px; left: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.next-call { padding-left: 30px; }
.next-call .next-when { display: flex; align-items: baseline; gap: 8px; }
.next-call .next-day { font-size: 12px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.next-call .next-time { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.next-call .next-what .sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.next-call .next-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.next-call .cal-link { font-size: 13px; }
@media (max-width: 767px) {
  /* a phone gets a day list, never a seven-column grid */
  .cal-grid { display: none; }
  .cal-days { display: block; }
  .cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
  .cal-day.today { border-color: var(--accent); }
  .cal-day-head { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0 0 8px; }
  .cal-day .cal-card, .cal-day .cal-busy { margin: 0 0 8px; font-size: 14px; }
  .cal-day .cal-card .cal-who, .cal-day .cal-link { font-size: 13px; }
  .cal-day .cal-link { min-height: 40px; display: inline-flex; align-items: center; }
  .cal-none { color: var(--fg-3); font-size: 13px; }
  .cal-bar .cal-label { flex-basis: 100%; order: -1; }
  .cal-bar .btn { min-height: 44px; }
  .next-calls { grid-template-columns: 1fr; }
}

/* ---------- Messages with a client (B4 + B8, 17 Sep 2026) ---------- */
/* The thread on the client page: what they typed in their Kit (right), what we wrote back (left). */
.hq-messages-card {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px; margin: 14px 0;
}
.hq-messages-hint { font-size: 12.5px; color: var(--fg-3); }
.hq-thread-empty { font-size: 13.5px; color: var(--fg-2); padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; margin: 8px 0 14px; }
.hq-thread { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; max-height: 420px; overflow-y: auto; padding: 2px; }
.hq-msg { max-width: 82%; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.hq-msg.client { align-self: flex-end; background: rgba(16,165,176,.12); border-color: rgba(16,165,176,.25); border-bottom-right-radius: 4px; }
.hq-msg.client.fresh { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(16,165,176,.18); }
.hq-msg.gg { align-self: flex-start; border-bottom-left-radius: 4px; }
.hq-msg.gg.sending { border-style: dashed; }
.hq-msg.gg.failed { border-color: var(--red); }
.hq-msg-who { font-size: 12px; font-weight: 700; color: var(--fg-2); margin-bottom: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hq-msg-when { font-weight: 400; color: var(--fg-3); }
.hq-msg-subject { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.hq-msg-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink, var(--fg)); }
.hq-msg-foot { margin-top: 6px; }
.pill.unread { background: rgba(180,35,24,.12); color: var(--red); margin-left: 6px; }
.pill.email { white-space: normal; line-height: 1.35; padding: 3px 10px; }
.pill.email.held, .pill.email.waiting { background: rgba(233,180,76,.22); color: var(--amber); }
.pill.email.sent { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.pill.email.dropped { background: var(--surface-2); color: var(--fg-3); }
.pill.email.error { background: rgba(180,35,24,.12); color: var(--red); }
.hq-reply { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.hq-reply-subject, .hq-reply-text {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; font-size: 14.5px;
  color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
}
.hq-reply-text { min-height: 96px; resize: vertical; }
.hq-reply-subject:focus, .hq-reply-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hq-reply-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hq-reply-email { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.hq-reply-email input { width: 18px; height: 18px; accent-color: var(--accent-deep); }
.hq-reply-emailnote { font-size: 12.5px; font-weight: 400; color: var(--fg-3); }
.hq-reply-note { font-size: 13px; color: var(--accent-deep); font-weight: 600; }
.hq-reply-note.failed { color: var(--red); }
.wrote-strip { display: flex; align-items: center; gap: 12px; }
.wrote-strip .strip-go { flex-shrink: 0; }
@media (max-width: 767px) {
  .hq-msg { max-width: 92%; }
  .hq-reply-row .btn { width: 100%; min-height: 44px; }
  .wrote-strip { flex-wrap: wrap; }
}

/* ---------- The Messages screen (p14, 20 Sep 2026): Team, one DM per founder, one per client ---------- */
.hq-messages-wrap { display: flex; gap: 18px; align-items: flex-start; margin-top: 8px; }
.hq-messages-list { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--surface); }
.hq-thread-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: inherit; }
.hq-thread-item:hover { background: var(--surface-2); }
.hq-thread-item.active { background: rgba(16,165,176,.12); }
.hq-thread-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hq-thread-item-name { font-size: 14px; font-weight: 700; }
.hq-thread-item-sub { font-size: 12.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-messages-thread { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.hq-messages-thread-title { font-size: 16px; margin: 2px 0 10px; }
.hq-messages-back { display: none; font-size: 13px; font-weight: 600; color: var(--accent-deep); text-decoration: none; margin-bottom: 8px; }
.hq-msg.mine { align-self: flex-end; background: rgba(16,165,176,.12); border-color: rgba(16,165,176,.25); border-bottom-right-radius: 4px; }
.hq-msg.mine.fresh { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(16,165,176,.18); }
.hq-msg.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
@media (max-width: 767px) {
  .hq-messages-wrap { flex-direction: column; }
  .hq-messages-list { width: 100%; }
  .hq-messages-wrap.has-thread .hq-messages-list { display: none; }
  .hq-messages-wrap:not(.has-thread) .hq-messages-thread { display: none; }
  .hq-messages-back { display: inline-block; }
}

/* ---------- The Brand Room (17 Sep 2026): the Brand tab on a client's page ---------- */
.brand-hint { margin-bottom: 12px; }
.brand-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 16px; margin-bottom: 12px;
}
.brand-strip-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; flex: 1 1 320px; }
.brand-strip-words { font-size: 13px; color: var(--fg-2); }
/* 17 Sep 2026: the runner's step table under a failed build (brand_rooms.steps) */
.brand-steps { margin: 0 0 14px; font-size: 13px; }
.brand-steps td, .brand-steps th { vertical-align: top; }
.brand-steps td:last-child { max-width: 520px; overflow-wrap: anywhere; }
.brand-strip-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-save { flex-basis: 100%; }
.brand-strip .hq-reply-note { flex-basis: 100%; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; margin-bottom: 12px; }
.brand-card { margin-bottom: 12px; min-width: 0; }
.brand-grid .brand-card { margin-bottom: 0; }
.brand-card-head { margin-bottom: 10px; align-items: flex-start; }
.brand-card-head .lc-h3 { margin: 0; }
.brand-card-head .hq-messages-hint { flex: 1 1 200px; }
.brand-logo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.brand-logo-box {
  position: relative; border: 1px solid var(--line); border-radius: 10px; min-height: 110px; padding: 18px 14px 26px;
  display: grid; place-items: center;
}
.brand-logo-box img { max-width: 100%; max-height: 80px; object-fit: contain; }
.brand-logo-tag { position: absolute; left: 10px; bottom: 6px; font-size: 12px; color: var(--fg-3); }
.brand-pic-missing { font-size: 12.5px; color: var(--fg-3); padding: 10px; text-align: center; }
.brand-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.brand-role { display: flex; align-items: flex-end; gap: 10px; }
.brand-role .lc-field { flex: 1; }
.brand-swatch { display: inline-block; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); flex-shrink: 0; vertical-align: middle; }
.brand-swatch.small { width: 20px; height: 20px; border-radius: var(--radius-sm); }
.brand-hex-row { display: flex; gap: 6px; align-items: center; }
.brand-hex-row .lc-field input.brand-hex, .lc-field .brand-hex-row input.brand-hex { flex: 1 1 auto; width: auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.brand-hex-row .brand-hex.bad { border-color: var(--red); outline: 2px solid rgba(180,35,24,.25); }
.lc-field .brand-hex-row input.brand-picker { width: 44px; flex: 0 0 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.brand-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-pal {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px 4px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); font-size: 12.5px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brand-pal:hover { border-color: var(--accent-deep); color: var(--ink); }
.brand-font-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 12px; background: var(--bg); }
.brand-font-h { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.brand-font-b { font-size: 14px; color: var(--fg-2); margin-top: 6px; }
.brand-weak { list-style: none; margin: 0; padding: 0; }
.brand-weak-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.brand-weak-row:first-child { border-top: 0; }
.brand-weak-row.off .brand-weak-body { opacity: .5; text-decoration: line-through; }
.brand-weak-tick { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; cursor: pointer; }
.brand-weak-tick input { width: 20px; height: 20px; accent-color: var(--accent-deep); cursor: pointer; }
.brand-weak-body { flex: 1; min-width: 0; }
.brand-weak-line { font-weight: 600; font-size: 14px; color: var(--ink); }
.brand-weak-why, .brand-weak-fix { font-size: 13px; color: var(--fg-2); margin-top: 2px; }
.brand-weak-fix { color: var(--accent-deep); }
.brand-weak-off { font-size: 12px; font-weight: 500; color: var(--fg-3); text-decoration: none; display: inline-block; }
.brand-weak-add { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.brand-shots { display: flex; gap: 10px; margin-top: 12px; align-items: flex-start; }
.brand-pic { display: inline-block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); line-height: 0; }
.brand-pic img { display: block; max-width: 100%; height: auto; }
.brand-pic.shot img { width: auto; max-height: 150px; }
.brand-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.brand-fact { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.brand-fact .label { font-size: 12px; color: var(--fg-2); }
.brand-fact .value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.brand-fact .note { font-size: 12.5px; color: var(--fg-3); }
.brand-winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.brand-winner { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.brand-winner-pic { display: block; background: var(--surface-2); aspect-ratio: 1 / 1; line-height: 0; }
.brand-winner-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-winner-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand-winner-who { font-weight: 700; font-size: 14px; color: var(--ink); }
.brand-winner-days { font-size: 12.5px; font-weight: 600; color: var(--accent-deep); }
.brand-winner-text { font-size: 13px; color: var(--fg-2); }
.brand-winner-why { font-size: 12.5px; color: var(--fg-3); }
.brand-winner-body .btn { align-self: flex-start; margin-top: 4px; min-height: 40px; }
.brand-renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.brand-renders.emails { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.brand-render { margin: 0; min-width: 0; }
.brand-render .brand-pic { display: block; aspect-ratio: var(--ar, 1 / 1); }
.brand-render .brand-pic img { width: 100%; height: 100%; object-fit: contain; }
.brand-render figcaption { font-size: 12.5px; color: var(--fg-2); margin-top: 6px; }
.brand-frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 12px; }
.brand-frame iframe { width: 100%; height: 420px; border: 0; display: block; }
.brand-mini {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 3px 8px 3px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--fg-2); font-size: 12px; min-height: 26px; vertical-align: middle;
}
.brand-mini:hover { border-color: var(--accent-deep); color: var(--ink); }
.brand-mini img { height: 16px; width: auto; max-width: 48px; object-fit: contain; }
.brand-mini-label { font-weight: 600; margin: 0 2px; }
.brand-mini-swatch { display: inline-block; width: 12px; height: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
@media (max-width: 767px) {
  .brand-grid { grid-template-columns: 1fr; }
  .brand-logo-row { grid-template-columns: 1fr; }
  .brand-strip-btns { width: 100%; }
  .brand-strip-btns .btn { flex: 1 1 auto; min-height: 44px; }
  .brand-frame iframe { height: 320px; }
  .brand-shots { flex-wrap: wrap; }
}
.brand-card .lc-small { min-height: 40px; }

/* Brand tab - the client's Google ads list (18 Sep 2026) */
.brand-google-ads { margin-top: 12px; }
.brand-google-ads .lc-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-2, #3a3a3a); }
.brand-google-ads .lc-list a { color: var(--teal, #10A5B0); font-weight: 600; }

/* 19 Sep 2026: the Came-from picker on every lead */
.src-pick{display:inline-flex;align-items:center;gap:6px;font-size:.85rem;color:var(--muted)}
.src-pick select{font:inherit;padding:2px 6px;border:1px solid var(--line);border-radius:6px;background:var(--card);color:var(--ink)}
.src-set{font-size:.8rem;color:var(--muted)}
.src-note{margin-left:8px;font-size:.8rem;color:var(--muted)}.src-note.bad{color:#8A1F1F}
.hq-accounts-hint { color: var(--fg-2); font-size: 12px; }

/* 19 Sep 2026: asking without a browser box - the two-tap Yes and the small inline form.
   (prompt/confirm froze the page and could not be read on a phone.) */
.btn.armed { background: var(--red, #B42318); border-color: var(--red, #B42318); color: #fff; }
.btn.armed-no { margin-left: 4px; }
.inline-form { display: block; }
tr.inline-form > td { background: var(--surface-2); padding: 12px 14px; }
.inline-form-body, .inline-form:not(tr) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form:not(tr) { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 6px 0 10px; }
.inline-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg-2); min-width: 220px; flex: 1 1 220px; }
.inline-field input {
  font: inherit; padding: 9px 10px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card, #fff); color: var(--ink, inherit);
}
.inline-form-btns { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-form-note { color: var(--red, #B42318); }

/* 19 Sep 2026: the same-email/same-phone pill on a lead */
.pill.dup { background: rgba(233,180,76,.22); color: var(--amber); white-space: normal; }

/* 19 Sep 2026: History - the `changes` ledger read back on a client, under a lead, and on Jobs */
.hq-history { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; line-height: 1.5; }
.hq-history li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.hq-history li:first-child { border-top: 0; }
.hq-history-who { font-weight: 600; color: var(--fg); }
.hq-history-when { color: var(--fg-3); }
.hq-history-what { color: var(--fg-2); flex: 1 1 260px; min-width: 0; }
.lead-history { margin-top: 8px; font-size: 13px; }
.lead-history summary { cursor: pointer; color: var(--fg-2); }
/* 21 Sep 2026: the clients' put-away enquiries, a card that stays folded shut (client page + foot of Leads). */
.put-away-fold { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 16px; margin: 0 0 12px; }
.put-away-fold summary { font-weight: 600; color: var(--fg); }
.put-away-fold .lc-note { margin: 8px 0 4px; }
.put-away-fold .hq-history li { align-items: center; }
.put-away-fold .hq-history .btn { margin-left: auto; }
@media (max-width: 720px) {
  .inline-field { min-width: 100%; flex: 1 1 100%; }
  .inline-form-btns .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ------------------------------------------------------------------
   19 Sep 2026 (wave 1b): the pieces the calls, the lead page, Remove
   and "Run it now" put on screen.
   ------------------------------------------------------------------ */

/* The picker inside an inline form reads as the same box as the text fields beside it. */
.inline-field select {
  font: inherit; padding: 9px 10px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card, #fff); color: var(--ink, inherit);
}

/* Remove: quiet, never the first thing the eye lands on. It hides a row, it does not delete one. */
.btn.btn-remove { color: var(--fg-3); }
.btn.btn-remove:hover { color: var(--red, #B42318); border-color: var(--red, #B42318); }

/* The 30-second Undo strip above every screen. */
.undo-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin: 0 0 16px; font-size: 14px; color: var(--fg-2);
}
.undo-strip .btn { min-height: 36px; }

/* A lead row's name is a link to that lead's own page, with Remove beside it. */
.row-title-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.row-title-link { font-weight: 600; color: var(--ink, inherit); text-decoration: none; }
.row-title-link:hover { color: var(--teal, #10A5B0); text-decoration: underline; }

/* Move / Cancel / Didn't show, on the call itself. */
.call-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* One lead's own page: every field, in two columns on a desk and one on a phone. */
.lead-page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.lead-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 18px; }
.lead-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lead-field-label { font-size: 12px; color: var(--fg-3); text-transform: none; }
.lead-field-value { font-size: 14px; color: var(--ink, inherit); word-break: break-word; }
.lead-notes {
  white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.6; color: var(--fg-2);
  background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; max-height: 320px; overflow: auto;
}
#lead-note-form textarea {
  font: inherit; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card, #fff); color: var(--ink, inherit); margin-bottom: 8px;
}

/* What the last "Run it now" said, under its own row. */
.run-note { font-size: 12px; color: var(--fg-2); margin-top: 4px; max-width: 320px; }

@media (max-width: 720px) {
  .lead-fields { grid-template-columns: 1fr; }
  .undo-strip .btn { flex: 1 1 auto; min-height: 44px; }
  .call-row .btn { min-height: 44px; }
}

/* ---------------- p11 (18 Sep 2026): said out loud, said when the line is gone ---------------- */
/* The live region carries every note beside a button for a screen reader. It must stay in the page
   (display:none is not read out), so it is clipped to nothing instead of hidden. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Across the top of everything, above the sidebar, because a tap anywhere is about to do nothing. */
.offline-strip {
  position: fixed; inset: 0 0 auto 0; z-index: 4000;
  background: var(--red, #B3261E); color: #fff;
  font-weight: 600; font-size: 14px; text-align: center; padding: 8px 16px;
}
.offline-strip[hidden] { display: none; }
/* A whole email does not fit on one line: the words box in an inline form takes the full width. */
.inline-field-tall { flex: 1 1 100%; align-items: stretch; }
.inline-field-tall textarea {
  width: 100%; min-height: 160px; font: inherit; font-size: 15px; line-height: 1.45;
  padding: 10px 12px; border: 1px solid var(--line, #E2DDD3); border-radius: 8px;
  background: #fff; color: inherit; resize: vertical;
}
/* Forget this person: it cannot be undone, so it never looks like an ordinary button. */
.btn-forget { color: var(--red, #B3261E); }
.btn-forget:hover { background: rgba(179, 38, 30, 0.08); }

/* ---------------- Ideas 15-20 (20 Sep 2026): board, chase-on, tags, timeline, health strip, documents */

/* idea 15: the Leads board. Five columns, native drag-and-drop, no library. */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col {
  flex: 1 0 220px; min-width: 220px; background: var(--surface-2); border-radius: 10px; padding: 10px;
}
.board-col h3 { font-size: 13px; margin: 0 0 8px; color: var(--fg-2); display: flex; justify-content: space-between; }
.board-col h3 .n { color: var(--fg-3); font-weight: 400; }
.board-card {
  background: var(--card, #fff); border: 1px solid var(--line, #E2DDD3); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; cursor: grab; font-size: 13px;
}
.board-card:active { cursor: grabbing; opacity: 0.7; }
.board-empty { font-size: 12px; color: var(--fg-3); margin: 0; }
.view-toggle { margin-left: auto; }

/* idea 16: "Chase on" - one date box, red when it is overdue. */
.chase-date { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line, #E2DDD3); border-radius: var(--radius-sm); background: var(--card, #fff); color: inherit; }
.chase-date.overdue { border-color: var(--red, #B3261E); color: var(--red, #B3261E); }
.chase-label { font-size: 12px; color: var(--fg-3); margin-right: 4px; }
.overdue-pill { background: rgba(179, 38, 30, 0.12); color: var(--red, #B3261E); }
.client-chase-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* idea 18: tag chips - type to add, x to remove. */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; }
.tag-x { border: 0; background: none; cursor: pointer; color: var(--fg-3); font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.tag-x:hover { color: var(--red, #B3261E); }
.tag-add-input {
  font: inherit; font-size: 12px; border: 1px dashed var(--line, #E2DDD3); border-radius: 12px;
  padding: 3px 10px; background: none; color: var(--fg-2); width: 84px;
}
.saved-filters { margin-top: 4px; }

/* idea 19: the client health strip - red only where something is actually late. */
.client-health td.cell-bad { color: var(--red, #B3261E); font-weight: 600; }

@media (max-width: 720px) {
  .board { flex-direction: column; }
  .board-col { min-width: 0; }
}

/* ---------------- Settings (idea 21, 20 Sep 2026) ---------------- */
.settings-hours-line { font-size: 14px; color: var(--fg-2); margin-bottom: 4px; }
.settings-field-row { display: block; margin-bottom: 10px; }
.settings-bell-toggle { display: inline-flex; }

/* ---------------- Command palette, Cmd/Ctrl-K (idea 22, 20 Sep 2026) ---------------- */
.cmdk-modal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 11, 13, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk-box { background: var(--surface); border-radius: var(--radius); width: min(560px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.cmdk-input { border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 16px; background: var(--surface); color: var(--fg); outline: none; }
.cmdk-rows { overflow-y: auto; padding: 6px; }
.cmdk-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cmdk-row.active, .cmdk-row:hover { background: var(--surface-2); }
.cmdk-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg-3); min-width: 52px; }
.cmdk-label { flex: 1 1 auto; color: var(--fg); }
.cmdk-sub { font-size: 12px; color: var(--fg-2); }
.cmdk-empty { padding: 14px 10px; color: var(--fg-2); font-size: 14px; }
@media (max-width: 600px) { .cmdk-modal { padding: 8vh 8px 8px; } }

/* ---------------- One toast, bottom-centre (idea 23, 20 Sep 2026) ---------------- */
.hq-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 12px; background: var(--ink, #09090B); color: #fff;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: calc(100vw - 32px);
}
.hq-toast .btn { min-height: 30px; color: #fff; border-color: rgba(255,255,255,.35); }
.hq-toast .btn:hover { background: rgba(255,255,255,.12); }
.hq-toast-x { background: none; border: 0; color: #fff; opacity: .7; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.hq-toast-x:hover { opacity: 1; }
@media (max-width: 600px) { .hq-toast { left: 12px; right: 12px; bottom: calc(var(--tabbar-h, 0px) + 12px); transform: none; max-width: none; } }

/* Book a call by hand (21 Sep 2026): a free half-hour is a tap target */
.cal-cell.free { cursor: pointer; }
.cal-cell.free:hover { background: var(--emerald-soft, #e6f4f2); box-shadow: inset 0 0 0 1px var(--emerald, #10A5B0); }
.cal-cell.free:hover::after { content: "+"; color: var(--emerald, #10A5B0); font-weight: 600; font-size: 14px; line-height: 1; display: block; text-align: center; }

.cal-founders { margin: 6px 0 10px; font-size: 13px; color: var(--muted, #555); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-founder { padding: 2px 8px; border-radius: 6px; background: var(--card-2, #f2f2ee); color: var(--ink, #111); }
.cal-founder.on { background: var(--emerald-soft, #e6f4f2); }
.cal-founder.off { background: #fbecec; }

.pill.moved { background: #fff3d6; color: #6b4a00; }

.board-card .btn-row { margin-top: 6px; gap: 4px; flex-wrap: wrap; }
.board-card .btn { padding: 4px 8px; font-size: 12px; }

.done-jobs { margin: 8px 0 16px; }
.done-jobs summary { cursor: pointer; color: var(--muted, #555); font-size: 13px; padding: 6px 0; }

.add-owed { margin: 10px 0 18px; }
.add-owed summary { display: inline-block; list-style: none; cursor: pointer; }
.add-owed summary::-webkit-details-marker { display: none; }
.add-owed .add-form { margin-top: 10px; }
.row-actions .btn-row { flex-wrap: wrap; gap: 4px; }

.lead-notes-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.lead-notes-list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 10px; background: var(--card-2, #f6f6f2); border-radius: 8px; font-size: 14px; }
.lead-notes-list li.editing { flex-direction: column; }
.lead-notes-list .note-text { white-space: pre-wrap; }
.lead-notes-list .note-btns { display: flex; gap: 4px; flex: 0 0 auto; }
.lead-notes-list .note-btns .btn { padding: 4px 8px; font-size: 12px; }
.note-edit-box { width: 100%; }
.lead-notes-empty { color: var(--muted, #666); font-size: 14px; }

.cal-card.compact { cursor: pointer; padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
.cal-card.compact .cal-biz { font-weight: 600; }
.cal-card.compact .cal-who { color: var(--muted, #666); }
.cal-card.compact:hover { box-shadow: inset 0 0 0 1px var(--emerald, #10A5B0); }
.cal-card { position: relative; }
.cal-card-close { position: absolute; top: 4px; right: 4px; padding: 2px 8px; }

/* ---------- Calendar p21 (21 Sep 2026): go-to date, month view, block edit ---------- */
.cal-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #5c6660); }
.cal-jump input { font: inherit; padding: 6px 8px; border: 1px solid var(--line, #d9ded9); border-radius: 8px; background: #fff; color: inherit; }
.cal-month { margin-top: 12px; }
.cal-month-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-month-dow { font-size: 12px; color: var(--muted, #5c6660); padding: 4px 6px; }
.cal-month-cell { min-height: 84px; background: #fff; border: 1px solid var(--line, #d9ded9); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font-size: 12px; }
.cal-month-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-month-cell.today { border-color: var(--accent, #10a5b0); }
.cal-month-cell.has:hover { background: var(--cream, #f7f6f1); }
.cal-month-dom { font-weight: 600; font-size: 13px; }
.cal-month-n { color: var(--accent, #10a5b0); font-weight: 600; }
.cal-month-o { color: var(--muted, #5c6660); }
.cal-month-name { color: var(--muted, #5c6660); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-busy .cal-block-edit { margin-left: 4px; }
@media (max-width: 700px) { .cal-month-cell { min-height: 56px; } .cal-month-name { display: none; } }
