/* Relay CRM */

/* Fonts are served from this site (SIL Open Font License). */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700; src: url(/fonts/instrument-sans-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/bricolage-grotesque-latin-opsz-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --bg: #F3F5F4;
  --surface: #FFFFFF;
  --well: #ECF0EE;
  --hover: #E7ECEA;
  --ink: #15262E;
  --ink-2: #4B5E64;
  --ink-3: #7B8C90;
  --line: #DAE2DF;
  --line-soft: #E6ECE9;
  --pine: #17614F;
  --pine-hover: #114E3F;
  --pine-tint: #E0EEE8;
  --pine-text: #13584A;
  --marigold: #A86F06;
  --marigold-tint: #FBF0D8;
  --brick: #B13F2B;
  --brick-tint: #F8E5E0;
  --link: #1F5FAE;
  --focus: #3D8AF7;

  --call-bg: #0F3A31;
  --call-raised: #164A3E;
  --call-line: #24594C;
  --call-ink: #E4F4EC;
  --call-ink-2: #A3CBBB;
  --them-bg: #E7F6EF;
  --them-ink: #0C2C24;
  --you-bg: rgba(255, 255, 255, 0.09);

  --pop: 0 14px 36px -14px rgba(16, 36, 44, 0.34), 0 2px 6px rgba(16, 36, 44, 0.08);
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1517;
    --surface: #152024;
    --well: #1A272B;
    --hover: #1F2E33;
    --ink: #E4ECEA;
    --ink-2: #A6B6B5;
    --ink-3: #74878A;
    --line: #26353A;
    --line-soft: #1F2D31;
    --pine: #2E9E7E;
    --pine-hover: #3AB592;
    --pine-tint: #16322B;
    --pine-text: #7FD8BB;
    --marigold: #E8B34A;
    --marigold-tint: #33290F;
    --brick: #EC7A63;
    --brick-tint: #3A1E19;
    --link: #8BB8F2;
    --call-bg: #0B2C25;
    --call-raised: #11392F;
    --call-line: #1D4A3E;
    --pop: 0 14px 36px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1517; --surface: #152024; --well: #1A272B; --hover: #1F2E33; --ink: #E4ECEA; --ink-2: #A6B6B5; --ink-3: #74878A;
  --line: #26353A; --line-soft: #1F2D31; --pine: #2E9E7E; --pine-hover: #3AB592; --pine-tint: #16322B; --pine-text: #7FD8BB;
  --marigold: #E8B34A; --marigold-tint: #33290F; --brick: #EC7A63; --brick-tint: #3A1E19; --link: #8BB8F2;
  --call-bg: #0B2C25; --call-raised: #11392F; --call-line: #1D4A3E; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.5 var(--font);
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.icon { flex: none; display: block; }
.tabnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-gap.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.late-text { color: var(--brick); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
}
.brand {
  font: 700 25px/1 var(--display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.03em;
  color: var(--ink);
  padding: 2px 10px;
}
.brand:hover { text-decoration: none; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 520;
}
.nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on .icon { color: var(--pine); }
.badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--pine); color: #fff;
  font-size: 11.5px; font-weight: 650; display: grid; place-items: center;
}
.phone-status { margin-top: auto; display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--well); }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 560; font-size: 13.5px; }
.status-sub { color: var(--ink-3); font-size: 12.5px; padding-left: 16px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.sdot.ok { background: #2FA37E; box-shadow: 0 0 0 3px color-mix(in srgb, #2FA37E 22%, transparent); }
.sdot.wait { background: var(--marigold); }
.sdot.bad { background: var(--brick); }

.main { min-width: 0; }
.top .btn.primary { margin-left: auto; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.page { padding: 10px 32px 140px; max-width: 1280px; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* Search */
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.search:focus-within { border-color: color-mix(in srgb, var(--pine) 60%, var(--line)); box-shadow: 0 0 0 3px var(--pine-tint); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; }
.search kbd { font: 500 11px var(--font); padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-3); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); padding: 6px; z-index: 50; }
.search-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; }
.search-row.sel { background: var(--well); }
.sr-main { display: grid; }
.sr-main span { color: var(--ink-3); font-size: 12.5px; }
.search-empty { padding: 10px; color: var(--ink-3); }
.preview-note { font-size: 12.5px; color: var(--marigold); background: var(--marigold-tint); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 1100px) { .preview-note { display: none; } }
.queue-resume { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--pine-tint); color: var(--pine-text); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-weight: 560; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--hover); text-decoration: none; }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--pine); border-color: transparent; color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--pine-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--hover); }
.btn.danger, .link-btn.danger { color: var(--brick); }
.btn.call { background: var(--pine); color: #fff; border-color: transparent; border-radius: 999px; padding: 0 18px 0 14px; }
.btn.call:hover:not(:disabled) { background: var(--pine-hover); }
.btn.push-left { margin-right: auto; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn.small { width: 26px; height: 26px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font-weight: 520; }
.link-btn:hover { text-decoration: underline; }
.call-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px;
  border-radius: 999px; border: 0; background: var(--pine-tint); color: var(--pine-text); font-weight: 600; font-size: 13px;
}
.call-chip:hover:not(:disabled) { background: var(--pine); color: #fff; }
.call-chip.ghost { background: transparent; padding: 0 6px; height: 26px; }
.call-chip.ghost:hover:not(:disabled) { background: var(--pine-tint); color: var(--pine-text); }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 9px 9px 0; }

/* ---------- Form ---------- */
.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); outline: 0;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: color-mix(in srgb, var(--pine) 60%, var(--line)); box-shadow: 0 0 0 3px var(--pine-tint); }
.input.slim { width: auto; height: 36px; padding-right: 28px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B8C90' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field { display: grid; gap: 6px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { display: block; font-size: 12.5px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-sub { grid-column: 1 / -1; font: 600 15px var(--display); margin-top: 6px; }
.form-error { color: var(--brick); font-size: 13.5px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pine); }
input[type="checkbox"].switch { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch:checked { background: var(--pine); }
.switch:checked::after { transform: translateX(16px); }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-label { display: block; font-weight: 560; }
.when { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.when-hint { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 13px; color: var(--pine-text); font-weight: 560; }
.when.dark .when-hint { color: var(--call-ink); }
.when.dark .link-btn { color: var(--call-ink-2); }
.when.dark .input { background: var(--call-raised); border-color: var(--call-line); color: var(--call-ink); }

/* ---------- Pills, chips, tags ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
  color: color-mix(in srgb, var(--c) 70%, var(--ink));
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.pill.small { height: 22px; font-size: 12px; padding: 0 9px 0 8px; gap: 6px; }
.pill.small .dot { width: 7px; height: 7px; }
.pill-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--call-line); background: transparent; color: var(--call-ink); font-size: 13px; font-weight: 540; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--call-raised); }
.chip.on { background: var(--call-ink); color: var(--call-bg); border-color: var(--call-ink); }
.chip.status.on { background: color-mix(in srgb, var(--c) 30%, var(--call-ink)); color: var(--them-ink); border-color: transparent; }
.chips.light .chip { border-color: var(--line); color: var(--ink-2); }
.chips.light .chip:hover { background: var(--hover); }
.chips.light .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--well); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; text-transform: none; }
.tag.live { background: var(--pine-tint); color: var(--pine-text); }
.muted-tag { color: var(--ink-3); }
.kind { font-weight: 600; color: var(--ink-2); }

/* ---------- Page heads ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 18px 0 22px; flex-wrap: wrap; }
.page-head h1, .lead-title h1 {
  font: 680 32px/1.12 var(--display);
  font-variation-settings: 'opsz' 72;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.page-head .sub { margin-top: 6px; color: var(--ink-3); }
.eyebrowless { color: var(--ink-3); margin-bottom: 6px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; color: var(--ink-3); font-weight: 520; }
.section-title { font: 650 15px/1.3 var(--display); letter-spacing: -0.005em; color: var(--ink); }
.section-title.quiet { color: var(--ink-3); }
.late-title { color: var(--brick); }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hint-line { display: flex; align-items: center; gap: 8px; color: var(--ink-2); margin: -8px 0 22px; flex-wrap: wrap; }
.hint-line.small { display: block; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
.hint-line.small .icon { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.cal-side .task-row { grid-template-columns: 22px 74px minmax(0, 1fr) auto; gap: 10px; }
.cal-side .task-title, .cal-side .task-meta a { white-space: normal; }
.cal-side .call-chip span, .lead-side .task-row .call-chip span { display: none; }
.cal-side .call-chip, .lead-side .task-row .call-chip { padding: 0 8px; }

/* ---------- Today ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.split-main { display: grid; gap: 30px; }
.split-side { display: grid; gap: 28px; position: sticky; top: 80px; }
.agenda { display: grid; gap: 2px; }
.agenda .section-title { margin-bottom: 8px; }
.side-block { display: grid; gap: 12px; }
.tally { margin: 0; display: grid; gap: 0; }
.tally div { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.tally dt { color: var(--ink-2); }
.tally dd { margin: 0; font: 650 17px var(--display); font-variant-numeric: tabular-nums; }
.mini-calls { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-calls a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 8px; color: var(--ink); }
.mini-calls a:hover { background: var(--hover); text-decoration: none; }
.mini-calls .icon { color: var(--ink-3); }
.mc-main { flex: 1; min-width: 0; display: grid; }
.mc-main strong { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-main span { font-size: 12.5px; color: var(--ink-3); }
.mc-time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* Task rows */
.task-row { display: grid; grid-template-columns: 22px 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 10px; margin: 0 -10px; border-radius: 10px; }
.task-row:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-soft); }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--ink-3); background: transparent; display: grid; place-items: center; padding: 0; color: #fff; }
.check:hover { border-color: var(--pine); }
.task-row.done .check { background: var(--pine); border-color: var(--pine); }
.task-row.done .task-title { color: var(--ink-3); text-decoration: line-through; }
.task-when { display: grid; line-height: 1.3; }
.task-day { font-size: 12px; color: var(--ink-3); }
.task-time { font-weight: 620; font-variant-numeric: tabular-nums; }
.late { font-size: 12px; color: var(--brick); font-weight: 560; }
.task-row.overdue .task-time { color: var(--brick); }
.task-main { display: grid; min-width: 0; }
.task-title { text-align: left; border: 0; background: none; padding: 0; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.task-meta a { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-actions { display: flex; align-items: center; gap: 4px; }
.lead-side .task-title { white-space: normal; }
.lead-side .task-row { grid-template-columns: 22px 78px minmax(0, 1fr) auto; gap: 10px; padding: 9px 8px; margin: 0 -8px; }

/* ---------- Leads table ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-3); }
.filter-search input { flex: 1; border: 0; outline: 0; background: none; color: var(--ink); min-width: 0; }
.filter-search:focus-within { box-shadow: 0 0 0 3px var(--pine-tint); border-color: color-mix(in srgb, var(--pine) 60%, var(--line)); }
.status-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.status-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--ink-2); font-weight: 540; }
.status-tabs button span:last-child { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.status-tabs button:hover { background: var(--hover); }
.status-tabs button.on { background: var(--surface); border-color: var(--line); color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: color-mix(in srgb, var(--well) 70%, var(--surface)); }
.table tbody tr.sel { background: var(--pine-tint); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cb { width: 44px; padding-right: 0; }
.table .num { width: 44px; }
.lead-name { color: var(--ink); font-weight: 600; }
.cell-sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .link-btn { margin-right: 6px; }
.more-row { display: flex; justify-content: center; padding: 18px; }
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(calc(-50% + 114px)); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
  border-radius: 14px; background: var(--call-bg); color: var(--call-ink); box-shadow: var(--pop);
}
.btn.on-dark { background: var(--call-raised); border-color: var(--call-line); color: var(--call-ink); }
.btn.on-dark:hover:not(:disabled) { background: var(--call-line); }
.btn.on-dark.primary { background: var(--call-ink); color: var(--call-bg); border-color: transparent; }
.btn.on-dark.primary:hover:not(:disabled) { background: #fff; }
.btn.on-dark.ghost { background: transparent; border-color: transparent; }
.icon-btn.on-dark { color: var(--call-ink-2); }
.icon-btn.on-dark:hover { background: var(--call-raised); color: var(--call-ink); }

/* ---------- Lead page ---------- */
.queue-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--pine-tint); color: var(--pine-text); }
.q-label { font-size: 13.5px; }
.q-count { font-weight: 650; }
.q-progress { flex: 1; min-width: 60px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--pine) 18%, transparent); overflow: hidden; }
.q-progress div { height: 100%; background: var(--pine); border-radius: 4px; }
.lead-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 22px 0 26px; flex-wrap: wrap; }
.lead-title { display: grid; gap: 12px; min-width: 0; }
.lead-title h1 { font-size: 36px; cursor: text; }
.name-input { height: 48px; font: 680 30px var(--display); letter-spacing: -0.02em; }
.lead-facts { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; color: var(--ink-2); }
.fact { display: inline-flex; align-items: center; gap: 6px; }
a.fact { color: var(--ink-2); }
.lead-cta .btn.call { height: 44px; font-size: 15px; padding: 0 22px 0 18px; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main side"; gap: 36px; align-items: start; }
.lead-grid.with-call { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "main call" "main side"; row-gap: 28px; }
.lead-call { grid-area: call; position: sticky; top: 76px; z-index: 5; scroll-margin-top: 72px; }
.lead-main { grid-area: main; min-width: 0; display: grid; gap: 26px; }
.lead-side { grid-area: side; display: grid; gap: 28px; align-content: start; }
.lead-side > .link-btn { justify-self: start; }

.composer { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.composer-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line-soft); }
.composer-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 10px; border: 0; background: none; color: var(--ink-3); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.composer-tabs button.on { color: var(--ink); border-bottom-color: var(--pine); }
.composer-body { padding: 12px; display: grid; gap: 10px; }
.composer-body textarea.input { border: 0; box-shadow: none; padding: 4px 2px; resize: none; min-height: 64px; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; }

.timeline { display: grid; }
.tl-day { font: 600 13px var(--font); color: var(--ink-3); margin: 18px 0 8px; }
.timeline > div:first-child .tl-day { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 4px 0 18px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 14px; top: 34px; bottom: 0; width: 1px; background: var(--line); }
.tl-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.tl-item.call .tl-icon { background: var(--pine-tint); border-color: transparent; color: var(--pine-text); }
.tl-body { display: grid; gap: 8px; min-width: 0; padding-top: 4px; justify-items: start; }
.tl-body > .tl-head, .tl-body > .transcript { justify-self: stretch; }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-head strong { font-weight: 620; }
.tl-time { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.tl-dur { color: var(--ink-3); font-size: 13px; }
.tl-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); max-width: 70ch; }
.tl-next { display: flex; align-items: center; gap: 6px; color: var(--pine-text); font-size: 13.5px; font-weight: 540; }
.tl-item.slim { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; padding: 0 0 14px; color: var(--ink-2); }
.tl-item.slim::before { top: 24px; }
.tl-icon.small { width: 22px; height: 22px; margin-left: 4px; }
.tl-icon.done { background: var(--pine); color: #fff; border-color: transparent; }
.tl-item.slim .tl-time { margin-left: 0; }
.timeline > div:last-child .tl-item::before { display: none; }
.summary { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--pine-tint); color: var(--ink); max-width: 70ch; }
.summary .icon { color: var(--pine-text); margin-top: 3px; }

/* Transcript in the timeline */
.transcript { display: grid; gap: 3px; padding: 4px 0; max-width: 640px; }
.transcript .line { display: grid; max-width: 82%; }
.transcript .line p { padding: 8px 12px; border-radius: 14px; line-height: 1.45; }
.transcript .line.them { justify-self: start; }
.transcript .line.them p { background: var(--well); border-bottom-left-radius: 4px; }
.transcript .line.you { justify-self: end; text-align: right; }
.transcript .line.you p { background: var(--pine-tint); color: var(--ink); border-bottom-right-radius: 4px; text-align: left; }
.transcript .who { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin: 8px 6px 2px; }
.transcript .line.cont p { margin-top: 0; }

/* Audio player */
.player { width: 100%; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 4px; border-radius: 999px; background: var(--well); max-width: 460px; }
.player.error { padding: 0 14px; color: var(--ink-3); font-size: 13px; }
.player .play { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--pine); color: #fff; display: grid; place-items: center; flex: none; }
.player .time { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrub { flex: 1; height: 16px; display: flex; align-items: center; cursor: pointer; position: relative; }
.scrub::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--line); }
.scrub-fill { position: relative; height: 4px; border-radius: 4px; background: var(--pine); }
.player .rate { border: 0; background: none; font-size: 12.5px; font-weight: 650; color: var(--ink-2); padding: 0 8px; }

/* Side blocks on lead page */
.contact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.contact:last-of-type { border-bottom: 0; }
.contact-main { display: grid; line-height: 1.4; min-width: 0; }
.contact-main strong { font-weight: 620; }
.contact-main a, .contact-main span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.contact-actions { display: flex; gap: 2px; align-items: center; }
.contact.editing { grid-template-columns: 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 650; background: hsl(var(--h) 38% 88%); color: hsl(var(--h) 45% 26%); flex: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 25% 24%); color: hsl(var(--h) 50% 82%); } }
.details { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.details > div { display: grid; padding: 6px 0; min-width: 0; }
.details .wide { grid-column: 1 / -1; }
.details dt { font-size: 12px; color: var(--ink-3); font-weight: 560; }
.details dd { margin: 0; min-width: 0; }
.inline-val { border: 0; background: none; padding: 2px 4px; margin: 0 -4px; border-radius: 6px; text-align: left; width: calc(100% + 8px); overflow: hidden; text-overflow: ellipsis; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-val:hover { background: var(--hover); }
.inline-val.is-empty { color: var(--ink-3); }
.inline-input { height: 32px; }
textarea.inline-input { height: auto; }
.list-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.list-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.list-chip a { color: var(--ink); }
.list-chip button { border: 0; background: none; padding: 3px; border-radius: 50%; color: var(--ink-3); display: grid; }
.list-chip button:hover { background: var(--hover); color: var(--ink); }
.list-chip.add { padding: 0 11px; gap: 5px; color: var(--ink-2); border-style: dashed; background: none; }

/* ---------- The call panel ---------- */
.callpanel {
  scroll-margin-top: 72px;
  background: var(--call-bg); color: var(--call-ink);
  border-radius: 18px; padding: 18px; display: grid; gap: 14px;
  box-shadow: var(--pop);
}
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cp-state { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--call-ink-2); font-weight: 560; }
.cp-timer { color: var(--call-ink); font-variant-numeric: tabular-nums; font-weight: 650; }
.cp-warn { color: #F3C66B; }
.cp-head-actions { display: flex; align-items: center; gap: 4px; }
.cp-link { border: 0; background: none; color: var(--call-ink-2); font-size: 13px; font-weight: 560; }
.cp-link:hover { color: var(--call-ink); text-decoration: underline; }
.cp-icon { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--call-ink-2); display: grid; place-items: center; }
.cp-icon:hover { background: var(--call-raised); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--call-ink-2); flex: none; }
.live-dot.on { background: #6BE0B3; box-shadow: 0 0 0 0 rgba(107, 224, 179, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(107, 224, 179, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(107, 224, 179, 0); } 100% { box-shadow: 0 0 0 0 rgba(107, 224, 179, 0); } }
.phase-ringing .live-dot.on, .phase-connecting .live-dot.on { background: #F3C66B; animation-duration: 1.1s; }
.cp-who h3 { font: 680 25px/1.15 var(--display); letter-spacing: -0.02em; font-variation-settings: 'opsz' 60; }
.cp-who p { color: var(--call-ink-2); margin-top: 3px; }
.cp-controls { display: flex; gap: 10px; }
.round { display: grid; justify-items: center; gap: 4px; border: 0; background: none; color: var(--call-ink-2); font-size: 11.5px; font-weight: 560; padding: 0; }
.round > .icon { width: 48px; height: 48px; padding: 14px; border-radius: 50%; background: var(--call-raised); color: var(--call-ink); box-sizing: border-box; }
.round:hover > .icon { background: var(--call-line); }
.round.on > .icon { background: var(--call-ink); color: var(--call-bg); }
.round.hang { margin-left: auto; }
.round.hang > .icon { background: #D2543C; color: #fff; padding: 13px; }
.round.hang:hover > .icon { background: #E2644B; }
.round.small > .icon { width: 34px; height: 34px; padding: 9px; }
.round.answer > .icon { background: #2FA37E; color: #fff; }
.dtmf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dtmf button { height: 40px; border: 0; border-radius: 10px; background: var(--call-raised); color: var(--call-ink); font: 600 17px var(--display); }
.dtmf button:hover { background: var(--call-line); }
.cp-transcript { display: grid; gap: 3px; align-content: start; max-height: 320px; overflow-y: auto; padding: 4px 2px; scroll-behavior: smooth; overscroll-behavior: contain; }
.cp-waiting { color: var(--call-ink-2); font-size: 13.5px; padding: 6px 0; }
.cp-line { display: grid; max-width: 86%; }
.cp-line p { padding: 8px 12px; border-radius: 14px; line-height: 1.45; font-size: 14px; }
.cp-line.them { justify-self: start; }
.cp-line.them p { background: var(--them-bg); color: var(--them-ink); border-bottom-left-radius: 4px; }
.cp-line.you { justify-self: end; }
.cp-line.you p { background: var(--you-bg); color: var(--call-ink); border-bottom-right-radius: 4px; }
.cp-line .who { font-size: 11px; font-weight: 600; color: var(--call-ink-2); margin: 8px 6px 2px; }
.cp-line.you .who { text-align: right; }
.cp-line:last-child p { animation: lineIn 0.25s ease-out; }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cp-notes, .cp-input { width: 100%; border: 1px solid var(--call-line); border-radius: 10px; background: var(--call-raised); color: var(--call-ink); padding: 9px 11px; resize: vertical; outline: 0; }
.cp-input { height: 36px; }
.cp-notes::placeholder, .cp-input::placeholder { color: var(--call-ink-2); opacity: 0.8; }
.cp-notes:focus, .cp-input:focus { border-color: var(--call-ink-2); }
.cp-muted { color: var(--call-ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.cp-summary { padding: 12px; border-radius: 12px; background: var(--call-raised); display: grid; gap: 6px; }
.cp-summary-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: #9FE6C8; }
.cp-summary p { font-size: 14px; line-height: 1.5; }
.wrap { display: grid; gap: 16px; }
.wrap-group { display: grid; gap: 8px; }
.wrap-label { font-size: 12.5px; font-weight: 650; color: var(--call-ink-2); }
.wrap-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: color-mix(in srgb, #9FE6C8 16%, var(--call-raised)); font-size: 13.5px; }
.suggest p { line-height: 1.4; }
.suggest p .icon { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.suggest .chip, .suggest .btn { flex: none; white-space: nowrap; }
.suggest.light { background: var(--marigold-tint); color: var(--ink); max-width: 520px; }
.callpanel.floating { width: 380px; max-height: calc(100vh - 40px); overflow-y: auto; }
.float-call { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.call-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--call-bg); color: var(--call-ink); box-shadow: var(--pop); }
.call-bar-who { border: 0; background: none; color: var(--call-ink); font-weight: 650; }
.call-bar-time { color: var(--call-ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.incoming { position: fixed; top: 16px; right: 20px; z-index: 80; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 18px; background: var(--call-bg); color: var(--call-ink); box-shadow: var(--pop); min-width: 320px; }
.ring-anim { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #2FA37E; color: #fff; animation: ring 1.2s infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: rotate(0); } }
.incoming-who { display: grid; flex: 1; line-height: 1.3; }
.incoming-label { font-size: 12px; color: var(--call-ink-2); }
.incoming-who strong { font: 650 17px var(--display); }
.incoming-who span:last-child { font-size: 13px; color: var(--call-ink-2); }
.incoming-actions { display: flex; gap: 10px; }
.incoming-actions .round { margin: 0; }

/* ---------- Lists ---------- */
.list-rows { display: grid; gap: 10px; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto auto; gap: 18px; align-items: center; padding: 16px 16px 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.list-row-main { display: grid; color: var(--ink); min-width: 0; }
.list-row-main strong { font: 650 18px/1.3 var(--display); letter-spacing: -0.01em; }
.list-row-progress { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.progress { height: 8px; border-radius: 8px; background: var(--well); overflow: hidden; }
.progress.thin { height: 5px; }
.progress div { height: 100%; background: var(--pine); border-radius: 8px; transition: width 0.3s; }

/* ---------- Calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--surface); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.cal-day { background: var(--surface); border: 0; min-height: 104px; padding: 6px 6px 8px; text-align: left; display: flex; flex-direction: column; gap: 3px; align-items: stretch; overflow: hidden; }
.cal-day:hover { background: color-mix(in srgb, var(--well) 60%, var(--surface)); }
.cal-day.outside { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.cal-day.outside .cal-num { color: var(--ink-3); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--pine); }
.cal-num { font-weight: 620; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--pine); color: #fff; }
.cal-item { font-size: 12px; line-height: 1.35; padding: 2px 6px; border-radius: 5px; background: var(--pine-tint); color: var(--pine-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item .tabnum { font-weight: 650; }
.cal-item.k-meeting { background: color-mix(in srgb, #7D62C9 16%, var(--surface)); color: color-mix(in srgb, #7D62C9 70%, var(--ink)); }
.cal-item.k-email, .cal-item.k-other { background: var(--well); color: var(--ink-2); }
.cal-item.done { opacity: 0.5; text-decoration: line-through; }
.cal-more { font-size: 11.5px; color: var(--ink-3); padding-left: 6px; }
.cal-side { display: grid; gap: 8px; position: sticky; top: 80px; }
.day-title { font: 650 19px var(--display); letter-spacing: -0.01em; margin-bottom: 6px; }

/* ---------- Calls ---------- */
.call-list { display: grid; }
.call-row { border-radius: 12px; }
.call-row.open { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin: 4px 0; }
.call-row-head { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1.6fr) minmax(0, 1fr) 90px 60px 90px; gap: 12px; align-items: center; padding: 10px 12px; border: 0; background: none; text-align: left; border-radius: 12px; }
.call-row-head:hover { background: var(--hover); }
.call-row.open .call-row-head:hover { background: none; }
.call-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--well); color: var(--ink-2); }
.call-ic.outgoing { background: var(--pine-tint); color: var(--pine-text); }
.call-ic.missed { background: var(--brick-tint); color: var(--brick); }
.cr-who { display: grid; min-width: 0; line-height: 1.35; }
.cr-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-who span { font-size: 12.5px; }
.cr-flags { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.cr-dur { color: var(--ink-2); }
.cr-time { color: var(--ink-3); font-size: 13px; text-align: right; }
.call-row-body { padding: 4px 16px 18px 56px; display: grid; gap: 12px; }
.attach { display: grid; gap: 4px; min-width: 260px; }
.picker { position: relative; }
.picker-list { position: absolute; top: 42px; left: 0; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop); padding: 4px; }
.picker-list button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; }
.picker-list button:hover { background: var(--well); }
.picked { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 9px; background: var(--well); }
.picked span { flex: 1; font-weight: 560; }

/* ---------- Settings ---------- */
.settings { max-width: 860px; }
.settings-section { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.settings-section h2 { font: 650 17px var(--display); letter-spacing: -0.01em; }
.settings-card { display: grid; gap: 14px; }
.settings-card > p { max-width: 62ch; }
.settings-card > .btn { justify-self: start; }
.phone-summary { display: flex; gap: 12px; align-items: center; }
.phone-summary > div { display: grid; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--marigold-tint); color: var(--ink); font-size: 13.5px; }
.numbers { display: grid; gap: 8px; }
.number-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.status-editor { display: grid; gap: 6px; }
.status-edit-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; }
.status-edit-row input[type="color"] { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: var(--surface); cursor: pointer; }
.copy-row { display: flex; gap: 8px; }
.howto { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); }

/* ---------- Menus, modals, toasts ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; top: calc(100% + 6px); z-index: 70; min-width: 200px; max-height: 360px; overflow-y: auto; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--pop); color: var(--ink); }
.menu.left { left: 0; }
.menu.right { right: 0; }
.bulkbar .menu { top: auto; bottom: calc(100% + 8px); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; background: none; border-radius: 8px; text-align: left; white-space: nowrap; }
.menu-item:hover { background: var(--well); }
.menu-item.danger { color: var(--brick); }
.menu-item .icon { color: var(--ink-3); }
.menu-check { margin-left: auto; color: var(--pine) !important; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 4px; }
.menu-heading { padding: 6px 10px 3px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(12, 24, 28, 0.42); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--pop); animation: rise 0.18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px 22px; }
.modal-head h2 { font: 670 21px var(--display); letter-spacing: -0.015em; }
.modal-body { padding: 10px 22px 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--pop); max-width: min(560px, calc(100vw - 32px)); animation: rise 0.2s ease-out; }
.toast.error { background: var(--brick); color: #fff; }
.toast.reminder { background: var(--call-bg); color: var(--call-ink); }
.toast .icon-btn { color: inherit; opacity: 0.7; }
.toast-action { border: 0; background: color-mix(in srgb, currentColor 16%, transparent); color: inherit; font-weight: 650; padding: 5px 10px; border-radius: 8px; white-space: nowrap; }

/* ---------- Misc ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 20px; border: 1px dashed var(--line); border-radius: 16px; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--pine-tint); color: var(--pine-text); }
.empty h3 { font: 650 19px var(--display); }
.empty p { color: var(--ink-2); max-width: 46ch; }
.spinner { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 24px 0; }
.spinner span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--pine); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; border: 1.5px dashed var(--line); border-radius: 14px; text-align: center; color: var(--ink-2); }
.drop.over { border-color: var(--pine); background: var(--pine-tint); }
.map-table { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px 220px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.map-col { display: grid; min-width: 0; }
.map-col span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-block { display: grid; gap: 10px; padding: 20px 0; }
.result h3 { font: 650 22px var(--display); margin-bottom: 6px; }
.dial-input { height: 52px; font: 600 24px var(--display); text-align: center; letter-spacing: 0.02em; }
.dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dialpad button { height: 52px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: 600 21px var(--display); }
.dialpad button:hover { background: var(--hover); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login-mark { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--call-bg); color: #9FE6C8; }
.login-card h1 { font: 720 44px/1 var(--display); letter-spacing: -0.035em; font-variation-settings: 'opsz' 96; }
.login-card > p { color: var(--ink-2); margin-top: -6px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .split, .cal-layout { grid-template-columns: 1fr; }
  .split-side, .cal-side { position: static; }
  .lead-grid, .lead-grid.with-call { grid-template-columns: 1fr; grid-template-areas: "call" "main" "side"; }
  .lead-call { position: static; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .list-row-progress { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 50; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: var(--surface); }
  .brand, .phone-status { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; position: relative; }
  .nav a.on { box-shadow: none; background: var(--well); }
  .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: 10.5px; }
  .top { padding: 0 16px; height: 60px; }
  .top .btn.primary { padding: 0 10px; }
  .top .btn.primary span, .search kbd { display: none; }
  .preview-note { font-size: 12.5px; color: var(--marigold); background: var(--marigold-tint); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 1100px) { .preview-note { display: none; } }
.queue-resume { display: none; }
  .page { padding: 4px 16px 150px; }
  .page-head h1 { font-size: 27px; }
  .lead-title h1 { font-size: 29px; }
  .form-grid, .composer-row, .details { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 22px 70px minmax(0, 1fr) auto; gap: 10px; }
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; scrollbar-width: none; }
  .status-tabs button { flex: none; }
  .phone-text { display: none; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(6), .table td:nth-child(6) { display: none; }
  .call-row-head { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .cr-outcome, .cr-flags, .cr-dur { display: none; }
  .call-row-body { padding: 4px 12px 16px; }
  .settings-section { grid-template-columns: 1fr; gap: 12px; }
  .cal-day { min-height: 64px; }
  .cal-item { font-size: 0; height: 6px; padding: 0; }
  .float-call { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .callpanel.floating { width: 100%; max-height: 70vh; }
  .bulkbar { transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom)); flex-wrap: wrap; max-width: calc(100vw - 24px); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .map-row { grid-template-columns: 1fr; }
  .map-row .icon { display: none; }
  .incoming { left: 12px; right: 12px; min-width: 0; }
}
