/* R&R dashboard. Same look as the video tracker dashboard (vids.peakprevail.au). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e2e7ee;
  --ink: #0d1726;
  --ink-2: #3f4b5c;
  --muted: #6b7686;
  --accent: #1177b6;
  --grad: linear-gradient(135deg, #16c9f6 0%, #1177b6 100%);
  --chart: #1177b6;
  --chart-soft: rgba(17, 119, 182, 0.14);
  --good: #137a3d;
  --good-bg: #e7f6ec;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --bad: #b42318;
  --bad-bg: #fef3f2;
  --ai: #6a3fa0;
  --ai-bg: #f3edfa;
  --chip: #eef2f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 23, 38, 0.04), 0 8px 24px rgba(13, 23, 38, 0.06);
  --head: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Site colours: categorical slots in fixed order (validated: adjacent CVD and normal-vision pass) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s-other: #8a94a3;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s-other: #6b7686;
  --bg: #0f141b; --surface: #161d26; --surface-2: #1b2430; --line: #2a3442; --ink: #eef2f7; --ink-2: #c3ccd8;
  --muted: #8d99a9; --accent: #3bb4e6; --chart: #2a9fd6; --chart-soft: rgba(42, 159, 214, 0.18);
  --good: #6fd497; --good-bg: #133222; --warn: #f1c35b; --warn-bg: #352a10; --bad: #ff9b8f; --bad-bg: #3a1714;
  --ai: #c9a8f2; --ai-bg: #2a2038; --chip: #222c39; --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s-other: #6b7686;
    --bg: #0f141b; --surface: #161d26; --surface-2: #1b2430; --line: #2a3442; --ink: #eef2f7; --ink-2: #c3ccd8;
    --muted: #8d99a9; --accent: #3bb4e6; --chart: #2a9fd6; --chart-soft: rgba(42, 159, 214, 0.18);
    --good: #6fd497; --good-bg: #133222; --warn: #f1c35b; --warn-bg: #352a10; --bad: #ff9b8f; --bad-bg: #3a1714;
    --ai: #c9a8f2; --ai-bg: #2a2038; --chip: #222c39; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 15.5px; font-weight: 700; }
h3 { font-size: 13.5px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---- login ---- */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 12vh 16px 40px; }
.login-wrap .brand { justify-content: center; margin-bottom: 18px; font-size: 17px; }
.login-card { padding: 26px 24px 22px; box-shadow: var(--shadow); }
.undo-wrap { max-width: 480px; }
.undo-facts { width: 100%; margin: 6px 0 12px; font-size: 13.5px; border-collapse: collapse; }
.undo-facts th { text-align: left; color: var(--ink-2); font-weight: 600; padding: 3px 12px 3px 0; width: 70px; vertical-align: top; }
.undo-facts td { padding: 3px 0; overflow-wrap: anywhere; }
.undo-why { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 4px 0 12px; }
.login-card h1 { font-size: 21px; }
.login-card > p.muted { margin: 4px 0 14px; font-size: 14px; }
.login { display: grid; gap: 8px; margin-top: 8px; }
.login label { font-weight: 600; }
.login input[type="password"] { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.login .btn { margin-top: 8px; justify-content: center; padding: 11px; font-size: 15px; }
.login-foot { text-align: center; font-size: 13px; margin-top: 16px; }
.error { color: var(--bad); background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); padding: 10px 12px; border-radius: 10px; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font: 800 15px/1 var(--head); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); padding: 7px 11px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--chip); color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.fresh { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .next-sync { display: none; } }
.who { color: var(--muted); font-size: 13px; }
.signout { color: var(--muted); font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 9px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- layout ---- */
.main { max-width: 1320px; margin: 0 auto; padding: 20px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head .sub, .card .sub { color: var(--muted); font-size: 12.5px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 18px 0; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }

/* ---- filters ---- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.select, .search { height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 12px; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7686' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
.search { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button { border: 0; text-decoration: none; background: transparent; padding: 5px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.seg button .count { color: var(--muted); font-weight: 500; margin-left: 4px; }
.filters .spacer { flex: 1; }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: 700 10px/1 var(--body); cursor: help; vertical-align: 1px; margin-left: 4px; }
[data-tip] { cursor: help; }
th[data-tip] > span, .kpi-label[data-tip] { text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; }
a[data-tip], button[data-tip] { cursor: pointer; }

/* ---- KPIs ---- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; min-width: 0; }
a.kpi { color: inherit; display: block; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-value { font: 800 26px/1.15 var(--head); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---- bar chart ---- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 250px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.bar i { display: block; width: min(34px, 80%); background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar:hover i { filter: brightness(1.12); }
.bar b { position: absolute; top: -2px; font: 600 11px/1 var(--body); color: var(--ink-2); transform: translateY(-100%); }
.bar-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 6px; }
.bar-labels span { text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
td { font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
tbody tr.sel td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.clip { max-width: 440px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nowrap { white-space: nowrap; }
.lead-name { font-weight: 600; }
.lead-sub { color: var(--muted); font-size: 12px; }
.more { display: flex; justify-content: center; padding: 12px; }
.sheet-table td { font-size: 13px; }
.sheet-table td.wrap { min-width: 220px; max-width: 520px; white-space: pre-wrap; }

/* ---- chips & pills ---- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ai { background: var(--ai-bg); color: var(--ai); }
.chip.blue { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.cqw { display: inline-flex; gap: 3px; }
.cqw span { width: 21px; height: 21px; border-radius: 6px; display: inline-grid; place-items: center; font: 700 11px/1 var(--body); border: 1px solid var(--line); color: var(--muted); }
.cqw span.Y { background: var(--good-bg); border-color: transparent; color: var(--good); }
.cqw span.N { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.cqw span.ai { font-style: italic; box-shadow: 0 0 0 2px var(--ai); }
.cqw span.ai:not(.Y):not(.N) { background: var(--ai-bg); color: var(--ai); border-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.blue { background: var(--accent); }
.yes { color: var(--good); font-weight: 600; } .no { color: var(--bad); font-weight: 600; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ext::after { content: '↗'; font-size: 0.85em; margin-left: 3px; }

/* ---- drawer ---- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(13, 23, 38, 0.12); transform: translateX(100%); transition: transform 0.2s ease; z-index: 40; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-inner { padding: 18px 22px 40px; }
.scrim { position: fixed; inset: 0; background: rgba(13, 23, 38, 0.28); z-index: 35; }
.drawer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.drawer-top h2 { font-size: 19px; font-weight: 800; }
.close { border: 0; background: var(--chip); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink-2); flex: none; }
.dsec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.dsec > h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.quote { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; }
.ai-box { background: var(--ai-bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.ai-box b { color: var(--ai); }
details.tx summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.tx .quote { margin-top: 8px; max-height: 360px; overflow-y: auto; }
.edit-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.edit-grid label { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.yn { display: inline-flex; gap: 4px; }
.yn button { min-width: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: 13px; }
.yn button.on.Y { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.yn button.on.N { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.yn button.on.blank { background: var(--chip); border-color: var(--muted); }
.yn button.on.ai { box-shadow: 0 0 0 2px var(--ai); font-style: italic; }
.yn .hint { font-size: 12px; color: var(--ai); align-self: center; margin-left: 6px; font-style: italic; }
.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 10px; }
textarea.input { min-height: 74px; resize: vertical; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--good); }
.save-bar { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.save-bar .msg { font-size: 13px; color: var(--muted); }

/* ---- sites ---- */
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.site-card { cursor: pointer; transition: border-color 0.15s; }
.site-card:hover { border-color: var(--accent); }
.site-card h2 { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.site-card .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.site-card .facts b { display: block; font: 800 18px/1.2 var(--head); }
.site-card .facts span { font-size: 11.5px; color: var(--muted); }
.site-card .note { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- money ---- */
.money-table th:first-child, .money-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 230px; }
.money-table td.v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-table td.v a { color: var(--ink); }
.money-table td.v a:hover { color: var(--accent); }
.money-table tr.group td { background: var(--surface-2); font: 700 11.5px/1 var(--body); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px; }
.money-table td.neg a, .money-table td.neg { color: var(--bad); }
.src { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--chip); color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
a.src:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.notes-list { display: grid; gap: 10px; }
.notes-list .n { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; font-size: 13.5px; }
.notes-list .n b { display: block; font-family: var(--head); }

/* ---- changelog ---- */
.timeline { position: relative; }
.day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }

.day-label { position: sticky; top: 64px; align-self: start; padding-top: 14px; font: 700 13px/1.3 var(--head); color: var(--ink-2); }
.day-label small { display: block; font: 500 12px/1.4 var(--body); color: var(--muted); }
.entries { border-left: 2px solid var(--line); padding-left: 18px; display: grid; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.entry { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.entry::before { content: ''; position: absolute; left: -26px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.entry .areas { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.entry .what { font-size: 14px; }
.entry .what.short { max-height: 4.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.entry .why { color: var(--muted); font-size: 13px; margin-top: 6px; }
.entry .why b { color: var(--ink-2); font-weight: 600; }
.entry .foot { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.entry .expand { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; font-size: 12.5px; }

/* ---- today / sections ---- */
.section-card h2 { margin-bottom: 4px; }
.section-card .notes { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.intro { color: var(--muted); margin: -6px 0 16px; }
.tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); }
.tick.on { background: var(--good); border-color: var(--good); color: #fff; font-size: 12px; }

/* ---- constraint ---- */
.constraint { background: var(--grad); color: #fff; border: 0; }
.constraint .sub, .constraint .muted { color: rgba(255, 255, 255, 0.82); }
.constraint h2 { font-size: 19px; margin: 4px 0 10px; }
.constraint .cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.constraint .cgrid div { background: rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.constraint .cgrid b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; margin-bottom: 2px; }
.projects { margin-top: 12px; display: grid; gap: 6px; }
.projects div { display: flex; justify-content: space-between; gap: 10px; background: rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }

/* ---- users ---- */
.pw-box { display: flex; gap: 8px; align-items: center; background: var(--good-bg); border-radius: 10px; padding: 12px; margin-top: 12px; }
.pw-box code { font: 700 17px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.form-grid label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sites-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; }

/* ---- tooltip & toast ---- */
.tooltip { position: fixed; z-index: 60; max-width: 320px; background: #0d1726; color: #eef2f7; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); white-space: pre-line; }
.tooltip b { color: #9fd9f5; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; z-index: 70; font-weight: 600; font-size: 13.5px; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
.banner { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.banner code { background: rgba(0, 0, 0, 0.06); padding: 1px 5px; border-radius: 5px; }

/* ---- small screens ---- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .fresh { display: none; }
}
@media (max-width: 760px) {
  .top { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; }
  .who { display: none; }
  .main { padding: 14px 14px 70px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-value { font-size: 22px; }
  .hide-sm { display: none; }
  .search { max-width: none; }
  .day { grid-template-columns: 1fr; gap: 0; }
  .day-label { position: static; padding-top: 10px; }
  .constraint .cgrid, .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px minmax(0, 1fr); }
  .drawer-inner { padding: 14px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } .icon-btn.spin svg { animation: none; } }

/* ---- sidebar layout ---- */
.menu-btn { display: none; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; padding: 14px 10px 30px; border-right: 1px solid var(--line); background: var(--surface); }
.nav-head { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; cursor: pointer; font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 6px 10px; border-radius: 6px; text-align: left; }
.nav-head:hover { color: var(--ink-2); background: var(--surface-2); }
.nav-head:focus-visible { outline: 2px solid var(--color-focus, var(--ink)); outline-offset: 1px; }
.nav-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0 8px; transition: transform 0.15s ease; }
.nav-group.shut .nav-caret { transform: rotate(-45deg); margin-top: 0; }
.nav-group.shut .nav-items { display: none; }
.nav-group + .nav-group { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .nav-caret { transition: none; } }
.side a { display: block; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.side a:hover { background: var(--surface-2); text-decoration: none; }
.side a.on { background: var(--chip); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.layout .main { max-width: 1320px; margin: 0; width: 100%; }
.section-title { margin: 22px 0 0; font-size: 16px; }

/* ---- stacked chart ---- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin: -2px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--muted); font-weight: 600; }
.bar .bstack { width: min(34px, 80%); display: flex; flex-direction: column-reverse; gap: 2px; min-height: 2px; }
.bar .bstack i { display: block; width: 100%; min-height: 3px; border-radius: 2px; cursor: default; }
.bar .bstack i:last-child { border-radius: 4px 4px 2px 2px; }
.bar .bstack i:hover { filter: brightness(1.12); }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

/* ---- constraint extras ---- */
.why-line { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; background: rgba(255, 255, 255, 0.12); border-radius: 10px; padding: 10px 12px; }
.why-line b { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }

/* ---- funnels and horizontal bars ---- */
.funnel, .hbars { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: 13px; }
.hbars .frow { grid-template-columns: 70px minmax(0, 1fr) 70px; }
.frow b { text-align: right; }
.fbar { height: 12px; background: var(--chip); border-radius: 6px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--chart); border-radius: 6px; min-width: 2px; }
.hbars { max-height: 420px; overflow-y: auto; padding-right: 4px; }

/* ---- pricing ---- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.trio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trio > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.trio span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.trio .price { font: 800 18px/1.3 var(--head); }
.trio small { color: var(--muted); }
.advice { margin-top: 10px; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; }
.advice.warn { background: var(--warn-bg); color: var(--warn); }
.advice.good { background: var(--good-bg); color: var(--good); }
.advice.blue { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.kv-wide { grid-template-columns: 200px minmax(0, 1fr); }
.lever-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lever h3 { font-size: 15px; }
.lever .give { margin: 6px 0; font-weight: 600; }
.lever p.muted { font-size: 13px; margin: 0; }

/* ---- misc ---- */
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.delta { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
tr.total td { background: var(--surface-2); font-weight: 700; }
.clip3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.date-in { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.date-in input { padding-right: 10px; background-image: none; }
.readme p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; }
.readme p.step { padding-left: 10px; border-left: 3px solid var(--line); }
.readme h2 { margin-bottom: 4px; }

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .layout { display: block; }
  .side { position: fixed; top: 53px; left: 0; bottom: 0; width: 240px; height: auto; z-index: 30; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 10px 0 30px rgba(13, 23, 38, 0.12); }
  body.nav-open .side { transform: none; }
  .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frow { grid-template-columns: 110px minmax(0, 1fr) 50px; }
  .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-wide { grid-template-columns: 130px minmax(0, 1fr); }
}

.trio .nop { display: block; font-style: normal; font-size: 13px; color: var(--muted); padding-top: 3px; }
.facts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 12px; }
.facts2 span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.facts2 b { font-weight: 600; font-size: 13.5px; }
.lbs td:first-child { min-width: 220px; white-space: nowrap; }
.lbs td:first-child .lead-sub { margin-top: 2px; }
.delta { white-space: nowrap; }

/* ---- charts page ---- */
:root { --spam: color-mix(in srgb, var(--bad) 82%, var(--surface)); }
.crow { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 128px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.clabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrack { position: relative; height: 14px; background: var(--chip); border-radius: 4px; }
.ctrack > i { display: block; height: 100%; background: var(--chart); border-radius: 4px; min-width: 2px; }
.ctrack .target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-2); opacity: 0.55; z-index: 1; }
.cval { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cval small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.seg100 { display: flex; gap: 2px; background: transparent; overflow: hidden; }
.seg100 > i { min-width: 3px; border-radius: 2px; }
.seg100 > i:first-child { border-radius: 4px 2px 2px 4px; }
.seg100 > i:last-child { border-radius: 2px 4px 4px 2px; }
.kpi-value.small { font-size: 17px; line-height: 1.3; }
.bigfunnel { display: grid; gap: 14px; }
.fhead { display: flex; justify-content: space-between; font-weight: 600; }
.fhead b { font: 800 20px/1.1 var(--head); }
.ftrack { height: 18px; background: var(--chip); border-radius: 5px; margin-top: 4px; overflow: hidden; }
.ftrack i { display: block; height: 100%; background: var(--chart); border-radius: 5px; min-width: 2px; }
.ftrack.small { height: 10px; margin: 0; }
.fsub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sfun { display: grid; grid-template-columns: minmax(110px, 170px) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sfun-head { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 0; }
.sfun-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfun-name small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.sfun-cell { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.sfun-cell b { text-align: right; font-variant-numeric: tabular-nums; }
.heat { display: grid; gap: 3px; align-items: center; }
.heat i { display: block; height: 22px; border-radius: 4px; }
.heat .hh { font-size: 11px; color: var(--muted); white-space: nowrap; }
.heat .hd { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.heat-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.heat-key i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }
.gbars { display: flex; gap: 14px; align-items: stretch; height: 240px; padding-top: 6px; position: relative; }
.gcol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gplot { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; background: linear-gradient(to bottom, transparent calc(var(--zero) - 1px), var(--line) calc(var(--zero) - 1px), var(--line) var(--zero), transparent var(--zero)); }
.gslot { position: relative; }
.gslot i { position: absolute; left: 0; right: 0; border-radius: 3px; min-height: 2px; }
.gcol > span { text-align: center; font-size: 11.5px; color: var(--muted); height: 24px; padding-top: 6px; white-space: nowrap; }
@media (max-width: 760px) {
  .crow { grid-template-columns: 100px minmax(0, 1fr) 96px; gap: 8px; font-size: 12.5px; }
  .sfun { grid-template-columns: 90px repeat(4, minmax(0, 1fr)); gap: 6px; }
  .sfun-cell { grid-template-columns: 1fr; }
  .heat i { height: 16px; }
}

.grid.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.half .crow { grid-template-columns: minmax(100px, 160px) minmax(0, 1fr) 118px; }
@media (max-width: 1100px) { .grid.half { grid-template-columns: 1fr; } }

/* best guesses for blank sheet cells */
.guess { color: var(--muted); font-style: italic; }
.lead-name .guess { font-weight: 600; }
.approved-by { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.review-confirm { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: 13.5px; }
.review-confirm p { margin: 0 0 8px; }

/* walkthrough */
.tour { position: fixed; z-index: 60; width: min(380px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(13, 23, 38, 0.28); padding: 14px 16px; }
.tour h3 { margin: 2px 0 6px; font-size: 15px; }
.tour p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tour-step { font-size: 12px; color: var(--muted); font-weight: 600; }
.tour-on { position: relative; z-index: 45; outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 10px; scroll-margin: 120px; }
.drawer .tour-on { z-index: auto; }
.tour-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; font-size: 13.5px; }
.tour-banner .close { width: 28px; height: 28px; }
.tour-intro { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.tour-intro p { margin: 4px 0 0; color: var(--ink-2); max-width: 640px; }
ul.news { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
ol.tour-list { list-style: none; counter-reset: t; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
ol.tour-list li { counter-increment: t; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 44px; position: relative; }
ol.tour-list li::before { content: counter(t); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font: 700 12px/1 var(--body); color: var(--ink-2); }
ol.tour-list p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 640px) { .tour { left: 8px; right: 8px; bottom: 8px; width: auto; } .touring .main, .touring .drawer-inner { padding-bottom: 50vh; } .tour-on { scroll-margin: 70px; } }

/* Leads by site: paired bars (this range + the period before) */
.prow { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 118px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.prow .clabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptrack { position: relative; display: flex; flex-direction: column; gap: 2px; justify-content: center; min-height: 18px; }
.ptrack i { display: block; border-radius: 3px; min-width: 2px; }
.ptrack .pnow { height: 11px; }
.ptrack .pwas { height: 5px; background: var(--muted); opacity: 0.55; }
.ptrack .target { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-2); opacity: 0.5; }
.prow .cval { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .prow { grid-template-columns: 96px minmax(0, 1fr) 92px; font-size: 12.5px; } }
.prow .delta { display: inline; margin-left: 4px; }

/* contact history */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 6px 0 6px 12px; position: relative; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--chart); }
.timeline li.out::before { background: var(--good); }
.timeline li.me > div > b { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.timeline .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.decide { background: var(--chip); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-top: 6px; }
.decide.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.touch-form { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.tgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.tgrid .wide { grid-column: 1 / -1; }
.tgrid .select { width: 100%; }
@media (max-width: 640px) { .tgrid { grid-template-columns: 1fr; } .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* period over period */
.linechart { width: 100%; height: auto; display: block; margin-top: 4px; }
.linechart .gl { stroke: var(--line); stroke-width: 1; }
.linechart .gt { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.linechart .mark { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 4; }
.linechart .mark-t { fill: var(--bad); font-weight: 700; }
.linechart circle { cursor: default; }
.grow { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 72px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.grow .clabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow .cval { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gtrack { position: relative; height: 14px; background: var(--chip); border-radius: 4px; }
.gtrack em { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink-2); opacity: 0.5; }
.gtrack i { position: absolute; top: 0; bottom: 0; background: var(--muted); border-radius: 3px; min-width: 2px; }
.gtrack i.up { background: var(--good); }
.gtrack i.down { background: var(--bad); }
.kpis.kpis-cmp { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 4px; }
.kpis-cmp .kpi-sub .delta { display: inline; margin-left: 6px; }
@media (max-width: 640px) { .grow { grid-template-columns: 96px minmax(0, 1fr) 58px; font-size: 12.5px; } }

/* columns menu (saved per login) */
.col-off { display: none !important; }
.colbar { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.card:not(.flush) > .colbar { padding: 0 0 8px; }
.card-head .colpick { margin-left: auto; }
.colpick { position: relative; }
.colpick > summary { list-style: none; cursor: pointer; }
.colpick > summary::-webkit-details-marker { display: none; }
.colmenu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(13, 23, 38, 0.18); padding: 8px 12px 10px; overflow: auto; }
.colmenu-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.colhint { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.colitem { display: flex; align-items: center; gap: 6px; border-radius: 6px; padding: 0 2px; }
.colitem .grip { color: var(--muted); cursor: grab; font-size: 12px; letter-spacing: -2px; user-select: none; }
.colitem label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.colitem.dragging { opacity: 0.45; }
.colitem.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.colitem.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.colmv { background: none; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); width: 24px; height: 24px; padding: 0; font-size: 12px; line-height: 1; cursor: pointer; }
.colmv:hover:not([disabled]) { background: var(--chip); }
.colmv[disabled] { opacity: 0.3; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }

/* CallRail calls page (phone view of CallRail) */
.cr-kpis button.kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cr-kpis button.kpi:hover { border-color: var(--accent); }
.crlist { display: grid; gap: 10px; }
.crcall { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.crtop { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.crdir { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.crdir.out { background: var(--good-bg); color: var(--good); }
.crwho { min-width: 0; }
.crwho b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crwhen { text-align: right; font-size: 13px; white-space: nowrap; }
.crmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.sitedot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--s-other)); display: inline-block; }
.crnote { margin-top: 6px; }
.crbtns { margin-top: 10px; flex-wrap: wrap; }
.btn.on-good { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.btn.on-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.crplayer audio { width: 100%; margin-top: 10px; }
.crplayer .msg { margin: 8px 0 0; }
.crcall .call-form { margin-top: 10px; }
@media (max-width: 760px) {
  .kpis.cr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cr-kpis .kpi { padding: 8px 9px; }
  .cr-kpis .kpi-label { font-size: 11.5px; }
  .cr-kpis .kpi-value { font-size: 18px; }
  .cr-kpis .kpi-sub { display: none; }
  .crcall { padding: 11px 12px; }
}

/* dialer */
.inrow { display: flex; gap: 6px; align-items: center; }
.inrow .input { flex: 1; min-width: 0; }
.btn.paste { flex: none; }
.call-form .check + .check { margin-top: 4px; }
.ios-tip { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: 13px; }
.ios-tip p { margin: 4px 0; }
.ios-tip ol { margin: 6px 0 8px; padding-left: 20px; }
.ios-tip li { margin: 3px 0; }
.card.newcall { margin-bottom: 14px; }
.phone-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.phone-add > .input { flex: 1 1 180px; }
.phone-add .inrow { flex: 1 1 200px; }
.card audio { width: 100%; margin-top: 6px; }
label.btn { cursor: pointer; }
.phone-btns { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* group text + cost */
.cost-est { margin: 8px 0 0; }
.gt-form textarea.gt-text, .tpl-form textarea { width: 100%; font: inherit; line-height: 1.45; resize: vertical; }
.gt-form .wide { display: block; margin-top: 8px; }
.gt-left b { color: var(--warn); }
table.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mini td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.mini td:last-child { text-align: right; }
table.mini tr.sub-head td { padding-top: 14px; border-top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left; }
table.mini tr.sub-head + tr td { border-top: 0; }
.tpl { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.tpl-text { white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); margin: 6px 0 8px; }
.tpl-form { display: grid; gap: 8px; margin: 10px 0; }

/* phones: inputs at 16px so iPhone doesn't zoom in on them (and stay zoomed after the form closes) */
@media (max-width: 760px), (pointer: coarse) {
  input.input, select.select, textarea.input, .touch-form input, .touch-form select, .touch-form textarea { font-size: 16px; }
}
.drawer { overflow-x: hidden; }
.touch-form input[type="date"], .touch-form input[type="time"], .touch-form input[type="datetime-local"] { min-width: 0; max-width: 100%; width: 100%; }
@media (max-width: 900px) {
  .menu-btn { width: 40px; height: 40px; border-radius: 11px; }
  .menu-btn svg { width: 22px; height: 22px; }
}

/* phone book: room between sections */
.phones-page > .card, .phones-page > .grid { margin-top: 16px; }
.phones-page > .card:first-child { margin-top: 0; }
.phones-page .card > label, .phones-page .card h3 + label { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.phones-page .card > label .select { width: 100%; max-width: 360px; }
.phones-page .card h3 { margin: 18px 0 6px; }
.phones-page .card h2 + p, .phones-page .card h2 + .muted { margin-top: 6px; }
.phones-page table.mini tr.sub-head td { padding-top: 16px; }
.phones-page table.mini tr.sub-head:first-child td { padding-top: 6px; }
.phones-page .tpl { margin-top: 12px; }
.phones-page .phone-form, .phones-page .phone-add { margin: 0; }
.phone-warn .ios-tip { margin-top: 8px; }

/* call recording player */
.recplayer { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.recplayer audio { width: 100%; display: block; margin: 6px 0; }
.recplayer .rechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.recplayer .speeds { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.recplayer .speeds button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 7px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.recplayer .speeds button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.recplayer .recpick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.recplayer .recpick button { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 3px 9px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.recplayer .recpick button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.recplayer .recmsg { font-size: 12.5px; color: var(--muted); }
/* a column the login ticked shows on an upright phone too */
@media (max-width: 760px) { th.hide-sm.col-on, td.hide-sm.col-on { display: table-cell; } }

/* ad spend: Google Ads vs Meta Ads detail line under each bar */
.split-sub { margin: -2px 0 8px; }

/* ---- AI runs, unscored reasons ---- */
.ai-next { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--ai-bg); color: var(--ink-2); font-size: 13px; }
.ai-next b { color: var(--ai); }
.why-tot { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.why-tot b { font-size: 15px; color: var(--ink); margin-right: 3px; }

/* ---- check-ins ---- */
.checkin-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); font-size: 13.5px; }
.checkin-banner a { font-weight: 600; }
.select.small { padding: 5px 28px 5px 8px; font-size: 13px; min-height: 0; }
.checkin-done { padding: 0 14px 14px; }
.past-ci { list-style: none; margin: 0; padding: 0; }
.past-ci li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.past-ci li:first-child { border-top: 0; }

/* ---- pricing: editable cells ---- */
button.pe { background: none; border: 0; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); padding: 0; font: inherit; color: inherit; cursor: pointer; }
button.pe i { font-style: normal; font-size: 11px; color: var(--accent); margin-left: 4px; }
.deal-block + .deal-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.deal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.deal-head span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.deal-text p { margin: 4px 0; }
.deal-text ul { margin: 4px 0; padding-left: 20px; }
.deal-text li { margin: 3px 0; }
.deal-form textarea { width: 100%; min-height: 150px; resize: vertical; font: inherit; line-height: 1.45; }
.deal-form .btn-row { margin-top: 6px; align-items: center; }
.owner-src { display: block; margin-top: 3px; }
.close-notes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.close-notes-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.close-notes-head span { color: var(--muted); font-size: 13.5px; }
.close-notes-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; text-align: left; }
.close-form-wide { display: block; }
.close-form-wide textarea { width: 100%; min-height: 130px; resize: vertical; font: inherit; line-height: 1.45; }
.close-form-wide .btn-row { margin-top: 6px; }
.pe-form.close-form .input, .pe-form.close-form .select { width: min(260px, 100%); }
.tl { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.tl-when { color: var(--ink-2); font-size: 12.5px; }
.tl-text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tl-src { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.tl-form { margin: 4px 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.tl-form .wide { display: block; margin-top: 8px; }
.tl-drop { display: block; padding: 14px; border: 1.5px dashed var(--line); border-radius: 10px; text-align: center; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.tl-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tl-thumb { position: relative; }
.tl-thumb img { height: 90px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.tl-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1; }
.tl-draft { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.tl-draft .wide { grid-column: 2; margin-top: 4px; }
.tl-draft textarea { width: 100%; }
.tl-form textarea, .tl-form .wide .input { width: 100%; }
.pe-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pe-form .input { width: 120px; padding: 5px 8px; }
button.pe-src { background: none; border: 0; padding: 0 2px; margin-left: 4px; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }
.pe-src-form { display: flex; margin-top: 4px; }
.pe-src-form .input { width: min(240px, 100%); }

/* ---- lead value calculator ---- */
.calc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.calc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.calc-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-box { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.calc-l { font-size: 14px; font-weight: 700; color: var(--ink); }
.calc-l small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.calc-slide { grid-column: 1 / -1; }
.calc-range { display: flex; align-items: center; gap: 14px; }
.calc-range input[type=range] { flex: 1; accent-color: var(--accent); height: 28px; cursor: pointer; min-width: 0; }
.calc-range output { min-width: 3.4em; text-align: right; font: 700 22px/1 var(--head); font-variant-numeric: tabular-nums; color: var(--ink); }
.calc-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding-right: calc(3.4em + 22px); }
.calc-ticks i { font-style: normal; width: 0; display: flex; justify-content: center; }
.calc-outcome-h { margin: 18px 0 0; padding: 10px; text-align: center; font-size: 18px; border-radius: 10px; background: var(--ink); color: var(--surface); }
.calc-main { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.calc-main .calc-tile { align-items: center; text-align: center; padding: 18px 14px; background: var(--surface); }
.calc-main .calc-tile span { font-size: 14px; color: var(--ink); }
.calc-main .calc-tile b { font-size: 34px; order: 3; margin-top: 6px; }
.calc-extra { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.calc-extra h3 { margin: 0 0 10px; font-size: 14px; }
.calc-extra h3 .muted { font-weight: 500; font-size: 12.5px; }
.calc-in-extra { grid-template-columns: minmax(0, 320px); }
.calc-wrap.is-full .calc-extra, .calc-wrap.calc-full .calc-extra { display: none; }
.calc-wrap.is-full .calc-bar, .calc-wrap.calc-full .calc-bar { justify-content: flex-end; }
.calc-wrap.is-full .calc-bar > :not([data-calc-full]), .calc-wrap.calc-full .calc-bar > :not([data-calc-full]) { display: none; }
.calc-wrap.is-full .calc-l, .calc-wrap.calc-full .calc-l { font-size: clamp(15px, 1.5vw, 22px); }
.calc-wrap.is-full .calc-range output, .calc-wrap.calc-full .calc-range output { font-size: clamp(22px, 2.4vw, 38px); }
.calc-wrap.is-full .calc-outcome-h, .calc-wrap.calc-full .calc-outcome-h { font-size: clamp(18px, 2vw, 30px); }
.calc-wrap.is-full .calc-main .calc-tile b, .calc-wrap.calc-full .calc-main .calc-tile b { font-size: clamp(30px, 3.6vw, 68px); }
.calc-field { position: relative; display: flex; align-items: center; }
.calc-field .input { width: 100%; font-size: 20px; font-weight: 700; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.calc-field i { position: absolute; font-style: normal; color: var(--muted); font-size: 16px; }
.calc-field i:first-child { left: 10px; }
.calc-field i:first-child + .input { padding-left: 24px; }
.calc-field .input + i { right: 12px; }
.calc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.calc-tile { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc-tile b { white-space: nowrap; }
.calc-tile span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.calc-tile b { font-family: var(--head); font-size: 26px; font-variant-numeric: tabular-nums; }
.calc-tile small { font-size: 12px; color: var(--muted); }
.calc-tile.big { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.calc-tile.big b { color: var(--good); font-size: 32px; }
.calc-wrap.is-full, .calc-wrap.calc-full { position: fixed; inset: 0; z-index: 80; border-radius: 0; overflow: auto; padding: 4vh 4vw; display: flex; flex-direction: column; justify-content: center; }
.calc-wrap.is-full .calc-field .input, .calc-wrap.calc-full .calc-field .input { font-size: clamp(22px, 3vw, 40px); }
.calc-wrap.is-full .calc-out, .calc-wrap.calc-full .calc-out { grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 21vw, 360px), 1fr)); }
.calc-wrap.is-full .calc-tile b, .calc-wrap.calc-full .calc-tile b { font-size: clamp(26px, 2.8vw, 52px); }
.calc-wrap.is-full .calc-tile.big b, .calc-wrap.calc-full .calc-tile.big b { font-size: clamp(30px, 3.4vw, 64px); }
.calc-wrap.is-full .calc-in label, .calc-wrap.calc-full .calc-in label { font-size: clamp(13px, 1.3vw, 18px); }
@media (max-width: 700px) { .calc-in, .calc-main { grid-template-columns: 1fr; } .calc-ticks i:nth-child(even) { visibility: hidden; } }

/* ---- proof jobs ---- */
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proof-card h2 { font-size: 16px; }
.proof-val { font-family: var(--head); font-size: 20px; color: var(--good); }
.proof-job { margin: 8px 0; font-size: 14px; }
.proof-note { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.proof-form { margin-top: 8px; }
.proof-form .input { width: 220px; }

/* ---- cold call trainer ---- */
.cct { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 26px 16px 34px; border-radius: var(--radius); background: #0d0d0d; color: #fff; }
.cct-modes { display: flex; gap: 6px; background: #161616; padding: 4px; border-radius: 30px; flex-wrap: wrap; justify-content: center; }
.cct-mode { border: 0; background: none; color: #8a8a8a; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 24px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cct-mode svg { width: 15px; height: 15px; }
.cct-mode.on { background: #fff; color: #000; }
.cct-mode[disabled] { opacity: 0.5; cursor: default; }
.cct-card { background: #161616; border-radius: 20px; padding: 26px 22px; text-align: center; width: 100%; max-width: 360px; min-height: 230px; }
.cct-card > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cct-card > div[hidden] { display: none; }
.cct svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cct-av { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #a3a3ab, #6e6e76); color: #fff; font-size: 34px; font-weight: 500; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif; }
.cct-av svg { width: 44px; height: 44px; }
.cct-nm { font-size: 20px; font-weight: 700; }
.cct-sb { font-size: 12.5px; color: #8a8a8a; }
.cct-sb b { color: #fff; }
.cct-call { background: #30d158; color: #fff; border: 0; width: 76px; height: 76px; border-radius: 50%; cursor: pointer; margin-top: 6px; display: grid; place-items: center; }
.cct-call svg, .cct-end svg { width: 34px; height: 34px; }
.cct-timer { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cct-err { font-size: 12.5px; color: #fca5a5; max-width: 300px; }
.cct-status { font-size: 13px; color: #8a8a8a; min-height: 18px; }
.cct-btns { display: flex; gap: 14px; align-items: center; }
.cct-end { background: #ff3b30; color: #fff; border: 0; width: 70px; height: 70px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.cct-mute { background: rgba(255, 255, 255, 0.16); color: #fff; border: 0; width: 56px; height: 56px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.cct-mute svg { width: 26px; height: 26px; }
.cct-mute.muted { background: #fff; color: #000; }
.cct-usage { display: flex; width: 100%; max-width: 360px; background: #161616; border-radius: 14px; overflow: hidden; }
.cct-usage span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 6px; font-size: 10px; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.5px; }
.cct-usage b { font-size: 15px; color: #fff; }
.cct-log { width: 100%; max-width: 560px; max-height: 260px; overflow: auto; font-size: 13.5px; }
.cct-log p { margin: 6px 0; color: #cfcfcf; }
.cct-log p.agent b { color: #7dd3fc; }
.cct-log p.you b { color: #86efac; }
.cct-log p.agent2 b { color: #fcd34d; }
.cct-card.wide { max-width: 400px; }
.cct-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; max-width: 560px; }
.cct-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.4px; }
.cct-field select { background: #161616; color: #fff; border: 1px solid #2a2a2a; border-radius: 10px; padding: 8px 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.cct-brief { width: 100%; max-width: 560px; background: #161616; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cct-brief-h { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.5px; }
.cct-brief-h .chip { text-transform: capitalize; }
.cct-brief > div:not(.cct-brief-h) { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.cct-brief span { color: #8a8a8a; }
.cct-brief b { color: #fff; font-weight: 600; }
.cct-reveal b { color: #fcd34d !important; }
.cct-brief-h button { background: none; border: 0; color: #7dd3fc; cursor: pointer; font-size: 11px; text-transform: none; letter-spacing: 0; margin: 0 auto 0 10px; padding: 0; }
.cct-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px 18px; justify-content: center; margin: 4px 0 8px; }
.cct-key { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: #fff; cursor: pointer; font-size: 11px; }
.cct-key i { font-style: normal; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; }
.cct-key i svg { width: 28px; height: 28px; }
.cct-key.on i { background: #fff; color: #000; }
.cct-key.red i { background: #fff; color: #ff3b30; }
.cct-key[disabled] { opacity: 0.35; cursor: default; }
.cct-pad { display: grid; grid-template-columns: repeat(3, 56px); gap: 8px; justify-content: center; margin-bottom: 8px; }
.cct-pad { grid-template-columns: repeat(3, 60px); gap: 10px 18px; }
.cct-pad button { width: 60px; height: 60px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 26px; font-weight: 400; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif; }
.cct-pad button:active { background: rgba(255, 255, 255, 0.4); }
.cct-fb { background: #1f2937; color: #fff; border: 1px solid #374151; border-radius: 22px; padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cct-line2 { margin-top: 10px; background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 12px; padding: 10px 12px; font-size: 13px; text-align: left; width: 100%; }
.cct-line2.ok { border-color: #166534; }
.cct-line2.warn { border-color: #92400e; }
.cct-line2 p { margin: 6px 0; color: #e5e5e5; }
.facts2 b { min-width: 0; overflow-wrap: anywhere; }

.ai-next-bar { margin: -6px 0 12px; }
.ai-next-bar .ai-next { margin: 0; }
.proof-sum { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.proof-card.clean .proof-job { font-size: 15px; }
/* Cold call trainer: plan usage and past calls (on the normal page colours, outside the dark call card) */
.cct-plan { display: flex; flex-direction: column; gap: 8px; }
.cct-plan-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font-size: 14px; }
.cct-plan-top span { color: var(--muted); }
.cct-bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.cct-bar i { display: block; height: 100%; background: var(--accent, #0ea5e9); }
.cct-bar.warn i { background: var(--warn); }
.cct-plan .cct-usage { max-width: none; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.cct-plan .cct-usage span { color: var(--muted); min-width: 110px; }
.cct-plan .cct-usage b { color: var(--ink); }
.tr-detail td { background: var(--surface-2); }
.tr-detail audio { width: 100%; max-width: 520px; margin-bottom: 8px; }
.tr-transcript { max-width: none; max-height: 340px; }
.tr-transcript p { color: var(--ink-2); }
.tr-transcript p.agent b { color: var(--ai); }
.tr-transcript p.you b { color: var(--good); }
.btn.danger { color: var(--bad, #dc2626); }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-right: 10px; }
.tr-tag-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.proof-grid:fullscreen { background: var(--bg); padding: 4vh 4vw; overflow: auto; align-content: start; }
.sc-bar { display: inline-block; width: 70px; height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.sc-bar i { display: block; height: 100%; background: var(--good); }
.sc-watch span { font-size: 13px; font-variant-numeric: tabular-nums; }
.sc-live { margin-bottom: 14px; }
.feed-row { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.feed-row:first-of-type { border-top: 0; }
a.kpi { color: inherit; text-decoration: none; }
.close-grid > div > .card { margin-bottom: 16px; }
.close-kpis { margin: 4px 0 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.close-kpis .kpi { padding: 10px 12px; }
.close-links { display: flex; flex-direction: column; gap: 10px; }
.close-links > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.close-links > div > span:first-child { min-width: 92px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lever-row { border-top: 1px solid var(--line); padding: 8px 0; }
.lever-row summary { cursor: pointer; font-size: 13.5px; display: grid; grid-template-columns: 14px minmax(110px, 30%) minmax(0, 1fr); gap: 4px 10px; align-items: baseline; list-style: none; }
.lever-row summary::-webkit-details-marker { display: none; }
.lever-row summary::before { content: '▸'; color: var(--muted); }
.lever-row[open] summary::before { content: '▾'; }
.lever-row .lv-name { color: var(--accent); }
.lever-row .lv-body, .lever .give { display: flex; flex-direction: column; gap: 2px; }
.lv-gg { line-height: 1.45; }
.lv-k { display: inline-block; min-width: 2.6em; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); }
.lv-k.get { color: var(--good); }
.lv-how { margin: 6px 0 2px 24px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.lv-intro { font-size: 13px; margin: 0 0 8px; }
.lv-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.5; }
.lv-rules { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad, #c53030) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bad, #c53030) 25%, transparent); }
.lv-rules h3 { margin: 0 0 6px; font-size: 13.5px; }
.lv-rules ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .lever-row summary { grid-template-columns: 14px minmax(0, 1fr); } .lever-row .lv-body { grid-column: 2; } .lv-how { margin-left: 24px; } }
.grid.two.close-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 900px) { .grid.two.close-grid { grid-template-columns: minmax(0, 1fr); } }
.close-grid > div { min-width: 0; }
.close-grid .trio { flex-wrap: wrap; }
/* Date fields: the .select look (appearance none + arrow) broke the browser's own date picker and typing. */
input[type="date"].select, input[type="date"].input { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 10px; cursor: text; min-width: 9.5em; }
.ph-name { display: flex; align-items: center; gap: 8px; }
.ph-move { display: inline-flex; flex-direction: column; gap: 2px; }
.ph-move .btn { padding: 0 6px; min-height: 0; height: 18px; line-height: 1; font-size: 11px; }
/* trainer: free engines note and the written scorecard */
.cct-free { width: 100%; max-width: 560px; font-size: 12.5px; color: #a3a3a3; margin-top: -8px; line-height: 1.45; }
.cct-free b { color: #fff; }
.cct-score { width: 100%; max-width: 560px; background: #161616; border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: #e5e5e5; text-align: left; }
.tr-detail .cct-score { background: var(--surface-2); color: var(--ink); max-width: none; margin: 10px 0; }
.cct-score-h { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.cct-score-n { font-size: 20px; font-weight: 800; padding: 2px 10px; border-radius: 10px; }
.cct-score-n.good, .cct-chip.good { background: #14532d; color: #bbf7d0; }
.cct-score-n.warn, .cct-chip.warn { background: #713f12; color: #fde68a; }
.cct-score-n.bad, .cct-chip.bad { background: #7f1d1d; color: #fecaca; }
.cct-verdict { margin: 0 0 10px; }
.cct-steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cct-step { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start; }
.cct-step > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; border-radius: 6px; padding: 2px 0; text-align: center; background: #2a2a2a; color: #a3a3a3; }
.cct-step.hit > span { background: #14532d; color: #bbf7d0; }
.cct-step.part > span { background: #713f12; color: #fde68a; }
.cct-step.miss > span { background: #7f1d1d; color: #fecaca; }
.cct-step .muted { font-size: 12.5px; }
.cct-score h4 { margin: 10px 0 4px; font-size: 13px; }
.cct-score ul { margin: 0; padding-left: 18px; }
.cct-next { margin-top: 10px; padding: 8px 10px; border-left: 3px solid #30d158; background: rgba(48, 209, 88, 0.08); border-radius: 6px; }
.cct-next span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: #86efac; margin-bottom: 2px; }
.tr-detail .cct-step.na > span { background: var(--surface); color: var(--muted); }
.tr-detail .cct-next span { color: #15803d; }

/* Ads vs SEO weekly bars */
.wkbars { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; }
.wkbars i { display: block; width: 7px; background: var(--line); border-radius: 2px; }
.wkbars i.hit { background: var(--good); }
.dpos { color: var(--good); font-size: 12px; }
.dneg { color: var(--bad); font-size: 12px; }

/* SEO page: room between stacked cards, and a number never wraps away from its change */
.seo-page .card + .card, .seo-page .card + .grid, .seo-page .grid > div > .card + .card { margin-top: 16px; }
.seo-page td.num { white-space: nowrap; }
.seo-page .mig-card td:first-child { white-space: nowrap; }
.seo-page .ps-good { color: var(--good); }
.seo-page .ps-warn { color: var(--warn); }
.seo-page .ps-bad { color: var(--bad); }
.seo-page .ps-hist .linechart { max-width: 560px; }
.seo-page td.num .dpos, .seo-page td.num .dneg, .seo-page td.num .muted { margin-left: 4px; }
.seo-page .seo-chans td:first-child { white-space: nowrap; }
.seo-page .seo-bot-h { margin: 0 0 6px; font-size: 13.5px; }
.seo-page .seo-bot-list { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.seo-page .seo-bot-list li + li { margin-top: 6px; }
.seo-page .seo-bot-list code, .seo-page td code { font-size: 12px; }
.seo-page .seo-set { align-items: start; }
.seo-page .seo-set .wide, .seo-page .seo-set .span2 { grid-column: span 2; }
.seo-page .seo-set .select, .seo-page .seo-set .input { width: 100%; min-width: 0; box-sizing: border-box; }
.seo-page .seo-set label.check.full { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.page-cell { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; margin-right: 10px; }
.page-cell .clip { min-width: 0; }
a.page-go { text-decoration: none; padding: 0 2px; }
a.page-go::after { margin-left: 0; }
.seo-page .seo-set textarea { resize: vertical; font: inherit; }
@media (max-width: 720px) { .seo-page .seo-set .wide, .seo-page .seo-set .span2 { grid-column: 1 / -1; } }
.seo-page .seo-vs { margin: -6px 0 14px; font-size: 12.5px; }
.seo-page .table-wrap td .clip { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* Close call: Start a trial */
.trial-card { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.trial-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 10px; }
@media (max-width: 900px) { .trial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .trial-grid { grid-template-columns: minmax(0, 1fr); } }
.trial-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.trial-f .input { width: 100%; }
.trial-steps { margin: 4px 0 0; padding-left: 20px; }
.trial-steps li { margin: 6px 0; line-height: 1.6; }
.trial-steps .btn { margin-left: 6px; }
.seo-page .date-pair { display: inline-flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
@media (max-width: 520px) { .seo-page .date-pair { flex-wrap: wrap; } }

/* Phone book: Make a call */
.dial-owners { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 12.5px; }
.dial-owners .btn .sitedot { margin-right: 6px; }

/* Territories: Add new and the setup checklist */
.terr-form h3 { margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.terr-form h3:first-child { margin-top: 0; }
.trial-f.wide { grid-column: span 2; }
@media (max-width: 520px) { .trial-f.wide { grid-column: auto; } }
.terr-form > .trial-f.wide { margin-bottom: 4px; }
.setup-badge { margin-top: 8px; }
.setup-step { padding: 10px 0; border-top: 1px dashed var(--line); }
.setup-step .check { align-items: flex-start; font-size: 13.5px; }
.setup-step.done .check span { color: var(--muted); text-decoration: line-through; }
.setup-step.later { opacity: 0.6; }
.setup-sops { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; margin: 4px 0 0 26px; }
.setup-step .lead-sub, .setup-step .setup-form, .setup-step .pe-form { margin-left: 26px; }
.setup-form { margin-top: 8px; }
.setup-form .trial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 6px; }
@media (max-width: 520px) { .setup-form .trial-grid { grid-template-columns: minmax(0, 1fr); } }
.dsec > .setup-form { margin: 0 0 8px; }

/* trainer: per-engine limits (Past calls) */
.cct-limits { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.cct-lim-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 13px; }
.cct-lim-h .muted { font-size: 12px; }
.cct-lim { display: grid; grid-template-columns: 100px 90px 1fr; gap: 4px 10px; align-items: center; font-size: 13px; }
.cct-lim .input { width: 90px; padding: 5px 8px; }
.cct-lim em { font-style: normal; color: var(--muted); }
.cct-lim small { grid-column: 3; color: var(--muted); font-size: 12px; margin-top: -4px; }
.cct-lim .bad-t { color: #dc2626; font-weight: 600; }
.cct-limits .btn { align-self: flex-start; }

/* Lead panel: Block this contact */
.block-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.block-cs { display: flex; flex-direction: column; gap: 4px; }
.block-res { margin-top: 10px; font-size: 13px; line-height: 1.5; }
.block-res ul { margin: 6px 0 0; padding-left: 18px; }

.good-t { color: var(--good); font-weight: 600; }
.bad-t { color: var(--bad); font-weight: 600; }

/* Objections: library, practise, the on-call panel */
.obj-tools { flex-wrap: wrap; gap: 8px; }
.obj-tools .search { flex: 1 1 260px; }
.obj-stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.obj-stages .chip { text-decoration: none; cursor: pointer; }
.obj-stages .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.obj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .obj-list { grid-template-columns: minmax(0, 1fr); } }
.obj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.obj-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.obj-top h3 { margin: 0 6px 0 0; font-size: 15.5px; flex: 1 1 auto; }
.obj-says { color: var(--muted); font-style: italic; font-size: 13px; }
.obj-say { font-size: 15px; line-height: 1.55; padding: 10px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0 8px 8px 0; }
.obj-card.big .obj-say { font-size: 19px; line-height: 1.5; }
.obj-card.big .obj-top h3 { font-size: 18px; }
.obj-say mark.fill, .obj-follow mark.fill, .obj-more mark.fill { background: color-mix(in srgb, var(--warn, #b7791f) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.obj-follow { font-size: 14px; }
.obj-card.big .obj-follow { font-size: 16px; }
.obj-why { font-size: 12.5px; color: var(--muted); }
.obj-more summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.obj-more p { margin: 6px 0; font-size: 13px; line-height: 1.5; }
.obj-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; font-size: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.obj-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.obj-calc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.obj-calc-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.obj-calc-h .muted { font-weight: 400; }
.obj-ins { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; margin-bottom: 8px; }
.obj-ins label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.obj-ins .input { width: 100%; padding: 5px 8px; }
.obj-out { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-top: 1px dotted var(--line); }
.obj-out b { text-align: right; }
.obj-out.strong { font-size: 14.5px; }
.obj-out.strong b { color: var(--good); }
.obj-flash { max-width: 760px; }
.obj-flash-q { font-size: 22px; font-weight: 600; margin: 10px 0 4px; line-height: 1.35; }
.obj-flash .obj-card { margin: 12px 0; }
.obj-rate { gap: 8px; }
.obj-form { margin-bottom: 16px; }
.obj-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; }
.obj-fab[hidden] { display: none; }
@media (max-width: 760px) { .obj-fab { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: 12px; } }
.obj-panel { position: fixed; right: 16px; bottom: 72px; width: min(560px, calc(100vw - 32px)); max-height: min(78vh, 760px); overflow: auto; z-index: 61; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.22); padding: 12px 14px 14px; }
.obj-panel[hidden] { display: none; }
@media (max-width: 760px) { .obj-panel { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: 86vh; } }
.obj-panel-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; position: sticky; top: -12px; background: var(--surface); padding-top: 2px; }
.obj-panel-h .search { flex: 1; font-size: 16px; }
.obj-panel-h .grow { flex: 1; }
.obj-panel-h .close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.obj-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.obj-tile { text-align: left; border: 1px solid var(--line); background: none; border-radius: 10px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: inherit; font: inherit; }
.obj-tile b { font-size: 14px; }
.obj-tile span { font-size: 11.5px; color: var(--muted); }
.obj-tile.here { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.obj-tile:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.obj-say mark.fill.got { background: color-mix(in srgb, var(--good) 18%, transparent); }

/* Leads: Include spam box */
.spam-box { white-space: nowrap; font-size: 13px; }
.spam-note { font-size: 12px; }
.perm-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.perm-form .trial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
@media (max-width: 520px) { .perm-form .trial-grid { grid-template-columns: minmax(0, 1fr); } }
.obj-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.obj-quick .chip { cursor: pointer; font: inherit; font-size: 12.5px; }
.obj-quick .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Cold call trainer: usage for every engine */
.cct-engs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.cct-eng { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cct-eng.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cct-eng.off { opacity: 0.6; }
.cct-eng-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cct-eng-n { font-size: 13px; }
.cct-eng .cct-bar { margin: 2px 0; }

/* Cold call trainer: Script panel */
.cct-script-btn { margin-left: auto; }
.cct-script { width: 100%; max-width: 560px; margin: 14px auto 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); color: var(--ink); text-align: left; }
.cct-script-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.cct-script-h .grow { flex: 1; }
.cct-sc-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cct-sc-step { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cct-sc-step.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cct-sc-step-h { cursor: pointer; font-size: 13.5px; }
.cct-say { margin: 6px 0 0; font-size: 15.5px; line-height: 1.5; }
.cct-if { margin-top: 6px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.cct-if span { color: var(--muted); }
.cct-tip { margin-top: 6px; font-size: 12px; color: var(--muted); }
.cct-script mark.fill { background: color-mix(in srgb, var(--warn) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.cct-script mark.fill.got { background: color-mix(in srgb, var(--good) 18%, transparent); }
.cct-script .btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cct-script .btn-row .grow { flex: 1; display: block; padding: 0; }
.cct-sc-edit { display: flex; flex-direction: column; gap: 6px; }
.cct-sc-edit-h { display: flex; gap: 6px; align-items: center; }
.cct-sc-edit-h .input { flex: 1; min-width: 0; font-weight: 600; }
.cct-sc-edit label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.cct-sc-edit textarea, .cct-sc-edit label .input { width: 100%; box-sizing: border-box; font-size: 14px; color: var(--ink); }
@media (max-width: 520px) { .cct-sc-edit-h { flex-wrap: wrap; } .cct-sc-edit-h .input { flex-basis: 100%; } }
.miss-note { margin: 12px 0; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; background: var(--surface); }
.miss-note ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.miss-note li .btn { margin-left: 4px; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.subtabs a:hover { color: var(--ink); }
.drag-h { border: 0; background: transparent; padding: 4px 3px; margin-right: 4px; cursor: grab; color: var(--muted); border-radius: 6px; touch-action: none; display: inline-flex; align-items: center; }
.drag-h svg { fill: currentColor; }
.drag-h:hover, .drag-h:focus-visible { color: var(--ink); background: var(--chip); }
body.drag-on, body.drag-on * { cursor: grabbing !important; user-select: none; }
tr.dragging { background: var(--chip); opacity: 0.85; }
.entry .what { font-size: 14px; line-height: 1.55; }
.entry .what-head { margin: 0; font-weight: 600; color: var(--ink); }
.entry .what-pts { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.entry .what-pts li + li { margin-top: 3px; }
.entry .what-more summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 4px; }
.entry .why { line-height: 1.5; }
.entry .foot { margin-top: 8px; }
.colitem .drag-h { margin-right: 0; padding: 4px 2px; }
.colitem.dragging { background: var(--chip); opacity: 0.85; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: '↕'; margin-left: 4px; font-size: 0.85em; opacity: 0.3; }
th.sortable[aria-sort="descending"]::after { content: '▼'; opacity: 0.9; }
th.sortable[aria-sort="ascending"]::after { content: '▲'; opacity: 0.9; }
th.sortable:focus-visible { outline: 2px solid var(--color-focus, var(--ink)); outline-offset: -2px; }
.lever-row .lv-body { color: var(--ink); font-weight: 400; }
.lever-btns { display: flex; gap: 6px; margin-top: 10px; }
.lever-add { display: flex; align-items: center; justify-content: center; min-height: 120px; border-style: dashed; background: transparent; color: var(--accent); font: 600 14px var(--body); cursor: pointer; }
.lever-add:hover { background: var(--chip); }
.lever-form { display: flex; flex-direction: column; gap: 8px; }
.lever-form .trial-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lever-form .input { width: 100%; box-sizing: border-box; font-size: 14px; color: var(--ink); }

/* Check-in banner: each site with its chip, and a close button */
.checkin-banner .ci-due { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin-right: 6px; }
.checkin-banner { position: relative; padding-right: 40px; }
.checkin-banner .ci-hide { position: absolute; top: 6px; right: 8px; }
/* Sync status: a dot on the refresh button (phones), and the line at the top of the menu */
#refresh { position: relative; }
#refresh[data-fresh]::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--surface); }
#refresh[data-fresh="old"]::after { background: var(--warn); }
#refresh[data-fresh="stale"]::after { background: var(--bad, #c53030); }
.nav-fresh { display: none; }
@media (max-width: 860px) {
  .nav-fresh { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
  .nav-fresh .fresh-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: var(--good); }
  .nav-fresh .fresh-dot.old { background: var(--warn); }
  .nav-fresh .fresh-dot.stale { background: var(--bad, #c53030); }
}
@media (min-width: 861px) { #refresh[data-fresh]::after { display: none; } }
/* Trainer: lead questions, speed, metrics, filters */
.cct-lq { width: 100%; max-width: 560px; background: #161616; border: 1px solid #2a2a2a; border-radius: 12px; padding: 10px 14px; color: #f2f2f2; text-align: left; font-size: 13.5px; }
.cct-lq-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cct-lq-h .muted { color: #a3a3a3; font-size: 12px; }
.cct-lq-h .linkish { margin-left: auto; color: #7cc4ff; background: none; border: 0; cursor: pointer; font: inherit; }
.cct-lq ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.5; }
.cct-lq textarea { width: 100%; box-sizing: border-box; margin-top: 8px; font: inherit; color: var(--ink); }
.cct-lq-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cct-lq-note { margin: 6px 0 0; font-size: 12px; color: #a3a3a3; }
.cct-setlinks { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; color: #cfcfcf; }
.cct-setlinks .linkish { color: #7cc4ff; }
.cct-speed { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }
.cct-speed select { background: #161616; color: #f2f2f2; border: 1px solid #333; border-radius: 6px; padding: 2px 4px; }
.tr-detail .cct-speed, .cct-limits-page .cct-speed { color: var(--ink-2); }
.tr-detail .cct-speed select { background: var(--surface); color: var(--ink); border-color: var(--line); }
.cct-speedrow { display: flex; justify-content: center; margin-top: 6px; color: #cfcfcf; }
.cct-mets { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 10px; }
.cct-met { border-radius: 10px; padding: 8px 10px; background: rgba(127, 127, 127, 0.12); display: flex; flex-direction: column; gap: 1px; }
.cct-met span { font-size: 11.5px; opacity: 0.8; }
.cct-met b { font-size: 17px; }
.cct-met small { font-size: 11.5px; opacity: 0.75; }
.cct-met.hit b { color: var(--good); }
.cct-met.part b { color: var(--warn); }
.cct-met.miss b { color: var(--bad, #c53030); }
.tr-what { cursor: pointer; }
.tr-filters .search { min-width: 220px; flex: 1; }
@media (max-width: 640px) {
  .cct-engs { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .cct-eng { flex: 0 0 150px; padding: 8px 10px; scroll-snap-align: start; }
  .cct-eng .lead-sub:last-child { display: none; }
  .cct-eng .lead-sub { font-size: 11px; }
  .cct-engs { align-items: flex-start; margin-bottom: 8px; }
  .cct-eng { gap: 3px; flex-basis: 170px; }
  .cct-eng > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cct-eng > :nth-child(n+5) { display: none; }
  .cct-plan .cct-usage { flex-wrap: nowrap; overflow-x: auto; border-radius: 10px; }
  .cct-plan .cct-usage span { min-width: 0; flex: 1 0 auto; padding: 6px 8px; font-size: 9.5px; gap: 1px; letter-spacing: 0.2px; white-space: nowrap; }
  .cct-plan .cct-usage b { font-size: 13px; }
  [data-tour="trainer-log"] .card-head { flex-wrap: nowrap; gap: 8px; }
  [data-tour="trainer-log"] .card-head .btn-row { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
  .tr-filters select { font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
  .tr-filters .search { min-width: 0; flex-basis: 100%; }
}

/* Trainer call screen: the real iPhone layout (iOS 26) */
.cct-card.oncall { max-width: 390px; min-height: 640px; padding: 22px 22px 26px; position: relative; overflow: hidden; border-radius: 34px;
  background: radial-gradient(120% 70% at 50% 30%, #4d4f40 0%, #3a3a2e 45%, #2c3a33 75%, #3a3f22 100%); font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif; }
.cct-card.oncall > .ios-call { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 592px; }
.cct-card.oncall > .ios-call[hidden] { display: none; }
.ios-top { margin-top: 58px; display: flex; align-items: center; gap: 7px; font-size: 22px; font-weight: 600; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.ios-line { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; background: #fff; color: #111; font-size: 11px; font-weight: 800; }
.ios-name { font-size: 40px; font-weight: 700; color: #fff; letter-spacing: -0.5px; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ios-status { font-size: 13px; color: rgba(255, 255, 255, 0.6); min-height: 18px; margin-top: 6px; }
.cct-card.oncall #tr-controls { margin-top: auto; width: 100%; }
.cct-grid.ios { grid-template-columns: repeat(3, 1fr); gap: 18px 8px; margin: 0; justify-items: center; }
.cct-grid.ios .cct-key { font-size: 15px; gap: 8px; color: #fff; }
.cct-grid.ios .cct-key i { width: 76px; height: 76px; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.06); backdrop-filter: blur(12px); }
.cct-grid.ios .cct-key i svg { width: 32px; height: 32px; }
.cct-grid.ios .cct-key.on i { background: #fff; color: #111; }
.cct-grid.ios .cct-key.hold i { background: #ff9f0a; color: #fff; }
.cct-grid.ios .cct-key.end i { background: #e5352b; }
.cct-grid.ios .cct-key.end i svg { width: 36px; height: 36px; }
.cct-grid.ios .cct-hide { background: none; border: 0; color: #fff; font-size: 17px; cursor: pointer; align-self: center; }
.cct-card.oncall .cct-pad { grid-template-columns: repeat(3, 76px); gap: 14px 24px; margin-bottom: 18px; }
.cct-card.oncall .cct-pad button { width: 76px; height: 76px; font-size: 32px; background: rgba(255, 255, 255, 0.14); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cct-card.oncall .cct-pad small { font-size: 9.5px; font-weight: 700; letter-spacing: 1.5px; margin-top: 2px; min-height: 10px; }
.ios-sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 2; }
.ios-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; background: rgba(58, 64, 52, 0.94); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 30px; padding: 14px 18px; text-align: left; }
.ios-sheet hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.15); margin: 6px 0 6px 58px; }
.ios-row { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; color: #fff; padding: 8px 0; cursor: pointer; text-align: left; font: inherit; }
.ios-row[disabled] { opacity: 0.4; cursor: default; }
.ios-row i { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ios-row i svg { width: 24px; height: 24px; }
.ios-row b { font-size: 17px; font-weight: 600; display: flex; flex-direction: column; }
.ios-row small { font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 0.6); }
.ios-beta { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.18); margin-left: 6px; vertical-align: middle; }
.c-blue { background: #0a9cf5; } .c-grey { background: linear-gradient(#5b5670, #2e2b3b); } .c-teal { background: #1cc8d8; } .c-orange { background: #ff9426; }
.c-rec { background: #fff !important; } .c-rec em { width: 30px; height: 30px; border-radius: 50%; background: #f23a2f; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #222; }
.c-rec.on em { border-radius: 6px; width: 18px; height: 18px; }
.ios-contact { margin: 0 0 6px 58px; font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; }
.ios-contact div { display: flex; gap: 8px; }
.ios-contact span { color: rgba(255, 255, 255, 0.6); min-width: 64px; }
.cct-under { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cct-under-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cct-fb.ghost { background: transparent; }
.cct-fb.ghost.on { background: #fff; color: #111; border-color: #fff; }
.cct-lq.oncall ol { margin-top: 4px; }
@media (max-width: 640px) {
  .cct-card.oncall { min-height: 600px; border-radius: 28px; padding: 16px 14px 20px; }
  .cct-card.oncall > .ios-call { min-height: 560px; }
  .ios-top { margin-top: 40px; }
  .ios-name { font-size: 36px; }
  .cct-grid.ios .cct-key i, .cct-card.oncall .cct-pad button { width: 70px; height: 70px; }
  .cct-card.oncall .cct-pad { grid-template-columns: repeat(3, 70px); gap: 12px 20px; }
}

/* Sort by biggest change: the heading says which */
th.sortable[data-sortnote]::after { content: ' · ' attr(data-sortnote); font-weight: 600; font-size: 11px; color: var(--accent, #2563eb); white-space: nowrap; }
/* Script: Minimise all (step names only) */
.cct-sc-step.mini { cursor: pointer; padding-top: 6px; padding-bottom: 6px; }
.cct-sc-step.mini:hover { background: rgba(127, 127, 127, 0.08); }
.close-script { margin: 0 0 16px; }
.close-script .cct-script { max-width: none; }
/* Calculator: type the % */
output[data-calc-v] { cursor: text; }
.calc-type { width: 4.2em; font: inherit; font-weight: 700; text-align: right; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
/* Past calls: custom dates */
.tr-dates { display: inline-flex; align-items: center; gap: 6px; }
.tr-dates .input { width: auto; padding: 5px 8px; }

/* Ads bot */
.ads-line { max-width: 360px; white-space: normal; }
.ads-verdict { font-size: 15px; margin: 2px 0 6px; }
.ads-kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 10px 0; }
.ads-kpis .kpi-label { text-transform: none; }
.ads-p { margin: 6px 0; font-size: 13.5px; }
.ads-gaps { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.ads-gaps ul, .ads-sc { margin: 4px 0 0; padding-left: 20px; }
.ads-sc li { margin: 3px 0; font-size: 13.5px; }
[data-tour="ads-items"], [data-tour="ads-changes"], [data-tour="ads-site-changes"] { margin-top: 16px; }
.ads-kpis .kpi-label::first-letter { text-transform: uppercase; }
.ads-acts { white-space: nowrap; }
.ads-acts .btn + .btn { margin-left: 6px; }
.ads-warn { margin: 0 18px 8px; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
@media (max-width: 640px) { .ads-acts { white-space: normal; } .ads-acts .btn { margin: 2px 4px 2px 0; } }
/* Leads: pick many */
label.lsel { display: inline-flex; align-items: center; padding: 6px 8px 6px 2px; margin: -6px 2px -6px -2px; cursor: pointer; vertical-align: middle; }
label.lsel input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--accent); }
tbody tr.picked td { background: color-mix(in srgb, #f5c400 16%, var(--surface)); }
tbody tr.picked.sel td { background: color-mix(in srgb, #f5c400 24%, var(--surface)); }
.lsel-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.lsel-bar b { margin-right: 4px; }
.tl-pick { max-width: 320px; }
.tl-biz { background: var(--surface-2); }
@media (max-width: 640px) { .tl-pick { max-width: 100%; width: 100%; } }
.cct-vis-list { display: grid; gap: 6px; margin: 4px 0 10px; }
.trs-grid .card { min-width: 0; }
.trs-bar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 2fr) auto; gap: 4px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.trs-bar:last-child { border-bottom: 0; }
.trs-bar-n { overflow-wrap: anywhere; }
.trs-bar-t { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.trs-bar-t i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.trs-bar-t i.good { background: var(--good, #2e8b57); }
.trs-bar-t i.mid { background: #c9822b; }
.trs-bar-t i.bad { background: var(--bad, #c0392b); }
.trs-bar small { grid-column: 1 / -1; margin-top: -2px; }
.sp-drills { margin: 0 auto 14px; max-width: 760px; }
.sp-grid { grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
.sp-read { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.sp-read p { font-size: 17px; line-height: 1.6; margin: 4px 0 0; }
.sp-read p.sp-prompt { font-weight: 600; }
.sp-hid { color: var(--muted, #888); letter-spacing: 1px; }
.sp-warm { padding-left: 18px; display: grid; gap: 6px; margin: 8px 0; }
.sp-rules { margin-top: 10px; font-size: 13.5px; }
.sp-rules summary { cursor: pointer; font-weight: 600; }
.sp-rec-card { text-align: center; display: grid; justify-items: center; gap: 8px; padding-top: 22px; }
.sp-rec { width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.sp-rec:disabled { opacity: 0.5; cursor: wait; }
.sp-rec .sp-dot { width: 40px; height: 40px; border-radius: 50%; background: #e5484d; }
.sp-rec .sp-stop { width: 30px; height: 30px; border-radius: 6px; background: #e5484d; }
.sp-rec.on { border-color: #e5484d; animation: sp-pulse 1.4s ease-in-out infinite; }
@keyframes sp-pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0.15); } }
.sp-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-level { width: 100%; max-width: 220px; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.sp-level i { display: block; height: 100%; background: #30a46c; transition: width 0.1s; }
.sp-noise { margin-top: 16px; }
.sp-vol { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.sp-result { margin-top: 16px; scroll-margin-top: 70px; }
.sp-tips { padding-left: 20px; display: grid; gap: 4px; }
.sp-text { margin-top: 10px; }
.sp-text p { margin: 4px 0 0; line-height: 1.6; }
mark.sp-fill { background: rgba(201, 130, 43, 0.25); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.sp-miss { background: rgba(229, 72, 77, 0.2); color: inherit; border-radius: 3px; padding: 0 2px; text-decoration: underline dotted; }
@media (max-width: 760px) {
  .sp-grid { grid-template-columns: 1fr; }
  .sp-read p { font-size: 16px; }
  /* On a phone the record button sits at the bottom of the screen, so the passage stays in view while you read it. */
  .sp-rec-card { position: sticky; bottom: 8px; z-index: 5; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; justify-items: start; align-items: center; column-gap: 12px; row-gap: 2px; padding: 10px 14px; text-align: left; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
  .sp-rec-card .sp-rec { grid-row: 1 / 4; width: 58px; height: 58px; border-width: 3px; }
  .sp-rec-card .sp-rec .sp-dot { width: 28px; height: 28px; }
  .sp-rec-card .sp-rec .sp-stop { width: 22px; height: 22px; }
  .sp-rec-card .sp-time { font-size: 18px; }
  .sp-rec-card .sp-time.idle { font-size: 15px; }
  .sp-rec-card .sp-level { max-width: none; }
}
.fb-btn { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; }
.fb-btn-t { font-size: 13px; font-weight: 600; }
@media (max-width: 760px) { .fb-btn-t { display: none; } .fb-btn { padding: 0; width: 32px; justify-content: center; } }
.nav-fb { display: none; }
/* Small phones: the top bar has no room for Feedback, so it is the first thing in the menu instead. */
@media (max-width: 480px) { .top-right { gap: 6px; } .fb-btn { display: none; } .nav-fb { display: block; width: calc(100% - 24px); margin: 4px 12px 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; } }
.fb-form { display: grid; gap: 12px; }
.fb-form label > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fb-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; font-size: 13px; }
.fb-drop:focus { outline: 2px solid var(--color-focus, var(--accent)); }
.fb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-thumb { position: relative; }
.fb-thumb img, .fb-thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.fb-thumbs.small img { width: 64px; height: 48px; }
.fb-thumb button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; cursor: pointer; line-height: 1; }
.fb-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13px; width: 100%; max-width: 760px; justify-content: center; }
.fb-what { min-width: 220px; }
.fb-txt { white-space: pre-wrap; max-height: 9em; overflow: auto; }
.sp-time.idle { font-size: 15px; font-weight: 600; }
.sp-noise .seg { flex-wrap: wrap; }
.sms-body { white-space: pre-wrap; min-width: 220px; max-width: 520px; }
.setup-list { padding-left: 20px; display: grid; gap: 6px; }
.setup-list code { font-size: 12px; overflow-wrap: anywhere; }
