/* ClearMCA admin, UX v2 (26 Nov 2026). The brand stays (docs/design.md, docs/brand.md): Plus Jakarta Sans and the
 * Cormorant figures, ledger green, brass and paper. The layout is new and denser: a 60px icon rail that opens on hover,
 * the page at full width with 16-20px padding, one-line page headers, 13px body text, 32px controls and 38px table
 * rows. Every size, colour, radius and shadow is a token below; components use the tokens, never their own values.
 * Brass stays the one primary action per view, and brass is never text on a light ground (brass ink is). Errors read
 * in words first; one muted red marks a message that was not sent.
 * CSP: style-src 'self'. Nothing inline (scripts set CSS custom properties and sizes through the CSSOM only).
 * Contrast: every text colour passes WCAG 2.2 AA on its ground. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  /* brand */
  --ledger: #0b1f1a;
  --lamp: #123a30;
  --brass: #c9a866;
  --brass-hi: #d9bd82;
  --brass-ink: #7a5a1e;
  --brass-wash: #f7f1e3;
  --brass-line: #e2cf9f;
  --mint: #8fd9b6;
  --mint-wash: #e8f4ee;
  --mint-line: #bcdcca;
  --paper: #f4f7f5;
  --white: #ffffff;
  /* text and lines */
  --ink: #0b1f1a;
  --text: #3a4b45;
  --muted: #5d6d67;
  --faint: #606f6a; /* AA on white, surface-2, selected and the washes */
  --line: #e2e8e5;
  --line-strong: #cbd5d0;
  --hover: #f1f5f3;
  --selected: #e8f2ed;
  --surface: #ffffff;
  --surface-2: #f9fbfa;
  --danger: #b42318;
  --danger-wash: #fdeeec;
  --on-dark: #ffffff;
  --on-dark-2: #b9c9c2;
  --on-dark-3: #8ea69c;
  --line-dark: rgba(255, 255, 255, 0.1);
  --focus-light: #1f6b54;
  --focus-dark: #8fd9b6;
  /* type */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-2xs: 0.65625rem; /* 10.5px */
  --fs-xs: 0.6875rem;   /* 11px */
  --fs-sm: 0.75rem;     /* 12px */
  --fs: 0.8125rem;      /* 13px: body */
  --fs-md: 0.875rem;    /* 14px */
  --fs-lg: 1rem;        /* 16px */
  --fs-xl: 1.125rem;    /* 18px: page titles */
  --fs-fig: 1.75rem;    /* 28px: figures */
  --lh: 1.45;
  /* space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --page-x: 20px;
  --page-y: 14px;
  /* shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 10px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 26, 0.06);
  --shadow: 0 1px 2px rgba(11, 31, 26, 0.05), 0 4px 12px -6px rgba(11, 31, 26, 0.12);
  --shadow-lg: 0 18px 44px -14px rgba(11, 31, 26, 0.34);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* controls */
  --control-h: 32px;
  --control-h-sm: 28px;
  --row-pad-y: 8px;
  --rail: 60px;
  --rail-open: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--fs)/var(--lh) var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
h2 { font-size: var(--fs-md); font-weight: 650; line-height: 1.3; }
h3 { font-size: var(--fs); font-weight: 650; }
h4 { font-size: var(--fs-sm); font-weight: 650; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: var(--focus-dark); }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brass); color: var(--ledger); font-weight: 700;
  padding: 8px 14px; border-radius: var(--r-pill); text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript { padding: 24px; }
.muted { color: var(--muted); }

/* ---------- the top progress bar (net.js) ---------- */
.topbar-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 300; pointer-events: none; }
.topbar-progress span {
  display: block; height: 100%; width: 0; opacity: 0;
  background: linear-gradient(90deg, var(--focus-light), var(--brass));
  box-shadow: 0 0 8px rgba(201, 168, 102, 0.55);
}
.topbar-progress.is-on span { opacity: 1; animation: trickle 12s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
.topbar-progress.is-done span { animation: none; width: 100%; opacity: 0; transition: opacity 240ms ease 80ms; }
@keyframes trickle { 0% { width: 0; } 8% { width: 38%; } 30% { width: 62%; } 100% { width: 92%; } }

/* ---------- shell ----------
 * The menu, the header bar, the page frame and the sign-in page are in shell.css (ClockIn Master's pattern, owner,
 * 27 Nov 2026), loaded after this file. */
.main { position: relative; outline: none; min-width: 0; }
.loading { color: var(--muted); padding: 24px 0; }

/* ---------- screens: frame, skeleton, transition ---------- */
.view { min-width: 0; }
.view.is-pending { position: absolute; top: var(--page-y); left: var(--page-x); right: var(--page-x); visibility: hidden; pointer-events: none; }
.view.is-entering { animation: view-in 150ms var(--ease-out); }
.view.is-placeholder { cursor: progress; }
.view.is-placeholder:not(.sk-view) { animation: placeholder-dim 220ms ease 450ms forwards; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes placeholder-dim { to { opacity: 0.55; } }
/* a screen shown again as last drawn while it loads in the background (app.js, owner 30 Nov 2026): the thin bar is the
 * only sign; if the load fails this line says so, with Try again, and the last drawing stays */
.swr-note {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 5px 6px 5px 10px; width: fit-content; max-width: 100%;
  border: 1px solid var(--brass-line); background: var(--brass-wash); color: var(--ink); border-radius: var(--r); font-size: var(--fs-sm);
}
.swr-note .icon { color: var(--brass-ink); }
.sk {
  display: block; border-radius: var(--r-sm);
  background: linear-gradient(90deg, #e7edea 0%, #f3f6f5 45%, #e7edea 90%); background-size: 600px 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: -600px 0; } to { background-position: 600px 0; } }
.sk-line { height: 10px; }
.sk-w10 { width: 10%; } .sk-w15 { width: 15%; } .sk-w20 { width: 20%; } .sk-w30 { width: 30%; } .sk-w40 { width: 40%; }
.page-title .sk-w30 { width: 180px; align-self: center; }
.sk-figure { height: 24px; width: 64px; margin: 10px 0; }
.sk-block { height: 72px; }
.sk-toolbar { height: 32px; margin-bottom: 12px; max-width: 720px; }
.sk-input { height: 32px; margin: 12px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 10px; align-content: start; margin-bottom: 12px; }
.sk-table { padding: 0; gap: 0; }
.sk-row { display: flex; align-items: center; gap: 24px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sk-row:last-child { border-bottom: 0; }
.sk-row .sk-line { flex: none; }
.sk-row-sm { padding: 6px 0; border: 0; gap: 16px; }
.sk-row-conv { padding: 14px 12px; }
.sk-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.sk-grid > .sk-card { margin-bottom: 0; }
.sk-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sk-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sk-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sk-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sk-wide { grid-column: 1 / -1; }
.sk-inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; height: calc(100dvh - 82px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sk-pane { border-right: 1px solid var(--line); min-width: 0; }
.sk-pane:last-child { border-right: 0; }
.sk-thread { padding: 16px; display: grid; align-content: start; gap: 16px; }
.sk-side { padding: 8px 16px; }
.sk-bubbles { display: grid; gap: 12px; }
.sk-bubble { height: 40px; width: 46%; border-radius: 12px; }
.sk-bubble.sk-out { justify-self: end; width: 38%; }
.sk-board { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 10px; overflow: hidden; }
.sk-col { background: #ecf1ee; border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; align-content: start; height: 320px; }
.sk-detail { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1099px) { .sk-cols-4, .sk-cols-5, .sk-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sk-detail { grid-template-columns: 1fr; } }
@media (max-width: 1279px) { .sk-inbox { grid-template-columns: 300px minmax(0, 1fr); } .sk-side { display: none; } }
@media (max-width: 899px) { .sk-inbox { grid-template-columns: 1fr; height: calc(100dvh - 120px); } .sk-thread { display: none; } .sk-pane { border-right: 0; } }
@media (max-width: 599px) { .sk-cols-2, .sk-cols-3, .sk-cols-4, .sk-cols-5 { grid-template-columns: 1fr; } }

/* ---------- page header: one line ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 36px; margin-bottom: 12px; }
.page-head > div:first-child, .page-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.page-head p { color: var(--muted); font-size: var(--fs-sm); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-actions .field { display: flex; align-items: center; gap: 8px; }
.page-actions .field > span { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.crumbs { font-size: var(--fs-sm); margin-bottom: 2px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.panel + .panel { margin-top: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head p { color: var(--muted); font-size: var(--fs-sm); }
.grid-2 { display: grid; gap: 12px; }
.grid-2 > .panel + .panel { margin-top: 0; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.stack { display: grid; gap: 12px; }
.stack > .panel + .panel { margin-top: 0; }
.detail-layout { display: grid; gap: 12px; }
@media (min-width: 1200px) { .detail-layout { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; } }
/* the record's sections side by side when there is room */
@media (min-width: 1360px) { .detail-layout > .stack:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.load-problem { display: grid; gap: 8px; justify-items: start; max-width: 560px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 12px;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--fs); line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 140ms var(--ease-out), box-shadow 140ms;
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--ledger); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brass-hi); border-color: var(--brass-hi); }
.btn-quiet { border-color: transparent; background: transparent; padding: 0 8px; }
.btn-quiet:hover { background: var(--hover); border-color: transparent; }
.btn-small { height: var(--control-h-sm); padding: 0 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; height: 38px; }
.btn-on-dark { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, 0.28); }
.btn-on-dark:hover { border-color: var(--on-dark); background: transparent; }
.btn-caution { color: var(--brass-ink); border-color: var(--brass-line); }
.btn-caution:hover { border-color: var(--brass-ink); background: var(--brass-wash); }
.btn-google::before {
  content: "G"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid currentColor; font-weight: 800; font-size: var(--fs-2xs); line-height: 1;
}
.link-button { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.icon-btn {
  width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; padding: 0; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; position: relative;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--brass-wash); color: var(--brass-ink); border-color: var(--brass-line); }
.icon-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn.is-on .icon { fill: var(--brass); stroke: var(--brass-ink); }
.icon-btn .dot-count {
  position: absolute; top: -3px; right: -4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--brass); color: var(--ledger); font-size: 0.5625rem; font-weight: 800; display: inline-grid; place-items: center; line-height: 1;
}
.dot-count[hidden] { display: none; }

/* busy (dom.js markBusy): a spinner and the stage in words */
.spinner {
  width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 650ms linear infinite; opacity: 0.85;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-busy, .btn.is-busy[disabled] { opacity: 1; cursor: progress; }
.btn-primary.is-busy { background: var(--brass-hi); }
.icon-btn.is-busy { cursor: progress; opacity: 1; }
.icon-btn.is-busy .busy-words { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-button.is-busy { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; cursor: progress; }
.link-button.is-busy .spinner { width: 10px; height: 10px; border-width: 1.5px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 4px; min-width: 0; }
.field > span, .field > label, legend { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }
.hint { color: var(--muted); font-size: var(--fs-sm); }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: var(--control-h); padding: 0 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--ink); font-size: var(--fs);
  transition: border-color 120ms, box-shadow 120ms;
}
.select { padding-right: 6px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--focus-light); box-shadow: 0 0 0 3px rgba(31, 107, 84, 0.16); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--brass-ink); box-shadow: 0 0 0 1px var(--brass-ink); }
.textarea { height: auto; min-height: 76px; padding: 7px 10px; resize: vertical; line-height: var(--lh); }
.input[type="date"], .input[type="datetime-local"], .input[type="time"] { padding-right: 6px; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-error { color: var(--ink); background: var(--brass-wash); border-left: 3px solid var(--brass-ink); padding: 7px 10px; border-radius: var(--r-xs); font-size: var(--fs-sm); }
.form-error::before { content: "Problem: "; font-weight: 700; }
.form-ok { color: var(--ink); background: var(--mint-wash); border-left: 3px solid var(--focus-light); padding: 7px 10px; border-radius: var(--r-xs); font-size: var(--fs-sm); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; cursor: pointer; font-size: var(--fs); }
.check input { width: 15px; height: 15px; accent-color: var(--lamp); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 6px; }

/* ---------- filters: one compact bar ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.filters .field { flex: 1 1 140px; max-width: 210px; }
.filters .field:has(input[type="search"]) { flex: 2 1 220px; max-width: 320px; }
.filters .field > span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.filters .btn { align-self: flex-end; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: -2px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.table th, .table td { text-align: left; padding: var(--row-pad-y) 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: var(--fs-xs); white-space: nowrap; padding-top: 7px; padding-bottom: 7px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 100ms; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.table .nowrap { white-space: nowrap; }
.table .strong { color: var(--ink); font-weight: 600; }
.table .sub { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.table a.row-link { font-weight: 600; text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; }
.table td.actions, .table th.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn + .btn { margin-left: 4px; }
.empty { color: var(--muted); padding: 22px 12px; text-align: center; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); }
.pager .btns { display: flex; gap: 6px; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-xs);
  font-weight: 600; border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); white-space: nowrap; line-height: 18px;
}
.chip-stage { background: var(--surface-2); }
.chip-flag { border-color: var(--brass-line); color: var(--brass-ink); background: var(--brass-wash); }
.chip-ok { border-color: var(--mint-line); color: var(--lamp); background: var(--mint-wash); }
.chip-off { border-color: var(--line-strong); color: var(--muted); background: var(--paper); }
.chip-system { border-color: var(--ink); }
.chip-danger { border-color: #f1b8b2; color: var(--danger); background: var(--danger-wash); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- dashboard figures (reports and settings reuse them) ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.tile-label { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
a.figure { display: block; text-decoration: none; }
a.figure:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.figure { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--ink); font-size: var(--fs-fig); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- chart palette (owner, 27 Nov 2026: "bring some colours") ----------
 * One categorical set for the dashboard's charts: the validated default of the dataviz method (eight hues in a fixed
 * order; checked with its validate_palette.js on white: lightness band, chroma floor, neighbour separation under
 * colour-blind simulation and in normal vision, including the donut's wrap-around pair). A colour follows its entity
 * (a phase, a source), never its rank. Three slots are below 3:1 on white, so every mark has its name and figure
 * printed beside it. The funnel keeps the reports' ordinal greens. Dark steps are chosen for the dark chart surface
 * (#16211d) and checked the same way; the admin has no dark theme yet, so they apply only under [data-theme="dark"]. */
:root {
  --viz-1: #2a78d6;  /* blue */
  --viz-2: #eb6834;  /* orange */
  --viz-3: #1baf7a;  /* aqua */
  --viz-4: #eda100;  /* yellow */
  --viz-5: #e87ba4;  /* magenta */
  --viz-6: #008300;  /* green */
  --viz-7: #e34948;  /* red */
  --viz-8: #7c5cd6;  /* violet: the eighth source, Email (HL-3-01, #178) */
  --viz-other: #8a9893;
  --viz-track: #e9eeec;
  --viz-step-1: #7cbda0;
  --viz-step-2: #3f9877;
  --viz-step-3: #16805e;
  --viz-step-4: #0f4d39;
}
:root[data-theme="dark"] {
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-4: #c98500;
  --viz-5: #d55181;
  --viz-6: #0ca30c;
  --viz-7: #e66767;
  --viz-8: #9479e6;
  --viz-other: #7d8c86;
  --viz-track: #24302c;
  --viz-step-1: #2f7d61;
  --viz-step-2: #3f9877;
  --viz-step-3: #5fb08f;
  --viz-step-4: #8fd9b6;
}
.ph-1, .viz-1 { --c: var(--viz-1); } .ph-2, .viz-2 { --c: var(--viz-2); } .ph-3, .viz-3 { --c: var(--viz-3); }
.ph-4, .viz-4 { --c: var(--viz-4); } .ph-5, .viz-5 { --c: var(--viz-5); } .viz-6 { --c: var(--viz-6); } .viz-7 { --c: var(--viz-7); }
.viz-8 { --c: var(--viz-8); }
.viz-other { --c: var(--viz-other); } .viz-none { --c: var(--line-strong); }

/* ---------- dashboard (views/dashboard.js): what to do next, then the charts ---------- */
/* what to do next: one numbered line per list, its count, one sentence and one button */
.dash-next { margin-bottom: 16px; padding-bottom: 6px; }
.dash-next .panel-head { margin-bottom: 4px; }
.next-list { list-style: none; margin: 0; padding: 0; }
.next-item + .next-item { border-top: 1px solid var(--line); }
.next-line { display: grid; grid-template-columns: 26px 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; }
.next-step {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--ledger); color: var(--on-dark); font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.next-item.is-clear .next-step { background: var(--mint-wash); color: var(--lamp); }
.next-step .icon { width: 14px; height: 14px; }
.next-count { color: var(--ink); font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.next-count .sk { display: inline-block; width: 32px; }
.next-text { display: grid; gap: 1px; min-width: 0; }
.next-title { color: var(--ink); font-size: var(--fs-md); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-sub { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-item.is-clear :is(.next-count, .next-title) { color: var(--muted); font-weight: 600; }
.next-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.next-go .icon, .next-more .icon { width: 13px; height: 13px; }
.next-more .icon { transition: transform 160ms var(--ease-out); }
.next-more[aria-expanded="true"] .icon { transform: rotate(180deg); }
.next-item.is-clear .next-go { color: var(--muted); }
.next-rows { margin: 0 0 10px 102px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-row { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 8px; border-radius: var(--r-sm); }
.todo-row:hover { background: var(--surface); }
.todo-main { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--ink); }
.todo-main:hover .todo-name { text-decoration: underline; }
.todo-name { font-weight: 600; font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-sub { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-side { flex: none; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; text-align: right; }
.todo-side strong { color: var(--ink); font-weight: 650; }
.todo-call { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--lamp); background: var(--mint-wash); border: 1px solid var(--mint-line); }
.todo-call:hover { background: var(--lamp); color: var(--on-dark); }
.todo-call .icon { width: 13px; height: 13px; }
.todo-problem { color: var(--muted); font-size: var(--fs-sm); padding: 4px 8px; }
.dash-note { color: var(--muted); font-size: var(--fs-xs); margin-top: 10px; }
/* when the hourly report behind Lead sources and This week's conversions was taken (owner, 30 Nov 2026) */
.dash-updated { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--fs-xs); margin: -4px 0 10px; }
.dash-updated .icon { width: 13px; height: 13px; flex: none; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dash-grid > .panel + .panel { margin-top: 0; }

/* the pipeline: one bar of the five phases, the legend under it, the chosen phase's stages */
.pipe-bar { display: flex; gap: 2px; height: 28px; margin: 4px 0 12px; }
.pipe-seg { display: block; flex: 1 1 0; min-width: 6px; background: var(--c); cursor: pointer; transition: opacity 140ms var(--ease-out); }
.pipe-seg:first-child { border-radius: 6px 0 0 6px; }
.pipe-seg:last-child { border-radius: 0 6px 6px 0; }
.pipe-seg:only-child { border-radius: 6px; }
.pipe-seg.is-empty { background: var(--viz-track); cursor: default; }
.pipe-seg:hover { opacity: 0.85; }
.pipe-seg.is-current { box-shadow: inset 0 -4px 0 rgba(11, 31, 26, 0.35); }
.pipe-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pipe-key {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "sw name name" ". n p"; align-items: baseline; gap: 2px 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  font: inherit; transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.pipe-key:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pipe-key[aria-pressed="true"] { border-color: var(--c, var(--lamp)); box-shadow: inset 0 0 0 1px var(--c, var(--lamp)); background: var(--surface-2); }
.pipe-key:has(.ph-1) { --c: var(--viz-1); } .pipe-key:has(.ph-2) { --c: var(--viz-2); } .pipe-key:has(.ph-3) { --c: var(--viz-3); }
.pipe-key:has(.ph-4) { --c: var(--viz-4); } .pipe-key:has(.ph-5) { --c: var(--viz-5); }
.pipe-swatch { grid-area: sw; align-self: center; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.pipe-key-name { grid-area: name; color: var(--ink); font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-key-n { grid-area: n; color: var(--ink); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; }
.pipe-key-p { grid-area: p; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.pipe-stages { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.pipe-stages-head { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: var(--fs-sm); margin-bottom: 6px; }
.pipe-stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pipe-stage {
  display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) 36px; align-items: center; gap: 12px; min-height: 30px; padding: 0 6px; margin: 0 -6px;
  border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: var(--fs-sm);
}
a.pipe-stage:hover { background: var(--surface); color: var(--ink); }
a.pipe-stage:hover .pipe-stage-name { text-decoration: underline; }
.pipe-stage-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-stage-track { height: 8px; border-radius: var(--r-pill); background: var(--viz-track); overflow: hidden; }
.pipe-stage-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--c); border-radius: var(--r-pill); }
.pipe-stage-n { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pipe-stage[data-zero] :is(.pipe-stage-name, .pipe-stage-n) { color: var(--faint); font-weight: 500; }
.dash-pipe .rpt-numbers { margin-top: 6px; }

/* lead sources: the donut and every source beside it */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { flex: none; display: block; overflow: visible; }
.donut-track { fill: none; stroke: var(--viz-track); stroke-width: 22; }
.donut-arc { fill: none; stroke: var(--c); stroke-width: 22; transition: opacity 140ms var(--ease-out); cursor: default; }
.donut-arc.is-dim { opacity: 0.25; }
.donut-total { fill: var(--ink); font-family: var(--font); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.donut-sub { fill: var(--muted); font-family: var(--font); font-size: 11px; font-weight: 600; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; min-width: 0; display: grid; gap: 2px; }
.donut-key { display: grid; grid-template-columns: 10px minmax(0, 1fr) 40px 44px; align-items: center; gap: 10px; min-height: 28px; padding: 0 6px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.donut-key:hover { background: var(--surface-2); }
.donut-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.donut-key-name { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-key-n { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-key-p { text-align: right; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.donut-key[data-zero] :is(.donut-key-name, .donut-key-n) { color: var(--faint); font-weight: 500; }

/* conversions: the funnel as bars, each with its count and share of leads; the step-to-step share between them */
.conv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.conv-step { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) 44px 48px; grid-template-areas: "from from from from" "label track n p"; align-items: center; gap: 2px 10px; font-size: var(--fs-sm); }
.conv-from { grid-area: from; display: inline-flex; align-items: center; gap: 4px; padding-left: calc(34% + 10px); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.conv-from .icon { width: 12px; height: 12px; }
.conv-label { grid-area: label; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-track { grid-area: track; height: 22px; border-radius: 6px; background: var(--viz-track); overflow: hidden; }
.conv-fill { display: block; height: 100%; width: var(--w, 0%); min-width: 3px; border-radius: 6px; background: var(--c); }
.conv-1 { --c: var(--viz-step-1); } .conv-2 { --c: var(--viz-step-2); } .conv-3 { --c: var(--viz-step-3); } .conv-4 { --c: var(--viz-step-4); }
.conv-n { grid-area: n; text-align: right; font-weight: 700; color: var(--ink); font-size: var(--fs); font-variant-numeric: tabular-nums; }
.conv-p { grid-area: p; text-align: right; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 1099px) { .pipe-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .next-line { grid-template-columns: 24px 44px minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; }
  .next-count { font-size: 1.25rem; }
  .next-title, .next-sub { white-space: normal; }
  .next-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .next-actions .btn { height: var(--control-h-sm); }
  .next-rows { margin-left: 0; }
  .pipe-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-stage-list { grid-template-columns: minmax(0, 1fr); }
  .pipe-stage { grid-template-columns: minmax(0, 55%) minmax(0, 1fr) 36px; } /* stacked: the bars start on one line */
  .donut-wrap { justify-content: center; }
  .conv-step { grid-template-columns: minmax(0, 1fr) 40px 44px; grid-template-areas: "from from from" "label n p" "track track track"; }
  .conv-from { padding-left: 0; }
}
@media (forced-colors: active) {
  .pipe-seg, .pipe-swatch, .pipe-stage-fill, .donut-swatch, .conv-fill { background: CanvasText; }
  .donut-arc { stroke: CanvasText; }
  .pipe-key[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* ---------- pipeline board ---------- */
.board-hint { color: var(--muted); font-size: var(--fs-sm); margin: -6px 0 10px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.column { background: #edf2ef; border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 200px; display: flex; flex-direction: column; transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out); }
.column.is-over { background: var(--mint-wash); border-color: var(--focus-light); border-style: dashed; }
.column-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 10px 7px; position: sticky; top: 0; }
.column-head h2 { font-size: var(--fs-sm); line-height: 1.3; }
.column-count { color: var(--muted); font-weight: 650; font-size: var(--fs-sm); background: var(--surface); border-radius: var(--r-pill); padding: 0 7px; }
.cards { list-style: none; margin: 0; padding: 0 6px 8px; display: grid; gap: 6px; flex: 1; align-content: start; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 9px 6px;
  display: grid; gap: 2px; cursor: grab; box-shadow: var(--shadow-sm);
  transition: box-shadow 140ms var(--ease-out), opacity 140ms var(--ease-out);
}
.card:hover { box-shadow: var(--shadow); }
.card.is-dragging { opacity: 0.45; }
.card.is-moving { opacity: 0.6; }
.card-title { font-weight: 650; color: var(--ink); text-decoration: none; font-size: var(--fs); line-height: 1.3; }
.card-title:hover { text-decoration: underline; }
.card-sub { color: var(--muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.card-amount { font-weight: 650; color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.column-more { color: var(--muted); font-size: var(--fs-xs); padding: 0 10px 8px; }

/* ---------- My tasks (views/tasks.js), UX v2 ---------- */
/* whose tasks: the shared segmented control, here with links (each choice is its own address) */
.seg a {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); color: var(--muted);
  font-weight: 600; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.seg a:hover { color: var(--ink); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 31, 26, 0.14); }
/* the four lists: one tab strip, the table right under it */
.tabs { display: flex; gap: 2px; padding: 0 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.tabs + .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; color: var(--muted); font-weight: 600;
  font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.tab:focus-visible { outline-offset: -3px; }
.tab-count.is-zero { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.tab-count.is-late { background: var(--brass); color: var(--ledger); }
.task-table .task-title { display: block; }
.task-table .task-cell .chip { margin-top: 3px; }
.task-table .is-late { color: var(--brass-ink); }
.task-table tr.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.todo-side.is-late { color: var(--brass-ink); font-weight: 600; }
@media (max-width: 519px) {
  /* phones: the four tabs as a 2 x 2 grid, so Done is never scrolled out of sight */
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; border: 0; background: transparent; margin-bottom: 8px; overflow: visible; }
  .tabs + .table-wrap { border-radius: var(--r-lg); }
  .tab { justify-content: space-between; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .tab[aria-current="page"] { border-color: var(--lamp); box-shadow: inset 0 -2px 0 var(--lamp); }
}
@media (max-width: 639px) {
  /* phones: each task is one line (title, application, due) that a tap opens, with Mark done in it (compact lists) */
  .page-head .seg { width: 100%; }
  .page-head .seg a { flex: 1; justify-content: center; height: 30px; }
}
/* ---------- end My tasks ---------- */

/* ---------- application detail ---------- */
.app-head { display: grid; gap: 6px; margin-bottom: 12px; }
.app-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.app-amount { font-family: var(--serif); font-style: italic; font-size: 1.625rem; color: var(--ink); line-height: 1; font-variant-numeric: lining-nums; }
.app-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; color: var(--muted); font-size: var(--fs-sm); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; }
.action-bar .field { min-width: 180px; flex: 1 1 180px; max-width: 280px; }
.action-bar .field > span { font-size: var(--fs-xs); color: var(--muted); }
.action-group { display: flex; align-items: end; gap: 6px; flex: 1 1 240px; max-width: 360px; }
.action-group .field { max-width: none; }
.action-bar .push { margin-left: auto; }
@media (max-width: 639px) { .action-group, .action-bar .field { max-width: none; flex-basis: 100%; } .action-bar .push { margin-left: 0; } }
.facts { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); margin: 0; font-size: var(--fs); }
.facts dt, .facts dd { padding: 5px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); padding-right: 12px; }
.facts dd { color: var(--ink); overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.masked { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.masked-value { letter-spacing: 0.2em; color: var(--muted); }
.revealed { font-weight: 650; color: var(--ink); background: var(--brass-wash); padding: 1px 7px; border-radius: var(--r-xs); }
.note-list, .timeline, .task-list, .doc-list { list-style: none; margin: 0; padding: 0; }
.note-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.note-list li:last-child { border-bottom: 0; }
.note-meta, .tl-meta { color: var(--muted); font-size: var(--fs-xs); margin-top: 1px; }
/* CLEAR-4: the business portal's messages on an application */
.sub-h { font-size: var(--fs); font-weight: 650; margin: 12px 0 6px; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.msg-list li { padding: 7px 10px; border-radius: var(--r); border: 1px solid var(--line); }
.msg-list .msg-in { background: var(--surface-2); margin-right: 24px; }
.msg-list .msg-out { background: var(--mint-wash); margin-left: 24px; border-color: var(--mint-line); }
.msg-list .msg-who { font-size: var(--fs-xs); font-weight: 700; color: var(--ink); }
.msg-list .note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-text { white-space: pre-wrap; color: var(--ink); overflow-wrap: anywhere; }
.timeline li { position: relative; padding: 0 0 10px 18px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 15px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.tl-text { color: var(--ink); font-size: var(--fs); }
.task-list li, .doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.task-list li:last-child, .doc-list li:last-child { border-bottom: 0; }
.task-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { color: var(--ink); font-weight: 600; font-size: var(--fs); }
.task-body { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: var(--fs-xs); margin-top: 2px; } /* HL-2-03 */
.inline-form { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .inline-form.row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; } }
.origin a { font-weight: 600; }

/* ---------- role grid ---------- */
.grid-table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
.grid-table th, .grid-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.grid-table thead th { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); }
.grid-table td.level { text-align: center; width: 70px; }
.grid-table th[scope="row"] { color: var(--ink); font-weight: 600; }
.grid-table .module-desc { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.grid-table input[type="radio"] { width: 16px; height: 16px; accent-color: var(--lamp); cursor: pointer; }
.grid-table input[type="radio"]:disabled { cursor: not-allowed; }
.level-pill { display: inline-block; min-width: 38px; text-align: center; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 700; line-height: 17px; }
.level-edit { background: var(--lamp); color: var(--on-dark); }
.level-view { background: var(--mint-wash); color: var(--lamp); border: 1px solid var(--mint-line); }
.level-none { color: var(--muted); }

/* ---------- dialogs ---------- */
dialog.dialog {
  border: 0; padding: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); color: var(--text); background: var(--surface);
}
dialog.dialog[open] { animation: dialog-in 160ms var(--ease-out); }
@keyframes dialog-in { from { transform: translateY(8px) scale(0.985); } to { transform: none; } }
dialog.dialog.wide { width: min(780px, calc(100vw - 24px)); }
dialog.dialog.wide.sm-bulk { width: min(900px, calc(100vw - 24px)); }
dialog.dialog::backdrop { background: rgba(11, 31, 26, 0.45); }
.dialog-form { display: grid; gap: 12px; padding: 16px 18px 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-x { margin: -4px -6px -4px 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.dialog-body { display: grid; gap: 12px; }
details.more { border: 1px solid var(--line); border-radius: var(--r); padding: 0 10px; }
details.more > summary { cursor: pointer; min-height: 34px; display: flex; align-items: center; font-weight: 600; color: var(--ink); }
details.more[open] { padding-bottom: 10px; }

/* ---------- consultations (CLEAR-13) ---------- */
.chip-link { text-decoration: none; border-color: var(--focus-light); color: var(--lamp); }
.chip-link:hover { text-decoration: underline; }
.booking-summary { color: var(--muted); font-size: var(--fs-sm); margin: -4px 0 8px; }
.booking-table tbody + tbody .day-row th { border-top: 1px solid var(--line-strong); }
.day-row th { background: var(--surface-2); color: var(--ink); font-weight: 650; font-size: var(--fs-sm); padding: 6px 12px; }
.day-row .sub { display: inline; font-weight: 500; }
.day-row:hover { background: var(--surface-2); }
@media (min-width: 900px) { .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 899px) { .form-grid.cols-3 { grid-template-columns: 1fr 1fr; } }
.settings-form { display: grid; gap: 12px; }
.settings-form .panel + .panel { margin-top: 0; }
.hours-table { max-width: 520px; }
.hours-table td { width: 130px; }
.hours-table td:nth-child(2) { width: 56px; }
.hours-table input[type="checkbox"], .host-line input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--lamp); }
.input.time { height: var(--control-h-sm); padding: 0 6px; width: 112px; }
.host-list, .holiday-list { list-style: none; margin: 0; padding: 0; }
.host-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.host-row:last-child { border-bottom: 0; }
.host-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.host-line .strong { color: var(--ink); font-weight: 600; }
.own-hours { margin-top: 8px; }
.holiday-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: var(--fs); color: var(--ink); }
.holiday-list li:last-child { border-bottom: 0; }
.holiday-list li.hint { color: var(--muted); }
.settings-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- brokers (CLEAR-18) ---------- */
.filters.broker-filters { margin-bottom: 6px; }
.broker-count { margin-bottom: 8px; }
.broker-table tbody tr.is-off .row-link, .broker-table tbody tr.is-off .code { color: var(--muted); }
.code {
  font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 6px; white-space: nowrap;
}
.link-cell { display: flex; align-items: center; gap: 8px; }
.link-path { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
/* desktop: the whole row fits, Edit included (sit-regression F9). The name keeps its words, the code may break at its
   hyphens, and the link path, which only repeats the code, shows on wide screens (Copy link always copies it) */
@media (min-width: 640px) {
  .broker-table .c-broker { min-width: 170px; }
  .broker-table .code { white-space: normal; overflow-wrap: break-word; }
}
@media (min-width: 640px) and (max-width: 1599px) { .broker-table .c-link .link-path { display: none; } }
.count-link { font-weight: 700; text-decoration: none; display: inline-block; min-width: 22px; }
.count-link:hover { text-decoration: underline; }
.copy-btn { min-width: 84px; }
.copy-btn.is-done { border-color: var(--focus-light); background: var(--mint-wash); color: var(--lamp); }
.broker-empty { display: grid; gap: 8px; max-width: 600px; }
.broker-top { display: grid; gap: 12px; margin-bottom: 12px; }
.broker-top > .panel + .panel { margin-top: 0; }
@media (min-width: 1100px) { .broker-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; } }
.copy-field { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.copy-field .input { flex: 1 1 auto; font-size: var(--fs-sm); color: var(--ink); background: var(--surface-2); }
.copy-field .copy-btn { min-width: 78px; }
.broker-facts { margin-top: 12px; border-top: 1px solid var(--line); }
.broker-none { color: var(--muted); padding: 6px 0 4px; }
.tally { list-style: none; margin: 0 0 10px; padding: 0; }
.tally li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.tally li:last-child { border-bottom: 0; }
.tally-figure { font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1; color: var(--ink); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.tally-label { color: var(--ink); font-weight: 600; font-size: var(--fs); }
.broker-form > .field { align-content: start; }
.broker-form .field > .hint { color: var(--muted); font-weight: 400; }
.link-preview { grid-column: 1 / -1; display: grid; gap: 2px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-sm); }
.link-preview-label { color: var(--muted); font-weight: 600; }
.link-preview-url { color: var(--ink); overflow-wrap: anywhere; }
.code-input { font-family: var(--mono); font-size: var(--fs); }
.broker-switches { gap: 4px; }
.broker-switches legend { margin-bottom: 4px; }
.check-note { margin: -2px 0 6px 22px; }

/* phones: each row of a .cards-on-phone table is a card; data-label names a value whose column header is hidden */
@media (max-width: 639px) {
  .table.cards-on-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table.cards-on-phone, .table.cards-on-phone tbody { display: block; }
  .table.cards-on-phone tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .table.cards-on-phone tbody tr:last-child { border-bottom: 0; }
  .table.cards-on-phone tbody td { display: block; padding: 0; border: 0; text-align: left; }
  .table.cards-on-phone td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; margin-right: 4px; }
  .table.cards-on-phone td.empty { flex: 1 1 100%; text-align: center; padding: 12px 0; }
  /* the brokers list is a compact list now: one line a broker on phones (admin.css "compact lists") */
  .referral-table.cards-on-phone tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .referral-table .c-business { grid-column: 1 / -1; }
  .referral-table .c-applicant { order: 1; color: var(--ink); }
  .referral-table .c-amount { order: 2; text-align: right; font-weight: 650; color: var(--ink); }
  .referral-table .c-stage { order: 3; grid-column: 1 / -1; }
  .referral-table .c-told { order: 4; }
  .referral-table .c-linked { order: 5; text-align: right; color: var(--muted); font-size: var(--fs-sm); }
  .copy-field { flex-wrap: wrap; }
  .copy-field .copy-btn { flex: 1 1 100%; }
}
/* WP5c: "What brokers are told" under the brokers table (views/brokers-settings.js) */
.broker-told { margin-top: var(--sp-3); }
.broker-preview { display: grid; gap: 6px; margin-top: var(--sp-2); }
.broker-preview .sub-h { margin: var(--sp-2) 0 0; }
/* ---------- end brokers ---------- */

/* ---------- toasts ---------- */
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 260; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start;
  background: var(--ledger); color: var(--on-dark-2); padding: 10px 8px 10px 12px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  font-size: var(--fs); animation: toast-in 200ms var(--ease-out);
}
@keyframes toast-in { from { transform: translateY(12px); } to { transform: none; } } /* no fade: text keeps its contrast while it moves */
.toast-icon { width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: var(--mint); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.toast.is-problem .toast-icon { stroke: var(--brass); }
.toast.is-info .toast-icon { stroke: var(--on-dark-2); }
.toast-text { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.toast-title { color: var(--on-dark); font-weight: 650; }
.toast-close { width: 22px; height: 22px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--on-dark-3); display: inline-grid; place-items: center; cursor: pointer; }
.toast-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--on-dark); }
.toast-close .icon { width: 13px; height: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .spinner { animation: spin 1.4s linear infinite !important; }
}
@media (max-width: 479px) {
  .panel { padding: 12px; }
  h1 { font-size: var(--fs-lg); }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .figure { font-size: 1.5rem; }
}

/* ---------- Conversations (views/inbox.js), redesign of 27 Nov 2026 ----------
 * Owner: "I should know what I should do when I log in ... very simple, easy to read and understand." Three panes at
 * full height: the list (search, a labelled Filters button, the Open / Unread / Starred / Done views, rows grouped under
 * Needs a reply and Waiting for customer), the thread (its name and state in words, labelled controls, the automatic
 * replies bar, chat bubbles, the composer that says who sees what) and the details panel, which folds away. Who wrote
 * what is told by side, fill and words: the person on the left; staff, the AI assistant and the automation on the
 * right, each named; internal notes as locked brass cards; what the automation did as small muted lines. Field icons
 * reuse the compact lists' accents (--fx-*, PR #155) with the same values as fallbacks. 1280+: three panes; 900-1279:
 * list and thread, the details over the thread; below 900: one pane at a time, each with a way back. */
.inbox-page { display: flex; flex-direction: column; min-height: 0; height: calc(100dvh - var(--page-y) - 12px); min-height: 520px; }
.main:has(.inbox-page) { padding-bottom: 12px; }
.inbox-head { margin-bottom: 8px; min-height: 32px; }
.inbox-sync { gap: 4px; }
.inbox-updated { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; margin-right: 6px; }
.inbox-updated::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.inbox-updated.is-live::before { background: #2f9e74; box-shadow: 0 0 0 3px rgba(47, 158, 116, 0.18); }
.alerts-button { gap: 6px; padding: 0 8px; }
.alert-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--brass); color: var(--ledger);
  font-size: var(--fs-2xs); font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.alert-count[hidden] { display: none; }
.alert-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; max-height: 50vh; overflow-y: auto; }
.alert-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.alert-item.is-new .alert-what { font-weight: 700; color: var(--ink); }
.alert-item.is-new::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp); align-self: center; }
.alert-what { flex: 1 1 200px; }
.alert-open { font-weight: 600; }

.inbox {
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; position: relative;
}
.inbox-list { overflow-y: auto; min-height: 0; overscroll-behavior: contain; display: flex; flex-direction: column; background: var(--surface); }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); }
.inbox-contact { min-height: 0; overflow-y: auto; background: var(--surface-2); overscroll-behavior: contain; }

/* first-time hints: one line, dismissed for good with "Got it" */
.conv-hint { display: flex; align-items: flex-start; gap: 8px; margin: 8px 10px 2px; padding: 6px 10px; border-radius: var(--r); background: var(--mint-wash); border: 1px solid var(--mint-line); color: var(--ink); font-size: var(--fs-xs); line-height: 1.4; }
.conv-hint > .icon { width: 14px; height: 14px; color: var(--lamp); margin-top: 1px; }
.conv-hint > span { flex: 1; min-width: 0; }
.conv-hint-x { flex: none; font-size: var(--fs-xs); color: var(--lamp); }
.inbox-thread > .conv-hint { margin: 8px 16px 0; }
.composer > .conv-hint, .contact-body > .conv-hint { margin: 0; }

/* the list's controls */
.conv-controls { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 10px 0; display: grid; gap: 8px; }
.conv-search-row { display: flex; gap: 6px; align-items: center; position: relative; }
.conv-search { flex: 1; position: relative; min-width: 0; }
.conv-search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.conv-search-input { padding-left: 30px; height: 32px; background: var(--surface-2); }
.conv-search-input::placeholder { color: var(--faint); }
.conv-filter-btn { height: 32px; gap: 5px; padding: 0 9px; flex: none; }
.conv-filter-btn .dot-count { min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r-pill); background: var(--lamp); color: var(--on-dark); font-size: var(--fs-2xs); font-weight: 800; display: inline-grid; place-items: center; }
.conv-filter-btn[aria-expanded="true"] { background: var(--selected); border-color: var(--focus-light); color: var(--lamp); }
.conv-filters {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 5; display: grid; gap: 10px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.conv-filters .field > span { font-size: var(--fs-xs); color: var(--muted); }
.conv-checks { display: grid; gap: 0; }
.conv-filters-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; justify-self: start;
}
.chip-toggle .icon { width: 14px; height: 14px; }
.chip-toggle[aria-pressed="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--on-dark); }

/* Messages & comments (owner, 1 Dec 2026; views/social-inbox.js): the platform chips, the one note that nothing here
   answers on its own, the post a thread is on, and no Details panel */
.social-platforms { display: flex; flex-wrap: wrap; gap: 6px; }
a.chip-toggle { text-decoration: none; }
.social-platforms .chip-toggle[aria-current="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--on-dark); }
.social-auto-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; padding: 7px 12px; border-radius: var(--r); background: var(--mint-wash); border: 1px solid var(--mint-line); color: var(--ink); font-size: var(--fs-sm); line-height: 1.4; }
.social-auto-note > .icon { flex: none; width: 15px; height: 15px; color: var(--lamp); margin-top: 2px; }
.thread-post { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.thread-post > .icon { width: 13px; height: 13px; }
.composer-auto { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.composer-auto > .icon { flex: none; width: 13px; height: 13px; }
.inbox-page.is-social .inbox-contact { display: none !important; }
.conv-active { display: flex; flex-wrap: wrap; gap: 4px; }
.conv-active:empty { display: none; }
.active-chip { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 4px 0 8px; border-radius: var(--r-pill); background: var(--selected); color: var(--lamp); font-size: var(--fs-xs); font-weight: 600; border: 0; cursor: pointer; }
.active-chip .icon { width: 12px; height: 12px; }
.active-chip:hover { background: var(--mint-wash); text-decoration: line-through; }
.conv-tabs ul { list-style: none; margin: 0 -10px; padding: 0 6px; display: flex; gap: 2px; }
.conv-tab {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; color: var(--muted);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.conv-tab:hover { color: var(--ink); }
.conv-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.conv-tab:focus-visible { outline-offset: -3px; }
.tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--lamp); color: var(--on-dark);
  font-size: var(--fs-2xs); font-weight: 750; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.tab-count[hidden] { display: none; }

/* the list, in its plain-state groups */
.conv-list { padding: 2px 0 4px; }
.conv-group-h { margin: 0; }
.conv-group-head {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px 4px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 700 var(--fs-2xs)/1.2 var(--font); letter-spacing: 0.07em; text-transform: uppercase; text-align: left;
}
.conv-group-head:hover { color: var(--ink); }
.conv-group-head:focus-visible { outline-offset: -2px; }
.conv-group-caret { width: 12px; height: 12px; transition: transform 140ms var(--ease-out); }
.conv-group-head[aria-expanded="false"] .conv-group-caret { transform: rotate(-90deg); }
.conv-group-n {
  min-width: 18px; height: 17px; padding: 0 5px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: var(--fs-2xs); letter-spacing: 0; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.conv-group.is-reply .conv-group-head { color: var(--brass-ink); }
.conv-group.is-reply .conv-group-n { background: var(--brass-wash); border-color: var(--brass-line); color: var(--brass-ink); }
.conv-group.is-waiting .conv-group-head { color: var(--lamp); }
.conv-group.is-waiting .conv-group-n { background: var(--mint-wash); border-color: var(--mint-line); color: var(--lamp); }
.conv-group-list { list-style: none; margin: 0; padding: 0 0 4px; }
.conv {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 12px 7px 10px; color: var(--text);
  text-decoration: none; border-left: 2px solid transparent; transition: background-color 100ms var(--ease-out);
}
.conv:hover { background: var(--surface-2); }
.conv[aria-current="true"] { background: var(--selected); border-left-color: var(--lamp); }
.conv:focus-visible { outline-offset: -3px; }
.avatar-wrap { position: relative; width: 36px; height: 36px; flex: none; }
.avatar-lg {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 750;
  color: var(--av-ink, var(--lamp)); background: var(--av, var(--mint-wash)); letter-spacing: 0.01em;
}
.av-1 { --av: #e3f1ea; --av-ink: #1f5c48; } .av-2 { --av: #f4ecdb; --av-ink: #6e521c; } .av-3 { --av: #e4ecf3; --av-ink: #2b4a63; }
.av-4 { --av: #efe6ee; --av-ink: #5e3a59; } .av-5 { --av: #e8eee4; --av-ink: #3f5a2c; } .av-6 { --av: #f3e7e2; --av-ink: #7a3f2a; }
.staff-av {
  width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; letter-spacing: 0;
  font-size: 0.5625rem; font-weight: 800; color: var(--av-ink, var(--lamp)); background: var(--av, var(--mint-wash)); box-shadow: 0 0 0 1px rgba(11, 31, 26, 0.08);
}
.ch-badge {
  position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface); background: var(--lamp); color: var(--on-dark);
}
.conv[aria-current="true"] .ch-badge { box-shadow: 0 0 0 2px var(--selected); }
.ch-badge .icon { width: 10px; height: 10px; stroke-width: 2.2; }
.ch-facebook { background: #2d5a8c; color: #fff; }
.ch-instagram { background: #9a4a76; color: #fff; }
.ch-sms { background: var(--lamp); color: var(--on-dark); }
.ch-email { background: #5b6b8a; color: #fff; }
.ch-chat { background: #16805e; color: #fff; }
.ch-phone { background: var(--ledger); color: var(--mint); }
.ch-form { background: var(--brass-ink); color: #fff; }
.ch-portal { background: var(--ledger); color: var(--brass); }
.ch-imported { background: var(--surface); color: var(--muted); box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px var(--line-strong); }
.conv-body { display: grid; gap: 1px; min-width: 0; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-name { flex: 1; min-width: 0; color: var(--ink); font-weight: 550; font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.is-unread .conv-name { font-weight: 750; }
.conv.is-closed .conv-name { color: var(--muted); }
.conv-who { flex: none; display: inline-flex; }
.conv-when { flex: none; color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.conv.is-unread .conv-when { color: var(--lamp); font-weight: 650; }
.conv-preview { flex: 1; min-width: 0; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-by { color: var(--text); font-weight: 650; }
.conv.is-unread .conv-preview { color: var(--ink); }
.conv-marks { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.conv-mark { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: var(--r-pill); font-size: 0.625rem; font-weight: 700; white-space: nowrap; border: 1px solid; }
.conv-mark.is-flag { color: var(--brass-ink); background: var(--brass-wash); border-color: var(--brass-line); }
.conv-mark.is-problem { color: var(--danger); background: var(--danger-wash); border-color: #f1b8b2; }
.conv-mark.is-off { color: var(--muted); background: var(--paper); border-color: var(--line-strong); }
.conv-mark.is-auto { color: var(--lamp); background: var(--mint-wash); border-color: var(--mint-line); }
.conv-mark-icon { display: inline-flex; }
.conv-mark-icon .icon { width: 12px; height: 12px; color: var(--muted); }
.conv-marks .star-on { fill: var(--brass); stroke: var(--brass-ink); }
.conv-count {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r-pill); background: var(--lamp); color: var(--on-dark);
  font-size: var(--fs-2xs); font-weight: 750; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.dot-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); }
.conv-more { padding: 10px; text-align: center; }
.conv-more:has(> [hidden]) { display: none; }
.conv-empty { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }

/* the thread: its name and state, then labelled controls */
.thread-empty { margin: auto; padding: 32px 24px; max-width: 380px; text-align: center; display: grid; gap: 6px; color: var(--text); justify-items: center; }
.thread-empty .icon { width: 28px; height: 28px; color: var(--line-strong); stroke-width: 1.4; }
.thread-empty h2 { font-size: var(--fs-md); }
.thread-loading { margin: auto; }
.thread-head { display: grid; gap: 6px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.thread-line { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.thread-line > .thread-contact-btn { flex: none; margin-top: -2px; }
.thread-back { display: none; }
.refresh-btn, .thread-back { gap: 6px; }
.refresh-btn .icon, .thread-back .icon { width: 16px; height: 16px; }
/* the name first and whole; the chips whole; the channel line takes what is left and is the only part that truncates */
.thread-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.thread-name { flex: 0 1 auto; min-width: 0; max-width: 100%; font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-name:focus { outline: none; }
.thread-name:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; border-radius: 4px; }
.thread-kind { flex: 1 1 0; min-width: 120px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; }
.thread-kind span { overflow: hidden; text-overflow: ellipsis; }
.thread-kind .icon { width: 13px; height: 13px; }
.thread-chips { flex: none; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.thread-chips:empty { display: none; }
.state-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.state-chip.is-reply { color: var(--brass-ink); background: var(--brass-wash); border-color: var(--brass-line); }
.state-chip.is-waiting { color: var(--lamp); background: var(--mint-wash); border-color: var(--mint-line); }
.state-chip.is-done { color: var(--muted); background: var(--paper); border-color: var(--line-strong); }
.chip-paused { border-color: var(--brass-line); color: var(--brass-ink); background: var(--brass-wash); }
.thread-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* under the name, from the left (shell.css's older rule pushed the icon toolbar to the right) */
.thread-head > .thread-tools { margin-left: 0; }
.thread-contact-btn[aria-expanded="true"] { background: var(--selected); color: var(--lamp); }
.done-btn .icon { color: var(--lamp); stroke-width: 2.2; }
.assign-btn { max-width: 100%; }
.assign-k { color: var(--muted); font-weight: 500; }
.assign-v { font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a link found by a typed email or phone (security review of 26 Nov 2026) */
.thread-unverified { display: block; margin-top: 2px; color: var(--brass-ink); font-size: var(--fs-xs); font-weight: 600; }

/* the labelled menus (views/inbox-menu.js): Assigned to, More */
.menu-wrap { position: relative; display: inline-flex; min-width: 0; }
.menu-btn { gap: 6px; min-width: 0; }
.menu-btn .menu-caret { width: 12px; height: 12px; color: var(--muted); }
.menu-btn[aria-expanded="true"] { border-color: var(--focus-light); background: var(--selected); }
.menu-pop {
  position: absolute; top: calc(100% + 4px); z-index: 8; min-width: 230px; max-width: min(320px, calc(100vw - 24px)); max-height: 340px; overflow-y: auto;
  display: grid; gap: 1px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.menu-pop[data-align="end"] { right: 0; }
.menu-pop[data-align="start"] { left: 0; }
.menu-heading { padding: 4px 8px 6px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink); font: inherit; font-size: var(--fs); text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item:focus-visible { background: var(--hover); outline-offset: -2px; }
.menu-item[aria-checked="true"] { background: var(--selected); }
.menu-item > .icon { width: 15px; height: 15px; color: var(--muted); flex: none; }
.menu-item > .staff-av { width: 20px; height: 20px; font-size: 0.5625rem; }
.menu-item > .icon.menu-check { color: var(--lamp); margin-left: auto; stroke-width: 2.4; }
.menu-blank { width: 15px; flex: none; }
.menu-words { display: grid; flex: 1; min-width: 0; }
.menu-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-hint { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }

/* automatic replies: a switch with one line saying what it means */
.auto-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); }
.auto-bar > .icon { width: 14px; height: 14px; flex: none; }
.auto-bar.is-on > .icon { fill: var(--brass); stroke: var(--brass-ink); stroke-width: 1.4; }
.auto-bar.is-paused { background: var(--brass-wash); border-bottom-color: var(--brass-line); }
.auto-bar.is-paused > .icon { color: var(--brass-ink); }
.auto-words { flex: 1; min-width: 0; line-height: 1.4; color: var(--muted); }
.auto-words strong { color: var(--ink); font-weight: 700; }
.auto-bar.is-paused .auto-words { color: var(--text); }
.auto-switch { flex: none; gap: 8px; }
.switch-track { position: relative; width: 26px; height: 16px; border-radius: var(--r-pill); background: var(--line-strong); flex: none; transition: background-color 140ms var(--ease-out); }
.switch-dot { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 140ms var(--ease-out); }
.auto-switch[aria-checked="true"] .switch-track { background: #2f9e74; }
.auto-switch[aria-checked="true"] .switch-dot { transform: translateX(10px); }

/* the messages */
.thread-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 16px; background: var(--surface-2); overscroll-behavior: contain; }
.thread-body:focus-visible { outline-offset: -2px; }
.thread-none { color: var(--muted); padding: 24px 0; text-align: center; }
.thread-msgs { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 2px; max-width: 860px; }
.day-rule { align-self: center; margin: 14px 0 6px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 10px; }
.new-rule { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; color: var(--lamp); font-size: var(--fs-xs); font-weight: 750; }
.new-rule::before, .new-rule::after { content: ""; flex: 1; height: 1px; background: var(--lamp); opacity: 0.45; }
.msg { display: flex; flex-direction: column; max-width: min(620px, 80%); margin-top: 8px; }
.msg.is-cont { margin-top: 0; }
.msg-in { align-self: flex-start; align-items: flex-start; }
.msg-out { align-self: flex-end; align-items: flex-end; }
.msg-by { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin: 0 4px 3px; }
.msg-by .who { color: var(--text); }
.by-tag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: var(--r-pill); border: 1px solid; font-size: var(--fs-2xs); font-weight: 700; }
.by-tag .icon { width: 11px; height: 11px; stroke-width: 1.4; }
.by-tag.is-ai { background: var(--mint-wash); border-color: var(--mint-line); color: var(--lamp); }
.by-tag.is-ai .icon { fill: var(--lamp); stroke: var(--lamp); }
.by-tag.is-auto { background: var(--paper); border-color: var(--line-strong); color: var(--text); }
.by-tag.is-auto .icon { fill: var(--brass); stroke: var(--brass-ink); }
.by-detail { color: var(--muted); font-weight: 500; }
.by-av { width: 16px; height: 16px; font-size: 0.5rem; }
.bubble { padding: 7px 11px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); min-width: 0; max-width: 100%; box-shadow: var(--shadow-sm); }
.msg-in .bubble { border-bottom-left-radius: 4px; }
.msg-out .bubble { border-bottom-right-radius: 4px; }
.side-staff .bubble { background: var(--mint-wash); border-color: var(--mint-line); }
.by-ai .bubble { background: var(--surface); border-color: var(--mint-line); }
.by-auto .bubble { background: var(--surface); border-color: var(--line-strong); }
.msg.is-failed .bubble { border: 1px dashed #d9877d; background: #fff8f7; }
.msg.is-like .bubble { padding: 4px 10px; font-size: var(--fs-sm); color: var(--muted); }
.msg.is-unsent .msg-text { font-style: italic; color: var(--muted); }
.msg-subject { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 0.84375rem; line-height: 1.5; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; font-size: var(--fs-2xs); color: var(--faint); margin: 2px 4px 0; font-variant-numeric: tabular-nums; }
.msg-problem { display: inline-flex; align-items: center; gap: 3px; color: var(--danger); font-weight: 700; }
.msg-problem .icon { width: 11px; height: 11px; }
.msg-retry { font-size: var(--fs-2xs); color: var(--danger); font-weight: 700; }
.msg-ok { color: var(--focus-light); }
.avatar {
  width: 16px; height: 16px; border-radius: 50%; background: var(--lamp); color: var(--on-dark); font-size: 0.5rem; font-weight: 800;
  display: inline-grid; place-items: center; flex: none;
}
.avatar::before { content: attr(data-initials); }
/* an internal note: a locked brass card across the middle, never a bubble */
.msg-note { align-self: center; width: min(640px, 94%); max-width: none; margin: 10px 0 4px; padding: 8px 12px; background: var(--brass-wash); border: 1px solid var(--brass-line); border-left: 3px solid var(--brass-ink); border-radius: var(--r); }
.msg-note .msg-by { margin: 0 0 3px; color: var(--brass-ink); font-weight: 700; }
.msg-note .msg-by .icon { width: 12px; height: 12px; }
.msg-note .msg-by .who { color: var(--brass-ink); font-weight: 600; }
.msg-note .msg-meta { margin: 3px 0 0; }
/* what the automation (or staff) did: small, muted, centred; three or more in a row fold into one line */
.thread-event { align-self: center; max-width: 90%; color: var(--muted); font-size: var(--fs-2xs); text-align: center; padding: 2px 10px; margin: 3px 0; display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center; }
.thread-event .icon { width: 10px; height: 10px; flex: none; }
.thread-event.is-auto-event .icon { fill: var(--brass); stroke: var(--brass-ink); stroke-width: 1.4; }
.thread-event time, .thread-event-group time { color: var(--faint); }
.thread-event-group { align-self: center; max-width: 90%; margin: 4px 0; color: var(--muted); font-size: var(--fs-2xs); }
.thread-event-group summary { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--r-pill); cursor: pointer; list-style: none; }
.thread-event-group summary::-webkit-details-marker { display: none; }
.thread-event-group summary::after { content: "Show"; color: var(--text); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }
.thread-event-group details[open] summary::after { content: "Hide"; }
.thread-event-group summary:hover { background: var(--hover); }
.thread-event-group summary .icon { width: 10px; height: 10px; fill: var(--brass); stroke: var(--brass-ink); stroke-width: 1.4; }
.thread-event-group ul { list-style: none; margin: 4px 0 0; padding: 6px 10px; display: grid; gap: 2px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

/* the composer: Reply to customer or Internal note, each saying who sees it */
.composer { display: grid; gap: 6px; padding: 8px 14px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.composer-modes[hidden] { display: none; }
.composer-tab {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); color: var(--muted); text-align: left; cursor: pointer; transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.composer-tab:hover { border-color: var(--line-strong); color: var(--text); }
.composer-tab .icon { width: 16px; height: 16px; flex: none; }
.composer-tab-words { display: grid; min-width: 0; line-height: 1.25; }
.composer-tab-label { color: var(--text); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-tab-sub { font-size: var(--fs-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-tab[data-mode="reply"][aria-pressed="true"] { background: var(--mint-wash); border-color: var(--lamp); color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp); }
.composer-tab[data-mode="note"][aria-pressed="true"] { background: var(--brass-wash); border-color: var(--brass-ink); color: var(--brass-ink); box-shadow: inset 0 0 0 1px var(--brass-ink); }
.composer-tab[aria-pressed="true"] .composer-tab-label { color: var(--ink); }
.composer-explain { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; color: var(--text); font-size: var(--fs-xs); }
.composer-explain[hidden] { display: none; }
.composer.is-note .composer-explain { color: var(--brass-ink); font-weight: 600; }
.composer-window { display: inline-flex; align-items: center; gap: 4px; color: var(--lamp); font-weight: 700; white-space: nowrap; }
.composer-window .icon { width: 12px; height: 12px; }
.composer-notice { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.composer-notice .icon { width: 14px; height: 14px; margin-top: 2px; flex: none; color: var(--muted); }
.composer-notice > span { flex: 1; min-width: 0; }
.composer-notice > .btn { flex: none; }
.composer-box { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); transition: border-color 120ms, box-shadow 120ms; }
.composer-box:focus-within { border-color: var(--focus-light); box-shadow: 0 0 0 3px rgba(31, 107, 84, 0.14); }
.composer.is-note .composer-box { background: var(--brass-wash); border-color: var(--brass-line); }
.composer.is-note .composer-box:focus-within { border-color: var(--brass-ink); box-shadow: 0 0 0 3px rgba(122, 90, 30, 0.14); }
.composer-text { display: block; width: 100%; min-height: 40px; max-height: 220px; height: 40px; padding: 10px 12px 4px; border: 0; background: transparent; resize: none; color: var(--ink); line-height: 1.45; font-size: 0.84375rem; outline: none; }
.composer-text::placeholder { color: var(--faint); }
.composer-text:disabled { cursor: not-allowed; }
.composer-bar { display: flex; align-items: center; gap: 4px 6px; padding: 4px 6px 6px 8px; flex-wrap: wrap; }
.composer-left { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.composer-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.composer-sides, .composer-by { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.composer-sides[hidden], .composer-by[hidden] { display: none; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); }
.seg button {
  height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted);
  font-weight: 600; font-size: var(--fs-xs); cursor: pointer; transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 31, 26, 0.14); }
.composer-channel { height: 26px; width: auto; min-width: 0; max-width: 190px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink); padding: 0 4px 0 8px; border-radius: var(--r-pill); background: var(--surface-2); }
.composer-snippets { height: 26px; padding: 0 8px; font-size: var(--fs-xs); }
.composer-count { color: var(--faint); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; max-width: 320px; text-align: right; }
.composer-send .icon { width: 14px; height: 14px; }
.composer-info { position: relative; }
.composer-info > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: var(--r); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.composer-info > summary::-webkit-details-marker { display: none; }
.composer-info > summary:hover { background: var(--hover); }
.composer-info > summary .icon { width: 14px; height: 14px; color: var(--muted); }
.composer-info[open] > summary { background: var(--selected); color: var(--lamp); }
.composer-rules {
  position: absolute; bottom: calc(100% + 8px); left: -40px; z-index: 6; width: min(420px, 80vw); display: grid; gap: 6px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); color: var(--text);
}
.composer-rules h3 { font-size: var(--fs-sm); }
.composer-rules ul { margin: 0; padding-left: 16px; display: grid; gap: 2px; }
.composer-blocked { color: var(--text); }
.bot-indicator { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 650; color: var(--muted); white-space: nowrap; background: var(--surface-2); border: 1px solid var(--line); }
.bot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.bot-indicator.is-on { color: var(--lamp); background: var(--mint-wash); border-color: var(--mint-line); }
.bot-indicator.is-on .bot-dot { background: #2f9e74; }
.snippet-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; }
.snippet { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.snippet-body { flex: 1 1 240px; min-width: 0; }
.snippet-name { font-weight: 650; color: var(--ink); }
.snippet-text { color: var(--text); font-size: var(--fs); white-space: pre-wrap; overflow-wrap: anywhere; }
.snippet-actions { display: flex; gap: 4px; }

/* the details panel: titled sections, each line with its field's small coloured icon */
.contact-body { padding: 12px 12px 18px; display: grid; gap: 10px; align-content: start; }
.contact-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-title { font-size: var(--fs-2xs); font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.contact-title:focus { outline: none; }
.contact-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.contact-who .avatar-lg { width: 40px; height: 40px; font-size: var(--fs-sm); }
.contact-who-text { display: grid; min-width: 0; }
.contact-name { font-size: var(--fs-md); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; }
.contact-who .hint { font-size: var(--fs-xs); }
.contact-stage { display: flex; gap: 4px; align-items: center; width: 100%; }
.contact-stage .select { height: 28px; font-size: var(--fs-sm); min-width: 0; flex: 1; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-sec { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.cp-sec-title { margin: 0; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cp-lines { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); align-items: center; gap: 4px 10px; }
.cp-line { display: contents; }
.cp-line > dt, .cp-line > dd { min-height: 26px; display: flex; align-items: center; }
.cp-line > dt { gap: 7px; min-width: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.cp-line > dd { margin: 0; min-width: 0; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; flex-wrap: wrap; gap: 2px 4px; }
.cp-line > dd > span { min-width: 0; }
/* a control that needs the room (the stage and Move): the label on its own line, the control under it */
.cp-line.cp-wide > dd { grid-column: 1 / -1; }
.cp-line a { font-weight: 600; }
.cp-ic { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; color: var(--fx); background: color-mix(in srgb, var(--fx) 12%, var(--surface)); }
.cp-ic .icon { width: 13px; height: 13px; stroke-width: 2; }
.cp-ic.fx-person { --fx: var(--fx-person, #2f6fc4); } .cp-ic.fx-phone { --fx: var(--fx-phone, #1f8a5b); } .cp-ic.fx-mail { --fx: var(--fx-mail, #c2621f); }
.cp-ic.fx-business { --fx: var(--fx-business, #6b56c9); } .cp-ic.fx-money { --fx: var(--fx-money, #0f7f6e); } .cp-ic.fx-source { --fx: var(--fx-source, #b8487c); }
.cp-ic.fx-owner { --fx: var(--fx-owner, #2b7f96); } .cp-ic.fx-date { --fx: var(--fx-date, #8a6a24); } .cp-ic.fx-stage { --fx: var(--fx-stage, #52607a); }
.cp-ic.fx-tag { --fx: var(--fx-tag, #7a5a1e); }
.cp-empty { color: var(--faint); font-style: italic; font-weight: 400; font-size: var(--fs-sm); }
.chip.cp-tag { background: var(--tag-bg, #eef3f8); border-color: var(--tag-line, #cfdbe7); color: var(--tag-ink, #2d4a63); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.contact-list li { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.contact-list .strong { color: var(--ink); font-weight: 600; }
.contact-back { display: none; justify-self: start; }

/* linking a conversation to an application */
.link-search { display: flex; align-items: end; gap: 6px; }
.link-search .field { flex: 1; }
.link-results { display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }
.link-results:empty { display: none; }
.link-option { align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); min-height: 38px; }
.link-option input { margin-top: 2px; flex: none; }
.link-option:has(input:checked) { border-color: var(--focus-light); background: var(--mint-wash); }
.link-option .strong { color: var(--ink); font-weight: 600; }

@media (min-width: 900px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox-list { border-right: 1px solid var(--line); }
  /* the details open over the thread */
  .inbox-contact { display: none; }
  .inbox-page.show-contact .inbox-contact { display: block; grid-column: 2; grid-row: 1; z-index: 4; background: var(--surface-2); }
  .inbox-page.show-contact .inbox-thread { visibility: hidden; }
  .inbox-page.show-contact .contact-back { display: inline-flex; }
}
@media (min-width: 1280px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr) 290px; }
  .inbox-page.contact-folded .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox-contact { display: block; border-left: 1px solid var(--line); }
  .inbox-page.contact-folded .inbox-contact, .inbox-page:not(.has-thread) .inbox-contact { display: none; }
  .inbox-page:not(.has-thread) .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox-page.show-contact .inbox-contact { grid-column: 3; }
  .inbox-page.show-contact .inbox-thread { visibility: visible; }
  .inbox-page.show-contact .contact-back { display: none; }
}
@media (min-width: 1440px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr) 300px; }
  .inbox-page.contact-folded .inbox, .inbox-page:not(.has-thread) .inbox { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .inbox-page { height: calc(100dvh - 48px - var(--page-y) - 12px); min-height: 440px; }
  /* reading a conversation on a phone: the list's counts and Alerts (in the header bar) give their room to the messages */
  .shell:has(.inbox-page.has-thread) .topbar-slot:has(.inbox-head) { display: none; }
  .inbox-page.has-thread .inbox-head, .inbox-page.has-thread .inbox-list { display: none; }
  .inbox-page:not(.has-thread) .inbox-thread { display: none; }
  .inbox-contact { display: none; }
  .inbox-page.show-contact .inbox-thread { display: none; }
  .inbox-page.show-contact .inbox-contact { display: block; }
  .inbox-page.show-contact .contact-back { display: inline-flex; }
  .thread-back { display: inline-flex; align-items: center; gap: 6px; margin-left: -4px; }
  .thread-head { padding: 6px 8px 8px; }
  .thread-kind { flex-basis: 100%; min-width: 0; }
  .auto-bar { padding: 6px 10px; align-items: flex-start; }
  .auto-switch { align-self: center; }
  .thread-body { padding: 6px 10px 12px; }
  .inbox-thread > .conv-hint { margin: 6px 10px 0; }
  .composer { padding: 6px 8px 10px; }
  .msg { max-width: 88%; }
  .composer-count { display: none; }
  /* a phone keeps its height for the messages: the thread's and the composer's tips wait for a wider screen, and the
   * automatic replies line keeps to two lines (all of it is the switch's description) */
  .inbox-thread > .conv-hint, .composer > .conv-hint { display: none; }
  .auto-words { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .composer-tab { padding: 4px 8px; }
  .composer-channel { max-width: 55vw; }
  .menu-pop[data-align="end"] { right: 0; }
  .menu-pop[data-align="start"] { left: 0; }
}
@media (forced-colors: active) {
  .state-chip, .conv-mark, .by-tag, .cp-ic { border: 1px solid CanvasText; }
  .switch-track { border: 1px solid CanvasText; }
}
/* ---------- end admin inbox ---------- */

/* ---------- reports (CLEAR-17) ---------- */
/* Chart greens, one hue (~163°) from the ledger family, checked with the dataviz palette validator on white:
 * --rpt-bar (one series) is inside the lightness band, above the chroma floor and 3:1 on white; the four funnel
 * steps are an ordinal ramp (monotone lightness, steps >= 0.06 apart, the light end 2.18:1 on white, so every bar
 * also carries its figure as text). Text never wears these colours: names and figures stay ink and muted. */
.rpt {
  --rpt-bar: #16805e;
  --rpt-step-1: #7cbda0;
  --rpt-step-2: #3f9877;
  --rpt-step-3: #16805e;
  --rpt-step-4: #0f4d39;
  --rpt-reached: #7cbda0;
  --rpt-now: #0f4d39;
}
.rpt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 6px 8px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.rpt-periods { display: inline-flex; flex-direction: row; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); max-width: 100%; }
.rpt-period { position: relative; display: inline-flex; }
.rpt-period input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rpt-seg {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  color: var(--text); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}
.rpt-period:hover .rpt-seg { color: var(--ink); background: rgba(11, 31, 26, 0.05); }
.rpt-period input:checked + .rpt-seg { background: var(--ledger); color: var(--on-dark); }
.rpt-period input:focus-visible + .rpt-seg { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.rpt-short { display: none; }
.rpt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; }
.rpt-when { display: grid; gap: 0; text-align: right; }
.rpt-range { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }
.rpt-asof { color: var(--muted); font-size: var(--fs-xs); }
.rpt-refresh-wrap { display: flex; align-items: center; gap: 8px; }
.rpt-wait { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.rpt-refresh[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.rpt-refresh[aria-disabled="true"]:active { transform: none; }
.rpt-refresh[aria-disabled="true"]:hover { border-color: var(--line-strong); }
@media (max-width: 767px) {
  .rpt-meta { margin-left: 0; width: 100%; justify-content: space-between; }
  .rpt-when { text-align: left; }
}
@media (max-width: 559px) {
  .rpt-periods { display: flex; width: 100%; }
  .rpt-period { flex: 1 1 auto; }
  .rpt-seg { justify-content: center; width: 100%; padding: 0 6px; height: 40px; }
  .rpt-row, .rpt-compact .rpt-row { min-height: 40px; }
  .rpt-long { display: none; }
  .rpt-short { display: inline; }
}

.rpt-body { transition: opacity 200ms var(--ease-out); }
.rpt-body.is-stale { opacity: 0.5; pointer-events: none; }
.rpt-empty { color: var(--muted); padding: 16px 4px; }
.rpt-error { display: grid; gap: 8px; justify-items: start; }

.rpt-kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
@media (min-width: 768px) { .rpt-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
@media (max-width: 767px) { .rpt-kpi-leads { grid-column: 1 / -1; } }
.rpt-kpi { display: grid; align-content: start; gap: 1px; min-width: 0; }
.rpt-kpi .figure { font-variant-numeric: lining-nums proportional-nums; margin-top: 2px; overflow-wrap: anywhere; }
.rpt-kpi-amount { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: 1.25rem; line-height: 1.1; font-variant-numeric: lining-nums; }
.rpt-kpi-sub { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 1px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; text-wrap: pretty; }

.rpt-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.rpt-grid > .panel + .panel { margin-top: 0; }
@media (min-width: 1100px) { .rpt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }

.rpt-bars { list-style: none; margin: 0; padding: 0; }
.rpt-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "track track";
  gap: 3px 12px; align-items: center; padding: 4px 6px; min-height: 32px; border-radius: var(--r-sm); outline-offset: -2px;
  transition: background-color 120ms var(--ease-out);
}
@media (min-width: 640px) {
  .rpt-row { grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) minmax(44px, auto); grid-template-areas: "name track value"; }
}
.rpt-row:hover, .rpt-row:focus-visible { background: var(--surface-2); }
.rpt-name { grid-area: name; display: grid; min-width: 0; }
.rpt-name-text { color: var(--ink); font-weight: 600; font-size: var(--fs); line-height: 1.3; overflow-wrap: anywhere; }
.rpt-note { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.rpt-track { grid-area: track; display: block; min-width: 0; line-height: 0; }
.rpt-svg { display: block; width: 100%; height: 12px; overflow: visible; }
.rpt-axis { stroke: var(--line-strong); stroke-width: 1; }
.rpt-value { grid-area: value; text-align: right; color: var(--ink); font-weight: 650; font-size: var(--fs); font-variant-numeric: tabular-nums lining-nums; }
.rpt-row[data-zero] .rpt-name-text, .rpt-row[data-zero] .rpt-value { color: var(--muted); font-weight: 500; }
.rpt-fill rect { fill: var(--rpt-bar); }
.rpt-step-leads rect { fill: var(--rpt-step-1); }
.rpt-step-complete rect { fill: var(--rpt-step-2); }
.rpt-step-sent rect { fill: var(--rpt-step-3); }
.rpt-step-funded rect { fill: var(--rpt-step-4); }
.rpt-fill-reached rect { fill: var(--rpt-reached); }
.rpt-fill-now rect { fill: var(--rpt-now); }

.rpt-multiples { display: grid; gap: 16px 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .rpt-multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .rpt-multiples { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rpt-multiple { min-width: 0; }
.rpt-multiple h3 { font-size: var(--fs-sm); color: var(--ink); padding: 0 6px 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rpt-compact .rpt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "track track"; min-height: 32px; padding: 4px 6px; gap: 2px 10px; }

.rpt-stage-key { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; margin-bottom: 4px; }
.rpt-legend { list-style: none; margin: 0; padding: 0 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text); font-size: var(--fs-sm); }
.rpt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.rpt-swatch { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.rpt-swatch.rpt-fill-reached { background: var(--rpt-reached); }
.rpt-swatch.rpt-fill-now { background: var(--rpt-now); height: 5px; }
.rpt-cols, .rpt-pair { display: grid; grid-template-columns: 34px 48px; gap: 0 4px; text-align: right; }
.rpt-cols { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; padding: 0 6px; margin: 0 0 0 auto; }
.rpt-muted { color: var(--muted); font-weight: 500; }
@media (min-width: 640px) { .rpt-stages .rpt-row { grid-template-columns: minmax(140px, 30%) minmax(0, 1fr) 86px; } }

.rpt-numbers { margin-top: 8px; }
.rpt-numbers > summary { display: inline-flex; align-items: center; height: 30px; padding: 0 8px; cursor: pointer; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); border-radius: var(--r); }
.rpt-numbers > summary:hover { background: var(--hover); }
.rpt-numbers[open] > summary { margin-bottom: 6px; }

.rpt-tip {
  position: fixed; z-index: 70; pointer-events: none; display: grid; gap: 1px; max-width: 260px;
  padding: 7px 10px; border-radius: var(--r); background: var(--ledger); color: var(--on-dark-2);
  font-size: var(--fs-sm); line-height: 1.4; box-shadow: var(--shadow-lg);
}
.rpt-tip strong { color: var(--on-dark); font-size: var(--fs-md); font-variant-numeric: lining-nums; }
@media (forced-colors: active) {
  .rpt-svg rect { fill: CanvasText; }
  .rpt-fill-reached rect { fill: GrayText; }
  .rpt-period input:checked + .rpt-seg { outline: 2px solid Highlight; }
}

/* ---------- social content (CLEAR-20 UI: views/content*.js) ----------
 * The week as a Monday-to-Sunday strip, then one card per post with its image. Status reads in words and in the
 * ground of the strip cell: brass wash for "to review", mint wash for approved, paper for rejected. */
.content-banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 14px; margin-bottom: 12px; background: var(--brass-wash); border: 1px solid var(--brass-line); border-radius: var(--r-lg);
}
.banner-mark { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--brass-ink); }
.banner-title { color: var(--ink); font-weight: 650; }
.content-banner p + p { color: var(--text); font-size: var(--fs-sm); margin-top: 2px; }
.banner-channels { list-style: none; margin: 6px 0 0; padding: 0; }
.content-banner .banner-channels-none { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }

.content-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 20px; margin-bottom: 10px; }
.tenant-field { flex: 0 1 340px; min-width: min(100%, 220px); }
.field > span.content-hint { color: var(--muted); font-weight: 400; }
.post-meta .nowrap { white-space: nowrap; }
.week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-label { min-width: 12rem; text-align: center; padding: 0 4px; }
.week-label h2 { font-size: var(--fs-md); display: inline-flex; align-items: baseline; gap: 8px; }
.week-label p { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.week-rel { color: var(--brass-ink); font-size: var(--fs-xs); font-weight: 700; }
.week-step { min-width: 32px; }
.week-step [aria-hidden="true"] { font-size: var(--fs-lg); line-height: 1; }

.planned-weeks { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 12px; }
.planned-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.planned-weeks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.week-chip {
  display: inline-grid; gap: 0; min-height: 36px; align-content: center; padding: 3px 12px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); text-decoration: none; color: var(--ink);
  transition: border-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.week-chip:hover { border-color: var(--ink); }
.week-chip[aria-current="page"] { background: var(--ledger); border-color: var(--ledger); color: var(--on-dark); }
.week-chip-name { font-weight: 650; font-size: var(--fs-sm); }
.week-chip-state { font-size: var(--fs-xs); color: var(--muted); }
.week-chip[data-open="yes"] .week-chip-state { color: var(--brass-ink); font-weight: 600; }
.week-chip[aria-current="page"] .week-chip-state { color: var(--on-dark-2); }

.week-summary { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 8px; }
.week-summary strong { color: var(--ink); }
.week-strip {
  list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.week-day { display: flex; flex-direction: column; gap: 5px; min-width: 0; min-height: 100px; padding: 8px 8px 10px; border-left: 1px solid var(--line); }
.week-day:first-child { border-left: 0; }
.week-day.is-weekend { background: var(--surface-2); }
.day-head { display: flex; align-items: baseline; gap: 6px; }
.day-name { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.day-date { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.week-day.is-today .day-date { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--ledger); color: var(--on-dark); font-size: var(--fs-sm); }
.strip-post {
  position: relative; display: flex; align-items: flex-start; gap: 6px; width: 100%; min-height: 36px; padding: 5px 8px; text-align: left;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper); color: var(--ink); cursor: pointer;
  transition: border-color 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.strip-post:hover { border-color: var(--ink); }
.strip-post:active { transform: scale(0.98); }
.strip-post[data-status="draft"] { background: var(--brass-wash); border-color: var(--brass-line); }
.strip-post[data-status="approved"] { background: var(--mint-wash); border-color: var(--mint-line); }
.strip-post[data-status="rejected"] { color: var(--muted); }
.strip-dot { flex: none; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.strip-post[data-status="draft"] .strip-dot { background: var(--brass-ink); }
.strip-post[data-status="approved"] .strip-dot { background: var(--focus-light); }
.strip-post[data-status="rejected"] .strip-dot { background: transparent; border: 1.5px solid var(--muted); }
.strip-text { display: grid; min-width: 0; }
.strip-kind { font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; overflow-wrap: anywhere; }
.strip-state { color: var(--muted); font-size: var(--fs-xs); }
.strip-post[data-status="draft"] .strip-state { color: var(--brass-ink); font-weight: 600; }
.strip-post[data-status="approved"] .strip-state { color: var(--lamp); }
.strip-skip { position: relative; padding: 5px 8px; border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.strip-none { color: var(--line-strong); font-weight: 700; padding-left: 2px; }
.skipped-note { margin-bottom: 12px; background: var(--surface); }
.skipped-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.skipped-list li { display: grid; gap: 2px; font-size: var(--fs-sm); }
.skipped-list strong { color: var(--ink); }
.view-only { margin: -4px 0 12px; }
.empty-week { display: grid; gap: 8px; max-width: 600px; }
.empty-week .page-actions { margin-top: 4px; }
.regen-status { align-self: center; }

.post-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.post-card {
  display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); scroll-margin-top: 60px; outline: none;
}
.post-card:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; }
.post-title { min-width: 0; }
.post-title h3 { font-size: var(--fs-md); line-height: 1.3; }
.post-meta { color: var(--muted); font-size: var(--fs-sm); margin-top: 1px; }
.post-media { padding: 0 14px; }
.post-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); }
.post-frame.is-story { aspect-ratio: 9 / 16; width: min(100%, 280px); margin-inline: auto; }
.post-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 220ms var(--ease-out); }
.post-frame.is-loaded .post-img { opacity: 1; }
.post-img-wait { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.post-frame.is-loaded .post-img-wait { display: none; }
.media-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.slide-nav { display: inline-flex; align-items: center; gap: 4px; }
.slide-step { min-width: 28px; padding: 0; }
.slide-step [aria-hidden="true"] { font-size: var(--fs-lg); line-height: 1; }
.slide-count { min-width: 3.5em; text-align: center; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.open-image { margin-left: auto; }
.post-body { display: grid; gap: 12px; padding: 12px 14px 14px; min-width: 0; }
.post-section h4, .post-more h4 { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; margin: 0 0 3px; }
.post-check { padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line); border-left: 3px solid var(--focus-light); background: var(--mint-wash); }
.post-check[data-state="check"] { background: var(--brass-wash); border-color: var(--brass-line); border-left-color: var(--brass-ink); }
.post-check[data-state="blocked"], .post-check[data-state="unchecked"] { background: var(--surface); border-color: var(--line-strong); border-left: 3px solid var(--ink); }
.post-check-title { color: var(--ink); font-weight: 650; font-size: var(--fs); }
.post-check-sub { color: var(--text); font-size: var(--fs-sm); margin-top: 1px; }
.issue-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.issue-list li { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--text); }
.issue-list strong { color: var(--ink); }
.issue-kind { justify-self: start; font-size: var(--fs-2xs); font-weight: 700; padding: 0 6px; border-radius: var(--r-pill); line-height: 1.7; border: 1px solid var(--brass-line); color: var(--brass-ink); background: var(--surface); }
.issue-list li[data-severity="block"] .issue-kind { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.issue-where { color: var(--muted); overflow-wrap: anywhere; }
.issue-list.in-dialog { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.post-caption { color: var(--ink); font-size: var(--fs); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-caption.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.caption-more { margin-top: 4px; font-size: var(--fs-sm); }
.post-tags { list-style: none; margin: 0; padding: 0; }
.chip-tag { background: var(--surface-2); font-weight: 600; }
.post-link { font-size: var(--fs-sm); overflow-wrap: anywhere; color: var(--muted); }
.post-review { color: var(--muted); font-size: var(--fs-sm); }
.post-review q { color: var(--ink); }
.post-more { border-top: 1px solid var(--line); padding-top: 2px; }
.post-more > summary { cursor: pointer; min-height: 34px; display: flex; align-items: center; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }
.post-more-body { display: grid; gap: 6px; padding-bottom: 4px; }
.post-more-body h4 { margin-top: 4px; }
.source-list, .history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: var(--fs-sm); }
.source-list code { font-size: var(--fs-xs); color: var(--text); background: var(--surface-2); padding: 0 5px; border-radius: var(--r-xs); overflow-wrap: anywhere; }
.history-list li { color: var(--text); }
.history-list .strong { color: var(--ink); font-weight: 600; }
.history-list .sub { display: block; color: var(--muted); font-size: var(--fs-xs); }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.post-blocked { flex-basis: 100%; }
.btn-approve { background: var(--lamp); border-color: var(--lamp); color: var(--on-dark); }
.btn-approve:hover { background: var(--ledger); border-color: var(--ledger); }
.caption-input { min-height: 200px; line-height: 1.55; }
.char-count { justify-self: end; font-variant-numeric: tabular-nums; }
.check-row { display: grid; gap: 8px; justify-items: start; }
.check-result { display: grid; gap: 6px; width: 100%; }
.check-result:empty { display: none; }
.check-result-title { color: var(--ink); font-weight: 650; font-size: var(--fs); }

@media (max-width: 767px) {
  .week-nav { width: 100%; justify-content: space-between; }
  .week-label { min-width: 0; flex: 1; }
  .step-label { display: none; }
  .week-day { min-height: 0; padding: 6px 2px; align-items: center; gap: 4px; }
  .day-head { flex-direction: column; align-items: center; gap: 2px; }
  .strip-post { width: 44px; min-height: 44px; justify-content: center; align-items: center; padding: 0; }
  .strip-dot { width: 10px; height: 10px; margin: 0; }
  .strip-post .strip-text, .strip-skip .strip-text {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .strip-skip { width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; }
  .strip-skip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1.5px dashed var(--muted); }
  .strip-none { padding: 0; min-height: 44px; display: grid; place-items: center; }
  .week-chip { min-height: 40px; }
  .week-step { min-width: 40px; height: 40px; }
  .post-actions .btn { height: 40px; }
}
@media (max-width: 479px) {
  .post-head, .post-body { padding-left: 12px; padding-right: 12px; }
  .post-media { padding: 0 12px; }
  .post-actions { padding: 10px 12px; }
  .post-actions .btn { flex: 1 1 auto; }
}

/* ---------- social media library (CLEAR-20 v2: views/content.js, content-drawer.js, content-calendar.js,
 * content-questions.js), UX v2 tokens ----------
 * Tabs with counts, a grid of posts (thumbnail or poster, type, platforms, status, date), a drawer for one post and a
 * calendar. Status reads in words everywhere; the calendar's dot and the card's top rule add a second cue: brass for
 * waiting on James, lamp green for approved, ledger for scheduled and published, brass ink for changes, muted for
 * drafts and rejected. No red. */
.lib-lead { margin: -6px 0 10px; max-width: 80ch; }
.lib-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 12px; }
.lib-views { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); }
.lib-view { display: inline-flex; align-items: center; height: var(--control-h-sm); padding: 0 12px; border-radius: var(--r-pill); text-decoration: none; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.lib-view:hover { color: var(--ink); }
.lib-view[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 31, 26, 0.14); }
.lib-total { color: var(--muted); font-size: var(--fs); }

.lib-tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.lib-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; margin-bottom: -1px; background: none;
  border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
}
.lib-tab:hover { color: var(--ink); }
.lib-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--lamp); }
@media (max-width: 599px) { .lib-tab { height: 40px; } }
.lib-tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: var(--fs-2xs); font-weight: 750; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.lib-tab[aria-selected="true"] .lib-tab-count { background: var(--lamp); box-shadow: none; color: var(--on-dark); }

.lib-filters { display: grid; gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.lib-filters .lib-search { grid-column: 1 / -1; }
.lib-layout .seg { align-self: start; }
.lib-layout .seg button { height: 24px; }
@media (min-width: 1100px) { .lib-filters { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(240px, 2fr) auto; align-items: end; } .lib-filters .lib-search { grid-column: auto; } }

.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.lib-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.lib-card[data-status="pending_approval"] { border-top-color: var(--brass); }
.lib-card[data-status="approved"] { border-top-color: var(--lamp); }
.lib-card[data-status="scheduled"], .lib-card[data-status="published"] { border-top-color: var(--ledger); }
.lib-card[data-status="changes_requested"] { border-top-color: var(--brass-ink); }
.lib-select { position: absolute; top: 10px; left: 10px; z-index: 2; width: 26px; height: 26px; margin: 0; accent-color: var(--lamp); cursor: pointer; }
.lib-open { display: flex; flex-direction: column; flex: 1; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.lib-open:hover .lib-card-name { text-decoration: underline; text-underline-offset: 3px; }
.lib-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--ledger); overflow: hidden; }
.lib-thumb.is-tall { aspect-ratio: 4 / 5; }
.lib-thumb-img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 200ms var(--ease-out); }
.lib-thumb.is-loaded .lib-thumb-img { opacity: 1; }
.lib-thumb.is-empty::after { content: "No preview"; color: var(--on-dark-2); font-size: var(--fs); position: absolute; }
.lib-play { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(11, 31, 26, 0.72); border: 2px solid var(--on-dark); }
.lib-play::after { content: ""; position: absolute; left: 16px; top: 11px; border-left: 14px solid var(--on-dark); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.lib-nocut { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--brass-ink); font-size: var(--fs-sm); font-weight: 700; border: 1px solid var(--brass-line); }
.lib-card-body { display: grid; gap: 4px; padding: 10px 12px 6px; }
.lib-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.lib-type { color: var(--muted); font-size: var(--fs-sm); font-weight: 650; }
.lib-card-name { color: var(--ink); font-weight: 700; font-size: var(--fs-md); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-when { color: var(--text); font-size: var(--fs); font-variant-numeric: tabular-nums; }
.lib-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; padding: 0 12px 12px; margin-top: auto; }
.lib-platforms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.plat { display: inline-block; padding: 1px 7px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 700; color: var(--ink); background: var(--paper); }
.lib-flag { font-size: var(--fs-sm); font-weight: 700; color: var(--brass-ink); }
.lib-flag[data-state="blocked"], .lib-flag[data-state="unchecked"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lib-table .lib-thumb { width: 54px; aspect-ratio: 4 / 5; border-radius: var(--r-sm); }
.lib-table .lib-play { width: 22px; height: 22px; }
.lib-table .lib-play::after { left: 7px; top: 4px; border-left-width: 8px; border-top-width: 5px; border-bottom-width: 5px; }
.lib-table .lib-nocut { display: none; }
.lib-table td { vertical-align: middle; }
.lib-table .sub { display: block; }
.lib-col-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lib-col-select { width: 44px; }
.lib-col-select .lib-select { position: static; }
.lib-more { text-align: center; margin: 16px 0; }
.lib-empty { text-align: center; padding: 32px 18px; }
.lib-empty p { color: var(--muted); margin-top: 6px; }

.lib-bulk {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-top: 16px; padding: 10px 14px; background: var(--ledger); color: var(--on-dark); border-radius: var(--r); box-shadow: var(--shadow);
}
.lib-bulk-count { font-weight: 700; color: var(--on-dark); }
.lib-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-bulk .btn:not(.btn-approve) { background: var(--surface); }
.lib-bulk .btn.btn-quiet:not(.btn-approve) { background: transparent; color: var(--on-dark); }
.lib-bulk-list { margin: 0; padding-left: 18px; font-size: var(--fs-md); max-height: 220px; overflow: auto; }

/* the open questions */
.questions { margin-bottom: 16px; }
.q-panel { background: var(--surface); border: 1px solid var(--brass-line); border-left: 4px solid var(--brass-ink); border-radius: var(--r); padding: 0 16px; }
.q-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; list-style: none; }
.q-panel > summary::-webkit-details-marker { display: none; }
.q-panel > summary::after { content: "Show"; color: var(--muted); font-size: var(--fs); font-weight: 650; }
.q-panel[open] > summary::after { content: "Hide"; }
.q-panel > summary h2 { font-size: var(--fs-lg); }
.q-count { margin-left: auto; color: var(--brass-ink); font-weight: 700; font-size: var(--fs); }
.q-panel[open] { padding-bottom: 16px; }
.q-panel > .hint { margin-bottom: 12px; }
.q-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.q-card { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--brass-wash); }
.q-card.is-answered { background: var(--surface); }
.q-kicker { color: var(--brass-ink); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.q-card.is-answered .q-kicker { color: var(--lamp); }
.q-title { font-size: var(--fs-md); }
.q-body, .q-affects { font-size: var(--fs); }
.q-form { display: grid; gap: 10px; }
.q-options { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.q-options .check { align-items: flex-start; font-size: var(--fs-md); }
.q-options .check input { margin-top: 2px; flex: 0 0 auto; }
.q-answer { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--mint-wash); border: 1px solid var(--mint-line); }
.q-answer .btn { justify-self: start; }
.q-note { min-height: var(--control-h); }
.q-more > summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; font-size: var(--fs); font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.q-more[open] { display: grid; gap: 8px; }
.q-more[open] > summary { margin-bottom: 2px; }
/* users and roles module (30 Nov 2026): the Add user role list says what each role opens; the role editor's live line */
.role-checks { flex-direction: column; gap: 6px; }
.role-checks .check { align-items: flex-start; }
.role-checks .check input { margin-top: 3px; flex: 0 0 auto; }
.role-checks .check .strong { display: block; color: var(--ink); font-weight: 600; }
.role-checks .check .sub { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.roles-table .chip { margin-left: 6px; }
.role-preview { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-size: var(--fs); }
/* one role per person (30 Nov 2026): the note for a person with several roles from before; what the chosen role gives */
.role-several { margin: 0; color: var(--ink); background: var(--brass-wash); border-left: 4px solid var(--brass-ink); padding: 8px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.role-gives, .role-gives-grid { display: grid; gap: 6px; }
.role-gives .role-preview { margin-top: 0; }
.role-approver { align-items: flex-start; }
.role-approver input { margin-top: 3px; flex: 0 0 auto; }

/* the drawer */
dialog.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(980px, 100vw); max-width: 100vw; padding: 0; border: 0;
  background: var(--paper); color: var(--text); box-shadow: -20px 0 60px -30px rgba(11, 31, 26, 0.5); overflow-y: auto;
}
dialog.drawer::backdrop { background: rgba(11, 31, 26, 0.55); }
.drawer-body { display: grid; gap: 16px; padding: 0 20px 32px; }
.drawer-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 16px 0 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.drawer-kicker { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.drawer-head h2 { font-size: var(--fs-xl); margin: 2px 0 6px; }
.drawer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs); color: var(--text); }
.drawer-close { flex: 0 0 auto; }
.drawer-queue { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ledger); font-size: var(--fs-md); }
.drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

.drawer-why { flex-basis: 100%; }
.drawer-grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .drawer-grid { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); align-items: start; } .drawer-grid > .drawer-col:first-child { position: sticky; top: 96px; } }
.drawer-col { display: grid; gap: 16px; min-width: 0; }
.drawer-media { display: grid; gap: 8px; }
.drawer-media-host { min-width: 0; }
.drawer-video { width: 100%; height: auto; max-height: 70dvh; aspect-ratio: 9 / 16; background: var(--ledger); border-radius: var(--r); }
.drawer-frame { position: relative; background: var(--ledger); border-radius: var(--r); overflow: hidden; }
.drawer-img { display: block; width: 100%; height: auto; }
.drawer-img.is-poster { border-radius: var(--r); }
.drawer-media-note { font-size: var(--fs-sm); }
.drawer-nocut { padding: 10px 12px; border-radius: var(--r-sm); background: var(--brass-wash); border: 1px solid var(--brass-line); font-size: var(--fs-md); }
.drawer-section { display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.drawer-section h3 { font-size: var(--fs-md); }
.drawer-section h4 { font-size: var(--fs); color: var(--ink); margin: 0 0 4px; }
.drawer-caption { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: var(--fs-md); line-height: 1.55; }
.drawer-tags { list-style: none; margin: 0; padding: 0; }
.drawer-note { padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line); font-size: var(--fs-md); }
.drawer-list, .drawer-sources { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--fs); overflow-wrap: anywhere; }
.drawer-quote { margin: 2px 0 0; padding-left: 10px; border-left: 3px solid var(--line-strong); font-size: var(--fs-md); white-space: pre-wrap; }
.drawer-history, .drawer-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.drawer-history li, .drawer-comments li { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: var(--fs); }
.drawer-history li:last-child, .drawer-comments li:last-child { border-bottom: 0; padding-bottom: 0; }
.drawer-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.drawer-comment-text { white-space: pre-wrap; color: var(--ink); margin-top: 2px; }
.drawer-comment { display: grid; gap: 8px; margin-top: 4px; }
.drawer-comment .page-actions { justify-content: flex-end; }
.drawer .sub { color: var(--muted); }
@media (max-width: 639px) { .drawer-body { padding: 0 14px 24px; } .drawer-actions .btn { flex: 1 1 calc(50% - 8px); } }

/* the calendar */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .btn { min-width: var(--control-h); }
.cal-title { font-size: var(--fs-xl); min-width: 12rem; text-align: center; }
.cal-zone { flex-basis: 100%; }
.cal-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); color: var(--text); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); min-width: 980px; }
.cal-grid.is-month { grid-template-columns: repeat(7, minmax(120px, 1fr)); min-width: 860px; }
.cal-day { min-height: 150px; padding: 8px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-grid.is-week .cal-day { min-height: 420px; border-top: 0; }
.cal-grid.is-month .cal-day:nth-child(-n+7) { border-top: 0; }
.cal-day:nth-child(7n+1) { border-left: 0; }
.cal-day.is-out { background: var(--paper); }
.cal-day.is-out .cal-num { color: var(--muted); }
.cal-day.is-today { box-shadow: inset 0 3px 0 var(--brass-ink); }
.cal-date { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 650; }
.cal-num { color: var(--ink); font-size: var(--fs-lg); font-weight: 750; }
.cal-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cal-post {
  position: relative; display: grid; gap: 1px; width: 100%; min-height: 40px; padding: 5px 8px 5px 18px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-size: var(--fs-sm);
}
.cal-post:hover { border-color: var(--ink); }
.cal-time { font-weight: 750; font-variant-numeric: tabular-nums; }
.cal-what { color: var(--text); font-weight: 650; }
.cal-name { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-dot { position: absolute; left: 7px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.cal-legend .cal-dot { position: static; }
[data-status="pending_approval"] > .cal-dot { background: var(--brass); }
[data-status="approved"] > .cal-dot { background: var(--lamp); }
[data-status="scheduled"] > .cal-dot, [data-status="published"] > .cal-dot { background: var(--ledger); }
[data-status="changes_requested"] > .cal-dot { background: var(--brass-ink); }
[data-status="rejected"] > .cal-dot { background: var(--surface); border: 1px solid var(--muted); }
.cal-post[data-status="scheduled"] { background: var(--surface); border-left: 3px solid var(--ledger); }
.cal-post[data-status="approved"] { background: var(--mint-wash); }
.cal-post[data-status="pending_approval"] { background: var(--brass-wash); }
.cal-more { background: none; border: 0; padding: 4px 0; color: var(--ink); font-size: var(--fs-sm); font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 32px; text-align: left; }
.cal-undated { margin-top: 12px; background: var(--surface); }
.cal-undated .cal-posts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.drawer-sources { gap: 6px; }
.drawer-sources a { display: inline-block; min-height: 24px; padding: 2px 0; }

/* the daily publisher (26 Nov 2026): each platform's state, failed posts, Publish now. No red: words and brass ink */
.lib-card[data-status="failed"] { border-top-color: var(--brass-ink); border-top-style: dashed; }
.lib-flag[data-state="waiting"] { color: var(--brass-ink); }
.lib-flag[data-state="failed"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brass-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
[data-status="failed"] > .cal-dot { background: var(--surface); border: 2px solid var(--brass-ink); }
.cal-post[data-status="published"] { background: var(--surface); }
.cal-post[data-status="failed"] { background: var(--brass-wash); border-left: 3px dashed var(--brass-ink); }
.cal-state { font-weight: 700; color: var(--brass-ink); }
.cal-state[data-state="published"] { color: var(--lamp); }
.cal-state[data-state="failed"] { color: var(--ink); }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pub-list li {
  display: grid; grid-template-columns: 12px minmax(84px, auto) 1fr; align-items: baseline; gap: 4px 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-md);
}
.pub-mark { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); align-self: center; }
.pub-name { font-weight: 700; color: var(--ink); }
.pub-text { color: var(--text); overflow-wrap: anywhere; }
.pub-link { grid-column: 3; font-weight: 700; color: var(--lamp); min-height: 24px; display: inline-block; }
.pub-list li[data-state="posted"] { border-left: 4px solid var(--lamp); }
.pub-list li[data-state="posted"] .pub-mark { background: var(--lamp); }
.pub-list li[data-state="waiting"], .pub-list li[data-state="retrying"] { background: var(--brass-wash); border-color: var(--brass-line); }
.pub-list li[data-state="waiting"] .pub-mark, .pub-list li[data-state="retrying"] .pub-mark { background: var(--brass); }
/* WP8: Instagram or TikTok preparing the media (nothing public yet) */
.pub-list li[data-state="processing"] { background: var(--brass-wash); border-color: var(--brass-line); }
.pub-list li[data-state="processing"] .pub-mark { background: var(--brass); }
.lib-flag[data-state="processing"] { color: var(--brass-ink); }
.pub-list li[data-state="failed"] { border-left: 4px dashed var(--brass-ink); }
.pub-list li[data-state="failed"] .pub-mark { background: var(--surface); border: 2px solid var(--brass-ink); }
.pub-list li[data-state="failed"] .pub-text { color: var(--ink); }
.pub-list li[data-state="due"] .pub-mark, .pub-list li[data-state="posting"] .pub-mark { background: var(--ledger); }
.pub-plan { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: var(--fs-md); }
/* "Not sure the last try went out": the Schedule and Publish now dialogs ask for a look at the page first */
.hint.pub-unsure { color: var(--ink); background: var(--brass-wash); border-left: 4px dashed var(--brass-ink); padding: 8px 12px; border-radius: var(--r-sm); }
@media (max-width: 479px) {
  .pub-list li { grid-template-columns: 12px 1fr; }
  .pub-text, .pub-link { grid-column: 2; }
}

/* ---------- settings & status (views/settings.js) ---------- */
.settings-meta { display: grid; gap: 8px; margin-bottom: 12px; }
.settings-meta .hint { max-width: 80ch; }
.settings-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.settings-summary li { display: inline-flex; align-items: center; gap: 6px; }
.summary-count { font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; min-width: 0.6em; }
.settings-notice {
  border: 1px solid var(--brass-line); background: var(--brass-wash); color: var(--ink); padding: 8px 12px;
  border-radius: var(--r); margin-bottom: 12px; font-size: var(--fs); max-width: 80ch;
}
.intg-panel { padding: 0; }
.intg-list { list-style: none; margin: 0; padding: 0; }
.intg-list > li + li { border-top: 1px solid var(--line); }
.intg article { padding: 14px 16px 4px; }
.intg-grid { display: grid; gap: 10px 20px; }
.intg-id h2 { font-size: var(--fs-md); }
.intg-what { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; max-width: 52ch; }
.intg-state { display: grid; gap: 4px; justify-items: start; align-content: start; }
.intg-state-text { color: var(--muted); font-size: var(--fs-sm); max-width: 40ch; }
.intg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; font-size: var(--fs); align-content: start; }
.intg-facts dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.intg-facts dd { margin: 1px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.intg-facts .intg-notable { grid-column: 1 / -1; }
.intg-facts .intg-notable dd { margin: 0; }
@media (min-width: 640px) { .intg-facts { grid-template-columns: repeat(3, minmax(0, 0.8fr)) minmax(0, 1.3fr); } }
@media (min-width: 768px) {
  .intg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .intg-facts { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .intg-grid { grid-template-columns: minmax(220px, 1.1fr) minmax(200px, 0.85fr) minmax(0, 2.1fr); }
  .intg-facts { grid-column: auto; }
}
.problem { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.problem-code, .needs-text code {
  font: 600 var(--fs-xs)/1.5 var(--mono); color: var(--brass-ink);
  background: var(--brass-wash); border-radius: var(--r-xs); padding: 0 5px; overflow-wrap: anywhere;
}
.problem-code { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.needs-text code { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }

/* the read-only switch: a real checkbox (role switch), disabled; its state is also written next to it */
.switch-row { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; min-height: 24px; }
.switch-row label { display: inline-flex; gap: 6px; align-items: baseline; font-size: var(--fs-sm); color: var(--ink); }
.switch-label { font-weight: 600; }
.switch-state { color: var(--muted); }
.switch {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; width: 32px; height: 18px;
  border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--muted); cursor: default;
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.switch::before {
  content: ""; position: absolute; top: 4px; left: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.switch:checked { background: var(--lamp); box-shadow: inset 0 0 0 1.5px var(--lamp); }
.switch:checked::before { background: var(--white); transform: translateX(14px); }

.intg-needs { margin-top: 12px; border-top: 1px dashed var(--line-strong); }
.intg-needs > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer;
  color: var(--ink); font-weight: 600; font-size: var(--fs);
}
.intg-needs > summary::-webkit-details-marker { display: none; }
.intg-needs > summary::after {
  content: ""; width: 6px; height: 6px; margin: 0 4px 3px 0; border: solid var(--ink); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); transition: transform 200ms var(--ease-out); flex: none;
}
.intg-needs[open] > summary::after { transform: translateY(3px) rotate(-135deg); }
.intg-needs > summary:hover .needs-title { text-decoration: underline; text-underline-offset: 3px; }
.needs-count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; }
.needs-body { display: grid; gap: 14px; padding: 2px 0 14px; }
@media (min-width: 900px) { .needs-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; } }
.needs-col h3 { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.needs-list { list-style: none; margin: 0; padding: 0; }
.needs-item {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 5px 0; border-bottom: 1px solid var(--line); font-size: var(--fs); color: var(--ink);
}
.needs-item:last-child { border-bottom: 0; }
.needs-text { text-wrap: pretty; }
.needs-by { font-size: var(--fs-xs); font-weight: 600; color: var(--brass-ink); }
.needs-doc { margin-top: 10px; font-size: var(--fs); }
.needs-doc a { font-weight: 600; }
.mark { width: 16px; height: 16px; border-radius: 50%; margin-top: 2px; position: relative; flex: none; }
.mark.is-done { background: var(--lamp); }
.mark.is-done::after {
  content: ""; position: absolute; left: 5px; top: 2.5px; width: 4.5px; height: 8px;
  border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mark.is-todo { box-shadow: inset 0 0 0 2px var(--muted); }
.mark.is-manual { border: 2px dashed var(--brass-ink); }
@media (max-width: 479px) {
  .intg article { padding: 12px 12px 4px; }
}

/* ---------- integrations (views/integrations.js) ----------
 * The cards: name and the connected account under it, what it does, one Connect / Manage button. The Facebook &
 * Instagram screen reuses panels, facts, chips and the brass-wash banner. */
.intg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.intg-tab { padding: 6px 2px 8px; margin-bottom: -1px; color: var(--ink); font-weight: 600; font-size: var(--fs); text-decoration: none; border-bottom: 2px solid var(--lamp); }
.intg-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.intg-card { display: grid; grid-template-rows: auto 1fr auto; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.intg-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.intg-card-head h2 { font-size: var(--fs-md); }
.intg-glyph {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r);
  background: #2d5a8c; color: var(--on-dark); font-weight: 800; font-size: var(--fs-lg); line-height: 1;
}
.intg-card-sub { color: var(--lamp); font-size: var(--fs-sm); margin-top: 1px; overflow-wrap: anywhere; }
.intg-card-what { padding: 10px 14px; color: var(--text); font-size: var(--fs); }
.intg-card-foot { padding: 0 14px 14px; }
.meta-review-banner { margin-bottom: 12px; }
.meta-conn-list, .meta-gone-list, .meta-choose-list, .meta-perm-list { list-style: none; margin: 0; padding: 0; }
.meta-conn + .meta-conn { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.meta-conn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.meta-conn-head h3 { font-size: var(--fs-md); }
.meta-conn .facts { max-width: 620px; margin-bottom: 8px; }
.meta-note { color: var(--text); font-size: var(--fs); background: var(--brass-wash); border-left: 3px solid var(--brass-ink); padding: 7px 10px; border-radius: var(--r-xs); margin: 0 0 8px; max-width: 72ch; }
.meta-empty { display: grid; gap: 10px; justify-items: start; max-width: 64ch; }
.meta-gone-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.meta-gone-list li:first-child { border-top: 0; }
.meta-gone-name { font-weight: 600; color: var(--ink); }
.meta-perms summary { cursor: pointer; padding: 4px 0; color: var(--ink); font-weight: 600; font-size: var(--fs); }
.meta-perm-list { margin-top: 6px; }
.meta-perm-list li { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 4px 16px; padding: 5px 0; border-top: 1px solid var(--line); font-size: var(--fs); }
.meta-perm-list code { color: var(--ink); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.meta-choose { display: grid; gap: 10px; }
.meta-choose-list li + li { border-top: 1px solid var(--line); }
.meta-choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.meta-choice input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--lamp); flex: none; }
.meta-choice > span { display: grid; gap: 1px; }
.meta-choice-name { color: var(--ink); font-weight: 600; }
.meta-progress { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--selected); color: var(--lamp); font-weight: 600; font-size: var(--fs); }
.meta-progress .spinner { color: var(--lamp); }
@media (max-width: 599px) {
  .meta-perm-list li { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- needs a person (feature/admin-needs-human: views/detail.js), UX v2 ----------
 * One compact strip under an application's header while flags.needsHuman is on, with Mark handled on the right. Brass
 * wash and brass ink, like the flag chip: a call to act, never an alarm (no red). */
.human-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; margin-bottom: 12px;
  background: var(--brass-wash); border: 1px solid var(--brass-line); border-radius: var(--r-lg);
}
.human-note-icon { width: 28px; height: 28px; flex: none; border-radius: var(--r); display: inline-grid; place-items: center; background: var(--surface); color: var(--brass-ink); }
.human-note-icon .icon { width: 15px; height: 15px; }
.human-note-text { flex: 1 1 280px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.human-note-title { color: var(--ink); font-size: var(--fs); font-weight: 650; }
.human-note-text p { color: var(--text); font-size: var(--fs-sm); }
@media (max-width: 639px) { .human-note .btn { width: 100%; height: var(--control-h); } }
/* ---------- end needs a person ---------- */
/* ---------- consultations: week view and staff reschedule (views/bookings-week.js, bookings-reschedule.js), UX v2 ----------
 * List / Week is the shared segmented control (.seg); the week is a table in its own scrolling box; the reschedule
 * dialog offers the free times as pills. Sizes and colours are the tokens. */
.bk-week-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; }
.bk-week-nav h2 { font-size: var(--fs-md); }
.week-grid { table-layout: fixed; min-width: 980px; }
.week-grid thead th { padding: 6px 8px; color: var(--ink); white-space: normal; vertical-align: top; }
.week-grid thead th .day-name { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.week-grid thead th .day-date { display: block; color: var(--ink); font-size: var(--fs-sm); font-weight: 650; }
.week-grid thead th .day-today { display: inline-block; margin-top: 1px; color: var(--lamp); font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.week-grid thead th.is-today { background: var(--mint-wash); box-shadow: inset 0 2px 0 var(--focus-light); }
.week-grid .time-col { width: 60px; position: sticky; left: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; vertical-align: top; text-align: right; padding: 6px 8px 0 4px; white-space: nowrap; }
.week-grid thead .time-col { z-index: 2; }
.week-grid td { vertical-align: top; padding: 3px; height: 48px; border-left: 1px solid var(--line); }
.week-grid td.is-today { background: #f7fbf9; }
.week-grid tbody tr:hover { background: transparent; }
.call-card {
  display: grid; gap: 0; width: 100%; padding: 4px 7px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--lamp); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: var(--fs-sm); line-height: 1.3;
  transition: border-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.call-card + .call-card { margin-top: 3px; }
.call-card:hover { border-color: var(--ink); border-left-color: var(--ink); }
.call-card > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-card .call-time { font-weight: 650; font-variant-numeric: tabular-nums; }
.call-card .call-name { font-weight: 600; }
.call-card .call-state { color: var(--muted); font-size: var(--fs-xs); }
.call-card[data-status="confirmed"] { border-left-color: var(--focus-light); background: var(--mint-wash); }
.call-card[data-status="no-show"] { border-left-color: var(--brass-ink); background: var(--brass-wash); }
.call-card[data-status="completed"] { border-left-color: var(--ink); }
.call-card[data-status="cancelled"] { border-style: dashed; border-left: 3px solid var(--line-strong); background: var(--paper); color: var(--muted); }
.call-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.slot-days { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; }
.slot-days .field { flex: 1 1 240px; }
.slot-weeks { display: flex; gap: 6px; }
.slot-status { margin-top: -2px; }
.slot-times legend { margin-bottom: 4px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.slot-pick { position: relative; display: inline-flex; }
.slot-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.slot-pick > span {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--fs); font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.slot-pick:hover > span { border-color: var(--ink); }
.slot-pick input:checked + span { background: var(--ledger); border-color: var(--ledger); color: var(--on-dark); }
.slot-pick input:focus-visible + span { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.slot-pick .other-host { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.slot-pick input:checked + span .other-host { color: var(--on-dark-2); }
.slot-empty { color: var(--muted); font-size: var(--fs-sm); padding: 6px 0; }
.slot-nobody { grid-column: 1 / -1; color: var(--ink); font-size: var(--fs); padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
@media (max-width: 639px) {
  .page-head .view-switch { order: -1; }
  .slot-weeks { width: 100%; }
  .slot-weeks .btn { flex: 1; }
}
@media (forced-colors: active) {
  .slot-pick input:checked + span, .seg button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
/* ---------- end consultations: week view and staff reschedule ---------- */
/* ---------- audit and activity in plain words (views/audit.js, views/outbox.js, views/deliveries.js), UX v2 ----------
 * The filters are the shared compact bar; statuses are chips in the four tones; every size and colour is a token. */
.audit-filter-btns { display: flex; gap: 6px; align-items: end; }
.audit-table td, .outbox-table td { vertical-align: top; }
.audit-table td .sub a { font-weight: 600; }
.chip-msg-ok { border-color: var(--mint-line); color: var(--lamp); background: var(--mint-wash); }
.chip-msg-wait { background: var(--surface); }
.chip-msg-problem { border-color: var(--brass-line); color: var(--brass-ink); background: var(--brass-wash); }
.chip-msg-off { border-color: var(--line-strong); color: var(--muted); background: var(--paper); }
.msg-status-why { color: var(--muted); font-size: var(--fs-sm); text-wrap: pretty; }
.msg-status-why.is-problem { color: var(--brass-ink); font-weight: 600; }
.table .sub.msg-status-why { margin-top: 3px; max-width: 46ch; }
.msg-status-list { list-style: none; margin: 0 0 8px; padding: 0; }
.msg-status { padding: 7px 0; border-bottom: 1px solid var(--line); display: grid; gap: 1px; }
.msg-status:last-child { border-bottom: 0; }
.msg-status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.msg-status-name { color: var(--ink); font-weight: 600; font-size: var(--fs); min-width: 0; }
.delivery-panel > div > .msg-status-why.is-problem { margin-bottom: 6px; }
@media (max-width: 639px) {
  /* the shared .cards-on-phone card, laid out as a grid here */
  .audit-table.cards-on-phone tbody tr, .outbox-table.cards-on-phone tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
  .audit-table .c-what { order: 1; }
  .audit-table .c-when, .outbox-table .c-when { order: 2; text-align: right; color: var(--muted); font-size: var(--fs-sm); white-space: normal; }
  .audit-table .c-who { order: 3; grid-column: 1 / -1; }
  .audit-table .c-details { order: 4; grid-column: 1 / -1; color: var(--ink); }
  .outbox-table .c-msg { order: 1; }
  .outbox-table .c-status { order: 3; grid-column: 1 / -1; }
  .outbox-table .c-app { order: 4; grid-column: 1 / -1; }
  /* td.c-act: must outrank .table td.actions (nowrap), or a long "cannot be sent again" reason is cut off */
  .outbox-table td.c-act { order: 5; grid-column: 1 / -1; text-align: left; white-space: normal; }
  .outbox-table td.c-act:empty { display: none; }
}
/* ---------- end audit and activity ---------- */
/* ---------- signature (views/signature.js): the drawn picture or the typed name on a signing slip, UX v2 ----------
 * The typed name uses the face the application form sets it in (Mrs Saint Delafield, SIL OFL 1.1), so staff see it
 * as the applicant did. The slip is the form's: white paper, a brass rule to sign on and the x at its start. */
@font-face {
  font-family: "Mrs Saint Delafield";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/mrs-saint-delafield-400-latin.woff2") format("woff2");
}
.sig-slip {
  position: relative; display: grid; place-items: center; min-height: 112px; padding: 10px 16px 26px 40px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); overflow: hidden;
}
.sig-line { position: absolute; left: 16px; right: 16px; bottom: 22px; height: 1px; background: var(--brass-ink); opacity: 0.55; }
.sig-x { position: absolute; left: 16px; bottom: 26px; font-size: var(--fs-lg); line-height: 1; color: var(--brass-ink); }
.sig-typed {
  position: relative; z-index: 1; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "Mrs Saint Delafield", var(--serif); font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); line-height: 1.2; color: var(--ledger);
}
.sig-img { position: relative; z-index: 1; display: block; max-width: 100%; max-height: 104px; height: auto; object-fit: contain; }
.sig-slip.is-hidden { background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--surface-2) 10px 20px); }
.sig-placeholder { position: relative; z-index: 1; max-width: 42ch; margin: 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.sig-caption { margin: 6px 0 8px; }
.sig-browser { display: grid; gap: 1px; }
.sig-ua { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.sig-consent {
  margin: 0; padding: 8px 12px; border-left: 3px solid var(--brass-ink); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink); font-size: var(--fs-sm);
}
.sig-consent p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 479px) {
  .sig-slip { min-height: 100px; padding: 10px 12px 24px 32px; }
  .sig-line { left: 12px; right: 12px; }
  .sig-x { left: 12px; }
}
/* ---------- end signature ---------- */
/* ---------- bank statement viewer (views/viewer.js, pdf.js) ----------
 * A full-screen dialog on phones, a large one from 1024px. The pages sit on a grey desk, each a white sheet; the text
 * layer is pdf.js's (transparent text over the canvas, for selection and search marks). Search marks: brass for a
 * match, lamp green with an outline for the current one; never colour alone (the count says where you are).
 * Admin UX v2: sizes and colours are the tokens; Download shows a spinner and its stage while the file is prepared. */
dialog.pv {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100vh; max-height: 100dvh;
  background: var(--white); color: var(--text); overflow: hidden;
}
dialog.pv::backdrop { background: rgba(11, 31, 26, 0.72); }
@media (min-width: 1024px) {
  dialog.pv { margin: auto; width: min(1440px, calc(100vw - 48px)); height: calc(100vh - 48px); height: calc(100dvh - 48px); border-radius: var(--r-lg); box-shadow: var(--shadow); }
}
.pv-shell { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
/* each part has its own row, so the pages keep the free height whether or not the search bar is shown */
.pv-head { grid-row: 1; }
.pv-tools { grid-row: 2; }
.pv-searchbar { grid-row: 3; }
.pv-body { grid-row: 4; }
.pv-foot { grid-row: 5; }
.pv-head {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 12px 10px 16px;
  background: var(--ledger); color: var(--on-dark-2);
}
.pv-heading { min-width: 0; flex: 1 1 220px; }
.pv-title { color: var(--on-dark); font-size: var(--fs-lg); font-weight: 650; overflow-wrap: anywhere; }
.pv-meta { color: var(--on-dark-3); font-size: var(--fs); }
.pv-docs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 260px; justify-content: flex-end; }
.pv-docs .select { max-width: 340px; height: var(--control-h); padding: 4px 10px; background: var(--lamp); color: var(--on-dark); border-color: var(--line-dark); }
.pv-docs .select:focus-visible { outline-color: var(--focus-dark); }
.pv-head .pv-btn { color: var(--on-dark); border-color: var(--line-dark); background: transparent; }
.pv-head .pv-btn:hover { border-color: var(--on-dark); background: rgba(255, 255, 255, 0.06); }
.pv-head :focus-visible { outline-color: var(--focus-dark); }
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: var(--control-h); padding: 0 8px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--ink); cursor: pointer;
}
.pv-btn:hover { background: var(--paper); border-color: var(--line); }
.pv-btn[aria-pressed="true"], .pv-btn[aria-expanded="true"] { background: var(--mint-wash); border-color: var(--mint-line); color: var(--lamp); }
.pv-btn[disabled] { opacity: 0.4; cursor: not-allowed; background: transparent; border-color: transparent; }
.pv-btn svg { flex: none; }
.pv-close { padding: 0 12px; }
.pv-btn-text { font-weight: 650; font-size: var(--fs-md); }
.pv-tools {
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--white);
}
.pv-group { display: flex; align-items: center; gap: 2px; }
.pv-group + .pv-group { padding-left: 12px; border-left: 1px solid var(--line); }
.pv-end { margin-left: auto; border-left: 0 !important; }
.pv-pageno { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; color: var(--muted); font-size: var(--fs); white-space: nowrap; }
.pv-page-input { width: 52px; height: var(--control-h); padding: 4px 6px; text-align: center; }
.pv-zoom { width: auto; height: var(--control-h); padding: 4px 8px; margin: 0 2px; font-size: var(--fs); }
.pv-download svg { margin-left: -2px; }
.pv-searchbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.pv-search-input { flex: 1 1 220px; max-width: 420px; height: var(--control-h); }
.pv-count { color: var(--muted); font-size: var(--fs); min-width: 84px; font-variant-numeric: tabular-nums; }
.pv-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; background: var(--line); }
dialog.pv.has-thumbs .pv-body { grid-template-columns: 148px minmax(0, 1fr); }
.pv-thumbs-wrap { overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); min-height: 0; overscroll-behavior: contain; }
.pv-thumbs { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 12px; }
.pv-thumb { display: grid; justify-items: center; gap: 4px; width: 100%; padding: 6px; border: 2px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer; color: var(--muted); }
.pv-thumb:hover { border-color: var(--line-strong); }
.pv-thumb[aria-current="page"] { border-color: var(--lamp); color: var(--ink); }
.pv-thumb-box { display: block; width: 100%; max-width: 112px; background: var(--white); box-shadow: 0 1px 3px rgba(11, 31, 26, 0.2); overflow: hidden; }
.pv-thumb-canvas { display: block; width: 100%; height: 100%; }
.pv-thumb-no { font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.pv-stage { position: relative; overflow: auto; min-height: 0; outline: none; overscroll-behavior: contain; }
.pv-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-light); }
.pv-pages { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px; width: max-content; min-width: 100%; }
.pv-page {
  position: relative; flex: none; background: var(--white); box-shadow: 0 1px 3px rgba(11, 31, 26, 0.18), 0 8px 24px -16px rgba(11, 31, 26, 0.35);
  --user-unit: 1; --total-scale-factor: calc(var(--scale-factor, 1) * var(--user-unit)); --scale-round-x: 1px; --scale-round-y: 1px;
}
.pv-page:not(.is-rendered)::after { content: "Loading page…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: var(--fs); }
.pv-page.is-failed::after { content: "This page could not be drawn."; }
.pv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pv-status { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.pv-status-title { color: var(--ink); font-weight: 650; font-size: var(--fs-lg); overflow-wrap: anywhere; }
.pv-status-text { max-width: 46ch; }
.pv-status.is-error .pv-status-title::before { content: "Problem: "; color: var(--brass-ink); }
.pv-status.is-error { background: transparent; }
.pv-status-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pv-password { display: grid; gap: 12px; width: min(320px, 100%); text-align: left; }
.pv-progress { width: min(280px, 70vw); height: 6px; accent-color: var(--lamp); }
.pv-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--lamp); animation: pv-spin 0.9s linear infinite; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pv-spinner { animation-duration: 3s; } }
.pv-help {
  position: absolute; right: 12px; top: 12px; z-index: 5; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px;
}
.pv-help h3 { margin-bottom: 8px; }
.pv-help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: var(--fs); }
.pv-help dt { color: var(--ink); font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-help dd { margin: 0; }
.pv-foot { padding: 6px 16px; font-size: var(--fs-sm); color: var(--muted); border-top: 1px solid var(--line); background: var(--white); }

/* pdf.js text layer (from pdfjs-dist 6.5.438 web/pdf_viewer.css, Apache-2.0, the rules this viewer uses, un-nested) */
.pv-page .textLayer {
  position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal;
  -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size));
}
.pv-page .textLayer > span, .pv-page .textLayer > br {
  color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; -webkit-user-select: text; user-select: text;
  z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.pv-page .textLayer ::selection { background: rgba(31, 107, 84, 0.28); color: transparent; }
.pv-page .textLayer[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.pv-page .textLayer[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.pv-page .textLayer[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
.pv-page .textLayer .pv-hit { position: static; color: transparent; margin: -1px; padding: 1px; border-radius: 3px; background: rgba(201, 168, 102, 0.45); }
.pv-page .textLayer .pv-hit.is-current { background: rgba(18, 58, 48, 0.32); outline: 2px solid var(--lamp); outline-offset: 1px; }

@media (max-width: 899px) {
  dialog.pv.has-thumbs .pv-body { grid-template-columns: minmax(0, 1fr); }
  .pv-thumbs-wrap { position: absolute; inset: 0 auto 0 0; z-index: 4; width: 148px; box-shadow: var(--shadow); }
  .pv-tools { gap: 4px 6px; padding: 6px 8px; }
  .pv-group + .pv-group { padding-left: 6px; }
  .pv-docs { justify-content: flex-start; flex-basis: 100%; order: 3; }
  .pv-docs .select { flex: 1; max-width: none; }
  .pv-close .pv-btn-text { display: none; }
  .pv-foot { display: none; }
}
@media (max-width: 479px) {
  /* two toolbar rows on a phone: the fit buttons go (the zoom list has Fit width and Fit page) */
  .pv-head { padding: 8px 8px 8px 12px; }
  .pv-pages { padding: 10px; gap: 10px; }
  .pv-download span { display: none; }
  .pv-fit { display: none; }
  .pv-zoom { max-width: 150px; }
  .pv-group + .pv-group { border-left: 0; padding-left: 2px; }
  /* row 1: thumbnails, pages, Download; row 2: zoom, rotate, search, shortcuts */
  .pv-tools > .pv-group:nth-child(3) { order: 2; }
  .pv-tools > .pv-group:nth-child(4) { order: 3; }
  .pv-end { order: 1; }
  .pv-searchbar { flex-wrap: nowrap; padding: 6px 8px; gap: 4px; }
  .pv-search-input { flex: 1 1 0; min-width: 0; }
  .pv-searchbar .pv-btn, .pv-count { flex: none; }
  .pv-count { min-width: 0; padding: 0 6px; white-space: nowrap; }
}
/* the record's Documents list: the name takes the room, View stays on the right */
.doc-list .doc-name { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.doc-list .doc-actions { display: flex; gap: 6px; flex: none; } /* HL-5-15: View and Remove on a document for the business */
.pv-download[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.pv-download.is-busy { cursor: progress; }
.pv-download.is-busy svg { display: none; }

/* ---------- unfinished applications (owner, 26 Nov 2026; views/unfinished*.js), UX v2 ---------- */
/* the Applications screen's saved views, like HighLevel's smart lists: a segmented control on the header's right */
.view-tabs { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); }
.view-tab {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); color: var(--muted);
  font-weight: 600; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.view-tab:hover { color: var(--ink); }
.view-tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 31, 26, 0.14); }
.unfinished-table .c-step { min-width: 130px; max-width: 150px; }
.unfinished-table .step-text { display: block; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); line-height: 1.35; }
.unfinished-table .step-bar { display: block; width: 100%; max-width: 160px; height: 4px; margin-top: 5px; }
.unfinished-table .c-business { min-width: 110px; max-width: 140px; }
.unfinished-table .c-source .sub { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; }
.row-actions .chip { flex: none; }
.unfinished-table td.c-actions { white-space: nowrap; }
.unfinished-table .c-applicant .sub { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-call { border-color: var(--mint-line); color: var(--lamp); }
.btn-call:hover { background: var(--mint-wash); border-color: var(--lamp); }
@media (max-width: 639px) {
  .page-head .view-tabs { width: 100%; }
  .page-head .view-tab { flex: 1; justify-content: center; height: 32px; }
  /* the Not finished list is a compact list now: one line a lead on phones, Call / Add task / Open in its details */
  .row-actions { display: flex; flex-wrap: nowrap; }
  .row-actions .btn { flex: 1 1 0; height: var(--control-h); }
}
/* the application page: how far the applicant got */
.progress-line { color: var(--text); font-size: var(--fs); margin-bottom: 6px; }
.progress-line strong { color: var(--ink); }
.progress-bar { display: block; height: 6px; border-radius: var(--r-pill); margin-bottom: 10px; }
.progress-bar, .unfinished-table .step-bar { background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
/* the fill: views set --w on the inner span (UX v2 has no shared .bar rule any more) */
.progress-bar > span, .unfinished-table .step-bar > span { display: block; height: 100%; width: var(--w, 0%); background: #16805e; border-radius: inherit; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 20px; }
/* two columns only when the PANEL has room: on the lead record it sits in a ~380px column at 1440 (sit-regression F6) */
.step-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.step-item {
  display: grid; grid-template-columns: 16px 22px minmax(0, 1fr) max-content; gap: 6px; align-items: start;
  padding: 5px 0; border-bottom: 1px solid var(--line); font-size: var(--fs); color: var(--ink);
}
.step-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.step-name { font-weight: 600; overflow-wrap: break-word; min-width: 0; }
.step-legend { margin-top: 8px; }
.step-state { color: var(--muted); font-size: var(--fs-sm); text-align: right; }
.step-item.is-filled .step-state { color: var(--lamp); font-weight: 650; }
.step-item.is-not-reached .step-name { color: var(--muted); font-weight: 500; }
/* Settings & status: the call-task settings */
.uf-panel { margin-bottom: 12px; }
.uf-form { gap: 10px; max-width: 880px; }
.uf-form .input-suffix { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: var(--fs); }
.uf-form .field > .hint { color: var(--muted); font-weight: 400; }
.input-suffix .minutes-input { width: 100px; flex: none; }
/* ---------- end unfinished applications ---------- */
/* ---------- WP3 automations (views/automations*.js, views/tags.js), UX v2 ----------
 * The builder is a vertical list of numbered steps with a hairline spine; an if / else holds its branches as indented
 * lists with their own spine. Switched-off steps fade and say so in words. No red: problems use brass ink and words.
 * Every size and colour is a token; the filter bars are UX v2's one flex bar (no grid of their own). */
.au-switch { position: relative; } /* keeps its visually-hidden label inside a scrolling table */
.au-switch .switch { cursor: pointer; }
.au-switch .switch:disabled { cursor: not-allowed; opacity: 0.55; }
.au-switch .switch:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
/* the engine card */
.au-engine { margin-bottom: var(--sp-3); }
.au-engine-facts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); font-size: var(--fs); }
.au-engine-facts .chip { margin-left: var(--sp-1); }
.au-k { color: var(--muted); font-weight: 600; }
.au-channels { list-style: none; margin: var(--sp-3) 0 0; padding: var(--sp-3) 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.au-channel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; font-size: var(--fs); }
.au-channel-name { font-weight: 650; color: var(--ink); }
.au-channel-why { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-sm); }
@media (min-width: 900px) {
  .au-channel { grid-template-columns: 15em auto minmax(0, 1fr); }
  .au-channel .chip { justify-self: start; }
  .au-channel-why { grid-column: auto; }
}
.au-channel-switches { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.au-channel-switches .hint { margin-left: 22px; display: block; }
/* the list */
.au-table td:nth-child(4) { white-space: nowrap; }
/* one automation: header, counters, tabs */
.au-head-chips { align-self: center; }
/* a long name or description wraps inside the title, so the switch and buttons stay on the right */
.au-head > .page-title { flex: 1 1 360px; }
.page-title .au-head-about, .page-title .au-handover { flex-basis: 100%; }
.page-title .au-handover { color: var(--brass-ink); }
.au-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-2); }
.au-tiles .tile { padding: var(--sp-2) var(--sp-3); }
.au-by-trigger { margin: -4px 0 var(--sp-3); }
.au-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 var(--sp-3); overflow-x: auto; }
.au-tab {
  display: inline-flex; align-items: center; height: var(--control-h); padding: 0 var(--sp-3); color: var(--muted); font-weight: 600;
  font-size: var(--fs); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.au-tab:hover { color: var(--ink); }
.au-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.au-tab:focus-visible { outline-offset: -3px; }
/* the draft bar: stays in view while the steps scroll (below the phone's top bar) */
.au-bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
@media (max-width: 899px) { .au-bar { top: 48px; } }
.au-bar-text { flex: 1 1 18em; color: var(--text); font-size: var(--fs); }
.au-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.au-unsaved { color: var(--brass-ink); font-weight: 650; font-size: var(--fs-sm); }
.au-problems { border-color: var(--brass-line); background: var(--brass-wash); }
.au-problems a { color: var(--brass-ink); font-weight: 650; }
.au-waits {
  margin: var(--sp-1) 0; padding: 6px 10px; border-left: 3px solid var(--brass-ink); background: var(--brass-wash); color: var(--text);
  font-size: var(--fs-sm); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
/* triggers */
.au-triggers { list-style: none; margin: 0; padding: 0; display: grid; }
.au-trigger { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); justify-content: space-between; padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.au-trigger:first-child { border-top: 0; padding-top: 0; }
.au-trigger-main { flex: 1 1 18em; min-width: 0; }
/* WP5b: a trigger switched off on its own (a ported workflow's fixed trigger beside HighLevel's) */
.au-trigger.is-off .au-step-name, .au-trigger.is-off .au-step-sum { color: var(--muted); }
/* steps */
.au-steps { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: var(--sp-2); }
.au-steps-nested { border-left-style: dashed; }
.au-step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-2) var(--sp-3); scroll-margin-top: 96px; }
.au-step:focus { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.au-step.is-off { background: var(--paper); border-style: dashed; border-color: var(--line-strong); }
.au-step.has-problem { border-color: var(--brass-ink); box-shadow: inset 3px 0 0 var(--brass-ink); }
.au-step-head { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: flex-start; }
.au-step-n {
  position: absolute; left: -26px; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink); font-size: var(--fs-xs); font-weight: 700;
}
.au-step-main { flex: 1 1 16em; min-width: 0; display: grid; gap: 1px; }
.au-step-type { color: var(--muted); font-size: var(--fs-xs); font-weight: 650; }
.au-step-name { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.au-step-sum { color: var(--text); font-size: var(--fs); overflow-wrap: anywhere; }
.au-step-count { color: var(--lamp); font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.au-step-problem { color: var(--brass-ink); font-size: var(--fs); font-weight: 600; }
.au-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.au-more { position: relative; }
.au-more > summary { list-style: none; }
.au-more > summary::-webkit-details-marker { display: none; }
.au-more-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; display: grid; gap: 2px; min-width: 180px; padding: var(--sp-1);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.au-more-menu .btn { justify-content: flex-start; width: 100%; border-color: transparent; }
.au-more-menu .btn:hover { background: var(--hover); }
.au-step-list { display: grid; gap: var(--sp-2); padding-left: var(--sp-3); }
.au-add { justify-self: start; }
.au-branches { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }
.au-branch { border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-2) 10px 10px; background: var(--surface-2); display: grid; gap: var(--sp-2); }
.au-branch-else { background: var(--paper); }
.au-branch-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2); align-items: flex-start; }
.au-branch-name { color: var(--ink); font-weight: 700; font-size: var(--fs-md); }
.au-branches > .btn { justify-self: start; }
/* dialogs: wording with merge fields and a preview, conditions, step types */
.au-merge-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; }
.au-merge-tools .select { max-width: 280px; }
.au-merge .textarea { font-size: var(--fs-md); }
.au-preview {
  display: grid; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--paper);
  font-size: var(--fs-md); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.au-preview-label { color: var(--muted); font-size: var(--fs-sm); font-weight: 650; margin-bottom: var(--sp-1); }
.au-warn { color: var(--brass-ink); font-weight: 600; }
.au-lead-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.au-lead-row .input { width: auto; flex: 1 1 14em; }
.au-lead-preview { display: grid; gap: 6px; }
.au-field-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.au-field-pick .select, .au-field-pick .input { width: auto; flex: 1 1 12em; }
.au-cond { display: grid; gap: 10px; }
/* Add a condition / Add a group keep their own width (a grid would stretch them across the dialog) */
.au-cond > .btn, .au-group > .btn { justify-self: start; }
.au-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.au-group { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: var(--sp-2); background: var(--surface-2); }
.au-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs); font-weight: 650; color: var(--ink); }
.au-group-head .select { width: auto; }
.au-cond-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.au-cond-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.au-cond-parts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 20em; }
.au-cond-parts .select, .au-cond-parts .input { width: auto; min-width: 9em; flex: 1 1 9em; }
/* WP5c: whose record a condition reads (CMA-12), on its own line */
.au-cond-parts .au-cond-scope { flex: 1 1 100%; }
.au-filter > summary { cursor: pointer; min-height: var(--control-h); display: flex; align-items: center; font-weight: 650; color: var(--ink); font-size: var(--fs-md); }
.au-field-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.au-field-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.au-field-row .select, .au-field-row .input { width: auto; flex: 1 1 12em; }
.au-radios { display: grid; gap: var(--sp-1); }
.au-type-group { margin: 0 0 var(--sp-2); }
.au-type-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.au-type {
  display: flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h); padding: 0 var(--sp-3); border: 1px solid var(--line);
  border-radius: var(--r); cursor: pointer; font-size: var(--fs-md); color: var(--ink); transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.au-type:hover { border-color: var(--line-strong); background: var(--surface-2); }
.au-type:has(input:checked) { border-color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp); background: var(--mint-wash); }
.au-type input { accent-color: var(--lamp); }
.au-tag-checks { max-height: 240px; overflow-y: auto; padding: var(--sp-1) 2px; }
/* the test run */
.au-test-list { list-style: none; margin: var(--sp-2) 0; padding: 0; display: grid; gap: var(--sp-2); }
.au-test-step { border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-2) 10px; display: grid; gap: var(--sp-1); }
.au-test-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; align-items: center; }
.au-test-name { font-weight: 650; color: var(--ink); }
.au-test-detail, .au-test-subject { font-size: var(--fs); color: var(--text); }
.au-test-end { font-weight: 650; color: var(--ink); font-size: var(--fs-md); }
/* runs, log, history, tags */
.au-log-detail { min-width: 16em; color: var(--text); }
.au-tags td.c-wide { min-width: 12em; } /* the description keeps its room next to the two dates */
/* Tags grouped by category, each with its meaning and count; the dialog's saved name and the category's meaning */
.tag-group + .tag-group { margin-top: var(--sp-5); }
.tag-group-name { display: flex; align-items: baseline; gap: var(--sp-2); margin: 0; font-size: var(--fs-md); }
.tag-group-count { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.tag-group-meaning { margin: 2px 0 var(--sp-2); }
.tag-saved-as.is-problem { color: var(--danger); }
.au-history li { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs); }
.au-history li:first-child { border-top: 0; }
@media (max-width: 639px) {
  .au-steps { padding-left: var(--sp-3); }
  .au-step-list { padding-left: var(--sp-2); }
  .au-step-n { left: -22px; width: 20px; height: 20px; font-size: var(--fs-2xs); }
  .au-tools { flex-basis: 100%; }
  .au-more[open] { flex-basis: 100%; }
  .au-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .au-tiles .tile { padding: var(--sp-2) 10px; }
  .au-more-menu { position: static; box-shadow: none; margin-top: 6px; min-width: 0; }
  .au-channel-name { min-width: 0; }
  :is(.au-table, .au-runs, .au-log, .au-tags) .c-name { flex: 1 1 100%; }
  :is(.au-table, .au-runs, .au-log, .au-tags).cards-on-phone td.c-wide { flex: 1 1 100%; }
  :is(.au-table, .au-runs, .au-log, .au-tags).cards-on-phone td.actions { margin-left: auto; }
  .au-log-detail, .au-tags td.c-wide { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .au-tab, .au-type { transition: none; } }
/* WP5a partner access (views/partner-access.js) */
.pa-state { display: grid; gap: 6px; font-size: var(--fs); }
.pa-state .chip { margin-right: var(--sp-1); }
.pa-sub { margin: var(--sp-1) 0 var(--sp-2); }
.pa-sub h2 { font-size: var(--fs-md); }
.pa-keys .sub.code { display: inline-block; margin-top: 2px; }
@media (max-width: 639px) { .pa-keys .c-name { flex: 1 1 100%; } }
/* ---------- end WP3 automations ---------- */
/* ---------- WP10 fields: the record in HighLevel's folders (views/fields-panel.js) and the forecast (views/forecast.js), UX v2 ---------- */
details.fields-folder { padding: 0; }
details.fields-folder > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: var(--sp-2) var(--sp-4);
}
details.fields-folder > summary::-webkit-details-marker { display: none; }
details.fields-folder > summary::after {
  content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
  transition: transform 200ms var(--ease-out); flex: none; margin-left: var(--sp-1);
}
details.fields-folder[open] > summary::after { transform: translateY(3px) rotate(-135deg); }
details.fields-folder > summary:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.fields-count { margin-left: auto; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
details.fields-folder[open] > :not(summary) { margin-left: var(--sp-4); margin-right: var(--sp-4); }
details.fields-folder[open] > :last-child { margin-bottom: var(--sp-3); }
.fields-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-2); }
.fields-note { margin-bottom: 6px; }
.fields-facts dt { display: flex; flex-direction: column; gap: 2px; }
.fields-hl { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.fields-derived { color: var(--muted); font-size: var(--fs-sm); }
.fields-decision { display: inline; color: var(--brass-ink); }
.fields-form .field label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.fields-form .field { display: grid; gap: var(--sp-1); align-content: start; }
/* the forecast: UX v2's figures for the totals, a table by stage */
.forecast-summary { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.forecast-stat .hint { margin-top: 2px; }
.forecast-value { overflow-wrap: anywhere; }
.forecast-table tfoot th, .forecast-table tfoot td { border-top: 1px solid var(--line-strong); font-weight: 650; color: var(--ink); padding: var(--row-pad-y) 12px; }
.forecast-table tbody th { font-weight: 600; color: var(--ink); }
.forecast-panel { padding: 0; }
.forecast-panel > .table-wrap { border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.forecast-panel > .hint { margin: var(--sp-2) var(--sp-4); }
.forecast-panel > .hint:last-child { margin-bottom: var(--sp-3); }
@media (max-width: 479px) {
  details.fields-folder > summary { padding: var(--sp-2) var(--sp-3); }
  details.fields-folder[open] > :not(summary) { margin-left: var(--sp-3); margin-right: var(--sp-3); }
  .fields-facts { grid-template-columns: minmax(0, 1fr); }
  .fields-facts dt { padding-bottom: 0; border-bottom: 0; }
  .fields-facts dd { padding-top: 2px; }
}
@media (max-width: 639px) {
  .forecast-table.cards-on-phone tbody tr, .forecast-table.cards-on-phone tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: var(--sp-3); }
  .forecast-table.cards-on-phone tfoot { display: block; }
  .forecast-table.cards-on-phone tbody th, .forecast-table.cards-on-phone tfoot th { grid-column: 1 / -1; display: block; padding: 0; border: 0; }
  .forecast-table.cards-on-phone tfoot td { display: block; padding: 0; border: 0; text-align: left; }
  .forecast-table.cards-on-phone tfoot .fc-blank { display: none; }
}
/* ---------- end WP10 fields ---------- */
/* --- WP11 two-way email: the email channel in the inbox, and the lead record's Email dialog --- */
.ch-email { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.msg-subject { font-size: 0.8125rem; font-weight: 700; color: var(--ink); margin-top: 2px; overflow-wrap: anywhere; }
.msg-note { font-size: 0.75rem; color: var(--text); margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line-strong); }
.msg.is-unverified { border-color: var(--brass-ink); border-style: dashed; }
.msg.is-unverified .msg-note:first-of-type { color: var(--brass-ink); font-weight: 650; border-left-color: var(--brass-ink); }
.composer-subject-row { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 0.8125rem; color: var(--ink); }
.composer-subject-row .input { flex: 1; min-width: 0; }
.email-compose-to { font-size: 0.875rem; color: var(--ink); overflow-wrap: anywhere; }
.email-compose-note { font-size: 0.8125rem; color: var(--text); }
/* --- end WP11 --- */
/* NBC secure hand-off (CLEAR-12, views/nbc-panel.js) */
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 0 0 6px; }
.nbc-links li > span { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.nbc-link-meta { display: block; }
/* ---------- growth tools (CLEAR-14, views/growth.js), UX v2 ----------
 * The summary chips, the search as the shared filter bar, one card per funded business (two columns on wide screens). */
.growth-lead { margin: -6px 0 10px; max-width: 80ch; }
.growth-summary { list-style: none; margin: 0 0 12px; padding: 0; }
.growth-tools { margin: 12px 0 6px; }
.growth-list { display: grid; gap: 12px; margin-top: 10px; }
@media (min-width: 1100px) { .growth-list { grid-template-columns: 1fr 1fr; align-items: start; } }
.growth-list .panel + .panel { margin-top: 0; }
.growth-card h2 { font-size: var(--fs-md); }
.growth-card .facts { margin-bottom: 12px; }
.growth-swatch { display: inline-block; width: 16px; height: 16px; border-radius: var(--r-xs); border: 3px solid var(--line-strong); vertical-align: -3px; }
.growth-paused { color: var(--ink); background: var(--brass-wash); border-left: 2px solid var(--brass-ink); padding: 6px 10px; border-radius: var(--r-xs); font-size: var(--fs); margin-bottom: 10px; }
/* --- WP8: Social media > Accounts (views/content-accounts.js) --- */
.acct-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
@media (min-width: 1000px) { .acct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acct-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; display: grid; gap: 8px; height: 100%; align-content: start; }
.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acct-head h2 { font-size: var(--fs-md); }
.acct-name { color: var(--ink); font-weight: 600; font-size: var(--fs-md); margin-top: 2px; overflow-wrap: anywhere; }
.acct-why { font-size: var(--fs-md); color: var(--text); text-wrap: pretty; }
.acct-why.is-on { color: var(--lamp); font-weight: 600; }
.acct-warn { font-size: var(--fs); color: var(--brass-ink); background: var(--brass-wash); border-radius: var(--r-sm); padding: 6px 10px; }
.acct-steps > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--control-h); font-size: var(--fs); font-weight: 650; color: var(--ink); }
.acct-steps > summary::-webkit-details-marker { display: none; }
.acct-steps > summary::before { content: "▸"; color: var(--muted); }
.acct-steps[open] > summary::before { content: "▾"; }
.acct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 4px; }
.acct-blocked { flex-basis: 100%; }
.acct-page { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; flex-basis: 100%; }
.acct-page .field { flex: 1 1 220px; }
.acct-comments { display: grid; gap: 10px; }
.acct-tc-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: var(--fs-md); color: var(--ink); }
.acct-tc-steps .hint { display: block; margin-top: 2px; }
.acct-defect { border-left: 3px solid var(--brass); background: var(--brass-wash); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px; display: grid; gap: 6px; font-size: var(--fs-md); color: var(--ink); }
.acct-foot { margin-top: 12px; }
.acct-lead { margin: -6px 0 10px; max-width: 80ch; }
.oauth-return { padding: 32px 16px; }
/* ---------- end WP8 ---------- */

/* ---------- WP8: New post, the composer (views/content-composer.js), UX v2 tokens ----------
 * The kind of post as pills (the chosen one dark), where it goes and when, the files with their thumbnails, the
 * problems in words, the upload's progress. */
.cmp-types, .cmp-where, .cmp-when { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.cmp-type-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-type { display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); cursor: pointer; font-weight: 600; color: var(--ink); font-size: var(--fs); }
.cmp-type:has(input:checked) { background: var(--ledger); border-color: var(--ledger); color: var(--on-dark); }
.cmp-type input { accent-color: var(--brass); }
.cmp-type:focus-within { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.cmp-where-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cmp-where-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.cmp-why { color: var(--muted); font-size: var(--fs-sm); }
.cmp-file { font-size: var(--fs); max-width: 100%; }
.cmp-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cmp-file-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); }
.cmp-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); display: block; }
.cmp-thumb.is-video { background: var(--ledger); }
.cmp-file-text { display: grid; min-width: 0; }
.cmp-file-name { color: var(--ink); font-weight: 600; font-size: var(--fs); overflow-wrap: anywhere; }
.cmp-count { font-weight: 400; }
.cmp-when-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cmp-when-row .field { flex: 0 1 200px; }
.cmp-problems { margin: 0; padding: 8px 12px 8px 28px; background: var(--brass-wash); border-left: 2px solid var(--brass-ink); border-radius: var(--r-xs); color: var(--ink); font-size: var(--fs); display: grid; gap: 4px; }
.cmp-problems[hidden] { display: none; }
.cmp-progress { color: var(--lamp); font-weight: 600; font-size: var(--fs); }
/* ---------- end WP8 composer ---------- */
/* ---------- social results (views/social-results.js), UX v2 ----------
 * Built on the Reports screen's toolbar, key numbers, bars and tooltip (the .rpt classes and colours); what is its own
 * is below, on the tokens. No red: the switched-off Meta numbers are shown with words in brass ink. */
.sr-panel + .sr-panel { margin-top: 12px; }
.sr-panel .panel-head h2 + p { margin-top: 2px; max-width: 72ch; text-wrap: pretty; }
.sr-toggle { margin-bottom: 10px; }
.sr-sub { font-size: var(--fs-md); color: var(--ink); margin: 18px 0 8px; }
.sr-table th[scope="row"] { color: var(--ink); font-weight: 600; white-space: nowrap; }
.sr-table .sub { white-space: normal; }
.sr-table tr[data-zero] th, .sr-table tr[data-zero] td { color: var(--muted); font-weight: 500; }
.sr-table thead th[aria-sort] { color: var(--ink); }
.sr-sort {
  display: inline-flex; align-items: center; justify-content: inherit; height: 20px; padding: 0; margin: 0;
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap;
}
.sr-sort:hover { color: var(--ink); text-decoration: underline; }
.sr-sort:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; border-radius: var(--r-xs); }
th.num .sr-sort { width: 100%; justify-content: flex-end; }
.sr-arrow { font-size: var(--fs-2xs); margin-left: 2px; }
.sr-post { min-width: 240px; max-width: 420px; }
.sr-post .strong { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.sr-perpost-table td.num, .sr-perpost-table th.num { width: 1%; white-space: nowrap; }
th.sr-insight, td.sr-insight { color: var(--muted); }
.sr-best { padding: 8px 12px; margin-bottom: 10px; background: var(--brass-wash); border: 1px solid var(--brass-line); border-radius: var(--r); color: var(--ink); text-wrap: pretty; }
.sr-best-label { color: var(--brass-ink); font-weight: 600; }
/* a lead form that could not be read: words and brass ink, never red (docs/admin-ui.md) */
.sr-alert { padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-left: 3px solid var(--brass-ink); border-radius: var(--r); color: var(--ink); font-weight: 600; text-wrap: pretty; }
.sr-foot { color: var(--muted); font-size: var(--fs-sm); margin-top: 8px; text-wrap: pretty; }
.sr-funnel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 8px; }
.sr-funnel-pick { flex: 1 1 260px; max-width: 360px; }
.sr-amount { color: var(--text); }
.sr-amount strong { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: var(--fs-xl); color: var(--ink); font-variant-numeric: lining-nums; }
.sr-total th, .sr-total td { font-weight: 700; color: var(--ink); background: var(--surface-2); }
.sr-wrap-head thead th { white-space: normal; vertical-align: bottom; min-width: 4.5em; }
.sr-sort-phone { display: none; }
.sr-insight-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sr-placeholder { background: var(--surface-2); border-style: dashed; border-color: var(--line-strong); }
.sr-dash { color: var(--muted); }
.sr-needs { color: var(--brass-ink); font-weight: 600; font-size: var(--fs-sm); margin-top: 6px; }
@media (max-width: 559px) {
  .sr .sr-periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: var(--r-lg); }
  .sr .sr-periods .rpt-period { flex: none; }
}
@media (max-width: 639px) {
  .sr-library.cards-on-phone tbody td.c-post { flex: 1 1 100%; order: -1; }
  .sr-library.cards-on-phone tbody td.c-date { order: -2; flex: 1 1 100%; color: var(--muted); font-size: var(--fs-sm); }
  .sr-post { min-width: 0; max-width: none; }
  /* per post, every channel, lead forms: one card per row, the name on top, then the numbers three to a line with
   * their names above them. The per-post sort moves to the picker, so its header buttons are not left focusable. */
  .sr-sort-phone { display: grid; gap: 6px; margin-bottom: 10px; }
  .sr-perpost-table.cards-on-phone thead { display: none; }
  .table.cards-on-phone.sr-cards tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px 12px; }
  .table.cards-on-phone.sr-cards tbody th, .table.cards-on-phone.sr-cards tbody td.sr-post { grid-column: 1 / -1; display: block; padding: 0; border: 0; }
  .table.cards-on-phone.sr-cards td[data-label]::before { display: block; margin: 0 0 2px; line-height: 1.3; }
  .table.cards-on-phone.sr-cards tbody td.sr-insight { display: none; }
  .table.cards-on-phone.sr-cards .sr-total th, .table.cards-on-phone.sr-cards .sr-total td { background: none; }
  .table.cards-on-phone.sr-cards tr.sr-total { background: var(--surface-2); }
}
/* ---------- end social results ---------- */
/* ---------- WP13 calendars: hours with breaks, Calendars, Book a call (views/calendars.js, book-call.js), UX v2 ---------- */
/* the box around the week is as wide as the week (the shared .hours-table is narrower: no breaks column) */
.hours-table.hours-breaks { max-width: none; }
.table-wrap:has(> .hours-breaks) { max-width: 880px; }
.hours-table.hours-breaks td.breaks-cell { width: auto; min-width: 260px; }
.break-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.break-list:empty { display: none; }
.break-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.break-row .input.time { width: 118px; }
.break-label, .break-to { color: var(--muted); font-size: var(--fs-sm); }
.breaks-cell .break-list + .btn { margin-top: 4px; }
.confirm-hours { margin-top: 10px; font-weight: 600; color: var(--ink); }
.panel-intro { margin: -4px 0 10px; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.mono { font-family: var(--mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.link-text { display: inline-block; max-width: 34ch; overflow-wrap: anywhere; }
.cal-table .mono.nowrap { white-space: nowrap; }
.week-summary { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.week-summary .strong { color: var(--ink); font-weight: 600; }
.hl-table .sub { display: block; }
/* phones: the two tables are the shared cards (.cards-on-phone); each value takes its own line */
@media (max-width: 639px) {
  .cal-table.cards-on-phone tbody td, .hl-table.cards-on-phone tbody td { flex: 1 1 100%; }
  .cal-table.cards-on-phone td.actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .cal-table.cards-on-phone td.actions .btn + .btn { margin-left: 0; }
}
/* My calendar connection (WP13 calendar sync) */
.sync-list { list-style: none; margin: 0; padding: 0; }
.sync-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sync-row:last-child { border-bottom: 0; }
.sync-main { flex: 1 1 260px; min-width: 0; }
.sync-main .sub { margin: 3px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.sync-main .problem-text { color: var(--ink); }
.sync-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
/* Book a call */
.book-lead { display: grid; gap: 6px; margin-bottom: 12px; }
.book-lead > .btn { justify-self: start; }
.book-chosen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--ink); }
.book-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.book-results li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: var(--fs); }
.book-results .sub { color: var(--muted); font-size: var(--fs-sm); }
.book-pick { font-weight: 600; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.day-head .row { display: flex; gap: 6px; }
.day-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 6px; }
.day-btn, .time-btn {
  display: grid; justify-items: center; align-content: center; gap: 1px; padding: 4px 8px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.day-btn { min-height: calc(var(--control-h) + 12px); }
.time-btn { height: var(--control-h); font-weight: 600; font-size: var(--fs); }
.day-btn:hover:not([disabled]), .time-btn:hover { border-color: var(--muted); background: var(--surface-2); }
.day-btn[aria-pressed="true"], .time-btn[aria-pressed="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--on-dark); }
.day-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.day-btn .day-name { font-weight: 600; font-size: var(--fs-sm); color: inherit; } /* another .day-name rule greys it: not on the pressed (dark) button */
.day-btn .day-count { font-size: var(--fs-xs); color: inherit; }
.times-label { margin-top: 12px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 6px; max-height: 240px; overflow: auto; }
.book-with { margin-top: 12px; }
.book-with:empty { display: none; }
/* review: a calendar whose owner can no longer take calls: the chip, and why under it */
.status-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 20ch; }
.status-stack .sub { white-space: normal; }
/* ---------- end WP13 calendars ---------- */
/* ---------- WP11 two-way email (Conversations, views/inbox*.js; the application's Email panel, views/detail.js) ----------
 * UX v2 already has the email channel's badge (.ch-email) and the subject line (.msg-subject). */
/* an email's notes inside its bubble (.msg-note is UX v2's internal comment, so these have their own name) */
.msg-mailnote { font-size: var(--fs-sm); color: var(--text); margin-top: var(--sp-1); padding-left: var(--sp-2); border-left: 2px solid var(--line-strong); }
.msg.is-unverified .bubble { border-color: var(--brass-ink); border-style: dashed; }
.msg.is-unverified .msg-mailnote:first-of-type { color: var(--brass-ink); font-weight: 650; border-left-color: var(--brass-ink); }
/* the composer's subject line, inside the one box, above the text */
.composer-subject-row { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 12px 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.composer-subject-row[hidden] { display: none; }
.composer-subject {
  flex: 1; min-width: 0; height: 28px; padding: 0 0 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: var(--ink); font: 600 var(--fs) var(--font); outline: none;
}
.composer-subject:focus-visible { border-bottom-color: var(--focus-light); }
.composer-subject[aria-invalid="true"] { border-bottom-color: var(--brass-ink); }
.email-compose-to { font-size: var(--fs-md); color: var(--ink); overflow-wrap: anywhere; }
.email-compose-note { font-size: var(--fs); color: var(--text); }
/* ---------- end WP11 ---------- */
/* ---------- calls (WP9: views/calls.js, the dialer in ../js/dialer.js), UX v2 ----------
 * The call log is the shared table (cards on phones); the dashboard reuses the reports' toolbar, tiles and bar lists
 * (.rpt). The three views are the shared segmented control in the header, with links (each view is its own address).
 * The dialer is one panel fixed to the corner of the screen (a bottom sheet on phones) that stays while staff move
 * between screens; it is not a modal. Hang up is ink on white with words, never red. */
.calls-line { align-self: center; }
.calls-tabs a {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); color: var(--muted);
  font-weight: 600; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.calls-tabs a:hover { color: var(--ink); }
.calls-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.calls-off ol, .calls-wait { margin: 4px 0 4px 1.2em; padding: 0; display: grid; gap: 1px; font-size: var(--fs-sm); color: var(--ink); }
.calls-off a { font-weight: 600; }
.calls-count { margin-bottom: 6px; }
.calls-truncated { margin-bottom: 6px; color: var(--ink); }
/* the log's filters are the shared filter bar; the dates are narrow, Name or number takes the room */
.calls-filters .field:has(input[type="date"]) { flex: 0 1 150px; }
.calls-filters .field:has(input[type="search"]) { flex: 1 1 160px; max-width: 240px; }
.calls-filters > .btn { align-self: flex-end; }
.calls-sort {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 2px; height: 20px; text-transform: inherit; letter-spacing: inherit;
}
.calls-sort:hover { color: var(--ink); text-decoration: underline; }
th[aria-sort="ascending"] .calls-sort, th[aria-sort="descending"] .calls-sort { color: var(--ink); }
.calls-action-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; font-size: var(--fs-sm); color: var(--text); }
.calls-actions { min-width: 150px; }
/* the dashboard's own dates (HighLevel's start -> end), under the toolbar */
.calls-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: -4px 0 12px; }
.calls-dates .field { flex: 0 1 150px; }
.calls-dates .field > span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.calls-table td { vertical-align: top; }
.calls-table .calls-when .row-link { white-space: nowrap; }
.calls-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .calls-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .calls-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.calls-na { color: var(--muted); font-weight: 600; font-size: var(--fs-lg); line-height: 1.3; padding: 6px 0 2px; }
.calls-settings { max-width: 980px; }
.calls-settings .panel { display: grid; gap: 10px; }
.calls-settings .panel-head { margin-bottom: 0; }
.calls-settings fieldset { gap: 6px; }
.calls-settings legend { padding: 0; }
.calls-seconds-field .input { max-width: 140px; }
.calls-settings .field > span.hint { color: var(--muted); font-weight: 400; }
.calls-wordings { gap: 4px; }
.calls-wording { align-items: flex-start; min-height: 0; padding: 4px 0; }
.calls-wording input { margin-top: 3px; }
.calls-quote { color: var(--ink); font-weight: 600; }
.calls-audio { display: grid; gap: 6px; justify-items: start; }
.calls-audio audio { width: min(100%, 420px); height: 36px; }
.calls-transcript { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: var(--r-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
/* the application's Tasks: Call next to Complete */
.task-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 639px) {
  .page-head .calls-tabs { width: 100%; }
  .page-head .calls-tabs a { flex: 1; justify-content: center; height: var(--control-h-sm); }
  .page-head .page-actions:has(.calls-tabs) { width: 100%; }
  .page-head .page-actions:has(.calls-tabs) > .btn { flex: 1; }
  /* phones: one card per call (the shared .cards-on-phone layout): the time and how it ended take a full line */
  .calls-table .calls-when, .calls-table .c-ended { flex: 1 1 100%; }
  .calls-table .calls-when .row-link { font-size: var(--fs-md); }
}

.dialer {
  position: fixed; z-index: 40; right: 16px; bottom: 16px; width: 300px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 10px 12px 12px; display: grid; gap: 8px;
}
.dialer-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.dialer-head h2 { font-size: var(--fs-md); }
.dialer-icon { width: 15px; height: 15px; color: var(--lamp); }
.dialer-state { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.dialer[data-state="open"] .dialer-state { color: var(--lamp); }
.dialer-close { margin-left: auto; }
.dialer-body { display: grid; gap: 8px; }
.dialer-form { display: grid; gap: 8px; }
.dialer-off { color: var(--ink); font-weight: 600; }
.dialer-wait { margin: 0 0 0 1.2em; padding: 0; display: grid; gap: 1px; font-size: var(--fs-sm); color: var(--ink); }
.dialer-test { font-size: var(--fs-sm); color: var(--brass-ink); background: var(--brass-wash); border: 1px solid var(--brass-line); border-radius: var(--r-sm); padding: 5px 8px; }
.dialer-who { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.dialer-number { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: var(--fs-fig); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.dialer-timer { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.dialer-input { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.dialer-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.dialer-key { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.dialer-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dialer-actions .btn { flex: 1 1 auto; }
.dialer-hangup { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.dialer-take { font-size: var(--fs-sm); color: var(--ink); }
.dialer-ended { color: var(--ink); }
@media (max-width: 559px) {
  .dialer { left: 0; right: 0; bottom: 0; width: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 85vh; }
}
@media (prefers-reduced-motion: no-preference) {
  .dialer { animation: dialer-in 200ms var(--ease-out); }
}
@keyframes dialer-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* ---------- end calls ---------- */
/* ---------- reporting tabs (WP14: views/reports-tabs*.js), UX v2 ----------
 * HighLevel's module top tabs as one underlined strip under the header (as Conversations' tabs): muted words, the
 * current one ink with a ledger-green underline. On a phone the strip scrolls sideways inside itself, never the page. */
.rpt-head { margin-bottom: 4px; }
.rpt-tabs { margin: 0 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rpt-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.rpt-tabs li { flex: none; }
.rpt-tab {
  display: inline-flex; align-items: center; height: 36px; padding: 0 10px; margin-bottom: -1px;
  color: var(--muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.rpt-tab:hover { color: var(--ink); }
.rpt-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.rpt-tab:focus-visible { outline-offset: -3px; }
@media (max-width: 599px) { .rpt-tab { height: 40px; padding: 0 8px; } }

/* what a tab's numbers wait for: brass ink on the brass wash, words first */
.rpt-notes { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--brass-line); border-radius: var(--r-lg); background: var(--brass-wash); color: var(--ink); font-size: var(--fs); }
.rpt-notes-head { font-weight: 700; color: var(--brass-ink); font-size: var(--fs-sm); margin-bottom: 4px; }
.rpt-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.rpt-more { margin-top: 8px; font-size: var(--fs); font-weight: 600; }
.rpt-more a { display: inline-flex; align-items: center; min-height: var(--control-h); }
.rpt-footnote { margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); max-width: 80ch; }
.rpt-table-wrap { margin-top: 10px; }
.rpt-table-wrap tbody th, .rpt-table-wrap tfoot th, .rpt-table-wrap td.num, .rpt-table-wrap td.nowrap { white-space: nowrap; }
.rpt-table-wrap td.rpt-wide { min-width: 280px; }
@media (max-width: 559px) { .rpt-table-wrap td.rpt-wide { min-width: 420px; } }
/* six key numbers stay one row on a wide screen; a long figure (money) is set smaller rather than broken */
@media (min-width: 1200px) { .rpt-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.rpt-kpi .figure.is-long { font-size: var(--fs-xl); line-height: 1.55; overflow-wrap: normal; white-space: nowrap; }
.rpt-panel + .rpt-panel { margin-top: 12px; }
.rpt-grid + .rpt-panel { margin-top: 0; }
.rpt-forecast-table tfoot th, .rpt-forecast-table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 700; color: var(--ink); }

/* a workflow's Stats: one folded row per workflow */
.rpt-wf-list { display: grid; gap: 6px; }
.rpt-wf { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.rpt-wf > summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  min-height: 40px; padding: 6px 14px; cursor: pointer; border-radius: var(--r-lg);
}
.rpt-wf > summary:hover { background: var(--surface-2); }
.rpt-wf[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.rpt-wf-name { color: var(--ink); font-weight: 600; font-size: var(--fs); }
.rpt-wf-sum { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.rpt-wf-body { padding: 10px 14px 12px; display: grid; gap: 8px; }
.rpt-wf-body h3 { font-size: var(--fs-sm); }
.rpt-wf-triggers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs); max-width: 520px; }
.rpt-wf-triggers li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rpt-wf-triggers .num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rpt-section { font-size: var(--fs-lg); margin: 18px 0 8px; }
.rpt-section:first-child, .rpt-notes + .rpt-section { margin-top: 0; }
.rpt-reasons { margin-top: 12px; display: grid; gap: 6px; }
.rpt-reasons h3 { font-size: var(--fs-sm); }
/* ---------- end reporting tabs ---------- */

/* ---------- comment automation (parity gaps A: Workflows > Comment automation, views/comment-automation.js) ---------- */
.ca-master { padding: 12px 16px; margin-bottom: 12px; }
.ca-master .hint, .ca-switch .hint { margin: 2px 0 0 46px; }
.ca-switch { margin: 4px 0 8px; }
.ca-tabs { margin-top: 4px; }
.ca-tabs .au-tab { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.ca-tabs .au-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--lamp); }
.ca-cols { display: grid; gap: 12px; align-items: start; }
@media (min-width: 1100px) { .ca-cols { grid-template-columns: minmax(0, 1fr) 380px; } .ca-side { position: sticky; top: calc(var(--topbar) + 12px); } }
.ca-main { display: grid; gap: 12px; min-width: 0; }
.ca-main > .panel + .panel { margin-top: 0; }
.ca-main .panel > .field, .ca-main .panel > .form-grid, .ca-main .panel > div + .field { margin-top: 10px; }
.ca-text-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ca-text .textarea { width: 100%; }
.char-count.is-over { color: var(--brass-ink); font-weight: 700; }
.ca-seconds { width: 110px; flex: none; }
.ca-buttons { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.ca-button { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); display: grid; gap: 8px; }
.ca-button-row { display: grid; gap: 8px; align-items: end; }
@media (min-width: 720px) { .ca-button-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; } }
.ca-title-row { display: flex; align-items: center; gap: 8px; }
.ca-title-row .input { flex: 1 1 auto; min-width: 0; }
.ca-title-row .char-count { white-space: nowrap; }
.ca-insert, .ca-try { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ca-instant { border-color: var(--brass-line); }
.ca-preview-out { margin-top: 12px; display: grid; gap: 8px; }
.ca-comment { color: var(--ink); }
.ca-timeline { margin: 4px 0 0; padding: 0; list-style: none; }
.ca-step-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: var(--fs-sm); }
.ca-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.ca-what { color: var(--ink); font-weight: 650; }
.ca-bubble { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ca-qr { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ca-answers { margin-top: 6px; font-size: var(--fs-sm); }
.ca-answers ul { margin: 4px 0 0 16px; display: grid; gap: 4px; }
.ca-errors ul { margin: 4px 0 0 18px; }
.ca-actions { position: sticky; bottom: 0; z-index: 2; align-items: center; margin-top: 12px; box-shadow: var(--card-shadow); }
.ca-stamp { margin-left: auto; }
/* ---------- end comment automation ---------- */

/* ---------- consent panel (parity gaps A: the lead record's Consent, views/consent-panel.js) ---------- */
.consent-words { margin: 4px 0 0; padding: 8px 12px; border-left: 3px solid var(--lamp); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; color: var(--ink); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.consent-panel .facts dd .chip { vertical-align: baseline; }
.consent-history .consent-words { margin-top: 6px; }
/* ---------- end consent panel ---------- */
/* ---------- WP2 lead capture (views/lead-panels.js, lead-assignment.js), UX v2 ----------
 * followers in the application's action bar, the hand-off reason under its header, the merge list, Add lead and the
 * lead-assignment rule */
.followers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs); min-height: var(--control-h); }
.followers-label { color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.followers-names { color: var(--ink); }
.handoff { margin-top: 8px; padding: 7px 10px; border-left: 3px solid var(--brass-ink); background: var(--brass-wash); border-radius: var(--r-xs); font-size: var(--fs); color: var(--ink); max-width: 80ch; }
.merge-list, .mode-list { display: grid; gap: 6px; }
.mode-list { border: 0; padding: 0; margin: 0 0 12px; }
.mode-list legend { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; color: var(--ink); }
.merge-row, .mode-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer;
  transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.merge-row:hover, .mode-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.merge-row:has(input:checked), .mode-row:has(input:checked) { border-color: var(--lamp); background: var(--selected); }
.merge-row input, .mode-row input { margin-top: 3px; accent-color: var(--lamp); }
.merge-name, .mode-name { display: block; font-weight: 600; color: var(--ink); }
.mode-row .hint, .merge-row .hint { display: block; }
.input-narrow { width: 6em; min-width: 0; }
.lead-form { align-items: start; } /* a field with a hint must not stretch the input beside it */
/* a field's hint reads as a hint (muted, regular), not as a second label */
.dialog:has(.lead-form) .field > .hint, .lead-assign .field > .hint { color: var(--muted); font-weight: 400; }
.lead-assign { display: grid; gap: 12px; max-width: 880px; }
.lead-assign .stack { gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* #125's later fix (in #129): the Lead assignment form's hints in plain weight, a narrower owner picker, room above
 * the Welcome email panel */
.la-form .field > .hint { color: var(--muted); font-weight: 400; }
.la-form .field .select { max-width: 360px; }
.la-form + .panel { margin-top: 12px; }
/* ---------- end WP2 ---------- */

/* ---------- WP12 CRM screens (views/contacts.js, opportunities.js, crm-*.js, lead-actions.js), UX v2 ----------
 * HighLevel's Contacts and Opportunities: the module tabs as a strip under the one-line head, smart lists as pills,
 * the toolbar, the dark bulk bar, the board (UX v2's columns with each stage's count and $ total, collapsible), the
 * forecast, the import steps, the lead record's Call / Text / Email and DND, and Search in the menu rail. */
.crm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tab {
  display: inline-flex; align-items: center; height: 34px; padding: 0 8px; margin-bottom: -1px; white-space: nowrap;
  color: var(--muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; border-bottom: 2px solid transparent;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.crm-tab:hover { color: var(--ink); }
.crm-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.crm-tab:focus-visible { outline-offset: -3px; }
.import-intro { margin: -6px 0 12px; }

.list-tabs-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.list-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; max-width: 100%; padding: 2px; }
.list-tab {
  display: inline-flex; align-items: center; gap: 5px; height: var(--control-h-sm); padding: 0 10px; border-radius: var(--r-pill); white-space: nowrap;
  border: 1px solid transparent; background: transparent; color: var(--text); font-weight: 600; font-size: var(--fs-sm);
  text-decoration: none; cursor: pointer; transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.list-tab:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.list-tab[aria-current="page"] { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.list-tab.list-add { color: var(--lamp); }
.head-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.crm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.tools-left, .tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.tools-right { margin-left: auto; }
.crm-toolbar .select { width: auto; max-width: 100%; height: var(--control-h-sm); padding: 0 26px 0 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.pipeline-pick .select { color: var(--ink); }
.count-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--mint-wash); color: var(--lamp); font-weight: 650; font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
.crm-toolbar .search-input { width: 240px; max-width: 100%; height: var(--control-h-sm); border-radius: var(--r-pill); padding: 0 12px; font-size: var(--fs); }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 10px; }
.filter-chips .chip { white-space: normal; }

.crm-table .check-col { width: 36px; padding-right: 0; }
.crm-table input[type="checkbox"], .card-top input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--lamp); margin: 0; cursor: pointer; }
.crm-table td { white-space: nowrap; }
.crm-table td.tags-cell { white-space: normal; min-width: 150px; }
/* a long tag (application-link-sent) breaks inside its chip instead of running past the table's edge (WP12 review) */
.crm-table td.tags-cell .chip { white-space: normal; overflow-wrap: anywhere; }
.crm-table .cell-day { display: block; }
.crm-table td .sub { white-space: nowrap; }
.pager .page-no { display: inline-grid; place-items: center; min-width: var(--control-h-sm); height: var(--control-h-sm); border-radius: var(--r-pill); background: var(--ledger); color: var(--on-dark); font-weight: 650; font-size: var(--fs-sm); }
.pager .btns { align-items: center; flex-wrap: wrap; }
.pager .select { width: auto; height: var(--control-h-sm); padding: 0 24px 0 8px; }

/* the bulk bar: dark like HighLevel's selection bar, so it reads as "acting on what you ticked" */
.bulk-bar { position: sticky; top: 8px; z-index: 6; display: grid; gap: 4px; margin-bottom: 10px; padding: 6px 8px 6px 12px; border-radius: var(--r-lg); background: var(--ledger); color: var(--on-dark); box-shadow: var(--shadow); }
@media (max-width: 899px) { .bulk-bar { top: 64px; } }
.bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.bulk-count { font-weight: 650; color: var(--on-dark); margin-right: 4px; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.bulk-bar .btn { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, 0.28); }
.bulk-bar .btn:hover { border-color: var(--on-dark); background: rgba(255, 255, 255, 0.06); }
.bulk-bar .btn-quiet { border-color: transparent; color: var(--on-dark-2); }
.bulk-bar .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.bulk-bar :focus-visible { outline-color: var(--focus-dark); }
.bulk-waits { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; color: var(--on-dark-2); font-size: var(--fs-xs); }
.bulk-waits strong { color: var(--on-dark); font-weight: 600; }
.bulk-note { margin: 0; font-size: var(--fs-xs); color: var(--on-dark); }
.bulk-note.is-problem { color: #ffd4ce; font-weight: 600; }

/* the Filters dialog: one collapsible section per filter */
.filter-group { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 10px; }
.filter-group[open] { padding-bottom: 8px; }
.filter-group > summary {
  list-style: none; display: flex; align-items: center; gap: 8px; height: var(--control-h); cursor: pointer; color: var(--ink); font-weight: 600; font-size: var(--fs);
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::after {
  content: ""; margin-left: auto; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); transition: transform 160ms var(--ease-out);
}
.filter-group[open] > summary::after { transform: translateY(3px) rotate(-135deg); }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--lamp); color: var(--on-dark); font-size: var(--fs-2xs); font-weight: 750; }
.checks-compact { gap: 2px 14px; }
.checks-compact .check { min-height: 24px; font-size: var(--fs); }
.stack-buttons { display: grid; gap: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* the Opportunities board: UX v2's columns, each with its count and $ total, collapsible */
.opp-board { display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.opp-board .column { flex: 0 0 264px; min-width: 0; max-height: calc(100vh - 240px); min-height: 200px; }
.opp-board .cards { overflow-y: auto; }
.opp-head { align-items: flex-start; padding: 8px 6px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.opp-head > div { min-width: 0; }
.column-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 2px; font-size: var(--fs-xs); }
.column-meta .column-count { font-size: var(--fs-xs); }
.column-value { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.collapse-btn { height: 24px; min-width: 24px; padding: 0 4px; font-size: var(--fs-md); line-height: 1; }
.column.is-collapsed { flex-basis: 46px; min-height: 240px; }
.column.is-collapsed .cards, .column.is-collapsed .column-more-btn { display: none; }
.column.is-collapsed .opp-head { flex-direction: column-reverse; align-items: center; gap: 8px; border-bottom: 0; padding: 8px 4px; height: 100%; }
.column.is-collapsed .opp-head h2 { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.column.is-collapsed .column-meta { display: none; }
.column-more-btn { margin: 0 6px 8px; align-self: flex-start; }
.card-top { display: flex; align-items: flex-start; gap: 6px; }
.card-top input[type="checkbox"] { margin-top: 2px; flex: none; }
.card-top .card-title { min-width: 0; overflow-wrap: anywhere; }
.card-appt { color: var(--lamp); font-size: var(--fs-xs); font-weight: 600; }
.opp-card .card-foot { border-top: 1px solid var(--line); padding-top: 4px; min-height: 26px; }
.card-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; min-width: 0; }
.card-icons .ci-unread { color: var(--lamp); font-weight: 650; }
.card-icons .ci-unread::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--lamp); vertical-align: 1px; }
.opp-card .chips { gap: 4px; }

/* Forecast, the pipeline's stage shares and the import's counts */
.forecast-summary { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.forecast-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; display: grid; gap: 2px; align-content: start; }
.forecast-label { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.forecast-value { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: var(--fs-fig); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.forecast-table tfoot th, .forecast-table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 650; color: var(--ink); }
.forecast-table .strong { color: var(--ink); font-weight: 650; }
.forecast-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.panel > .hint + .hint, .panel > .table-wrap + .hint { margin-top: 6px; }
.stage-share .stage-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.stage-share .stage-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 5px 6px;
  border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: var(--fs);
}
.stage-share .stage-bar:hover { background: var(--surface-2); }
.stage-share .bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.stage-share .bar > span { display: block; height: 100%; width: var(--w, 0%); background: var(--lamp); border-radius: var(--r-pill); }
.stage-share .stage-count { white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .stage-share .stage-bar { grid-template-columns: 240px minmax(0, 1fr) 104px; } .stage-share .bar { grid-column: auto; } }

/* the staff CSV import */
.import-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: step; }
.import-steps li { counter-increment: step; display: inline-flex; align-items: center; height: var(--control-h-sm); padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.import-steps li::before { content: counter(step) ". "; margin-right: 4px; }
.import-steps li[aria-current="step"] { background: var(--ledger); border-color: var(--ledger); color: var(--on-dark); }
.import-steps li.is-done { background: var(--mint-wash); border-color: var(--mint-line); color: var(--lamp); }
.stack-form { display: grid; gap: 12px; max-width: 760px; }
.stack-form .field .select { max-width: 480px; }

/* the lead record: Call / Text / Email beside the name; the DND | Actions panel */
.reach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.reach .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.reach-why { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); }
.reach-why:empty { display: none; }
.reach-note { display: block; }
.reach-note strong { color: var(--ink); font-weight: 600; }
.lead-actions .panel-head { flex-wrap: wrap; gap: 8px; }
/* a segmented control used as tabs (role tab, aria-selected), as UX v2 draws the pressed one */
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 31, 26, 0.14); }
.tab-pane { padding-top: 6px; display: grid; gap: 8px; }
.switch-list { list-style: none; margin: 0; padding: 0; display: grid; }
.switch-list li { border-bottom: 1px solid var(--line); padding: 2px 0; }
.switch-list li:last-child { border-bottom: 0; }
.switch-list .switch-row { display: flex; justify-content: space-between; width: 100%; min-height: var(--control-h); margin: 0; color: var(--ink); font-weight: 600; font-size: var(--fs); cursor: pointer; }
.switch-list .switch { cursor: pointer; }
.switch-list .switch:disabled { cursor: not-allowed; opacity: 0.6; }
.switch-list .switch:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.switch-list .hint { margin-top: -4px; padding-bottom: 4px; }

/* Search (HighLevel's Search ⌘K): a pill in the header (owner, 28 Nov 2026: not in the menu), and the search box in a dialog */
.top-search { flex: none; display: flex; align-items: center; margin-left: auto; }
.top-search:empty { display: none; }
.top-search:not(:empty) + .topbar-actions { margin-left: 8px; }
.top-search-btn .top-kbd { margin-left: 2px; opacity: 1; border-color: var(--line); color: var(--muted); }
@media (max-width: 899px) { .top-search-btn { width: 36px; padding: 0; justify-content: center; } .top-search-btn :is(.top-search-label, .top-kbd) { display: none; } }
.nav-kbd { margin-left: auto; padding: 0 5px; border: 1px solid var(--line-dark); border-radius: var(--r-xs); color: var(--on-dark-3); font-size: var(--fs-2xs); font-weight: 650; line-height: 16px; opacity: 0; transition: opacity 120ms var(--ease-out); }
.rail.is-open .nav-kbd, .shell.is-pinned .rail .nav-kbd { opacity: 1; }
@media (max-width: 899px) { .rail .nav-kbd { opacity: 1; } }
dialog.dialog.search-dialog { width: min(560px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; overflow: visible; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.search-label { display: inline-grid; place-items: center; color: var(--muted); }
.search-label .icon { width: 18px; height: 18px; }
.search-box .search-input { flex: 1; min-width: 0; border: 0; box-shadow: none; height: var(--control-h); padding: 0; font-size: var(--fs-md); background: transparent; }
.search-box .search-input:focus-visible { box-shadow: none; }
.search-box .search-input::-webkit-search-cancel-button { display: none; } /* the dialog has its own Close */
.search-dialog .search-esc { opacity: 1; border-color: var(--line); color: var(--muted); }
.search-dialog.is-searching .search-label { color: var(--lamp); }
.search-results { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 520px); overflow-y: auto; }
.search-results[hidden] { display: none; }
.search-results [role="option"] { display: grid; gap: 1px; padding: 7px 10px; border-radius: var(--r); cursor: pointer; }
.search-results [role="option"]:hover, .search-results [role="option"][aria-selected="true"] { background: var(--mint-wash); }
.gs-name { color: var(--ink); font-weight: 650; font-size: var(--fs); overflow-wrap: anywhere; }
.gs-sub { color: var(--muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.search-results .search-all { color: var(--lamp); font-weight: 600; font-size: var(--fs-sm); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); margin-top: 4px; }
.search-results .search-empty { padding: 7px 10px; color: var(--muted); font-size: var(--fs-sm); cursor: default; }

@media (max-width: 639px) {
  .tools-right { margin-left: 0; width: 100%; }
  .crm-toolbar .search-input { width: 100%; flex: 1 1 100%; }
  .list-tabs-row .head-actions { width: 100%; }
  .bulk-actions { margin-left: 0; }
  .opp-board .column { flex-basis: 84vw; max-height: none; }
  .opp-board .cards { overflow-y: visible; }
  .forecast-value { font-size: 1.5rem; }
}
@media (max-width: 599px) {
  .crm-tab { height: 40px; }
  .list-tab, .crm-toolbar .select, .crm-toolbar .search-input, .pager .select { height: var(--control-h-sm); }
}
/* ---------- end WP12 ---------- */

/* ---------- WP15 Business Profile (views/business-profile.js) and Cut-over (views/cutover.js), UX v2 ----------
 * The profile as HighLevel's boxes in two columns, each with its own Update button; the cut-over checklist by phase
 * with the platform's own checks, and the old links. Module tabs reuse .crm-tabs (WP12). */
.bp-lead { margin: -6px 0 12px; max-width: 80ch; }
.bp-grid { display: grid; gap: 12px; }
.bp-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.bp-col .panel + .panel { margin-top: 0; }
@media (min-width: 1100px) { .bp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.bp-box .panel-head { display: grid; gap: 2px; justify-content: stretch; }
.bp-box .panel-head p { max-width: 60ch; }
@media (min-width: 640px) { .bp-span { grid-column: 1 / -1; } }
.bp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.bp-box .form-error { margin-top: 10px; }
.bp-box .field { align-content: start; }
.bp-box .field > .hint { color: var(--muted); font-weight: 400; }
.bp-box :is(.input, .select)[disabled] { background: var(--surface-2); color: var(--text); cursor: not-allowed; }
.bp-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bp-wordmark { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: var(--r); background: var(--ledger); color: var(--on-dark); font-weight: 800; letter-spacing: -0.02em; font-size: var(--fs-lg); }
.bp-logo .hint { flex: 1 1 220px; max-width: 46ch; }
.bp-missing { margin-bottom: 12px; max-width: 78ch; }
.bp-ro { margin: -6px 0 10px; }
.bp-hours-now { margin-bottom: 8px; color: var(--ink); font-size: var(--fs); }
.bp-hours-text { font-weight: 600; }
.bp-merge-panel { margin-top: 12px; }
.bp-merge code, .co-links code, .co-check code { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.bp-merge td:first-child { white-space: nowrap; }

.co-intro { display: grid; gap: 8px; margin-bottom: 12px; }
.co-intro > p, .co-lead { max-width: 80ch; color: var(--muted); font-size: var(--fs); }
.co-lead { margin-bottom: 10px; }
.co-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.co-summary li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs); }
.co-phase { padding: 0; overflow: hidden; }
.co-phase .panel-head { padding: 12px 16px 2px; margin-bottom: 6px; align-items: flex-start; }
.co-phase .panel-head h2 { font-size: var(--fs-md); }
.co-phase .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.co-table { table-layout: fixed; width: 100%; } /* every phase's columns line up, whatever an address's length */
.co-table td { vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; }
.co-table .co-hl { width: 24%; }
.co-table .co-new { width: 26%; }
.co-table .co-verify { width: 32%; }
.co-table .co-status { width: 18%; }
.co-table .sub, .co-links .sub { margin-top: 2px; }
.co-rows { margin-top: 4px; }
.co-check { display: block; margin-top: 6px; padding: 5px 8px; border-radius: var(--r-xs); background: var(--surface-2); border-left: 2px solid var(--line-strong); color: var(--text); }
.co-check.is-ok { background: var(--mint-wash); border-left-color: var(--focus-light); }
.co-check.is-todo { background: var(--brass-wash); border-left-color: var(--brass-ink); }
.co-status .chip { margin-bottom: 2px; }
.co-note { color: var(--text); font-style: italic; overflow-wrap: anywhere; }
.co-mark { margin-top: 6px; }
.co-statuses { display: grid; gap: 2px; }
.co-links td { vertical-align: top; line-height: 1.5; }
.co-links .co-old { width: 30%; }
.co-links .co-to { width: 10%; white-space: nowrap; }
.co-links .co-how .chip { margin-bottom: 4px; }
@media (max-width: 639px) {
  .co-table.cards-on-phone tbody tr, .co-links.cards-on-phone tbody tr { display: grid; gap: 8px; }
  .co-table.cards-on-phone td, .co-links.cards-on-phone td { width: auto; }
  .co-table td[data-label]::before, .co-links td[data-label]::before { display: block; margin-bottom: 2px; }
  .co-table .co-hl::before { display: none; }
  .co-table .co-hl .strong { font-size: var(--fs-md); }
  .bp-foot .btn { flex: 1 1 100%; }
  /* the week and the merge fields fit a phone without scrolling sideways */
  .bp-box .hours-table td, .bp-box .hours-table th { padding-left: 6px; padding-right: 6px; }
  .bp-box .hours-table td { width: auto; }
  .bp-box .hours-table .input.time { width: 100%; min-width: 0; padding: 0 4px; }
  .bp-merge td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .bp-merge td { overflow-wrap: anywhere; }
}
/* ---------- end WP15 ---------- */
/* ---------- AI Agents (WP6, views/ai-agents.js), UX v2 ----------
 * .page-tabs: a screen's own tabs as a strip under the header (AI Agents, Forms). Conversation AI / Knowledge Base as
 * that strip, Knowledge sources / gaps as a segmented control on
 * the header's right, the agent's settings beside "Try the assistant" and what it waits for, the knowledge sources as
 * a list. Conversations' assistant line and summary sit in the contact panel ("This conversation"). */
.page-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; color: var(--muted); font-weight: 600;
  font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab:hover { color: var(--ink); }
.page-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lamp); }
.page-tab:focus-visible { outline-offset: -3px; }
.page-tabs-sub { margin: -4px 0 12px; }
.ai-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); }
.ai-seg a {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); color: var(--muted);
  font-weight: 600; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.ai-seg a:hover { color: var(--ink); }
.ai-seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.page-tabs .tab-count.is-zero, .ai-seg .tab-count.is-zero { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.ai-seg .tab-count.is-due { background: var(--brass-wash); color: var(--brass-ink); box-shadow: inset 0 0 0 1px var(--brass-line); }
.ai-head-sub { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-head-sub .chips { display: inline-flex; }
.ai-agents-table td .sub, .ai-kb-table td .sub { margin-bottom: 4px; }
.ai-page .field > .hint { color: var(--muted); font-weight: 400; }
.ai-page .table-wrap + .panel { margin-top: 12px; }
.ai-layout { display: grid; gap: 12px; align-items: start; }
@media (min-width: 1200px) { .ai-layout { grid-template-columns: minmax(0, 1fr) 360px; } .ai-side { position: sticky; top: 12px; } }
.ai-form .ai-text { font-size: var(--fs); line-height: 1.55; }
.ai-field > label { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); }
.ai-field { display: grid; gap: 4px; }
.ai-fieldset { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
.ai-fieldset legend { margin-bottom: 4px; padding: 0; }
.ai-channels { display: grid; gap: 2px; }
.ai-channel { align-items: flex-start; }
.ai-channel input { margin-top: 2px; }
.ai-channel .strong { color: var(--ink); font-weight: 600; }
.ai-num { max-width: 140px; }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.ai-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.ai-step:first-child { border-top: 0; padding-top: 0; }
.ai-step-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-xs);
  color: var(--lamp); background: var(--mint-wash); box-shadow: inset 0 0 0 1px var(--mint-line);
}
.ai-step-body { display: grid; gap: 4px; min-width: 0; }
.ai-step-body .strong { color: var(--ink); font-weight: 600; }
.ai-kind { justify-self: start; }
.ai-waits { list-style: none; margin: 0; padding: 0; }
.ai-wait { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.ai-wait:first-child { border-top: 0; padding-top: 0; }
.ai-wait-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; box-shadow: inset 0 0 0 1.5px var(--brass-ink); }
.ai-wait-dot.is-ready { background: var(--lamp); box-shadow: none; }
.ai-wait-label { color: var(--ink); font-weight: 600; font-size: var(--fs); }
.ai-try-log { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.ai-try-log:empty { display: none; }
.ai-try-you, .ai-try-ai { padding: 7px 10px; border-radius: var(--r-lg); font-size: var(--fs); overflow-wrap: anywhere; white-space: pre-line; }
.ai-try-you { background: var(--surface-2); border: 1px solid var(--line); justify-self: start; max-width: 88%; }
.ai-try-ai { background: var(--mint-wash); justify-self: end; max-width: 92%; color: var(--ink); }
.ai-try-by { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.ai-try-row { display: flex; gap: 6px; }
.ai-try-row .input { flex: 1; min-width: 0; }
.ai-source-cards { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 720px) { .ai-source-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ai-source-card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ai-source-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ai-source-head h2 { font-size: var(--fs-md); }
.ai-source-count { display: grid; padding: 8px 12px 10px; background: var(--surface-2); }
.ai-articles { list-style: none; margin: 0; padding: 0; }
.ai-article { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.ai-article:first-child { border-top: 0; }
.ai-article.is-off { opacity: 0.72; }
.ai-article-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ai-article-head h3 { font-size: var(--fs-md); color: var(--ink); }
.ai-article-body { white-space: pre-line; font-size: var(--fs); color: var(--text); overflow-wrap: anywhere; }
.ai-article-actions { display: flex; gap: 4px; }
/* Conversations' contact panel: the conversation summary, closed by default */
.thread-summary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; cursor: pointer; list-style: none; }
.thread-summary-head::-webkit-details-marker { display: none; }
.thread-summary-head::before { content: "▸"; color: var(--brass-ink); font-size: var(--fs-xs); }
.thread-summary[open] > .thread-summary-head::before { content: "▾"; }
.thread-summary-head:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; border-radius: var(--r-xs); }
.thread-summary-text { margin-top: 4px; padding: 6px 8px; border-left: 2px solid var(--brass-line); background: var(--brass-wash); border-radius: var(--r-xs); color: var(--ink); font-weight: 400; }
.thread-assistant .strong { color: var(--ink); font-weight: 600; }
@media (max-width: 639px) {
  .table.cards-on-phone .ai-c-name, .table.cards-on-phone .ai-c-wide { flex: 1 1 100%; }
  .ai-gaps-table .actions { display: flex; gap: 4px; }
  .page-head .ai-seg { width: 100%; }
  .page-head .ai-seg a { flex: 1; justify-content: center; height: 32px; }
  .ai-article-head { display: grid; }
}
@media (max-width: 599px) {
  .page-tab { height: 40px; }
  .page-head .ai-seg a { height: var(--control-h-sm); }
}

/* ---------- Forms (WP7, views/forms.js), UX v2 ----------
 * HighLevel's Sites > Forms tabs as the page tab strip, the pickers as the shared filter bar, the reports' key numbers
 * and bars, each instant form's field mapping side by side. */
.forms-table td .sub, .forms-sub td .sub { margin-top: 2px; }
.forms-map td:first-child { color: var(--ink); }
.forms-maps { display: grid; gap: 12px; margin-top: 12px; }
.forms-maps > .panel { margin: 0; display: flex; flex-direction: column; }
.forms-maps .panel-head { display: block; }
.forms-maps .panel-head p { margin-top: 2px; }
@media (min-width: 1100px) { .forms-maps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }
.forms-page > .panel { margin-top: 12px; }
.forms-body .panel { margin-top: 12px; }
.forms-body .tiles { margin-bottom: 0; }
.forms-more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
@media (max-width: 639px) {
  .table.cards-on-phone .forms-c-name { flex: 1 1 100%; }
  .forms-table td.actions { flex: 1 1 100%; text-align: left; display: flex; gap: 4px; }
  .forms-table td.actions .btn + .btn { margin-left: 0; }
}

/* ---------- Forms > Analytics, redrawn (owner, 30 Nov 2026: "this UI I don't like it") ----------
 * The four numbers in one slim row; the drop-off as one chart of columns (reports-charts.js columnFunnel) with the
 * answer in a sentence over it; day by day as a line chart (lineChart); what reached ClearMCA compact beside it.
 * Colours: the funnel is the reports' single green (--rpt-bar, 4.9:1 on white); when one column is picked out (where
 * most people stop) the rest go grey (#a9b8b2, 2.1:1: every column carries its count as text) and that one keeps the
 * green, its name in bold and a chip in words over its cap, so colour is never the only sign (dataviz "emphasis": one
 * accent, the rest grey; checked with its validator: the pair is 21 apart under protanopia, 25 in normal vision). The
 * lines use the chart palette's first three slots in order, the set the validator passed for neighbours. */
.fa-stats {
  display: flex; flex-wrap: wrap; margin: 0; padding: 8px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.fa-stat { flex: 1 1 0; min-width: 120px; display: grid; padding: 2px 16px; }
.fa-stat + .fa-stat { border-left: 1px solid var(--line); }
.fa-stat dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.fa-stat dd { margin: 0; color: var(--ink); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; font-variant-numeric: lining-nums proportional-nums; }
.panel .fa-stats { border: 0; padding: 0; background: none; }
.panel .fa-stat:first-child { padding-left: 0; }
.fa-answer { color: var(--ink); font-size: var(--fs-md); font-weight: 650; margin: -4px 0 12px; text-wrap: pretty; }
.fa-answer.is-calm { color: var(--text); font-weight: 600; }

.fa-funnel { --fa-col: var(--rpt-bar); list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); gap: 2px; }
.fa-funnel[data-marked] { --fa-col: #a9b8b2; }
.fa-funnel .fa-col.is-marked { --fa-col: var(--rpt-bar); }
.fa-col { display: grid; grid-template-rows: auto auto; gap: 6px; padding: 4px 2px 6px; border-radius: var(--r); cursor: default; min-width: 0; }
.fa-col:hover, .fa-col:focus-visible { background: var(--surface-2); }
.fa-col:focus-visible { outline-offset: -2px; }
.fa-col-plot { height: 172px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; border-bottom: 1px solid var(--line-strong); }
.fa-col-bar { display: block; flex: none; width: min(24px, 70%); height: calc(var(--v, 0) * 124px); background: var(--fa-col); border-radius: 4px 4px 0 0; }
.fa-col:not([data-zero]) .fa-col-bar { min-height: 2px; }
.fa-col-n { color: var(--ink); font-size: var(--fs-sm); font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums lining-nums; }
.fa-col[data-zero] .fa-col-n { color: var(--muted); font-weight: 500; }
.fa-col-chip {
  display: inline-flex; align-items: center; gap: 1px; padding: 0 6px 0 3px; border-radius: var(--r-pill); white-space: nowrap;
  border: 1px solid var(--brass-line); background: var(--brass-wash); color: var(--brass-ink); font-size: var(--fs-2xs); font-weight: 700; line-height: 17px;
}
.fa-col-chip .icon { width: 12px; height: 12px; }
.fa-col-name { display: grid; align-content: start; justify-items: center; text-align: center; line-height: 1.25; min-height: 2.7em; }
.fa-col-step { color: var(--faint); font-size: var(--fs-2xs); font-weight: 600; }
.fa-col-short { color: var(--text); font-size: var(--fs-xs); font-weight: 600; overflow-wrap: anywhere; }
.fa-col.is-marked .fa-col-short { color: var(--ink); font-weight: 800; }

.fa-lower { display: grid; gap: 12px; margin-top: 12px; }
.forms-body .fa-lower > .panel { margin-top: 0; }
@media (min-width: 1100px) { .fa-lower { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; } }
.fa-line-wrap { display: grid; gap: 6px; }
.fa-line-legend { padding: 0; }
.fa-line-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.fa-line-total { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.fa-line { position: relative; height: 200px; padding: 8px 10px 24px 38px; border-radius: var(--r); }
.fa-line:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.fa-line-plot { position: relative; height: 100%; }
.fa-line-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fa-line-grid { stroke: var(--line); stroke-width: 1; }
.fa-line-base { stroke: var(--line-strong); stroke-width: 1; }
.fa-line-cross { stroke: var(--muted); stroke-width: 1; }
.fa-line-path { stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fa-line-dot { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.fa-line-y { position: absolute; left: 0; top: 8px; bottom: 24px; width: 30px; }
.fa-line-y span { position: absolute; right: 0; top: var(--y); transform: translateY(-50%); color: var(--muted); font-size: var(--fs-2xs); line-height: 1; font-variant-numeric: tabular-nums; }
.fa-line-x { position: absolute; left: 38px; right: 10px; bottom: 0; height: 18px; }
.fa-line-x span { position: absolute; left: var(--x); transform: translateX(-50%); color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; }
.fa-line-x span.is-first { transform: none; }
.fa-line-x span.is-last { transform: translateX(-100%); }

/* a phone: the numbers two by two, the funnel as rows (the step, its bar, its count), read top to bottom */
@media (max-width: 639px) {
  .fa-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 8px; }
  .fa-stat { min-width: 0; padding: 0 12px; }
  .fa-stat + .fa-stat { border-left: 0; }
  .fa-stat:nth-child(even) { border-left: 1px solid var(--line); }
  .fa-stat dd { font-size: var(--fs-lg); }
  .fa-funnel { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .fa-col { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); grid-template-rows: none; align-items: center; gap: 8px; padding: 5px 4px; min-height: 34px; }
  .fa-col-name { order: -1; display: flex; align-items: baseline; gap: 5px; text-align: left; min-height: 0; }
  .fa-col-step { flex: none; width: 3.9em; }
  .fa-col-short { overflow-wrap: normal; }
  .fa-col-plot { height: auto; min-height: 22px; flex-direction: row; justify-content: flex-start; align-items: center; gap: 6px; border-bottom: 0; border-left: 1px solid var(--line-strong); }
  .fa-col-bar { order: 1; height: 12px; width: calc(var(--v, 0) * 62%); border-radius: 0 4px 4px 0; }
  .fa-col:not([data-zero]) .fa-col-bar { min-height: 0; min-width: 2px; }
  .fa-col-n { order: 2; }
  .fa-col-chip { order: 3; }
  .fa-line { height: 180px; }
}
@media (forced-colors: active) {
  .fa-col-bar { background: CanvasText; }
  .fa-col.is-marked .fa-col-bar { background: Highlight; }
  .fa-line-path { stroke: CanvasText; }
  .fa-line-dot, .fa-line-key { background: CanvasText; }
}

/* ---------- Parity gaps B (HL-3-77, -78, -84): automations' Deleted tab, Global workflow settings, auto save,
 * custom fields ---------- */
.au-autosaved { color: var(--muted); font-size: var(--fs-sm); }
.au-deleted { margin: 8px 0 12px; }
.table tr.is-deleted td.c-name a { color: var(--muted); }
.au-pauses { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.au-pause { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; display: grid; gap: 8px; }
.au-pause fieldset { margin: 0; }
.au-pause-autos { max-height: 160px; overflow: auto; }
.au-pause-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.au-span-2 { grid-column: span 2; }
.cf-folders { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cf-folder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cf-folder:last-child { border-bottom: 0; }
.cf-folder-name { font-weight: 600; color: var(--ink); }
.cf-folder-tools { margin-left: auto; display: flex; gap: 4px; }
@media (max-width: 639px) {
  .au-span-2 { grid-column: auto; }
  .table.cards-on-phone .cf-table td.c-name { flex: 1 1 100%; }
  .cf-table td.actions { flex: 1 1 100%; text-align: left; display: flex; gap: 4px; }
}
.forms-own { margin-top: 12px; display: grid; gap: 8px; justify-items: start; }
.forms-own .table { width: 100%; }

/* ---- Forms > Application form (HL-3-78): the website application's question editor, views/apply-editor.js ---- */
.ae { display: grid; gap: 12px; }
.ae-status { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.ae-status-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 360px; }
.ae-live { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-md); color: var(--ink); }
.ae-dirty { font-size: var(--fs-sm); color: var(--muted); }
.ae-dirty.is-dirty { color: var(--brass-ink); font-weight: 600; }
.ae-problems { margin: 4px 0 0; padding: 8px 10px 8px 26px; border: 1px solid var(--brass-line); background: var(--brass-wash); border-radius: var(--r); color: var(--brass-ink); font-size: var(--fs-sm); }
.ae-actions { justify-content: flex-end; }
.ae-actions .btn .icon { width: 14px; height: 14px; }
.ae-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .ae-grid { grid-template-columns: minmax(0, 1fr) 320px; } .ae-side { position: sticky; top: 12px; } }
.ae-steps, .ae-side { display: grid; gap: 12px; min-width: 0; }
.ae-steps > .panel + .panel, .ae-side > .panel + .panel { margin-top: 0; }
.ae-step.is-hidden { background: var(--surface-2); border-style: dashed; }
.ae-step-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.ae-step-title { min-width: 0; }
.ae-step-title h2 { font-size: var(--fs-lg); color: var(--ink); }
.ae-step-num { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ae-step-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ae-step-tools .chip .icon, .ae-lock .icon, .ae-lock-ico { width: 13px; height: 13px; flex: none; }
.ae-move { display: inline-flex; gap: 2px; flex: none; }
.ae-move .icon-btn { width: 28px; height: 28px; font-size: var(--fs-md); font-weight: 700; }
.ae-qs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.ae-q { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ae-q.is-child { margin-left: 22px; }
.ae-q.is-hidden .ae-q-label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ae-q.is-open { border-color: var(--focus-light); box-shadow: 0 0 0 1px var(--focus-light); }
.ae-q-row { display: flex; align-items: center; gap: 6px; padding: 2px 6px 2px 2px; }
.ae-q-open {
  flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 40px; padding: 6px 8px;
  border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border-radius: var(--r-sm);
}
.ae-q-open:hover { background: var(--hover); }
.ae-q-open:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 1px; }
.ae-q-label { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ae-q-facts { font-size: var(--fs-sm); color: var(--muted); }
.ae-lock-ico { color: var(--brass-ink); }
.ae-edit { display: grid; gap: 10px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.ae-step > .ae-edit { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.ae-field { display: grid; gap: 4px; }
.ae-field > span:first-child { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.ae-lock { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--brass-line); background: var(--brass-wash); color: var(--brass-ink); border-radius: var(--r); font-size: var(--fs-sm); }
.ae-switches { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ae-switch .switch { cursor: pointer; }
.ae-switch .switch:disabled { cursor: not-allowed; opacity: 0.55; }
.ae-switch .switch:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.ae-options { display: grid; gap: 6px; }
.ae-opt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ae-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ae-opt .input { flex: 1 1 140px; min-width: 0; }
.ae-opt-hide { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.ae-opt-extra { display: grid; gap: 6px; }
.ae-opt-extra .btn { margin: 2px 4px 2px 0; }
.ae-opt-new { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-opt-new .input { flex: 1 1 180px; }
.ae-add { margin-top: 10px; }
.ae-add .icon { width: 14px; height: 14px; }
.ae-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs); }
.ae-version-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ae-version { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 4px; }
.ae-version.is-current { border-color: var(--mint-line); background: var(--mint-wash); }
.ae-version-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ae-version-note { font-size: var(--fs-sm); color: var(--ink); }
.ae-version-changes, .ae-change-list, .ae-help-list { margin: 0; padding-left: 18px; font-size: var(--fs-sm); color: var(--text); }
.ae-version .btn { justify-self: start; }
.ae-help h2 { font-size: var(--fs-md); margin-bottom: 6px; }
@media (max-width: 599px) {
  .ae-actions { justify-content: flex-start; width: 100%; }
  .ae-actions .btn { flex: 1 1 auto; }
  .ae-q.is-child { margin-left: 10px; }
  .ae-edit { padding: 10px 8px; }
}
/* ---- end Forms > Application form ---- */
/* ---------- compact lists (owner, 27 Nov 2026; views/compact-list.js) ----------
 * "A simple flat list so I can see a lot of data": every row of a .cl-table is one line about 44px tall, a long value
 * ends in "…", chips show the first one and "+N" (a popover lists them all), and one row at a time opens its details
 * right under it. Phones (below 640px): each row is one line (the name, one key value and the time); a tap opens it.
 * The selectors carry .table.cl-table so they win over shell.css's .table rules, which load later. */
.table.cl-table > thead > tr > th { white-space: nowrap; }
.table.cl-table > thead > tr > th, .table.cl-table > tbody > tr > td { padding-left: 10px; padding-right: 10px; }
.table.cl-table > tbody > tr.cl-row > td {
  height: 44px; padding-top: 0; padding-bottom: 0; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis;
}
.table.cl-table > tbody > tr.cl-row { cursor: pointer; }
.table.cl-table > tbody > tr.cl-row > td :focus-visible { outline-offset: -2px; }
/* a cell's second line (an email, a time, a campaign) follows on the same line, quieter */
.table.cl-table > tbody > tr.cl-row > td .sub { display: inline; margin-left: 8px; white-space: nowrap; }
.table.cl-table > tbody > tr.cl-row > td .cell-day { display: inline; }
.table.cl-table > tbody > tr.cl-row > td.tags-cell { white-space: nowrap; min-width: 0; }
.table.cl-table > tbody > tr.cl-row > td .chips { flex-wrap: nowrap; }
.table.cl-table > tbody > tr.cl-row > td .chip { white-space: nowrap; overflow-wrap: normal; }
.table.cl-table > tbody > tr.cl-row > td > .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.table.cl-table .task-title, .table.cl-table .step-text { display: inline; }
.table.cl-table .task-cell .chip { margin: 0 0 0 8px; }
/* how far they got: the words in the row (a one-line row has no room for the bar), the bar in the open row's details */
.table.cl-table > tbody > tr.cl-row .step-bar { display: none; }
.table.cl-table .row-actions .btn { height: 28px; }
.table.cl-table.unfinished-table > tbody > tr.cl-row > td.c-step { max-width: 240px; }
/* .cl-fixed: the table fits its box. The short columns have a width class (cl-w-s … cl-w-xxl, the same sizes as
 * compact-list.js fitColumns), the others share what is left; each value is cut with "…". With many columns the table
 * keeps --cl-min (fitColumns) and scrolls inside its box rather than squeezing the names. */
.table.cl-table.cl-fixed { table-layout: fixed; min-width: var(--cl-min, 0px); }
.table.cl-table.cl-fixed > tbody > tr.cl-row > td { max-width: none; }
.table.cl-table.cl-fixed th.check-col { width: 36px; }
.table.cl-table.cl-fixed th.cl-w-s { width: 96px; }
.table.cl-table.cl-fixed th.cl-w-m { width: 120px; }
.table.cl-table.cl-fixed th.cl-w-l { width: 140px; }
.table.cl-table.cl-fixed th.cl-w-xl { width: 160px; }
.table.cl-table.cl-fixed th.cl-w-xxl { width: 210px; }
.table.cl-table.cl-fixed th.cl-w-act { width: 236px; }
.table.cl-table.cl-fixed th.cl-w-phone { width: 158px; }
.table.cl-table.cl-fixed th.cl-w-date { width: 168px; }
/* the chevron column */
.table.cl-table th.cl-tog, .table.cl-table td.cl-tog { width: 40px; padding: 0 0 0 8px; }
.cl-tog-btn {
  width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); cursor: pointer; transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.cl-tog-btn:hover { background: var(--hover); color: var(--ink); }
.cl-tog-btn .icon { width: 15px; height: 15px; transition: transform 160ms var(--ease-out); }
.cl-tog-btn[aria-expanded="true"] { color: var(--ink); }
.cl-tog-btn[aria-expanded="true"] .icon { transform: rotate(90deg); }
.table.cl-table > tbody > tr.is-open > td { background: var(--selected); border-bottom-color: transparent; }
/* the open row's details */
.table.cl-table > tbody > tr.cl-detail > td { padding: 4px 16px 16px 48px; background: var(--selected); white-space: normal; cursor: auto; }
/* the card stays in view when the table scrolls sideways: it sticks to the box's left edge, as wide as the box */
.cl-detail-body { position: sticky; left: 48px; max-width: var(--cl-view, none); display: grid; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
/* the open row's card: titled sections that read top to bottom, flowing down three columns (one on a phone); each
 * line is the field's tinted icon, its muted label and its value, aligned (owner, 27 Nov 2026) */
.cl-sections { columns: 3 260px; column-gap: 12px; }
.cl-sec { break-inside: avoid; margin: 0 0 12px; padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.cl-sec-title { margin: 0 0 6px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
/* one grid per section, so the labels and the values line up from row to row */
.cl-lines { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); align-items: center; gap: 2px 14px; }
.cl-line { display: contents; }
.cl-line > :is(dt, dd) { min-height: 30px; display: flex; align-items: center; }
.cl-line dt { gap: 8px; min-width: 0; max-width: 190px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.cl-line-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-line dd { margin: 0; min-width: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; flex-wrap: wrap; }
.cl-line dd > * { min-width: 0; }
.cl-line dd .chips, .cl-sec > .chips { flex-wrap: wrap; }
.cl-sec .chip { white-space: normal; overflow-wrap: anywhere; }
.cl-sec .step-bar { display: block; max-width: 200px; margin-top: 4px; }
.cl-sec .link-cell { flex-wrap: wrap; }
.cl-sec .link-url { color: var(--text); font-size: var(--fs-sm); font-weight: 500; overflow-wrap: anywhere; }
.fx-badge { flex: none; width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; color: var(--fx, var(--muted)); background: color-mix(in srgb, var(--fx, var(--muted)) 12%, var(--surface)); }
.fx-badge.is-none { background: transparent; }
.fx-badge .icon { width: 13px; height: 13px; stroke-width: 2; }
.cl-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* chips on one line: the first, then "+N" which opens the rest in a popover */
.cl-chips { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: middle; }
.cl-chips > .chip:first-child { flex: 0 1 auto; min-width: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.chip.cl-more { flex: none; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--lamp); background: var(--mint-wash); border-color: var(--mint-line); }
.chip.cl-more:hover, .chip.cl-more[aria-expanded="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--on-dark); }
.cl-pop {
  position: fixed; inset: auto; margin: 0; width: max-content; max-width: min(320px, calc(100vw - 16px)); max-height: min(50vh, 360px); overflow: auto;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.cl-pop-head { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.cl-pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.cl-pop-list .chip { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 639px) {
  /* phones: one line a row; everything else is in the details a tap opens. No sideways scroll. */
  .table.cl-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table.cl-table, .table.cl-table > tbody { display: block; width: 100%; }
  .table.cl-table > tbody > tr.cl-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px 0 2px; border-bottom: 1px solid var(--line); }
  .table.cl-table > tbody > tr.cl-row > td { display: none; }
  .table.cl-table > tbody > tr.cl-row > td:is(.cl-tog, .check-col, .cl-first) {
    display: flex; align-items: center; height: auto; padding: 0; border: 0; max-width: none; background: transparent;
  }
  .table.cl-table > tbody > tr.cl-row > td.cl-tog { width: auto; flex: none; }
  .table.cl-table > tbody > tr.cl-row > td.check-col { width: auto; flex: none; }
  .table.cl-table > tbody > tr.cl-row > td.cl-first { flex: 1 1 auto; min-width: 0; gap: 8px; }
  /* the name (after its icon) shrinks with "…"; the second line and the chips wait in the details */
  .table.cl-table > tbody > tr.cl-row > td.cl-first > :not(svg):not(.sub):not(.chip) { flex: 0 1 auto; min-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
  .table.cl-table > tbody > tr.cl-row > td.cl-first > svg.fx { margin: 0; }
  .table.cl-table > tbody > tr.cl-row > td.cl-first > :is(.sub, .chip) { display: none; }
  /* the key value and the time after the name, from the cell's data-m-key and data-m-when (compact-list.js phoneData) */
  .table.cl-table > tbody > tr.cl-row > td.cl-first::before, .table.cl-table > tbody > tr.cl-row > td.cl-first::after {
    flex: none; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap;
  }
  .table.cl-table > tbody > tr.cl-row > td.cl-first[data-m-key]::before {
    content: attr(data-m-key); order: 2; flex: 0 0 auto; min-width: 0; max-width: 36%; overflow: hidden; text-overflow: ellipsis; margin-left: auto;
  }
  .table.cl-table > tbody > tr.cl-row > td.cl-first[data-m-when]::after { content: attr(data-m-when); order: 3; font-variant-numeric: tabular-nums; }
  .table.cl-table > tbody > tr.cl-row > td.cl-first:not([data-m-key])[data-m-when]::after { margin-left: auto; }
  .table.cl-table > tbody > tr.is-open { border-bottom-color: transparent; background: var(--selected); }
  .table.cl-table > tbody > tr.cl-detail { display: block; border-bottom: 1px solid var(--line); background: var(--selected); }
  .table.cl-table > tbody > tr.cl-detail > td { display: block; padding: 0 10px 12px; border: 0; }
  .cl-sections { columns: 1; }
  .cl-detail-body { position: static; max-width: none; }
  .cl-line dt { max-width: 150px; }
  .table.cl-table.cl-fixed { min-width: 0; }
  .cl-detail-actions .btn { flex: 1 1 0; height: var(--control-h); }
  .cl-detail-actions .row-actions { flex: 1 1 100%; }
  .table.cl-table > tbody > tr > td.empty { display: block; padding: 20px 12px; text-align: center; border: 0; }
}
@media (forced-colors: active) {
  .table.cl-table > tbody > tr.is-open > td { outline: 1px solid CanvasText; }
}
/* ---------- end compact lists ---------- */

/* ---------- field accents, chips and placeholders (owner, 27 Nov 2026: "small icons … a little bit colourful") ----------
 * One muted accent per kind of value (views/compact-list.js FIELDS): the small icon before a value in a row, and its
 * tinted badge in an open row. Each is 3:1 or more on white, on its tint and on the open row's green. Text never wears
 * them: values stay ink. A stage chip wears its pipeline phase's colour (the dashboard's --viz-1..5) as a tint with a
 * dark ink of the same hue (AA, 5.9:1 or more); a status its own; tags one calm tint. A missing value is muted italics. */
:root {
  --fx-person: #2f6fc4;
  --fx-phone: #1f8a5b;
  --fx-mail: #c2621f;
  --fx-business: #6b56c9;
  --fx-money: #0f7f6e;
  --fx-source: #b8487c;
  --fx-owner: #2b7f96;
  --fx-date: #8a6a24;
  --fx-stage: #52607a;
  --fx-tag: #7a5a1e;
  --fx-alert: #b42318;
  --ph-ink-1: #1d4f91;
  --ph-ink-2: #9a3d12;
  --ph-ink-3: #0d6646;
  --ph-ink-4: #6e4b00;
  --ph-ink-5: #9b2c5a;
  --tag-bg: #eef3f8;
  --tag-line: #cfdbe7;
  --tag-ink: #2d4a63;
}
:root[data-theme="dark"] {
  --fx-person: #6ea0e6;
  --fx-phone: #4fbf8a;
  --fx-mail: #e89155;
  --fx-business: #a596ec;
  --fx-money: #3fb8a3;
  --fx-source: #e07aa8;
  --fx-owner: #5fb3c9;
  --fx-date: #d2b06a;
  --fx-stage: #9aa8c2;
  --fx-tag: #d2b06a;
  --fx-alert: #f07a6e;
  --ph-ink-1: #b9d3f6;
  --ph-ink-2: #f6c3ab;
  --ph-ink-3: #a9e5cc;
  --ph-ink-4: #f2d68f;
  --ph-ink-5: #f3bcd2;
  --tag-bg: #1e2a33;
  --tag-line: #33475a;
  --tag-ink: #c9d9e8;
}
.fx-person { --fx: var(--fx-person); } .fx-phone { --fx: var(--fx-phone); } .fx-mail { --fx: var(--fx-mail); }
.fx-business { --fx: var(--fx-business); } .fx-money { --fx: var(--fx-money); } .fx-source { --fx: var(--fx-source); }
.fx-owner { --fx: var(--fx-owner); } .fx-date { --fx: var(--fx-date); } .fx-stage { --fx: var(--fx-stage); }
.fx-tag { --fx: var(--fx-tag); } .fx-alert { --fx: var(--fx-alert); }
/* the small icon before a value: 14px, its field's colour, on the text's line */
svg.fx { width: 14px; height: 14px; stroke: var(--fx); stroke-width: 2; vertical-align: -2px; margin-right: 6px; }
.fx-val { min-width: 0; }
.cl-empty { color: var(--faint); font-style: italic; font-weight: 400; }
.table .cl-empty, .cl-line dd .cl-empty { font-weight: 400; }
/* chips: a stage in its phase's colour, a status, tags, the active filters */
.chip.chip-ph-1, .chip.chip-ph-2, .chip.chip-ph-3, .chip.chip-ph-4, .chip.chip-ph-5 {
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: color-mix(in srgb, var(--c) 40%, var(--surface)); color: var(--ink-c);
}
.chip.chip-ph-1 { --c: var(--viz-1); --ink-c: var(--ph-ink-1); } .chip.chip-ph-2 { --c: var(--viz-2); --ink-c: var(--ph-ink-2); }
.chip.chip-ph-3 { --c: var(--viz-3); --ink-c: var(--ph-ink-3); } .chip.chip-ph-4 { --c: var(--viz-4); --ink-c: var(--ph-ink-4); }
.chip.chip-ph-5 { --c: var(--viz-5); --ink-c: var(--ph-ink-5); }
.chip.chip-lost { border-color: #f1b8b2; color: var(--danger); background: var(--danger-wash); }
.chip.chip-tag { background: var(--tag-bg); border-color: var(--tag-line); color: var(--tag-ink); font-weight: 600; }
.chip.chip-filter { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); font-weight: 600; }
/* the Opportunities board: each column wears its phase's colour on top, as the dashboard's pipeline bar */
.board .column.ph-1, .board .column.ph-2, .board .column.ph-3, .board .column.ph-4, .board .column.ph-5 { border-top: 3px solid var(--c); }
@media (forced-colors: active) {
  svg.fx, .fx-badge { stroke: CanvasText; color: CanvasText; }
  .chip.chip-ph-1, .chip.chip-ph-2, .chip.chip-ph-3, .chip.chip-ph-4, .chip.chip-ph-5, .chip.chip-tag { border-color: CanvasText; }
}
/* ---------- end field accents ---------- */

/* ---------- compact list toolbars (owner, 27 Nov 2026; views/list-toolbar.js): at most two rows ----------
 * Row 1: the screen's tabs, and its view switch, primary action and "⋯" on the right. Row 2: one toolbar (saved list,
 * filters with a count, the active filters as chips, sort, search, the count as quiet text). */
.lt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.lt-top { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.lt-top > :is(.crm-tabs, .page-tabs) { border-bottom: 0; margin: 0 0 -1px; flex: 0 1 auto; min-width: 0; }
.lt-top > .lt-actions { padding: 4px 0; }
.lt-tools { margin-bottom: 10px; }
.lt-left, .lt-right, .lt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lt-right { margin-left: auto; }
/* a select is as wide as its longest choice and never narrower (owner, 30 Nov 2026: the sort read "Created: newest fi") */
.lt-row :is(.lt-pick, .select.tool) { flex: 0 0 auto; width: auto; max-width: 100%; height: var(--control-h-sm); padding: 0 28px 0 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.lt-row :is(.btn, .lt-count) { flex-shrink: 0; white-space: nowrap; }
.lt-row .search-input { width: 180px; max-width: 100%; height: var(--control-h-sm); border-radius: var(--r-pill); padding: 0 12px; font-size: var(--fs); }
.lt-filter .icon { width: 14px; height: 14px; }
.lt-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: var(--r-pill); background: var(--ledger); color: var(--on-dark); font-size: var(--fs-2xs); font-weight: 700; }
.lt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.lt-count { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.more { display: inline-flex; }
.more-btn { width: var(--control-h-sm); padding: 0; justify-content: center; font-size: 1.125rem; line-height: 1; letter-spacing: 0.05em; }
.more-pop {
  position: fixed; inset: auto; margin: 0; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.more-link {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink); font: inherit; font-size: var(--fs); font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.more-link:hover, .more-link:focus-visible { background: var(--hover); }
.more-link .icon { width: 15px; height: 15px; color: var(--muted); }
.forms-top .forms-pickers { margin-left: auto; }
/* wide screens: row 2 stays one line; the search box gives way first, the active filters wrap inside their part */
@media (min-width: 1100px) {
  .lt-tools { flex-wrap: nowrap; }
  .lt-tools > .lt-left { flex: 1 1 auto; }
  .lt-tools > .lt-right { flex: 0 1 auto; flex-wrap: nowrap; }
  .lt-tools .search-input { flex: 0 1 170px; min-width: 110px; }
  .lt-tools :is(.lt-pick, .select.tool) { flex: 0 0 auto; }
}
@media (max-width: 639px) {
  .lt-top { align-items: stretch; }
  .lt-top > :is(.crm-tabs, .page-tabs) { flex: 1 1 100%; }
  .lt-top > .lt-actions { flex: 1 1 100%; justify-content: flex-start; }
  .lt-right { margin-left: 0; width: 100%; }
  .lt-row .search-input { flex: 1 1 0; width: auto; min-width: 0; }
  .lt-row :is(.lt-pick, .select.tool) { max-width: 100%; }
  /* side by side when both fit at their own width, else each on its own line; never narrower than the text */
  .lt-left > :is(.lt-pick, .lt-filter, .select.tool) { flex: 1 1 auto; max-width: 100%; }
  .lt-right > .select.tool { flex: 1 1 100%; max-width: 100%; }
  .more-link { min-height: 44px; }
}
/* ---------- end compact list toolbars ---------- */

/* Contacts: a date column's header names the business's time zone on its own line (owner, 30 Nov 2026) */
.th-zone { display: block; font-weight: 500; font-size: var(--fs-2xs); }
/* the lead record: why some stages are greyed out (owner, 30 Nov 2026; stage-rules.js) */
.stage-why { font-size: var(--fs-sm); color: var(--muted); }
.stage-why summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.stage-why[open] { flex-basis: 100%; }
.stage-why ul { margin: 6px 0 0; padding-left: 18px; }
.stage-why li { margin: 2px 0; }
/* the lead record: the lead's own local time (owner, 30 Nov 2026; zone.js theirNow) */
.lead-local { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.lead-local strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- visible screens (owner, 30 Nov 2026; visible-screens.js): No access, and the page before any screen is listed ---------- */
.no-access, .nothing-yet { max-width: 560px; }
.no-access h2 { margin-bottom: 6px; }
.no-access p + p { margin-top: 10px; }
.table span.row-name { font-weight: 600; }
/* ---------- end visible screens ---------- */

/* ---------- How it works videos (owner, 28 Nov 2026; how-to.js, views/how-it-works.js) ----------
 * The "How to" dialog (dom.js dialog, full screen on a phone), the player shared with the library page, "Video coming
 * soon" for a screen whose video is not recorded yet, and the library's one-line rows. Tokens only. */
dialog.dialog.howto-dialog { width: min(880px, calc(100vw - 24px)); }
.howto-meta { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; color: var(--muted); font-size: var(--fs-sm); }
.howto-meta > span + span::before { content: "·"; margin: 0 8px; color: var(--faint); }
.howto-stage { min-width: 0; }
.howto-frame { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--ledger); border-radius: var(--r); overflow: hidden; }
.howto-video { display: block; width: 100%; height: 100%; background: #000; }
.howto-loading { display: flex; align-items: center; gap: 8px; color: var(--on-dark-2); font-size: var(--fs-sm); }
.howto-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--ink); font-size: var(--fs-sm); }
.howto-status:empty { display: none; }
.howto-below { display: grid; gap: 10px; margin-top: 10px; }
.howto-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.howto-speed-field { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.select.howto-speed { width: auto; }
.howto-cc[aria-pressed="true"] { border-color: var(--focus-light); background: var(--mint-wash); color: var(--lamp); }
.howto-cc[aria-pressed="false"] .icon { visibility: hidden; }
.howto-h { margin-bottom: 4px; color: var(--ink); font-size: var(--fs-sm); }
.howto-chapters { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.howto-chapter {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.howto-chapter:hover { background: var(--hover); }
.howto-chapter[aria-current="true"] { background: var(--selected); color: var(--ink); font-weight: 600; }
.howto-ch-time { min-width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.howto-summary { color: var(--text); }
.howto-soon {
  display: grid; justify-items: center; gap: 6px; padding: 32px 20px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2);
}
.howto-soon-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--mint-wash); color: var(--lamp); }
.howto-soon-icon .icon { width: 26px; height: 26px; }
.howto-soon-title { color: var(--ink); font-size: var(--fs-md); font-weight: 700; }
.howto-soon-text { max-width: 52ch; color: var(--text); }
.howto-dialog .dialog-foot { align-items: center; }
.howto-progress { margin-right: auto; color: var(--muted); font-size: var(--fs-sm); }
.howto-progress:empty { display: none; }
@media (max-width: 599px) {
  /* a phone: the dialog is a full-screen sheet, the buttons at the bottom */
  dialog.dialog.howto-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .howto-dialog .dialog-form { display: flex; flex-direction: column; min-height: 100%; }
  .howto-dialog .dialog-foot { margin-top: auto; }
  .howto-dialog .dialog-foot .btn { flex: 1 1 0; justify-content: center; }
  .howto-progress { flex: 1 1 100%; margin-right: 0; }
  .howto-soon { padding: 24px 16px; }
}

/* the library: the lists at full width; a click opens the video in the centred dialog (owner, 28 Nov 2026) */
.hiw-lists { display: grid; gap: 12px; min-width: 0; }
.hiw-lists > .panel + .panel { margin-top: 0; }
.hiw-mine { display: inline-flex; align-items: center; gap: 6px; color: var(--lamp); font-size: var(--fs-sm); font-weight: 600; }
.hiw-mine .icon { width: 16px; height: 16px; }
.hiw-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 8px 10px; margin-bottom: 6px; }
.hiw-count { margin: 4px 0 6px; color: var(--muted); font-size: var(--fs-sm); }
.hiw-list { display: grid; margin: 0; padding: 0; list-style: none; }
.hiw-list > li + li { border-top: 1px solid var(--line); }
.hiw-row {
  display: flex; align-items: center; gap: 4px 12px; width: 100%; min-height: 44px; padding: 7px 8px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.hiw-row:hover { background: var(--hover); }
.hiw-row[aria-current="true"] { background: var(--selected); box-shadow: inset 3px 0 0 var(--lamp); }
.hiw-n {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-size: var(--fs-xs); font-weight: 700;
}
.hiw-row[data-state="watched"] .hiw-n { border-color: var(--mint-line); background: var(--mint-wash); color: var(--lamp); }
.hiw-row-main { display: grid; flex: 1 1 auto; min-width: 0; }
.hiw-row-title { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hiw-row-sub { overflow: hidden; color: var(--muted); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.hiw-row-len { flex: none; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hiw-row-state { flex: none; }
.hiw-row-state:empty { display: none; }
.hiw-team th[scope="row"] { font-weight: 400; }
.hiw-team-watched { white-space: nowrap; }
.hiw-meter { width: 90px; height: 8px; margin-left: 8px; vertical-align: middle; accent-color: var(--lamp); }
.hiw-which summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.hiw-which ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 599px) {
  .hiw-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hiw-search { grid-column: 1 / -1; }
  .hiw-row { flex-wrap: wrap; }
  .hiw-row-main { flex: 1 1 calc(100% - 40px); }
  .hiw-row-title, .hiw-row-sub { white-space: normal; }
  .hiw-ordered .hiw-row-len { margin-left: 36px; }
}
/* ---------- end How it works videos ---------- */

/* social media MVP: Approval and Scheduling */
.sm-filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.sm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.sm-chip { cursor: pointer; border: 1px solid var(--line, #d8dde2); background: transparent; }
.sm-chip.is-on { background: var(--brand, #0b1f1a); color: #fff; }
.sm-note { margin: 0 0 8px; padding: 10px 12px; border-left: 3px solid var(--warn, #b7791f); background: rgba(183, 121, 31, 0.08); }
.sm-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sm-card { border: 1px solid var(--line, #d8dde2); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: var(--panel, #fff); }
.sm-media { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #e9edf0; }
.sm-nomedia { display: flex; align-items: center; justify-content: center; color: #5b6770; font-size: 0.85rem; }
.sm-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.sm-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sm-caption { margin: 0; font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sm-empty { color: #5b6770; padding: 18px 0; }
.sm-warnings { border-left: 4px solid var(--warn, #b7791f); }
.sm-warn-list, .sm-slots, .sm-coming { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sm-slot { border: 1px solid var(--line, #d8dde2); border-radius: 8px; padding: 10px 12px; }
.sm-post { display: flex; gap: 12px; align-items: center; }
.sm-post.is-warning { background: rgba(183, 121, 31, 0.08); }
.sm-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: #e9edf0; flex: none; }
.sm-days { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.sm-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sm-logo { display: block; max-height: 48px; margin: 0 0 8px; }
.sm-brands { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.sm-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; color: inherit; }
a.sm-brand { text-decoration: underline; }
.sm-brand-mark { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.sm-brand-mark .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.sm-brand-facebook .sm-brand-mark { background: #1877f2; border-radius: 50%; }
.sm-brand-instagram .sm-brand-mark { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.sm-brand-tiktok .sm-brand-mark { background: #111; }
.sm-brand-google .sm-brand-mark { background: #4285f4; border-radius: 50%; }
.sm-brand.is-soon { opacity: 0.6; font-weight: 500; }
.sm-soon { font-size: 0.72rem; }
.sm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.sm-steps li { border: 1px solid var(--line, #d8dde2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.sm-step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand, #0b1f1a); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.sm-slot-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sm-slot-head .sm-brands { margin: 0; }
.sm-type { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sm-times { font-size: 1rem; font-weight: 600; margin: 8px 0; }
.sm-post-main { flex: 1 1 auto; display: grid; gap: 6px; min-width: 0; }
.sm-post-to { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.sm-check-brand { display: flex; align-items: center; gap: 8px; }
.sm-state-filled { background: #e8f0fe; color: #1a56c4; }
.sm-state-posted { background: #e6f4ea; color: #1e6b34; }
.sm-state-warning { background: rgba(183, 121, 31, 0.15); color: #8a5a12; }
.sm-state-failed, .sm-state-skipped { background: #fdecea; color: #a12a1f; }

/* social media, 1 Dec 2026 (owner): the Post schedule stepper and list, and the Business profile card */
.sm-dest { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.sm-dest .sm-brands { margin: 0; }
.sm-dest-label, .sm-vcard-label { font-size: var(--fs-xs, 0.75rem); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sm-wizard { border: 1px solid var(--brass-line, #e2cf9f); }
.sm-wiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sm-stepper { list-style: none; margin: 14px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sm-stepper li button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2, #f9fbfa); color: var(--muted); font: inherit; font-size: var(--fs-sm, 0.85rem); cursor: pointer; }
.sm-stepper li button:disabled { cursor: default; }
.sm-stepper .sm-step-n { width: 22px; height: 22px; font-size: 0.75rem; background: var(--line); color: var(--ink); }
.sm-stepper li.is-current button { border-color: var(--brass, #c9a866); background: var(--brass-wash, #f7f1e3); color: var(--ink); font-weight: 700; }
.sm-stepper li.is-current .sm-step-n { background: var(--brass, #c9a866); color: #fff; }
.sm-stepper li.is-done .sm-step-n { background: var(--ink); color: #fff; }
.sm-wiz-body { display: grid; gap: 14px; max-width: 720px; }
.sm-wiz-q { font-size: 1.1rem; font-weight: 700; margin: 0; }
.sm-wiz-fields { display: grid; gap: 10px; max-width: 480px; }
.sm-wiz-err { color: #a12a1f; font-weight: 600; margin: 12px 0 0; }
.sm-wiz-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sm-choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sm-choice { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface, #fff); color: var(--ink); font: inherit; cursor: pointer; }
.sm-choice:hover { border-color: var(--brass-line, #e2cf9f); }
.sm-choice.is-on { border-color: var(--brass, #c9a866); background: var(--brass-wash, #f7f1e3); box-shadow: 0 0 0 3px rgba(201, 168, 102, 0.18); }
.sm-choice.is-soon { cursor: default; border-style: dashed; }
.sm-choice-icon { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sm-days-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.sm-days-pick .sm-choice { padding: 8px 14px; border-radius: 999px; justify-items: center; min-width: 58px; }
.sm-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.sm-time-row { display: flex; gap: 8px; align-items: center; max-width: 280px; }
.sm-summary { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; background: var(--brass-wash, #f7f1e3); }
.sm-summary p { margin: 0; font-size: 1.05rem; font-weight: 600; }
.sm-slot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sm-slot-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.sm-slot-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brass-wash, #f7f1e3); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sm-slot-main { flex: 1 1 260px; display: grid; gap: 2px; min-width: 0; }
.sm-slot-row .sm-brands { margin: 0; gap: 6px; }
.sm-nomedia .icon { width: 20px; height: 20px; }
/* Business profile: the card on the left, the sections on the right */
.sm-biz { display: grid; gap: 18px; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.sm-biz-side { position: sticky; top: 12px; display: grid; gap: 12px; }
.sm-vcard { --vc1: #1e2a6c; --vc2: #c9a866; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(11, 31, 26, 0.08); }
.sm-vcard-band { height: 74px; background: linear-gradient(120deg, var(--vc1), var(--vc2)); }
.sm-vcard-logo { width: 76px; height: 76px; margin: -38px 0 0 18px; border-radius: 18px; background: #fff; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sm-vcard-logo img { width: 100%; height: 100%; object-fit: contain; }
.sm-vcard-logo span { font-weight: 800; font-size: 1.4rem; color: var(--vc1); }
.sm-vcard-body { padding: 10px 18px 18px; display: grid; gap: 8px; }
.sm-vcard-body h3 { margin: 0; font-size: 1.25rem; }
.sm-vcard-tone { justify-self: start; }
.sm-vcard-site { margin: 0; color: var(--vc1); font-weight: 600; font-size: var(--fs-sm, 0.85rem); word-break: break-all; }
.sm-vcard-what { margin: 0; font-size: var(--fs-sm, 0.85rem); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sm-vcard-for { margin: 0; font-size: var(--fs-sm, 0.85rem); color: var(--muted); }
.sm-vcard-posts, .sm-vcard-budget { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.sm-vcard-row { display: flex; gap: 8px; align-items: center; font-size: var(--fs-sm, 0.85rem); font-weight: 600; }
.sm-vcard-row.is-soon { opacity: 0.55; font-weight: 500; }
.sm-mark-facebook { background: #1877f2; border-radius: 50%; }
.sm-mark-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.sm-mark-tiktok { background: #111; }
.sm-mark-google { background: #4285f4; border-radius: 50%; }
.sm-meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sm-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--vc1), var(--vc2)); }
.sm-vcard-status { padding-top: 10px; border-top: 1px solid var(--line); }
.sm-biz-form { display: grid; gap: 14px; min-width: 0; }
.sm-biz-sec { display: grid; gap: 12px; }
.sm-biz-sec h2 { margin: 0; }
.sm-biz-sec > .hint { margin: -6px 0 0; }
.sm-field > span { font-weight: 600; }
.sm-hint { color: var(--muted); font-weight: 400; font-size: var(--fs-xs, 0.78rem); }
.sm-grid2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sm-tones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sm-colour-row { display: flex; gap: 8px; align-items: center; }
.sm-colour { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; flex: none; }
.sm-logo-row { display: flex; gap: 14px; align-items: center; }
.sm-logo-row > div:last-child { display: grid; gap: 6px; justify-items: start; }
.sm-logo-box { width: 72px; height: 72px; border: 1px dashed var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; flex: none; }
.sm-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.sm-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sm-do { border-left: 4px solid #2e7d4f; }
.sm-dont { border-left: 4px solid #b3261e; }
.sm-money { display: flex; align-items: center; gap: 6px; }
.sm-money > span { font-weight: 700; color: var(--muted); }
.sm-switch { display: flex; gap: 10px; align-items: center; cursor: pointer; align-self: end; padding-bottom: 6px; }
.sm-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sm-switch-ui { width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background 0.15s; }
.sm-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.sm-switch input:checked + .sm-switch-ui { background: var(--brass, #c9a866); }
.sm-switch input:checked + .sm-switch-ui::after { transform: translateX(18px); }
.sm-switch input:focus-visible + .sm-switch-ui { outline: 2px solid var(--brass-ink, #7a5a1e); outline-offset: 2px; }
.sm-switch > span:last-child { display: grid; }
.sm-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 12px 0; background: linear-gradient(transparent, var(--paper, #f4f7f5) 30%); }
@media (max-width: 960px) {
  .sm-biz { grid-template-columns: 1fr; }
  .sm-biz-side { position: static; }
  .sm-stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sm-stepper li button span:last-child { display: none; }
}
@media (max-width: 640px) { .sm-grid2 { grid-template-columns: 1fr; } }
.sm-wizard .field > .hint, .sm-field > .hint { font-weight: 400; color: var(--muted); }
.sm-coming { margin-top: 12px; }
.sm-soon-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 14px; }
.sm-soon-card { display: grid; gap: 10px; justify-items: start; opacity: 0.85; }
.sm-soon-head { display: flex; gap: 10px; align-items: center; }
.sm-soon-head h2 { margin: 0; }
/* Approve posts (1 Dec 2026): tabs, a small type switch and region filter, posts shaped like the Page will show them */
.sm-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 4px 0 8px; }
.sm-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sm-tab { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.sm-tab.is-on { color: var(--ink); border-bottom-color: var(--brass, #c9a866); }
.sm-tab-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: 0.78rem; text-align: center; }
.sm-tab.is-on .sm-tab-n { background: var(--brass, #c9a866); color: #fff; }
.sm-toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sm-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface, #fff); }
.sm-seg button { border: 0; background: none; padding: 7px 14px; font: inherit; font-size: var(--fs-sm, 0.85rem); cursor: pointer; color: var(--muted); }
.sm-seg button.is-on { background: var(--ink); color: #fff; }
.sm-region { width: auto; min-width: 170px; padding-top: 7px; padding-bottom: 7px; }
.sm-making { margin: 0 0 12px; }
/* Your posts (owner, 1 Dec 2026): the status line (Uploaded, Waiting to post, Scheduled, Posted) and how long the
   pictures and videos last, which Post schedule shows too */
.sm-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 12px; padding-bottom: 12px; margin-top: 12px; }
.sm-count { display: grid; gap: 2px; padding: 4px 10px; border-left: 3px solid var(--line); }
.sm-count strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sm-count span { color: var(--muted); font-size: var(--fs-sm, 0.85rem); }
.sm-count.is-waiting { border-left-color: var(--brass, #c9a866); }
.sm-count.is-scheduled { border-left-color: #1a56c4; }
.sm-count.is-posted { border-left-color: #1e6b34; }
.sm-runway { display: grid; gap: 6px; padding-top: 12px; padding-bottom: 12px; border-left: 4px solid #1e6b34; }
.sm-runway.is-warn { border-left-color: var(--warn, #b7791f); background: rgba(183, 121, 31, 0.06); }
.sm-runway-line { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 600; }
.sm-runway-line .icon { width: 18px; height: 18px; flex: none; }
.sm-runway-line.is-warn { color: #8a5a12; }
.sm-runway-line.is-plain { font-weight: 500; color: var(--muted); }
.sm-runway-line.is-bad { color: var(--danger, #b42318); }
.sm-runway.is-warn:has(.is-bad) { border-left-color: var(--danger, #b42318); background: var(--danger-wash, #fdecea); }
.sm-count-sub { font-size: var(--fs-xs, 0.75rem); }
/* Your posts' two lists, each split into Videos and Pictures (owner, 1 Dec 2026, 17:15) */
.sm-groups { display: grid; gap: 22px; }
.sm-group { display: grid; gap: 10px; scroll-margin-top: 76px; } /* below the sticky header when a link or the keyboard brings it into view */
.sm-group-head { display: flex; gap: 6px 14px; align-items: baseline; flex-wrap: wrap; }
.sm-group-head h2 { margin: 0; font-size: 1.1rem; display: flex; gap: 8px; align-items: center; }
.sm-group-head .sm-runway-line { font-size: var(--fs-sm, 0.85rem); }
.sm-next { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; font-size: var(--fs-sm, 0.85rem); font-weight: 600; color: #1a56c4; }
.sm-next .icon { width: 16px; height: 16px; }
.sm-posted { display: grid; gap: 4px; margin-top: 4px; }
.sm-posted-row { display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; margin: 0; font-size: var(--fs-sm, 0.85rem); font-weight: 600; color: #1e6b34; }
.sm-posted-row .sm-brand { font-size: var(--fs-xs, 0.78rem); }
/* Post schedule made simple (owner, 1 Dec 2026): a row per day with how many videos and pictures, the hours, the region */
.sm-plan .sm-wiz-body { max-width: 760px; gap: 18px; }
.sm-plan-sec { display: grid; gap: 8px; }
.sm-plan-days { width: auto; max-width: 100%; }
.sm-plan-days th, .sm-plan-days td { padding: 4px 6px; text-align: center; border: 0; }
.sm-plan-days tbody th { text-align: left; padding-right: 12px; font-weight: 600; }
.sm-plan-days thead th { color: var(--muted); font-weight: 500; }
.sm-plan-days thead th.is-on { color: var(--ink); font-weight: 700; }
.sm-plan-n { width: 62px; text-align: center; }
.sm-runbox > .sm-runway { margin-top: 12px; }
.sm-plan .table-wrap { border: 0; background: none; justify-self: start; max-width: 100%; }
/* "Coming soon · expected late December" (owner, 1 Dec 2026) is longer than "Coming soon": it wraps under the name */
.sm-choice.is-soon .sm-brand, .sm-soon-head, .sm-dest .sm-brands { flex-wrap: wrap; row-gap: 4px; }
.sm-plan-hours { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.sm-plan-hours .field { min-width: 130px; }
.sm-plan-line { display: block; }
.sm-summary .sm-plan-line { margin: 0; font-size: 1.05rem; font-weight: 600; }
@media (max-width: 640px) { .sm-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sm-making:empty { display: none; }
.sm-post-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.sm-post-head > div { display: grid; flex: 1 1 auto; min-width: 0; }
.sm-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex: none; }
.sm-pick { width: 18px; height: 18px; }
.sm-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-xs, 0.78rem); }
.sm-card .sm-actions .btn { flex: 1 1 0; }
.sm-soon-grid > .panel { margin: 0; }
.sm-spend { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 8px; }
.sm-spend h3 { margin: 0; font-size: 1rem; }
.sm-spend-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm, 0.85rem); }
.sm-spend-table th, .sm-spend-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.sm-spend-table th:first-child, .sm-spend-table td:first-child { text-align: left; }
.sm-spend-table thead th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs, 0.75rem); }
.sm-spend-table tfoot th { border-bottom: 0; font-size: 0.95rem; }
.sm-spend-table tfoot th:first-child { text-align: left; }

/* Full-size view of a post in Approve posts (owner, 1 Dec 2026): the whole picture or the video, the caption, Approve and Reject. */
.sm-zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.sm-zoom:focus-visible { outline: 3px solid var(--focus-light); outline-offset: -3px; }
.sm-zoom-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sm-zoom-play .icon, .sm-zoom-play svg { width: 26px; height: 26px; }
dialog.sm-viewer:focus { outline: none; }
dialog.sm-viewer { width: min(1180px, 96vw); max-width: 96vw; max-height: 96vh; padding: 0; border: 0; border-radius: 12px; background: var(--panel, #fff); color: inherit; overflow: auto; }
dialog.sm-viewer::backdrop { background: rgba(11, 20, 18, 0.7); }
.sm-viewer-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.sm-viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; background: #11161a; min-height: 260px; }
.sm-viewer-media { display: block; max-width: 100%; max-height: 90vh; width: auto; height: auto; object-fit: contain; }
.sm-viewer-media:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: -3px; }
.sm-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.85); color: #111; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.sm-viewer-nav:disabled { opacity: 0.35; cursor: default; }
.sm-viewer-nav:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: 2px; }
.sm-viewer-nav.is-prev { left: 10px; }
.sm-viewer-nav.is-next { right: 10px; }
.sm-viewer-side { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow: auto; max-height: 96vh; }
.sm-viewer-top { display: flex; align-items: center; justify-content: space-between; }
.sm-viewer-kind { margin: 0; font-weight: 600; }
.sm-viewer-caption { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-viewer-side .sm-actions { display: flex; gap: 8px; margin-top: auto; }
.sm-viewer-side .sm-actions .btn { flex: 1 1 0; }
@media (max-width: 800px) { .sm-viewer-body { grid-template-columns: 1fr; } .sm-viewer-media { max-height: 60vh; } }
/* Post schedule step 3: Every week or One date (owner, 1 Dec 2026) */
.sm-mode { justify-self: start; }
.sm-date { max-width: 220px; }
/* owner, 1 Dec 2026: the card shows the whole post as a phone shows it (4:5), never a square crop that hides the text */
.sm-card .sm-media { aspect-ratio: 4 / 5; object-fit: contain; background: #11161a; }
/* owner, 1 Dec 2026: full screen shows the whole video in its own shape (portrait stays portrait), never a crop */
.sm-card video:fullscreen, .sm-viewer video:fullscreen, video.sm-media:fullscreen, video.sm-viewer-media:fullscreen { object-fit: contain !important; width: 100%; height: 100%; background: #000; }

/* Upload your own, in bulk (1 Dec 2026): a row per file */
dialog.sm-bulk.is-drop { outline: 3px dashed var(--accent, #c9a866); outline-offset: -8px; }
.sm-bulk-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.sm-bulk-wait { grid-column: 1 / -1; margin: 0; }
.sm-bulk-empty { margin: 16px 0; padding: 24px; text-align: center; border: 2px dashed var(--line, #d5dbd8); border-radius: 10px; color: var(--muted, #5b6b66); }
.sm-bulk-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.sm-bulk-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 8px; border: 1px solid var(--line, #d5dbd8); border-radius: 8px; }
.sm-bulk-row[data-state="done"] { background: rgba(46, 125, 50, 0.07); }
.sm-bulk-row[data-state="failed"], .sm-bulk-row[data-state="skipped"] { background: rgba(176, 42, 42, 0.06); }
.sm-bulk-thumb { width: 88px; height: 66px; object-fit: cover; border-radius: 6px; background: #11161a; display: block; }
.sm-bulk-thumb.sm-nomedia { display: flex; align-items: center; justify-content: center; color: #cfd8d4; font-size: 12px; }
.sm-bulk-main { display: grid; gap: 4px; min-width: 0; }
.sm-bulk-name { overflow-wrap: anywhere; }
.sm-bulk-main textarea { width: 100%; resize: vertical; }
.sm-bulk-main progress { width: 100%; height: 8px; }
.sm-bulk-status { margin: 0; font-size: 13px; }
.sm-bulk-status.is-bad { color: #b02a2a; }
.sm-bulk-summary { margin: 8px 0 0; font-weight: 600; }
.sm-bulk-summary:empty { display: none; }
@media (max-width: 640px) { .sm-bulk-top { grid-template-columns: 1fr; } .sm-bulk-row { grid-template-columns: 64px minmax(0, 1fr); } .sm-bulk-row > button { grid-column: 2; justify-self: start; } .sm-bulk-thumb { width: 64px; height: 48px; } }

/* format fit chips (1 Dec 2026): where a picture or video can go */
.sm-fits { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.sm-fit { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; line-height: 1; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line, #d5dbd8); white-space: nowrap; }
.sm-fit.is-yes, .sm-fit.is-yes-short { background: rgba(46, 125, 50, 0.12); border-color: rgba(46, 125, 50, 0.45); }
.sm-fit.is-bars { background: rgba(230, 150, 0, 0.14); border-color: rgba(200, 120, 0, 0.5); }
.sm-fit.is-no { background: rgba(190, 50, 50, 0.1); border-color: rgba(190, 50, 50, 0.45); text-decoration: line-through; text-decoration-thickness: 1px; }
.sm-fit.is-unknown { background: transparent; }
.sm-fit.is-soon { opacity: 0.45; }
.sm-fit-soon { font-size: 0.65rem; }
.sm-fit-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; font-size: 0.85rem; }
.sm-fit-list li.is-soon { opacity: 0.55; }
.sm-fit-list li.is-no strong { color: #a33; }
.sm-bulk-shape { font-size: 0.8rem; }
.sm-sched-skip { color: #8a5a00; }

/* ---------- labels with colours (owner, 1 Dec 2026, night feature 6; views/social-labels.js) ----------
 * 8 fixed colours. Each has a tint (bg), its text (ink, at least 4.5:1 on the tint), a border (line) and a strong dot
 * (at least 3:1 on the page), light and dark. admin/test/social-labels.test.mjs reads these two blocks and checks it. */
:root {
  --lb-blue-bg: #e3edfb; --lb-blue-ink: #1d4f91; --lb-blue-line: #b9d0f0; --lb-blue-dot: #2f6fc4;
  --lb-green-bg: #dcf2e6; --lb-green-ink: #0d6646; --lb-green-line: #a9dbc0; --lb-green-dot: #1f8a5b;
  --lb-orange-bg: #fde8da; --lb-orange-ink: #9a3d12; --lb-orange-line: #f2c2a3; --lb-orange-dot: #c2621f;
  --lb-purple-bg: #ece7fb; --lb-purple-ink: #4f3aa8; --lb-purple-line: #cdc2f2; --lb-purple-dot: #6b56c9;
  --lb-teal-bg: #dbf0f3; --lb-teal-ink: #11606f; --lb-teal-line: #a7d9e1; --lb-teal-dot: #23808f;
  --lb-pink-bg: #fbe3ed; --lb-pink-ink: #9b2c5a; --lb-pink-line: #efbad1; --lb-pink-dot: #b8487c;
  --lb-gold-bg: #f7edcc; --lb-gold-ink: #6e4b00; --lb-gold-line: #e3cd86; --lb-gold-dot: #9a7412;
  --lb-grey-bg: #eceff2; --lb-grey-ink: #3d4752; --lb-grey-line: #cdd4db; --lb-grey-dot: #6b7785;
}
:root[data-theme="dark"] {
  --lb-blue-bg: #1b2c44; --lb-blue-ink: #b9d3f6; --lb-blue-line: #2f4c75; --lb-blue-dot: #6ea0e6;
  --lb-green-bg: #15322a; --lb-green-ink: #a9e5cc; --lb-green-line: #275a48; --lb-green-dot: #4fbf8a;
  --lb-orange-bg: #3a2418; --lb-orange-ink: #f6c3ab; --lb-orange-line: #6a3c25; --lb-orange-dot: #e89155;
  --lb-purple-bg: #2a2445; --lb-purple-ink: #d2c8f7; --lb-purple-line: #4a3f7a; --lb-purple-dot: #a596ec;
  --lb-teal-bg: #133238; --lb-teal-ink: #a6e0ea; --lb-teal-line: #245a64; --lb-teal-dot: #5fb3c9;
  --lb-pink-bg: #3a1d2b; --lb-pink-ink: #f3bcd2; --lb-pink-line: #6a3350; --lb-pink-dot: #e07aa8;
  --lb-gold-bg: #352a12; --lb-gold-ink: #f2d68f; --lb-gold-line: #64501f; --lb-gold-dot: #d2b06a;
  --lb-grey-bg: #262c33; --lb-grey-ink: #d3dae2; --lb-grey-line: #444e59; --lb-grey-dot: #9aa8b6;
}
:is(.sm-label, .sm-swatch-dot).is-blue { --lb-bg: var(--lb-blue-bg); --lb-ink: var(--lb-blue-ink); --lb-line: var(--lb-blue-line); --lb-dot: var(--lb-blue-dot); }
:is(.sm-label, .sm-swatch-dot).is-green { --lb-bg: var(--lb-green-bg); --lb-ink: var(--lb-green-ink); --lb-line: var(--lb-green-line); --lb-dot: var(--lb-green-dot); }
:is(.sm-label, .sm-swatch-dot).is-orange { --lb-bg: var(--lb-orange-bg); --lb-ink: var(--lb-orange-ink); --lb-line: var(--lb-orange-line); --lb-dot: var(--lb-orange-dot); }
:is(.sm-label, .sm-swatch-dot).is-purple { --lb-bg: var(--lb-purple-bg); --lb-ink: var(--lb-purple-ink); --lb-line: var(--lb-purple-line); --lb-dot: var(--lb-purple-dot); }
:is(.sm-label, .sm-swatch-dot).is-teal { --lb-bg: var(--lb-teal-bg); --lb-ink: var(--lb-teal-ink); --lb-line: var(--lb-teal-line); --lb-dot: var(--lb-teal-dot); }
:is(.sm-label, .sm-swatch-dot).is-pink { --lb-bg: var(--lb-pink-bg); --lb-ink: var(--lb-pink-ink); --lb-line: var(--lb-pink-line); --lb-dot: var(--lb-pink-dot); }
:is(.sm-label, .sm-swatch-dot).is-gold { --lb-bg: var(--lb-gold-bg); --lb-ink: var(--lb-gold-ink); --lb-line: var(--lb-gold-line); --lb-dot: var(--lb-gold-dot); }
:is(.sm-label, .sm-swatch-dot).is-grey { --lb-bg: var(--lb-grey-bg); --lb-ink: var(--lb-grey-ink); --lb-line: var(--lb-grey-line); --lb-dot: var(--lb-grey-dot); }
.chip.sm-label { background: var(--lb-bg); color: var(--lb-ink); border-color: var(--lb-line); max-width: 16em; min-width: 0; }
.sm-label-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.sm-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lb-dot); flex: none; }
.chip.sm-label-more, .chip.sm-label-none { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
/* one line: the first label and "+N" (the admin's list style); the full-size view wraps them all */
.sm-labels { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; flex-wrap: nowrap; }
.sm-labels.is-all { flex-wrap: wrap; }
.sm-labels > .sm-label { flex: 0 1 auto; }
.sm-labels > .sm-label-more { flex: none; }
.sm-card .sm-labels, .sm-viewer-side .sm-labels { display: flex; }
.sm-cal-open > .sm-labels { grid-column: 1 / -1; justify-self: start; }
.sm-cal-row-meta .sm-labels { max-width: 18em; }
/* a filter that is on: "Showing: Funding tips · Show all" */
.sm-label-on { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.sm-label-on[hidden] { display: none; }
.select.sm-label-filter { width: auto; min-width: 150px; max-width: 14em; padding-top: 7px; padding-bottom: 7px; }
.sm-cal-bar .sm-label-filter { margin-left: auto; }
/* Your posts: the label filter and the region side by side, on the right (they wrap on a phone) */
.sm-toolbar-right:has(.sm-label-filter) { flex: 1 1 auto; justify-content: flex-end; }
.sm-post-head .more { flex: none; }
/* the 8 colours as round buttons */
.sm-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sm-swatch { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.sm-swatch-in { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.sm-swatch-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--lb-dot); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.sm-swatch-in:checked + .sm-swatch-dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--lb-dot); }
.sm-swatch-in:focus-visible + .sm-swatch-dot { outline: 2px solid var(--focus-light); outline-offset: 4px; }
/* the Labels window */
dialog.dialog.sm-lbw { width: min(620px, calc(100vw - 24px)); }
.sm-lbw-new { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md, 8px); background: var(--surface-2); }
.sm-lbw-new > .field { grid-column: 1 / -1; margin: 0; }
.sm-lbw-new > .input { grid-column: 1 / -1; }
.sm-lbw-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sm-lbw-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-top: 1px solid var(--line); }
.sm-lbw-row:first-child { border-top: 0; }
.sm-lbw-used { flex: 1 1 auto; min-width: 0; }
.sm-lbw-acts { display: inline-flex; gap: 6px; flex: none; }
.sm-lbw-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; }
.sm-lbw-edit > .input { flex: 1 1 12em; min-width: 0; }
.sm-lbw-empty { color: var(--muted); padding: 8px 0; }
.sm-lbw-count { margin: 0; }
/* tick boxes, each drawn as its chip (an item's labels, and the upload window) */
.sm-lbx { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.sm-lbx > legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.sm-lbx-list { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.sm-lbx-item { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.sm-lbx-item input:disabled + .chip { opacity: 0.55; }
.sm-lbx-note { margin: 0; }
@media (max-width: 560px) {
  .sm-lbw-row { flex-wrap: wrap; }
  .sm-lbw-new { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .chip.sm-label, .sm-swatch-dot { border: 1px solid CanvasText; }
  .sm-swatch-in:checked + .sm-swatch-dot { outline: 3px solid Highlight; outline-offset: 2px; }
}
/* ---------- end labels with colours ---------- */
/* ---------- finding posts on Your posts (night feature 12, 1 Dec 2026) ---------- */
/* the search box (it grows) and the sort on one line; the type and "where it can go" sit beside the label filter */
.sm-find { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; }
.sm-find-box { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; min-width: 0; height: var(--control-h); padding: 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); }
.sm-find-box:hover { border-color: var(--muted); }
.sm-find-box:focus-within { border-color: var(--focus-light); box-shadow: 0 0 0 3px rgba(31, 107, 84, 0.16); }
.sm-find-box .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.sm-find-box .sm-find-q { flex: 1; height: 100%; border: 0; padding: 0; background: transparent; }
.sm-find-box .sm-find-q:focus-visible { box-shadow: none; }
.sm-find-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm, 0.85rem); }
.sm-find-sort .select { width: auto; min-width: 200px; padding-top: 7px; padding-bottom: 7px; color: var(--ink); }
.select.sm-find-type, .select.sm-find-fit { width: auto; min-width: 150px; max-width: 15em; padding-top: 7px; padding-bottom: 7px; }
.sm-toolbar-right:has(.sm-find-type) { flex: 1 1 auto; justify-content: flex-end; }
/* "12 of 140 waiting to post · Clear filters" */
.sm-find-line { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 10px; }
.sm-find-line[hidden] { display: none; }
.sm-more { justify-self: center; }
.sm-filename { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs, 0.75rem); }
@media (max-width: 640px) {
  .sm-find-sort { flex: 1 1 100%; }
  .sm-find-sort .select { flex: 1; min-width: 0; }
  .sm-toolbar-right:has(.sm-find-type) > .select { flex: 1 1 calc(50% - 5px); min-width: 0; max-width: none; }
}
/* ---------- end finding posts ---------- */
/* Social media Overview, 1 Dec 2026 (owner: graphs and charts of what is happening with the posting). Colours are the --viz-*
 * variables, so the charts read in light and dark; no inline styles (the CSP forbids them). */
.so-panel { margin-bottom: 16px; }
.so-panel h3 { font-size: var(--fs-md); margin: 14px 0 6px; }
.so-ready { --c: var(--viz-1); } .so-nothing { --c: var(--viz-4); } .so-posted { --c: var(--viz-3); } .so-skipped { --c: var(--viz-other); }
.so-failed { --c: var(--viz-7); } .so-facebook { --c: var(--viz-1); } .so-instagram { --c: var(--viz-5); }
/* Waiting to post and posted (owner, 1 Dec 2026, 17:15): videos and pictures each their own colour; waiting against posted */
.so-video { --c: var(--viz-2); } .so-picture { --c: var(--viz-6); } .so-waiting { --c: var(--viz-8); }
.so-stock.is-warn { border-color: #e8c98a; background: rgba(183, 121, 31, 0.08); }
.so-stock-line { font-weight: 600; }
.so-bar, .so-swatch { fill: var(--c); } .so-swatch { background: var(--c); }
.so-chart { display: block; width: 100%; height: auto; max-height: 230px; }
.so-grid { stroke: var(--line-strong); stroke-width: 1; }
.so-axis { fill: var(--muted); font-size: 11px; }
.so-val { fill: var(--text); font-size: 12px; font-weight: 700; }
.so-legend { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-sm); color: var(--text); }
.so-legend li { display: inline-flex; align-items: center; gap: 6px; }
.so-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.so-two { display: grid; gap: 16px 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .so-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.so-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.so-tile { display: grid; gap: 2px; min-width: 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: var(--fs-sm); color: var(--muted); }
.so-tile .sm-brand { color: var(--ink); font-size: var(--fs-lg); }
.so-fig { font-size: var(--fs-fig); line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.so-tile .so-fig { font-size: 1.5rem; }
.so-tile.is-warn { border-color: var(--brass-line, #e2cf9f); } .so-tile.is-bad { border-color: #f1b8b2; }
.so-stocks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 12px; }
.so-stock { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.so-stock p { margin: 6px 0 0; }
.so-stock-head { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); }
.so-stock.is-bad { border-color: #f1b8b2; background: var(--danger-wash, #fdecea); } .so-stock.is-ok { border-color: var(--mint-line, #bfe3d2); }
.so-alert { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--warn, #b7791f); background: rgba(183, 121, 31, 0.1); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-weight: 600; }
.so-alert.is-bad { border-left-color: var(--danger, #b42318); background: var(--danger-wash, #fdecea); }
.so-cover { display: grid; grid-template-columns: minmax(60px, 140px) auto; align-items: center; gap: 10px; }
.so-meter { display: block; } .so-track { fill: var(--viz-track); } .so-fill { fill: var(--viz-1); }
.so-table tr.is-soon td { background: rgba(183, 121, 31, 0.08); }
.so-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.so-month { font-size: var(--fs-lg); }
.so-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.so-wd { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.so-cell { min-height: 64px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); display: grid; align-content: start; gap: 4px; min-width: 0; }
.so-cell.is-blank { border-color: transparent; background: transparent; }
.so-cell.is-today { border-color: var(--ink); background: var(--surface); }
.so-day { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.so-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.so-more { font-size: var(--fs-2xs); color: var(--muted); }
.so-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--viz-other)); border: 2px solid var(--c, var(--viz-other)); box-sizing: border-box; }
.so-dot.is-video { border-radius: 3px; }
.so-dot.is-planned { background: transparent; border-style: dashed; }
.so-dot.is-ready { --c: var(--viz-1); } .so-dot.is-nothing { --c: var(--viz-4); } .so-dot.is-posted { --c: var(--viz-3); }
.so-dot.is-skipped { --c: var(--viz-other); } .so-dot.is-failed { --c: var(--viz-7); }
a.so-dot:hover, a.so-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.so-health { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 4px; }
.so-conn { display: flex; align-items: center; gap: 10px; }
.so-problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.so-reason { display: block; }
.so-nonum { margin: 12px 0 0; color: var(--muted); }
@media (max-width: 640px) { .so-cell { min-height: 52px; padding: 3px; } .so-dot { width: 10px; height: 10px; } }

/* Calendar, a post's panel, New post and the text per platform (owner, 1 Dec 2026; views/social-calendar.js, social-post.js,
 * social-preview.js). Each state has its colour (--c) and its own look: Ready filled, Nothing to post amber, Planned
 * dashed, Posted green, Failed red, Cancelled struck through and grey. Past days are dimmer. No inline styles (the CSP). */
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note) { --c: #5d6d67; --wash: var(--surface-2); }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-ready { --c: #1a56c4; --wash: #eaf1fd; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-nothing { --c: #9a5f0e; --wash: #fdf3e2; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-planned { --c: #5d6d67; --wash: transparent; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-posting { --c: #1a56c4; --wash: #eef4fd; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-posted { --c: #1e6b34; --wash: #e8f5ec; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-partial { --c: #8a5a12; --wash: #f3f4e4; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-failed { --c: #a12a1f; --wash: #fdecea; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-skipped { --c: #66706c; --wash: #f1f3f2; }
:is(.sm-cal-state, .sm-cal-card, .sm-cal-dot, .sm-cal-row, .sm-pp-note).is-cancelled { --c: #7c8783; --wash: #f4f6f5; }
.sm-cal-state { display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; line-height: 18px; white-space: nowrap; color: var(--c); background: var(--wash); border: 1px solid var(--c); }
.sm-cal-state.is-ready { background: var(--c); color: #fff; }
.sm-cal-state.is-planned { border-style: dashed; }
.sm-cal-state.is-cancelled { text-decoration: line-through; }
.sm-cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); border: 2px solid var(--c); box-sizing: border-box; flex: none; }
.sm-cal-dot.is-planned { background: transparent; }
.sm-cal-dot.is-cancelled { background: var(--line-strong); border-color: var(--line-strong); }

/* the bar: Previous, Today, Next and the dates; Week, Month, List */
.sm-cal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 8px; }
.sm-cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sm-cal-title { font-size: var(--fs-lg); color: var(--ink); margin-left: 6px; }
.sm-cal-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 0 0 10px; }
.sm-cal-help .hint { margin: 0; }
.sm-cal-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }

/* Week: seven columns; a phone stacks the days */
.sm-cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sm-cal-day { min-width: 0; min-height: 220px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 6px; transition: background-color 120ms, border-color 120ms; }
.sm-cal-day.is-past { background: var(--surface-2); }
.sm-cal-day.is-past > * { opacity: 0.62; }
.sm-cal-day.is-today { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sm-cal-day.is-drop, .sm-cal-cell.is-drop { border-color: var(--brass); background: var(--brass-wash); box-shadow: inset 0 0 0 2px var(--brass); }
.sm-cal-dayhead { display: flex; align-items: baseline; gap: 5px; margin: 0 2px 2px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.sm-cal-dayhead strong { font-size: var(--fs-lg); color: var(--ink); }
.sm-cal-todaytag { margin-left: auto; padding: 0 6px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: var(--fs-2xs); font-weight: 700; line-height: 16px; }
.sm-cal-grouphead .sm-cal-todaytag, .sm-cal-daylist h3 .sm-cal-todaytag { margin-left: 8px; }
.sm-cal-cards { display: grid; gap: 6px; }
.sm-cal-none { margin: 2px; color: var(--muted); font-size: var(--fs-sm); }

/* a post on the week */
.sm-cal-card { position: relative; min-width: 0; border: 1px solid var(--line-strong); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--wash); }
.sm-cal-card.is-ready { background: var(--wash); border-color: var(--c); }
.sm-cal-card.is-planned { border-style: dashed; border-left-style: dashed; background: var(--surface); }
.sm-cal-card.is-cancelled .sm-cal-time, .sm-cal-row.is-cancelled .sm-cal-row-top { text-decoration: line-through; color: var(--muted); }
.sm-cal-card.is-cancelled .sm-cal-thumb { filter: grayscale(1); opacity: 0.6; }
.sm-cal-card.is-drag { cursor: grab; }
.sm-cal-card.is-dragging { opacity: 0.45; }
.sm-cal-card.is-moving { opacity: 0.5; pointer-events: none; }
.sm-cal-card.is-flash, .sm-cal-row.is-flash { animation: sm-cal-flash 2.4s var(--ease-out); }
@keyframes sm-cal-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brass); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .sm-cal-card.is-flash, .sm-cal-row.is-flash { animation: none; box-shadow: 0 0 0 3px var(--brass); } }
.sm-cal-open { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "thumb when" "thumb marks" "state state" "sub sub" "why why"; gap: 3px 7px; align-items: center; width: 100%; padding: 6px 7px; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; border-radius: var(--r); }
.sm-cal-card.is-drag .sm-cal-open { cursor: grab; }
.sm-cal-open:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 1px; }
.sm-cal-open > .sm-cal-thumb { grid-area: thumb; }
.sm-cal-open > .sm-cal-when { grid-area: when; }
.sm-cal-open > .sm-cal-marks { grid-area: marks; }
.sm-cal-open > .sm-cal-state { grid-area: state; justify-self: start; }
.sm-cal-open > .sm-cal-sub { grid-area: sub; }
.sm-cal-open > .sm-cal-why { grid-area: why; }
.sm-cal-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; background: #11161a; display: block; }
.sm-cal-thumb.is-none { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--muted); box-sizing: border-box; }
.sm-cal-thumb.is-none .icon { width: 15px; height: 15px; }
.sm-cal-when { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.sm-cal-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.sm-cal-tz { color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-cal-marks { display: inline-flex; gap: 3px; }
.sm-cal-marks .sm-brand-mark { width: 16px; height: 16px; }
.sm-cal-marks .sm-brand-mark .icon { width: 10px; height: 10px; }
.sm-cal-sub { color: var(--muted); font-size: var(--fs-2xs); line-height: 1.3; }
.sm-cal-why { color: var(--c); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sm-cal-links { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0 7px 6px; position: relative; }
.sm-cal-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2xs); font-weight: 600; color: var(--c, var(--ink)); }
.sm-cal-link .sm-brand-mark { width: 14px; height: 14px; }
.sm-cal-link .sm-brand-mark .icon { width: 9px; height: 9px; }
/* Results per post (night feature 5): one small number on a posted card (people reached, else views) */
.sm-cal-reach { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); font-size: var(--fs-2xs); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-cal-reach .icon { width: 11px; height: 11px; color: var(--muted); }
.sm-cal-open > .sm-cal-reach { grid-area: state; justify-self: end; }

/* Month: a grid of days; on a wide screen each day lists its first three posts, on a phone coloured dots and a count */
.sm-cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sm-cal-wd { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 0; }
.sm-cal-cell { min-width: 0; min-height: 112px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 3px; }
.sm-cal-cell.is-out { background: var(--surface-2); }
.sm-cal-cell.is-out .sm-cal-n { color: var(--faint); font-weight: 500; }
.sm-cal-cell.is-past > * { opacity: 0.62; }
.sm-cal-cell.is-today { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sm-cal-cell.is-picked { border-color: var(--brass); box-shadow: inset 0 0 0 2px var(--brass); }
.sm-cal-num { display: flex; align-items: center; gap: 4px; width: 100%; padding: 2px 4px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 700; text-align: left; cursor: pointer; }
.sm-cal-num:hover { background: var(--hover); }
.sm-cal-num:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 0; }
.sm-cal-dots { display: none; flex-wrap: wrap; gap: 3px; align-items: center; }
.sm-cal-count { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; }
.sm-cal-minis { display: grid; gap: 3px; min-width: 0; }
.sm-cal-card.is-compact { border-left-width: 3px; }
.sm-cal-card.is-compact .sm-cal-open { display: flex; align-items: center; gap: 5px; padding: 2px 5px; font-size: var(--fs-xs); white-space: nowrap; }
.sm-cal-card.is-compact .sm-cal-state { border: 0; background: none; color: var(--c); padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sm-cal-card.is-compact.is-ready .sm-cal-state { background: none; color: var(--c); }
.sm-cal-more { align-self: start; padding: 1px 5px; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--fs-xs); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sm-cal-daylist { margin-top: 12px; }
.sm-cal-daylist h3 { margin: 0 0 8px; display: flex; align-items: center; }
.sm-cal-pickhint { margin: 10px 0 0; }

/* List (and the day under the month): one row per post */
.sm-cal-list { display: grid; gap: 14px; }
.sm-cal-group.is-past { opacity: 0.7; }
.sm-cal-grouphead { display: flex; align-items: center; margin: 0 0 6px; font-size: var(--fs-md); color: var(--ink); }
.sm-cal-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sm-cal-row { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.sm-cal-row.is-planned { border-style: dashed; border-left-style: dashed; }
.sm-cal-row.is-ready, .sm-cal-row.is-nothing, .sm-cal-row.is-failed { background: var(--wash); }
.sm-cal-row-open { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-lg); }
.sm-cal-row-open:hover { background: var(--hover); }
.sm-cal-row-open:focus-visible { outline: 2px solid var(--focus-light); outline-offset: -2px; }
.sm-cal-row-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #11161a; flex: none; display: block; }
.sm-cal-row-thumb.is-none { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--muted); box-sizing: border-box; }
.sm-cal-row-thumb.is-none .icon { width: 20px; height: 20px; }
.sm-cal-row-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 auto; }
.sm-cal-row-top { font-size: var(--fs); color: var(--text); }
.sm-cal-row-top strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.sm-cal-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sm-cal-row .sm-cal-links { padding: 0 10px 8px 70px; }
.sm-cal-row .sm-cal-why { -webkit-line-clamp: 3; }
/* Drafts (1 Dec 2026, night feature 3): the tab beside the views, and its list (rows like the List view's, no time) */
.sm-seg .sm-cal-drafts-tab { border-left: 1px solid var(--line); }
.sm-cal-row.is-draft { --c: var(--brass); }
.sm-cal-row.is-draft.is-gone { --c: #9a5f0e; --wash: #fdf3e2; background: var(--wash); }
.sm-draft-line strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-np-note { margin: 0 0 10px; }

@media (max-width: 1180px) {
  .sm-cal-open { grid-template-columns: minmax(0, 1fr); grid-template-areas: "when" "marks" "state" "sub" "why"; }
  .sm-cal-open > .sm-cal-thumb { display: none; }
}
@media (max-width: 699px) {
  .sm-cal-week { grid-template-columns: minmax(0, 1fr); }
  .sm-cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .sm-cal-day.is-empty { padding-top: 4px; padding-bottom: 4px; }
  .sm-cal-dayhead { flex: 0 0 64px; flex-direction: column; align-items: flex-start; gap: 0; margin: 2px 0 0; }
  .sm-cal-dayhead .sm-cal-todaytag { margin: 2px 0 0; }
  .sm-cal-cards, .sm-cal-none { flex: 1 1 0; min-width: 0; }
  .sm-cal-none { align-self: center; }
  .sm-cal-open { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "thumb when state" "thumb marks state" "sub sub sub" "why why why"; }
  .sm-cal-open > .sm-cal-thumb { display: block; width: 36px; height: 36px; }
  .sm-cal-open > .sm-cal-thumb.is-none { display: inline-flex; }
  .sm-cal-open > .sm-cal-state { justify-self: end; }
  .sm-cal-cell { min-height: 54px; padding: 2px; }
  .sm-cal-num { flex-direction: column; align-items: center; gap: 3px; height: 100%; padding: 4px 2px; }
  .sm-cal-dots { display: flex; justify-content: center; }
  .sm-cal-minis { display: none; }
  .sm-cal-wd { font-size: var(--fs-2xs); letter-spacing: 0; }
  .sm-cal-title { flex: 1 1 100%; margin: 2px 0 0; }
  .sm-cal-bar { align-items: flex-start; }
  .sm-cal-row .sm-cal-links { padding-left: 10px; }
}

/* a post's panel and New post: a large modal; the picture or video and the previews on the left, the details and the
 * changes on the right; one column on a phone */
dialog.sm-pp { width: min(1120px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
dialog.sm-pp::backdrop { background: rgba(11, 31, 26, 0.55); }
dialog.sm-pp.sm-np { width: min(980px, calc(100vw - 24px)); }
.sm-pp-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sm-pp-head h2 { margin: 0; font-size: var(--fs-lg); color: var(--ink); }
.sm-pp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.sm-pp-loading, .sm-pp-pad { padding: 18px; margin: 0; }
.sm-pp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 1fr); grid-template-areas: "stage side" "prev side"; gap: 16px 22px; padding: 16px 18px 18px; align-items: start; }
.sm-pp-stagebox { min-width: 0; }
.sm-pp-side { display: grid; gap: 14px; min-width: 0; }
.sm-pp-previews { min-width: 0; display: grid; gap: 8px; }
.sm-pp-grid > .sm-pp-stagebox { grid-area: stage; }
.sm-pp-grid > .sm-pp-side { grid-area: side; }
.sm-pp-grid > .sm-pp-previews { grid-area: prev; }
.sm-pp-previews h3, .sm-pp-sec h3 { margin: 0; font-size: var(--fs-md); color: var(--ink); }
.sm-pp-stage { display: flex; align-items: center; justify-content: center; min-height: 220px; border-radius: var(--r-lg); background: #11161a; overflow: hidden; }
.sm-pp-media { display: block; max-width: 100%; max-height: 52vh; width: auto; height: auto; object-fit: contain; }
.sm-pp-stage.is-portrait .sm-pp-media { max-height: 60vh; }
.sm-pp-stage.is-empty { flex-direction: column; gap: 8px; padding: 24px; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; }
.sm-pp-stage.is-empty p { margin: 0; max-width: 34ch; }
.sm-pp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: var(--fs); }
.sm-pp-facts dt { color: var(--muted); font-weight: 600; }
.sm-pp-facts dd { margin: 0; color: var(--ink); min-width: 0; }
.sm-pp-facts .sm-brands { margin: 0; gap: 10px; }
.sm-pp-note { margin: 0; padding: 8px 10px; border-left: 4px solid var(--c); border-radius: var(--r-xs, 4px); background: var(--wash); color: var(--ink); font-size: var(--fs); overflow-wrap: anywhere; }
.sm-pp-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
/* Results per post (night feature 5): each platform's latest totals in a post's panel */
.sm-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sm-res-plat { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.sm-res-phead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sm-res-open { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.sm-res-open .icon { width: 13px; height: 13px; }
.sm-res-read, .sm-res-why { margin: 0; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.sm-res-why { color: var(--text); }
.sm-res-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 0; }
.sm-res-num { display: grid; align-content: start; gap: 1px; padding: 6px 8px; border-radius: var(--r-xs, 4px); background: var(--surface-2); min-width: 0; }
.sm-res-num dt { font-size: var(--fs-2xs); color: var(--muted); }
.sm-res-num dd { margin: 0; display: grid; gap: 2px; }
.sm-res-val { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sm-res-num.is-none .sm-res-val { color: var(--muted); font-weight: 400; }
.sm-res-numwhy { font-size: var(--fs-2xs); color: var(--muted); line-height: 1.3; }
.sm-pp-sec { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
.sm-pp-when { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.sm-pp-when > .field { flex: 0 1 170px; }
/* Repeat a post (1 Dec 2026): how often, and when it ends; the times count and the last day sit beside the choice */
.sm-rep { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.sm-rep > .hint { flex-basis: 100%; margin: 0; }
.sm-rep-every { flex: 0 1 200px; }
.sm-rep-end:empty { display: none; }
.sm-rep-end .field { max-width: 170px; }
.sm-rep-n .hint { display: block; }
.sm-np-repeat { margin-top: 12px; }
.sm-pp-rep-line { margin: 0 0 8px; font-weight: 600; }
.sm-plan-was { margin: 0 0 8px; }
.sm-plan-tt { display: block; margin-top: 2px; } /* TikTok's line under the schedule's sentence, on a line of its own */
.sm-repeats { margin-top: 4px; }
.sm-pp-zone { padding-bottom: 9px; }
.sm-time { max-width: 150px; }
.sm-pp-current { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sm-pp-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-pp-plat { flex: 1 1 150px; padding: 10px 12px; border-radius: var(--r-lg); gap: 2px; }
.sm-pp-plat.is-blocked { opacity: 0.7; border-style: dashed; cursor: not-allowed; }
.sm-pp-plat .hint { font-size: var(--fs-xs); }
.sm-pp-again .sm-seg { justify-self: start; }
.sm-pp-again-plats { display: grid; gap: 6px; min-width: 0; }
.sm-pp-again-q { margin: 0; font-size: var(--fs); font-weight: 600; color: var(--ink); }
.sm-pp-foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 18px; background: var(--surface); border-top: 1px solid var(--line); }
.sm-pp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.sm-pp-why { margin: 0; color: var(--muted); font-size: var(--fs-sm); flex: 1 1 240px; min-width: 0; }
.sm-pp-why:empty { display: none; }
.sm-pp-why.is-bad { color: var(--danger); font-weight: 600; }
.sm-np-body { padding: 14px 18px 4px; }
.sm-np-body .sm-stepper { margin-top: 0; }
.sm-np-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sm-np-step { max-width: none; }
.sm-np-step > .sm-seg { justify-self: start; }
.sm-np-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sm-np-text > div:first-child { display: grid; gap: 8px; min-width: 0; }
.sm-np-step .sm-summary p { font-size: var(--fs-md); }
@media (max-width: 860px) {
  .sm-pp-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "side" "prev"; padding: 12px; }
  .sm-pp-head, .sm-pp-foot { padding-left: 12px; padding-right: 12px; }
  .sm-np-body { padding: 12px 12px 4px; }
  .sm-np-text { grid-template-columns: minmax(0, 1fr); }
  .sm-pp-media, .sm-pp-stage.is-portrait .sm-pp-media { max-height: 46vh; }
}
@media (max-width: 599px) {
  dialog.sm-pp, dialog.sm-pp.sm-np { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .sm-pp-btns { width: 100%; }
  .sm-pp-btns .btn { flex: 1 1 0; }
}

/* choosing an approved picture or video */
.sm-chooser { display: grid; gap: 10px; min-width: 0; }
.sm-chooser-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sm-chooser-grid { list-style: none; margin: 0; padding: 2px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 52vh; overflow: auto; }
.sm-pp-item .sm-chooser-grid { max-height: 340px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.sm-chooser-item { display: grid; gap: 4px; width: 100%; padding: 0 0 6px; border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.sm-chooser-item:hover { border-color: var(--brass-line); }
.sm-chooser-item.is-on { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201, 168, 102, 0.25); background: var(--brass-wash); }
.sm-chooser-item:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }
.sm-chooser-frame { position: relative; display: block; aspect-ratio: 1 / 1; background: #11161a; }
.sm-chooser-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.sm-chooser-media.sm-nomedia { display: flex; align-items: center; justify-content: center; color: #cfd8d4; }
.sm-chooser-badge { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.sm-chooser-badge .icon { width: 12px; height: 12px; fill: currentColor; }
.sm-chooser-cap { padding: 0 8px; font-size: var(--fs-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sm-chooser-shape { padding: 0 8px; font-size: var(--fs-2xs); color: var(--muted); }
.sm-chooser-empty { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: start; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text); }
.sm-chooser-empty p { margin: 0; }
@media (max-width: 599px) { .sm-chooser-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }

/* the text: one text for all, or a separate text per platform; the counters and the limits */
.sm-tx { display: grid; gap: 10px; min-width: 0; }
.sm-tx-shared, .sm-tx-own { display: grid; gap: 6px; min-width: 0; }
.sm-tx-label { font-size: var(--fs-sm); color: var(--ink); }
.sm-tx-area { min-height: 120px; }
.sm-tx-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sm-tx-count { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.sm-tx-count.is-over { color: var(--danger); font-weight: 700; }
.sm-tx-switches { display: grid; gap: 4px; }
.sm-tx-switch { align-self: start; padding-bottom: 0; font-size: var(--fs-sm); }
.sm-tx-own { padding-left: 10px; border-left: 3px solid var(--brass-line); }
.sm-tx-own-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.sm-tx-own-head .link-button { font-size: var(--fs-sm); }
.sm-tx-problems { margin: 0; color: var(--danger); font-weight: 600; font-size: var(--fs-sm); }
.sm-tx-problems[hidden] { display: none; }

/* First comment (night feature 4): a box per platform under the text, and its state on the post's panel */
.sm-fc { display: grid; gap: 8px; min-width: 0; }
.sm-fc > .hint, .sm-fc-from, .sm-fc-tt { margin: 0; }
.sm-fc-box { display: grid; gap: 4px; min-width: 0; }
.sm-fc-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; }
.sm-fc .sm-fc-area { min-height: 64px; }
.sm-np-fc { display: grid; gap: 6px; margin-top: 14px; }
.sm-plan-fc .sm-fc { max-width: 640px; }
.sm-fc-row { display: grid; gap: 6px; min-width: 0; }
.sm-fc-row + .sm-fc-row { padding-top: 10px; border-top: 1px dashed var(--line); }
.sm-fc-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.sm-fc-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.sm-fc-link { font-size: var(--fs-sm); }
.sm-fc-retry { justify-self: start; }
/* Short links with click counts (night feature 13): the switch, Instagram's line, Link clicks in Results, Top links */
.sm-links-switch { display: grid; gap: 4px; min-width: 0; }
.sm-links-switch .sm-switch { align-self: start; padding-bottom: 0; }
.sm-links-switch > .hint, .sm-links-pvhint, .sm-np-links > .sm-wiz-q { margin: 0; }
.sm-np-links { display: grid; gap: 8px; margin-top: 12px; }
.sm-links-box + div:empty { display: none; }
.sm-links-ig { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 0; }
.sm-links-res { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.sm-links-h { margin: 0; font-size: var(--fs-sm); }
.sm-links-plats, .sm-links-list, .so-links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sm-links-plat { display: grid; gap: 4px; min-width: 0; }
.sm-links-plat + .sm-links-plat { padding-top: 6px; border-top: 1px dashed var(--line); }
.sm-links-plat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sm-links-row { font-size: var(--fs-sm); overflow-wrap: anywhere; color: var(--muted); }
.sm-links-short { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.sm-links-res > .hint { margin: 0; }
.so-links-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.so-links-row:first-child { border-top: 0; }
.so-links-main { min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); color: var(--muted); }
.so-links-n { white-space: nowrap; }
@media (max-width: 640px) { .so-links-row { grid-template-columns: minmax(0, 1fr) auto; } .so-links-main { grid-column: 1 / -1; } }

/* the previews: our own simple drawing of a Facebook post and an Instagram post */
.sm-pv-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.sm-pv { margin: 0; display: grid; gap: 6px; min-width: 0; }
.sm-pv-cap .sm-brand { font-size: var(--fs-sm); }
.sm-pv-card { border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #1c1e21; font-size: 13px; line-height: 1.35; overflow: hidden; max-width: 380px; }
.sm-pv-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px; }
.sm-pv-head > div { display: grid; min-width: 0; }
.sm-pv-head strong { font-size: 13px; color: #1c1e21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-pv-sub { font-size: 11px; color: #65676b; }
.sm-pv-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ledger); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex: none; }
.sm-pv-avatar.is-ring { width: 28px; height: 28px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d6249f; }
.sm-pv-text { margin: 0; padding: 0 10px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-pv-instagram .sm-pv-text { padding-top: 0; }
.sm-pv-more { padding: 0; border: 0; background: none; color: #65676b; font: inherit; font-weight: 600; cursor: pointer; }
.sm-pv-media { position: relative; display: block; background: #11161a; aspect-ratio: 1 / 1; overflow: hidden; }
.sm-pv-media.is-portrait { aspect-ratio: 4 / 5; }
.sm-pv-media.is-landscape { aspect-ratio: 1.91 / 1; }
.sm-pv-media img, .sm-pv-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.sm-pv-nomedia { display: flex; align-items: center; justify-content: center; color: #cfd8d4; font-size: 12px; }
.sm-pv-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.sm-pv-play .icon { width: 20px; height: 20px; fill: currentColor; }
.sm-pv-actions { display: flex; gap: 18px; padding: 7px 10px; color: #65676b; font-size: 12px; font-weight: 600; }
.sm-pv-facebook .sm-pv-actions { justify-content: space-around; border-top: 1px solid #e4e6eb; }
.sm-pv-instagram .sm-pv-actions { font-size: 16px; font-weight: 400; color: #262626; padding-bottom: 4px; }

/* Post schedule: a coming post opens its panel */
.sm-post.is-openable { cursor: pointer; border-radius: var(--r); padding: 4px; margin: -4px; }
.sm-post.is-openable:hover { background: var(--hover); }
.sm-post-open { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sm-post-open:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 2px; }

/* TikTok in posting (Owner, 1 Dec 2026): the TikTok box (views/social-tiktok.js), its consent line, the Connected
 * accounts card and the TikTok preview */
.sm-tt { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.sm-tt h3 { margin: 0; font-size: var(--fs-md); color: var(--ink); }
.sm-tt-head, .sm-tt-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sm-tt-head > div, .sm-tt-who > div { display: grid; min-width: 0; }
.sm-tt-head strong, .sm-tt-who strong { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-tt-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #111; }
.sm-tt-avatar.is-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: var(--fs-sm); }
.sm-tt-privacy { display: grid; gap: 4px; max-width: 360px; }
.sm-tt-privacy label { font-weight: 600; color: var(--ink); }
.sm-tt-ticks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sm-tt-ticks legend { font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 6px; }
.sm-tt-tick { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.sm-tt-tick input { margin-top: 3px; }
.sm-tt-tick > span:not(.hint) { display: grid; }
.sm-tt-tick.is-off { opacity: 0.55; cursor: not-allowed; }
.sm-tt-off { flex-basis: 100%; margin: 0; }
.sm-tt-privacy .hint { margin: 0; font-weight: 400; }
.sm-tt-switch { align-self: start; padding-bottom: 0; }
.sm-tt-disclose { display: grid; gap: 10px; }
.sm-tt-brands { display: grid; gap: 8px; padding-left: 50px; }
.sm-tt-label { margin: 0 0 0 50px; font-weight: 600; color: var(--ink); }
.sm-tt-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.sm-tt-note.is-bad { color: var(--danger); font-weight: 600; }
.sm-tt-consent { margin: 0; font-size: var(--fs-sm); color: var(--text); }
.sm-tt-consent a { color: var(--ink); text-decoration: underline; }
.sm-pp-consent { flex: 1 1 100%; min-width: 0; }
.sm-pp-consent:empty { display: none; }
.sm-tt-slot { display: grid; }
.sm-tt-slot > .panel { margin: 0; }
.sm-tt-card { display: grid; gap: 10px; justify-items: start; }
.sm-tt-card .page-actions { margin: 0; }
.sm-pv-tt { position: relative; background: #000; max-width: 240px; }
.sm-pv-media.is-tt { aspect-ratio: 9 / 16; }
.sm-pv-tt-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; display: grid; gap: 2px; }
.sm-pv-tt-over strong { color: #fff; font-size: 13px; }
.sm-pv-tt-over .sm-pv-text { padding: 0; color: #fff; }
.sm-pv-tt-over .sm-pv-more { color: #ddd; }
/* Post types, video cover, picture description (night feature 9): "Post as", the Reel's cover, the Story and Reel previews */
.sm-pt { display: grid; gap: 10px; }
.sm-pt-row { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 4px 12px; align-items: center; }
.sm-pt-row > .hint { grid-column: 2; margin: 0; }
.sm-pt-seg, .sm-cover-mode { justify-self: start; width: fit-content; max-width: 100%; }
.sm-pt-seg button.is-off { opacity: 0.5; cursor: not-allowed; }
.sm-pt-fit.is-no { color: var(--danger, #b42318); }
.sm-pt-type { display: grid; gap: 8px; }
.sm-pt-type-h { margin: 0; font-weight: 600; }
.sm-pt-story { margin: 0; }
.sm-cover { display: grid; gap: 8px; }
.sm-cover-pick { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.sm-cover-frame { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #11161a; display: block; }
.sm-cover-frame.is-empty { display: grid; place-items: center; align-content: center; gap: 6px; color: #cfd6d3; font-size: var(--fs-sm); text-align: center; padding: 8px; }
.sm-cover-at { display: grid; gap: 4px; }
.sm-cover-slider { width: 100%; accent-color: var(--ledger); }
.sm-cover-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-sm); }
.sm-cover-up { display: grid; gap: 6px; justify-items: start; }
.sm-alt { display: grid; gap: 4px; }
.sm-alt-label { font-weight: 600; }
.sm-pv-kind { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sm-pv-tall { position: relative; background: #000; max-width: 240px; }
.sm-pv-media.is-tall { aspect-ratio: 9 / 16; }
.sm-pv-story-top { position: absolute; left: 0; right: 0; top: 0; padding: 8px 10px 24px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); display: grid; gap: 8px; }
.sm-pv-bar { display: block; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.85); }
.sm-pv-story-who { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 12px; }
.sm-pv-story-who strong { color: #fff; }
.sm-pv-story-who .sm-pv-avatar { width: 24px; height: 24px; font-size: 10px; }
.sm-pv-reel .sm-pv-tt-over strong { color: #fff; font-size: 13px; }
.sm-pv-reel .sm-pv-tt-over .sm-pv-text { padding: 0; color: #fff; }
@media (max-width: 560px) { .sm-pt-row { grid-template-columns: 1fr; } .sm-pt-row > .hint { grid-column: 1; } }
@media (max-width: 560px) {
  .sm-tt-brands { padding-left: 0; }
  .sm-tt-label { margin-left: 0; }
}
/* ---------- saved text and platform sets (owner, 1 Dec 2026, night feature 7) ---------- */
/* Insert saved text under each text box of a post; the window that keeps them; Use set in New post and Post schedule */
.sm-st-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sm-st-note, .sm-st-left { margin: 8px 0 0; }
.sm-st-endnotes { white-space: normal; }
dialog.dialog.sm-st-pick { width: min(520px, calc(100vw - 24px)); }
.sm-st-picklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sm-st-pickitem { display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 8px 12px; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md, 8px); cursor: pointer; }
.sm-st-pickitem:hover, .sm-st-pickitem:focus-visible { border-color: var(--focus-light); }
.sm-st-snip { color: var(--muted); font-size: var(--fs-sm); white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sm-st-empty { color: var(--muted); padding: 8px 0; }
.sm-st-empty p { margin: 0 0 4px; }
dialog.dialog.sm-stw { width: min(680px, calc(100vw - 24px)); }
.sm-stw-tabs { margin: 0 0 12px; }
.sm-st-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; }
.sm-st-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); }
.sm-st-row:first-child { border-top: 0; }
.sm-st-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.sm-st-acts { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.sm-st-end { font-size: var(--fs-xs); }
.sm-st-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md, 8px); background: var(--surface-2); }
.sm-st-form h3 { margin: 0; font-size: var(--fs-md); }
.sm-st-form .field { margin: 0; }
.sm-st-count { font-variant-numeric: tabular-nums; margin-top: -4px; }
.sm-st-count.is-over { color: var(--danger); font-weight: 700; }
.sm-st-plats { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.sm-st-plats > legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.sm-st-plats .hint { margin: 0; }
.sm-st-platlist { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sm-st-plat { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.sm-st-formbtns { display: flex; justify-content: flex-end; gap: 8px; }
.sm-st-use { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0 0 10px; }
.sm-st-use .field { margin: 0; }
.sm-st-use .select { min-width: 14em; }
@media (max-width: 560px) {
  .sm-st-row { flex-wrap: wrap; }
  .sm-st-use .select { min-width: 0; width: 100%; }
}
/* ---------- end saved text and platform sets ---------- */

/* Notices (owner, 1 Dec 2026, night feature 10; views/social-notices.js): the Overview's panel and its settings dialog */
.sn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; }
.sn-head h2 { margin: 0; }
.sn-head-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.sn-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sn-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.sn-item.is-unread { background: var(--surface-2); }
.sn-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--line-strong); }
.sn-item.is-bad .sn-dot { background: var(--danger); }
.sn-item.is-warn .sn-dot { background: var(--brass); }
.sn-item.is-plain .sn-dot { background: var(--lamp); }
.sn-item.is-read .sn-dot { opacity: 0.35; }
.sn-main { min-width: 0; }
.sn-main p { margin: 0 0 2px; overflow-wrap: anywhere; }
.sn-title strong { color: var(--ink); }
.sn-item.is-read .sn-title strong { font-weight: 600; color: var(--text); }
.sn-line { color: var(--text); }
.sn-meta { color: var(--muted); font-size: var(--fs-sm); }
.sn-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sn-more { margin-top: 8px; }
.sn-mail { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--mint-line); background: var(--mint-wash); color: var(--ink); }
.sn-mail.is-off { border-left-color: var(--brass-line); background: var(--brass-wash); }
.sn-set { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 12px; }
.sn-set legend { font-weight: 700; color: var(--ink); padding: 0 4px; }
.sn-people { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sn-person { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.sn-who { margin: 4px 0 0; }
.sn-kind { display: grid; gap: 6px; padding: 6px 0; }
.sn-switch { align-self: start; padding-bottom: 0; }
.sn-switch > span:last-child { display: grid; }
.sn-hour { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: 50px; }
.sn-hour .select { width: auto; }
@media (max-width: 560px) {
  .sn-item { grid-template-columns: 12px minmax(0, 1fr); }
  .sn-acts { grid-column: 2; justify-content: flex-start; }
  .sn-head-acts { margin-left: 0; }
  .sn-hour { margin-left: 0; }
}

/* TikTok post settings (night feature 11): what is still to choose, the reason a button waits, a schedule's note, TikTok's notes */
.sm-tt-needs { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.sm-tt-needs.is-open { color: var(--danger); }
.sm-tt-needs.is-done { color: var(--muted); font-weight: 400; }
.sm-tt-block { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--danger); font-weight: 600; }
.sm-tt-schedule { display: grid; gap: 2px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--surface); }
.sm-tt-schedule .sm-tt-note { color: var(--ink); font-weight: 600; }
.sm-tt-later { margin: 0; }
.sm-tt-notes { display: block; }
