/* Leadline shared components. Every number comes from tokens.css; the rules are in
   docs/DESIGN-TOKENS.md. No raw font sizes, font families or hex colours
   outside tokens.css where a token exists. No border colours, light shadows only. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-base);
  font-weight: var(--weight-regular);
  font-optical-sizing: auto;
  font-synthesis: none;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* The signed-in app is dense: 14/20 is the base. Marketing and sign-in keep 16/24. */
.app-body { font-size: var(--text-sm); line-height: var(--line-sm); }

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: var(--weight-strong);
  margin: 0;
  color: var(--teal);
  text-wrap: balance;
}
h1 { font-size: var(--text-xl); line-height: var(--line-xl); }
h2 { font-size: var(--text-lg); line-height: var(--line-lg); }
h3 { font-size: var(--text-base); line-height: var(--line-base); }
h4 { font-size: var(--text-sm); line-height: var(--line-sm); }

p { margin: 0 0 1em; }
a { color: var(--teal-soft); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--coral); }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--coral-soft); color: var(--teal); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control); padding: 0 20px; border-radius: var(--radius-sm);
  background: var(--cream-2); color: var(--teal);
  font-weight: var(--weight-strong); font-size: var(--text-sm); text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  border: 0;
  white-space: nowrap; line-height: var(--line-sm);
}
.btn:hover { background: var(--cream-3); color: var(--teal); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: var(--shadow-coral); }
.btn-primary:hover { background: var(--coral-dark); color: #fff; }
.btn-dark { background: var(--teal); color: #fff; }
.btn-dark:hover { background: var(--teal-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal); }
.btn-ghost:hover { background: rgba(14, 39, 50, 0.06); }
.btn-sm { height: var(--control-md); padding: 0 12px; font-size: var(--text-sm); border-radius: var(--radius-sm); line-height: var(--line-sm); }
.btn-lg { height: 52px; padding: 0 24px; font-size: var(--text-base); border-radius: var(--radius-sm); line-height: var(--line-base); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
/* In the signed-in app every control is one step tighter: 36 default, 32 small. */
.app-body .btn { height: var(--control-md); padding: 0 12px; }
.app-body .btn-sm { height: var(--control-sm); padding: 0 12px; }
.app-body .btn-lg { height: var(--control); }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-title { width: 19px; height: 19px; color: var(--ink); vertical-align: -3px; margin-right: 9px; }

/* Inputs: shadow, never a coloured border. */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label {
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); line-height: var(--line-sm);
}
.input, .textarea, .select {
  width: 100%; min-height: var(--control); padding: 10px 14px;
  background: var(--paper); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-field);
  color: var(--ink); font-size: var(--text-base); line-height: var(--line-base);
  transition: box-shadow 0.16s ease;
  border: 0;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--teal), 0 0 0 3px rgba(14, 39, 50, 0.08);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d6a6b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px;
}
/* In the signed-in app, fields match the buttons: 36 high, 14/20. Phones keep 16 so the browser does not zoom in. */
.app-body .input, .app-body .select { min-height: var(--control-md); padding: 7px 12px; font-size: var(--text-sm); line-height: var(--line-sm); }
.app-body .textarea { padding: 8px 12px; font-size: var(--text-sm); line-height: var(--line-sm); }
.app-body .select { padding-right: 36px; background-position: right 12px center; }
.select-auto { width: auto; }
@media (pointer: coarse) {
  .app-body .input, .app-body .select, .app-body .textarea { min-height: var(--control); font-size: var(--text-base); line-height: var(--line-base); }
}
.hint { font-size: var(--text-xs); color: var(--muted); margin: 0; line-height: var(--line-xs); }
.error-text { font-size: var(--text-sm); color: var(--bad); margin: 8px 0 0; line-height: var(--line-sm); }

.check {
  display: flex; align-items: flex-start; gap: 10px; font-size: var(--text-sm); color: var(--ink);
  cursor: pointer; padding: 8px 0; line-height: var(--line-sm);
}
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--coral); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: var(--line-xs); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-verified { background: var(--good-bg); color: var(--good); }
.badge-risky { background: var(--warn-bg); color: var(--warn); }
.badge-guessed { background: var(--cool-bg); color: var(--cool); }
.badge-invalid { background: var(--bad-bg); color: var(--bad); }
.badge-new { background: var(--cool-bg); color: var(--cool); }
.badge-contacted { background: var(--warn-bg); color: var(--warn); }
.badge-replied { background: var(--good-bg); color: var(--good); }
.badge-meeting { background: var(--coral-soft); color: var(--bad); }
.badge-won { background: var(--teal); color: #fff; }
.badge-lost { background: #ececec; color: #5c6262; }
.badge-muted { background: rgba(14, 39, 50, 0.06); color: var(--muted); }
.badge-coral { background: var(--coral-soft); color: var(--bad); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream-2); color: var(--teal);
  padding: 6px 12px; border-radius: 999px; font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--line-sm);
}
.chip button {
  background: none; border: 0; padding: 0; color: var(--muted); line-height: 1;
  display: inline-flex; align-items: center;
}
.chip button:hover { color: var(--bad); }

.score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: var(--weight-strong); line-height: var(--line-sm); font-variant-numeric: tabular-nums;
}
.score-high { background: var(--teal); color: #fff; }
.score-mid { background: var(--warn-bg); color: var(--warn); }
.score-low { background: var(--cool-bg); color: var(--cool); }

/* Panels */
.panel {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px;
}
.panel-tight { padding: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { font-size: var(--text-lg); line-height: var(--line-lg); }
.panel-head p { color: var(--muted); font-size: var(--text-sm); margin: 4px 0 0; line-height: var(--line-sm); }
.tint { background: var(--cream); border-radius: var(--radius-sm); padding: 16px; }

/* Tables: alternating tints, no rules. Sentence-case headers, tabular numbers, one line of text per cell where the data allows. */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left; font-size: var(--text-xs); line-height: var(--line-xs); font-weight: var(--weight-strong);
  color: var(--muted); padding: 0 12px; height: var(--grid-head); white-space: nowrap;
}
.table td { padding: 8px 12px; vertical-align: middle; }
.table tbody tr { background: var(--paper); }
.table:not(.table-dense) tbody tr:nth-child(even) { background: var(--row-alt); }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr.is-selected { background: var(--row-selected); }
.table .cell-name { font-weight: var(--weight-medium); color: var(--teal); }
.cell-sub { display: block; font-size: var(--text-xs); line-height: var(--line-xs); color: var(--muted); font-weight: var(--weight-regular); }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .company-cell { min-width: 150px; }
.table a { color: inherit; text-decoration: none; }
.table a:hover { color: var(--coral); }
.table .num { text-align: right; }
.table .dim { color: var(--muted); }

/* Sortable headers: the whole cell is the button. The arrow shows on the sorted column and on hover. */
.table th.th-sort { padding: 0; }
.th-sort button {
  display: flex; align-items: center; gap: 4px; width: 100%; height: var(--grid-head); padding: 0 12px;
  background: none; border: 0; border-radius: 4px;
  font: inherit; font-size: var(--text-xs); line-height: var(--line-xs); font-weight: var(--weight-strong);
  color: var(--muted); text-align: left;
}
.th-sort.num button { justify-content: flex-end; }
.th-sort button:hover { color: var(--teal); }
.th-sort[aria-sort="ascending"] button,
.th-sort[aria-sort="descending"] button { color: var(--teal); }
.sort-arrow { font-size: var(--text-xs); line-height: 1; opacity: 0; width: 10px; text-align: center; }
.th-sort button:hover .sort-arrow { opacity: 0.5; }
.th-sort[aria-sort="ascending"] .sort-arrow,
.th-sort[aria-sort="descending"] .sort-arrow { opacity: 1; color: var(--coral-dark); }

/* The grid: the Companies table. Fixed layout, one-line rows, sticky header, its own scroll area,
   and only the rows on screen exist in the page (public/assets/grid.a5e43384fc.js). */
.panel-grid { padding: 16px 0 0; overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 172px); min-height: 360px; }
.panel-grid .panel-head { padding: 0 16px; margin-bottom: 12px; }
.panel-grid .panel-head p { margin-top: 0; }
.panel-grid .toolbar { padding: 0 16px 12px; }
.panel-foot { padding: 8px 16px; }
/* contain: rows written while scrolling never make the browser lay out the rest of the page.
   overflow-anchor: the windowed grid keeps the height above the screen exact itself, so the
   browser's scroll anchoring has nothing to fix and only costs a layout pass per update. */
.grid-scroll { overflow: auto; overscroll-behavior: contain; flex: 1 1 0; min-height: 0; contain: content; scrollbar-gutter: auto; overflow-anchor: none; }
/* Scroll the grid on its own GPU layer. A DevTools trace of two flicks on Companies at 4x slower
   CPU (2026-11-11) put layerize at 572 ms and paint at 625 ms without it, 97 and 452 ms with it
   (pipeleo#12). The opaque background keeps text sharp on that layer. */
.grid-scroll { will-change: scroll-position; background: var(--paper); }
/* A table waiting for its next rows dims after a beat, so a fast answer never flickers. */
.table[aria-busy="true"] tbody { opacity: 0.6; transition: opacity var(--motion-panel) ease 120ms; }
.table-dense { table-layout: fixed; min-width: 900px; }
.table-dense th { position: sticky; top: 0; z-index: 2; background: var(--paper); }
.table-dense td {
  height: var(--grid-row); padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: var(--text-sm); line-height: var(--line-sm);
}
.table-dense tbody tr { cursor: pointer; }
.table-dense tbody tr.r1 { background: var(--row-alt); }
.table-dense tbody tr:hover { background: var(--row-hover); }
.table-dense tbody tr.is-selected { background: var(--row-selected); }
.table-dense tbody tr.spacer { cursor: default; background: var(--paper); }
.table-dense tbody tr.spacer td { height: auto; padding: 0; }
.table-dense .cell-check { padding: 0; text-align: center; cursor: pointer; }
.table-dense td.num { padding-right: 16px; }
.table-dense th.num, .table-dense th.th-sort.num button { padding-right: 16px; }
.table-dense .cell-link { padding: 0; }
.table-dense .cell-link a {
  display: flex; align-items: center; justify-content: center; height: var(--grid-row); color: var(--muted);
}
.table-dense .cell-link a:hover { color: var(--coral-dark); }
.co-name { font-weight: var(--weight-medium); color: var(--teal); }
.co-domain { margin-left: 8px; font-size: var(--text-xs); color: var(--muted); }
.table .co-domain:hover { color: var(--coral-dark); text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 4px; }
.status-ok { color: var(--good); font-weight: var(--weight-medium); }
.status .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.fit-cell { display: inline-flex; align-items: center; gap: 8px; }
.fit-n { font-weight: var(--weight-strong); min-width: 16px; text-align: right; }

.cell-flex { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.table-dense .cell-link { text-align: center; }
.table a.badge-verified { color: var(--good); }
.table a.badge-muted { color: var(--muted); }
.table a.badge:hover { text-decoration: underline; }
.table-leads .col-hq { display: none; }
@media (min-width: 1561px) {
  .table-leads th.col-hq, .table-leads td.col-hq { display: table-cell; }
  .table-leads col.col-hq { display: table-column; }
}

/* Initials in a circle. Sized by the place that uses it. */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); line-height: var(--line-xs); font-weight: var(--weight-strong); color: var(--teal); background: var(--cream-2);
}
.avatar.coral { background: var(--coral-soft); color: var(--bad); }
.avatar.teal { background: #dbe8e6; color: var(--teal-soft); }
.table-dense .avatar { width: 24px; height: 24px; margin-right: 8px; vertical-align: middle; }

/* Floating action bar for a selection. It floats over the page, so choosing a row never pushes the table down. */
.bulkbar {
  position: fixed; z-index: 35; bottom: 24px; left: calc(50% + var(--app-sidebar) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; max-width: calc(100vw - 32px);
  background: var(--teal); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.bulkbar[hidden] { display: none; }
.bulkbar strong { font-weight: var(--weight-strong); margin-right: 8px; white-space: nowrap; }
.bulkbar .btn { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.bulkbar .btn-primary { background: var(--coral); }
.bulkbar .btn-primary:hover { background: var(--coral-dark); }
.bulkbar .select { width: auto; min-height: var(--control-sm); background-color: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; padding: 4px 32px 4px 12px; }
.bulkbar .select option { color: var(--ink); }
.bulkbar.has-foot { bottom: 80px; } /* sits above the paging row, so Previous and Next stay reachable */
@media (max-width: 900px) {
  .bulkbar { left: 50%; bottom: 16px; flex-wrap: wrap; }
  .bulkbar.has-foot { bottom: 80px; }
  .table-dense { min-width: 640px; }
  .table-dense .col-industry, .table-dense .col-hq { display: none; }
  .table-dense col.col-industry, .table-dense col.col-hq { display: none; }
  .table-dense col.col-company { width: 216px; }
  .panel-grid { height: 80vh; }
  .panel.panel-grid { padding: 16px 0 0; }
  .panel-grid .panel-head { flex-wrap: wrap; }
  .panel-grid .panel-head .row { flex-wrap: wrap; }
}

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty h3 { font-size: var(--text-lg); margin-bottom: 8px; line-height: var(--line-lg); }
.empty p { max-width: 420px; margin: 0 auto 18px; font-size: var(--text-sm); line-height: var(--line-sm); }
.empty-art, .empty .empty-art { display: block; width: var(--empty-art); height: var(--empty-art); margin: 0 auto var(--space-4); color: var(--cream-3); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); line-height: var(--line-sm); }
.meta { font-size: var(--text-xs); color: var(--muted-2); line-height: var(--line-xs); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* App shell */
.app-body { background: var(--cream); min-height: 100vh; }
.app-shell { display: grid; grid-template-columns: var(--app-sidebar) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--cream-2); padding: 20px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--teal); position: relative; flex: none; }
.brand-mark::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 10px;
  background: var(--coral); border-radius: 2px 2px 0 0;
}
.brand-mark::before {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 3px;
  background: #fff; border-radius: 2px;
}
.brand-name { font-size: var(--text-lg); font-weight: var(--weight-strong); color: var(--teal); line-height: var(--line-lg); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: var(--text-xs); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--muted-2); padding: 16px 12px 6px; line-height: var(--line-xs);
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 0 12px;
  height: 40px; border-radius: 8px; color: var(--teal); text-decoration: none;
  font-size: var(--text-sm); font-weight: var(--weight-medium); transition: background 0.15s ease; line-height: var(--line-sm);
}
.nav-item:hover { background: rgba(14, 39, 50, 0.06); color: var(--teal); }
.nav-item.is-active { background: var(--paper); color: var(--teal); font-weight: var(--weight-strong); box-shadow: var(--shadow-xs); }
.nav-item .icon { color: var(--muted); }
.nav-item.is-active .icon { color: var(--ink); }
.nav-item .count {
  margin-left: auto; font-size: var(--text-xs); font-weight: var(--weight-strong); background: var(--cream-3);
  color: var(--muted); border-radius: 999px; padding: 1px 8px; line-height: var(--line-xs);
}
.nav-item.is-active .count { background: var(--coral-soft); color: var(--bad); }

.sidebar-foot { margin-top: auto; padding-top: 20px; }
.plan-card { background: var(--paper); border-radius: 10px; padding: 14px; box-shadow: var(--shadow-xs); }
.plan-card .plan-name { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--teal); line-height: var(--line-xs); }
.plan-card .plan-usage { font-size: var(--text-xs); color: var(--muted); margin: 4px 0 8px; line-height: var(--line-xs); }
.plan-bar { height: 6px; border-radius: 999px; background: var(--cream-3); overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: var(--coral); border-radius: 999px; }
.plan-card a { display: inline-block; margin-top: 10px; font-size: var(--text-xs); font-weight: var(--weight-strong); text-decoration: none; line-height: var(--line-xs); }

.main { min-width: 0; padding: 0 0 48px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; background: var(--cream);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar h1 { font-size: var(--text-xl); line-height: var(--line-xl); }
.topbar .sub { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; line-height: var(--line-xs); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.searchbox { position: relative; width: 250px; }
.searchbox .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.searchbox input {
  width: 100%; height: 40px; border-radius: 8px; border: 0; padding: 0 12px 0 38px;
  background: var(--paper); box-shadow: inset 0 0 0 1px rgba(14, 39, 50, 0.08);
  font-size: var(--text-sm); line-height: var(--line-sm);
}
.searchbox input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--teal); }

.view { padding: 8px 32px 0; max-width: 1440px; }
.view-narrow { max-width: 1040px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-grid-billing { grid-template-columns: 1.3fr 1fr; }
@media (max-width: 1100px) {
  .settings-grid, .settings-grid-billing { grid-template-columns: 1fr; }
}
.kpi { background: var(--paper); border-radius: 12px; padding: 18px; box-shadow: var(--shadow-sm); }
.kpi .kpi-label { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--muted); display: flex; align-items: center; gap: 6px; line-height: var(--line-xs); }
.kpi .kpi-value { font-size: var(--text-display); line-height: var(--line-display); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; color: var(--teal); margin-top: 8px; }
.kpi .kpi-foot { font-size: var(--text-xs); color: var(--muted-2); margin-top: 6px; line-height: var(--line-xs); }
.kpi .kpi-trend { color: var(--good); font-weight: var(--weight-strong); }
button.kpi { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: inherit; }
.kpi-metric { cursor: pointer; transition: box-shadow var(--motion-hover) ease; }
.kpi-metric .kpi-value { text-decoration: underline; text-decoration-color: var(--surface-3); text-underline-offset: 3px; }
.kpi-metric:hover { box-shadow: var(--shadow-sm); }
.kpi-metric:hover .kpi-value, .kpi-metric:focus-visible .kpi-value { color: var(--brand-2); }

/* Drawer */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 29, 37, 0.34); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 96vw); background: var(--paper);
  z-index: 61; box-shadow: var(--shadow-md); transform: translateX(102%);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1); display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head { padding: 22px 24px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-body { padding: 0 24px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; background: var(--cream); display: flex; gap: 10px; align-items: center; }
.drawer h2 { font-size: var(--text-xl); line-height: var(--line-xl); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.icon-btn:hover { background: rgba(14, 39, 50, 0.07); color: var(--teal); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail { background: var(--cream); border-radius: 8px; padding: 10px 12px; }
.detail .label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--track-caps); color: var(--muted-2); line-height: var(--line-xs); }
.detail .value { font-size: var(--text-sm); color: var(--teal); margin-top: 2px; word-break: break-word; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; line-height: var(--line-sm); }
.detail .value .cell-sub { flex-basis: 100%; }
.detail .value a { text-decoration: none; }
.copy-btn { border: 0; background: transparent; color: var(--muted-2); padding: 2px; display: inline-flex; }
.copy-btn:hover { color: var(--coral); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; font-size: var(--text-sm); line-height: var(--line-sm); }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--cream-3);
}
.timeline li:first-child::before { background: var(--coral); }
.timeline .when { font-size: var(--text-xs); color: var(--muted-2); display: block; margin-top: 2px; line-height: var(--line-xs); }

.progress { height: 8px; border-radius: 999px; background: var(--cream-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--coral); border-radius: 999px; transition: width 0.4s ease; }
.log {
  background: var(--teal-deep); color: #cfe3e6; border-radius: 10px; padding: 14px 16px;
  height: 190px; overflow-y: auto; font-family: var(--font-mono);
  font-size: var(--text-xs); line-height: var(--line-xs);
}
.log div { opacity: 0.9; }
.log .t { color: #7fa3a8; margin-right: 8px; }
.log .ok { color: #9fe0b4; }
.log .err { color: #f2a49a; }

.source-pill { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--muted); line-height: var(--line-xs); }
.source-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.source-pill.is-off .dot { background: var(--muted-2); }

.result-row { background: var(--paper); }
.result-row:hover { background: var(--cream); }
.result-row.is-dup { opacity: 0.55; }

/* Steps list */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; font-size: var(--text-sm); line-height: var(--line-sm); }
.steps .num {
  counter-increment: step; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--cream-2); color: var(--teal); display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: var(--line-xs);
}
.steps .num::before { content: counter(step); }

/* Toggle */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle .t-label { font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--line-sm); }
.toggle .t-sub { font-size: var(--text-xs); color: var(--muted); line-height: var(--line-xs); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--cream-3); transition: background 0.16s ease; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform 0.16s ease;
}
.switch input:checked + span { background: var(--coral); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Source chain in the lead drawer. */
.chain { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chain li { display: flex; gap: 10px; font-size: var(--text-sm); line-height: var(--line-sm); }
.chain-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--paper);
  color: var(--teal); display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--weight-strong); box-shadow: var(--shadow-xs); line-height: var(--line-xs);
}
.chain-body { min-width: 0; }
.chain-quote { margin: 4px 0 0; padding: 6px 10px; background: var(--paper); border-radius: 6px; font-size: var(--text-xs); color: var(--teal); line-height: var(--line-xs); }

/* Sub-tabs under Leads: Companies and People. */
.subtabs { display: flex; gap: 6px; margin-bottom: 16px; }
.subtab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 8px; background: var(--cream-2); color: var(--muted);
  text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-strong); line-height: var(--line-sm);
}
.subtab:hover { background: var(--cream-3); color: var(--teal); }
.subtab.is-active { background: var(--paper); color: var(--teal); box-shadow: var(--shadow-xs); }
.subtab .icon { color: var(--muted-2); }
.subtab.is-active .icon { color: var(--ink); }

/* Toasts */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: var(--teal); color: #fff; padding: 12px 16px; border-radius: 10px;
  box-shadow: var(--shadow-md); font-size: var(--text-sm); max-width: 360px;
  animation: toast-in 0.18s ease; line-height: var(--line-sm);
}
.toast.is-error { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-wrap { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 70; padding: 20px; background: rgba(10, 29, 37, 0.38); backdrop-filter: blur(3px); }
.modal-wrap.is-open { display: flex; }
.modal { background: var(--paper); border-radius: var(--radius); width: min(560px, 100%); box-shadow: var(--shadow-md); padding: 24px; }
.modal h2 { font-size: var(--text-xl); margin-bottom: 6px; line-height: var(--line-xl); }

/* Mobile */
.mobile-bar { display: none; }
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.sidebar-scrim { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 55;
    transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow-md);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(10, 29, 37, 0.4); z-index: 54; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; position: sticky; top: 0; z-index: 30;
    background: var(--cream); box-shadow: var(--shadow-xs);
  }
  .topbar { padding: 14px 16px; position: static; }
  .topbar h1 { font-size: var(--text-lg); line-height: var(--line-lg); }
  .searchbox { display: none; }
  .view { padding: 8px 16px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .drawer { width: 100%; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .kpi-value { font-size: var(--text-xl); line-height: var(--line-xl); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .topbar-actions .btn span { display: none; }
  .table { min-width: 640px; }
}

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

/* Company screenshots in the company drawer. Thumbnails, no borders, open full size. */
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.shot { display: block; background: var(--cream); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; transition: background 83ms ease; }
.shot:hover { background: #f2ece2; }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; background: #e8e2d6; }
.shot-label { display: block; font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--teal); padding: 8px 10px 0; line-height: var(--line-xs); }
.shot .meta { display: block; padding: 2px 10px 10px; }
.shot:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
@media (max-width: 560px) { .shot-grid { grid-template-columns: 1fr; } }

/* Inbox: one quiet list and one reading pane. No cards, no borders, no badge noise. */
.inbox-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.inbox-list { min-width: 0; padding-top: 12px; }
.inbox-tabs { display: flex; gap: 0; margin: 12px 0; flex-wrap: wrap; }
.inbox-tab { display: inline-flex; align-items: center; height: 32px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--text-xs); font-weight: var(--weight-strong); padding: 0 12px; border-radius: 8px; cursor: pointer; transition: background 83ms ease, color 83ms ease; line-height: var(--line-xs); }
.inbox-tab:hover { background: rgba(14, 39, 50, 0.08); color: var(--ink); }
.inbox-tab[aria-pressed="true"] { position: relative; background: rgba(14, 39, 50, 0.1); color: var(--ink); box-shadow: none; }
.inbox-tab[aria-pressed="true"]::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 999px; background: var(--coral); }
.inbox-tab:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.inbox-row { display: grid; gap: 4px; width: calc(100% - 8px); text-align: left; border: 0; background: transparent; padding: 8px; margin: 0 4px 2px; border-radius: 10px; cursor: pointer; overflow: hidden; transition: background 83ms ease; }
.inbox-row:hover { background: rgba(14, 39, 50, 0.08); }
.inbox-row.is-active { background: var(--paper); box-shadow: var(--shadow-xs); }
.inbox-row:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.inbox-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.inbox-name { flex: 1; min-width: 0; font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--line-sm); }
.inbox-time { font-size: var(--text-xs); color: var(--muted); flex: none; line-height: var(--line-xs); }
.inbox-sub { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--line-xs); }
.inbox-preview { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--line-xs); }
.inbox-flag { color: var(--coral-dark); font-weight: var(--weight-strong); }
.inbox-pane { padding: 24px; }
.inbox-pane-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.inbox-title { font-size: var(--text-lg); font-weight: var(--weight-strong); color: var(--ink); margin: 0; line-height: var(--line-lg); }
.inbox-meta { font-size: var(--text-xs); color: var(--muted); margin-top: 4px; line-height: var(--line-xs); }
.inbox-link { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--teal-soft); text-decoration: none; flex: none; line-height: var(--line-xs); }
.inbox-link:hover { color: var(--coral); }
.inbox-thread { margin-top: 28px; max-width: 72ch; }
.inbox-subject { font-size: var(--text-xs); color: var(--muted); margin-bottom: 16px; line-height: var(--line-xs); }
.msg { padding: 0 0 28px; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-xs); color: var(--muted); margin-bottom: 6px; line-height: var(--line-xs); }
.msg-who { font-weight: var(--weight-strong); color: var(--ink); }
.msg-body { font-size: var(--text-base); line-height: var(--line-base); color: var(--ink); max-width: none; white-space: pre-line; }
.inbox-draft { margin: 4px 0 20px; padding: 16px; border-radius: 12px; background: var(--cream-2); }
.inbox-draft-label { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--teal); margin-bottom: 8px; line-height: var(--line-xs); }
.inbox-draft .textarea { background: var(--paper); }
.inbox-empty { padding: 40px 16px; text-align: center; }
.inbox-empty h3 { font-size: var(--text-lg); line-height: var(--line-lg); margin: 0 0 8px; }
.inbox-empty p { color: var(--muted); font-size: var(--text-sm); margin: 0 auto 24px; max-width: 42ch; line-height: var(--line-sm); }
@media (max-width: 900px) {
  .inbox-layout { grid-template-columns: 1fr; gap: 16px; }
  .inbox-pane { padding: 20px 16px; }
}

/* Structured place cells and integration marks. */
.hq-cell { display: inline-flex; gap: 5px; align-items: center; min-width: 0; white-space: nowrap; }
.hq-cell .flag { font-size: var(--text-base); line-height: var(--line-sm); }
.hq-city { font-size: var(--text-sm); color: var(--ink); line-height: var(--line-sm); overflow: hidden; text-overflow: ellipsis; }
.hq-cell .cell-sub { display: block; }
.brand-tile { width: 32px; height: 32px; border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-xs); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.check-yes { width: 20px; height: 20px; border-radius: 999px; background: var(--good-bg); color: var(--good); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Industry tags. */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--cream-2); color: var(--teal); font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: var(--line-xs); white-space: nowrap; }
.tag-more { color: var(--muted); }
.tag-row { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

.client-record-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--cream-2); }
.client-record-head .avatar { width: 48px; height: 48px; font-size: var(--text-base); line-height: var(--line-base); }

.task-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cream-2); }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.profile-grid h3 { grid-column: 1 / -1; margin: 12px 0 0; }
@media (max-width: 720px) { .profile-grid { grid-template-columns: 1fr; } }


/* Client console C: overview, health, alerts and search. */
.cc-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cc-health-head { display: flex; gap: 14px; align-items: center; }
.cc-score { font-size: var(--text-display); line-height: 1; color: var(--teal); }
.cc-line { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--cream-2); }
.cc-line:last-child { border-bottom: 0; }
.cc-line.is-ack { opacity: .65; }
.cc-link { text-decoration: none; color: inherit; border-radius: 8px; }
.cc-link:hover { background: var(--cream-2); color: var(--teal); }
.cc-profile-details summary { cursor: pointer; font-weight: var(--weight-strong); color: var(--teal); padding: 10px 0; }

.cc-search-panel { position: fixed; left: calc(var(--app-sidebar) + var(--space-2)); right: auto; width: min(440px, calc(100vw - var(--app-sidebar) - var(--space-4))); max-height: min(68vh, 560px); overflow: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 8px; z-index: 75; }
@media (max-width: 900px) { .cc-search-panel { left: var(--space-4); right: var(--space-4); width: auto; } }
.cc-search-group-label { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--muted); padding: 8px 10px 4px; line-height: var(--line-xs); }
.cc-result { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--teal); }
.cc-result:hover, .cc-result.is-active { background: var(--cream-2); color: var(--teal); }
.cc-result-kind { flex: none; width: 58px; font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--muted); line-height: var(--line-xs); }
.cc-result-body { flex: 1; min-width: 0; }
.cc-result-title { display: block; font-size: var(--text-sm); font-weight: var(--weight-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: var(--line-sm); }
.cc-result-sub { display: block; font-size: var(--text-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: var(--line-xs); }
.cc-result-meta { flex: none; max-width: 110px; text-align: right; font-size: var(--text-xs); color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: var(--line-xs); }
.cc-search-foot { display: flex; gap: 14px; padding: 8px 10px 2px; margin-top: 4px; border-top: 1px solid var(--cream-2); font-size: var(--text-xs); color: var(--muted); line-height: var(--line-xs); }
.cc-search-empty { padding: 16px 10px; margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.cc-search-section { margin-bottom: 18px; }
.cc-search-section h3 { margin-bottom: 0; }
.cc-result-list { margin-top: 8px; }
.cc-direct { align-items: center; }

@media (max-width: 900px) { .cc-columns { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .cc-result-meta { display: none; } }

.cc-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cc-line .cell-sub { display: block; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--muted); margin-top: 2px; line-height: var(--line-xs); }

/* ---------- Client console (#1203 to #1208) ----------
   New screens use tokens only: no raw colour, no raw font size. */
.console-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.console-grid-wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .console-grid { grid-template-columns: 1fr; } }

.console-card { background: var(--surface); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow-xs); min-width: 0; }
.console-card + .console-card { margin-top: var(--space-4); }
.console-card h3 { font-family: var(--font-body); font-size: var(--text-base); font-weight: var(--weight-strong); line-height: var(--line-base); color: var(--ink); margin-bottom: var(--space-2); }
.console-card .console-note { font-size: var(--text-xs); line-height: var(--line-xs); color: var(--ink-2); }
.console-head { display: flex; justify-content: space-between; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-3); flex-wrap: wrap; }
.console-head h3 { margin: 0; }

.console-list { list-style: none; margin: 0; padding: 0; }
.console-row { display: flex; justify-content: space-between; gap: var(--space-3); align-items: flex-start; padding: var(--space-2); border-radius: var(--radius-sm); }
.console-row:nth-child(odd) { background: var(--page); }
.console-row-main { min-width: 0; }
.console-row-title { font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--ink); overflow-wrap: anywhere; }
.console-row-sub { display: block; font-size: var(--text-xs); line-height: var(--line-xs); color: var(--ink-2); margin-top: 2px; }
.console-row-actions { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }

.console-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); margin: 0; }
.console-facts div { min-width: 0; }
.console-facts dt { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--ink-2); }
.console-facts dd { margin: 2px 0 0; font-size: var(--text-sm); color: var(--ink); overflow-wrap: anywhere; }

.console-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); }
.console-form .field { margin-bottom: 0; }
.console-form .field-full { grid-column: 1 / -1; }
.console-form-actions { grid-column: 1 / -1; display: flex; gap: var(--space-2); flex-wrap: wrap; }
@media (max-width: 720px) { .console-form, .console-facts { grid-template-columns: 1fr; } }

.console-checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.console-check { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min); font-size: var(--text-sm); color: var(--ink); }

.console-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--space-3); }
.console-toolbar .field { margin-bottom: 0; }

.console-pill { display: inline-flex; align-items: center; gap: 4px; height: var(--target-min); padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: 1; white-space: nowrap; }
.console-pill[data-tone="good"] { background: var(--good-bg); color: var(--good); }
.console-pill[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); }
.console-pill[data-tone="bad"] { background: var(--bad-bg); color: var(--bad); }
.console-pill[data-tone="cool"] { background: var(--cool-bg); color: var(--cool); }

/* Simple CSS bars. One series, one colour, a number at the end. */
.bar-chart { display: flex; flex-direction: column; gap: var(--space-2); }
.bar-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) 54px; gap: var(--space-2); align-items: center; }
.bar-label { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--ink-2); white-space: nowrap; }
.bar-track { height: var(--space-2); border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 2px; border-radius: var(--radius-pill); background: var(--brand); }
.bar-fill[data-tone="coral"] { background: var(--action); }
.bar-fill[data-tone="sand"] { background: var(--surface-3); }
.bar-value { font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

.console-funnel { display: flex; flex-direction: column; gap: var(--space-1); }
.console-funnel-step { display: flex; align-items: center; gap: var(--space-2); }
.console-funnel-bar { height: var(--space-5); border-radius: var(--radius-sm); background: var(--brand); color: var(--white); font-size: var(--text-xs); font-weight: var(--weight-strong); display: flex; align-items: center; padding: 0 var(--space-2); min-width: var(--space-7); }

.console-thread { display: flex; flex-direction: column; gap: var(--space-3); }
.console-message { background: var(--page); border-radius: var(--radius-sm); padding: var(--space-3); }
.console-message[data-direction="outbound"] { background: var(--surface-2); }
.console-message-head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-2); margin-bottom: var(--space-1); }
.console-message-body { font-size: var(--text-sm); line-height: var(--line-sm); color: var(--ink); white-space: pre-line; }

.console-table-scroll { overflow-x: auto; }

/* WCAG 2.2 target size: no control is smaller than 24x24. Inline prose links
   are exempt, as the guideline allows. */
input[type="checkbox"], input[type="radio"] { min-width: var(--target-min); min-height: var(--target-min); }
.copy-btn { min-width: var(--target-min); min-height: var(--target-min); justify-content: center; }

/* The client tab strip scrolls sideways at 1024 and never wraps the page. */
.client-record-head + .subtabs, .subtabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.subtabs { flex-wrap: nowrap; }


/* Client book and workspace switcher (from the workspaces branch) */

/* ---------- workspace switcher ---------- */

.workspace-switch { padding: 0 10px 4px; }
.workspace-switch .nav-label { padding: 0 2px 6px; }
.workspace-select {
  width: 100%; min-height: 36px; padding: 6px 30px 6px 10px; border: 0; border-radius: 8px;
  background-color: var(--paper); color: var(--teal); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-strong);
  box-shadow: var(--shadow-xs); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e2732' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; line-height: var(--line-sm);
}
.workspace-select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.workspace-pinned {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px;
  border-radius: 8px; background: var(--paper); color: var(--teal); font-size: var(--text-sm); font-weight: var(--weight-strong);
  box-shadow: var(--shadow-xs); line-height: var(--line-sm);
}
.workspace-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: none; }
.workspace-note { margin: 6px 2px 0; font-size: var(--text-xs); line-height: var(--line-xs); color: var(--muted-2); }
@media (max-width: 900px) { .workspace-switch { display: none; } }

.workspace-pinned[hidden], .workspace-select[hidden], .workspace-note[hidden], .workspace-switch[hidden] { display: none; }

/* Client book: portfolio and record. Uses the app tokens above. */
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--bad-bg); color: var(--bad); }
.book-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.book-back { border: 0; background: transparent; color: var(--muted); font-size: var(--text-lg); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); line-height: var(--line-lg); }
.book-back:hover { background: var(--cream-2); color: var(--teal); }
.book-logo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: var(--radius); background: var(--cream-2); color: var(--teal); display: grid; place-items: center; font-weight: var(--weight-strong); font-size: var(--text-lg); line-height: var(--line-lg); }
.book-title h1 { font-size: var(--text-xl); line-height: var(--line-xl); margin: 0; }
.book-sub { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; line-height: var(--line-xs); }
.book-health { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: var(--line-xs); }
.book-health b { font-variant-numeric: tabular-nums; }
.book-health.is-healthy { background: var(--good-bg); color: var(--good); }
.book-health.is-watch { background: var(--warn-bg); color: var(--warn); }
.book-health.is-at-risk { background: var(--bad-bg); color: var(--bad); }
.book-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.book-col { display: flex; flex-direction: column; gap: 16px; }
.book-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.book-fact span { display: block; font-size: var(--text-xs); font-weight: var(--weight-strong); color: var(--muted); line-height: var(--line-xs); }
.book-fact b { font-size: var(--text-sm); color: var(--ink); font-weight: var(--weight-strong); line-height: var(--line-sm); }
.book-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.book-reasons li { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-sm); line-height: var(--line-sm); }
.book-reasons b { color: var(--bad); font-variant-numeric: tabular-nums; }
.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-person, .book-task { display: flex; flex-direction: column; font-size: var(--text-sm); line-height: var(--line-sm); }
.book-person span, .book-task em { font-size: var(--text-xs); color: var(--muted); font-style: normal; line-height: var(--line-xs); }
.book-person em { font-size: var(--text-xs); color: var(--muted); font-style: normal; line-height: var(--line-xs); }
.book-task { flex-direction: row; justify-content: space-between; gap: 12px; align-items: baseline; }
.book-task .is-bad { color: var(--bad); }
.book-timeline { display: flex; flex-direction: column; gap: 10px; }
.book-act { display: flex; gap: 8px; font-size: var(--text-sm); align-items: baseline; line-height: var(--line-sm); }
.book-act b { color: var(--teal); }
.book-act em { margin-left: auto; font-size: var(--text-xs); color: var(--muted); font-style: normal; white-space: nowrap; line-height: var(--line-xs); }
.book-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.book-form .field { margin: 0; }
.book-form .row { grid-column: 1 / -1; }
.book-task-list { display: flex; flex-direction: column; gap: 8px; }
.book-task-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.book-task-row div { display: flex; flex-direction: column; min-width: 0; }
.book-task-row span { font-size: var(--text-xs); color: var(--muted); line-height: var(--line-xs); }
.book-task-row.is-done b { color: var(--muted); text-decoration: line-through; }
.book-task-row .icon-btn { margin-left: auto; }
.book-notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.book-row { cursor: pointer; }
.book-row:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.book-note { font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: var(--line-xs); }
.book-note.is-warn { color: var(--warn); }
.book-note.is-bad { color: var(--bad); }
@media (max-width: 1100px) { .book-grid { grid-template-columns: 1fr; } .book-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .book-form { grid-template-columns: 1fr; } .book-facts { grid-template-columns: 1fr; } }
.book-health.is-unscored { background: var(--cream-2); color: var(--muted); }

/* Numeric sortable headers: the arrow takes room only while that column is sorted, so the label stays flush with its numbers. */
.th-sort.num button { gap: 0; }
.th-sort.num .sort-arrow { width: 0; overflow: hidden; }
.th-sort.num[aria-sort="ascending"] .sort-arrow, .th-sort.num[aria-sort="descending"] .sort-arrow { width: 14px; padding-left: 4px; }
.panel-grid .toolbar .row { flex-wrap: wrap; }
.table-dense th.cell-check { cursor: pointer; }
.table-dense tbody tr:focus-visible { outline-offset: -2px; border-radius: 0; }
