/* Theme tokens, matching the landing page (sites/enginepulse/src/app/globals.css): warm white or near black canvas
   and the ember accent. theme.js sets data-theme on <html> before paint from the viewer's choice; with no choice
   the system setting decides. Every color in web/*.css comes from these. */
:root {
  color-scheme: light;
  --ink: #0b0c0e;
  --ink-2: #3b3e44;
  --muted: #5c5f66;
  /* Faint text holds 4.5:1 or better on every light surface, grey-soft included. */
  --faint: #6e6962;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f6f2eb;
  --grey-soft: #efe9df;
  --border: #e6dfd3;
  --border-strong: #d3cabb;
  --accent: #ff6b2c;
  --accent-hover: #e85514;
  --accent-ink: #b93d0b;
  --accent-soft: #fff0e6;
  --accent-line: #ffd0b8;
  --accent-glow: rgba(255, 107, 44, .28);
  --on-accent: #0b0c0e;
  --on-ink: #ffffff;
  --on-status: #ffffff;
  --focus-ring: rgba(255, 107, 44, .2);
  --cyan: #1fb6d9;
  --cyan-soft: #e4f7fc;
  --cyan-ink: #0e7490;
  --cyan-line: #b9e8f4;
  --blue: #2f6fe4;
  --blue-soft: #eaf1fd;
  --green: #12a46b;
  --green-soft: #e3f6ee;
  --green-ink: #0b6b46;
  --green-line: #bfe8d6;
  --green-glow: rgba(18, 164, 107, .18);
  /* Solid fills under white text (badges, chips, Answer and Decline, the red and amber banners): 4.5:1 or better with --on-status in both themes. */
  --green-solid: #0e8556;
  --red-solid: #c8323f;
  --amber-solid: #9c5a00;
  --cyan-solid: #0e7490;
  --red: #e0414f;
  --red-soft: #fdecee;
  --red-ink: #a8202d;
  --red-line: #f6c3c8;
  --red-tint: #fffafa;
  --amber: #d98a10;
  --amber-soft: #fdf3e1;
  --amber-ink: #8a5300;
  --amber-line: #f1d29a;
  --amber-tint: #fffcf5;
  /* A caller the AI assistant has: not waiting on a person, so neither the amber ringing nor the red hold color. */
  --assistant: #7254d4;
  --assistant-soft: #f1edfc;
  --assistant-ink: #5536b0;
  --assistant-line: #d6cbf5;
  --overlay: rgba(11, 12, 14, .45);
  --shadow-color: rgba(60, 40, 20, .2);
  --shadow-soft-color: rgba(60, 40, 20, .07);
  --topbar-bg: rgba(250, 247, 242, .86);
  /* The coach card and the sign in brand panel stay dark in both themes. */
  --hero: #0b0c0e;
  --hero-ink: #f3f2ef;
  --hero-dim: rgba(243, 242, 239, .62);
  --hero-line: rgba(243, 242, 239, .14);
  --hero-accent: #ff9a6b;
  --hero-green: #62d9a6;
  --hero-glow: rgba(255, 107, 44, .32);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 4px 16px rgba(60, 40, 20, .06);
  --head: "Plus Jakarta Sans", system-ui, sans-serif;
  --rail-w: 248px;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f2ef;
  --ink-2: #c9c7c2;
  --muted: #9aa1aa;
  --faint: #8a9099;
  --bg: #0b0c0e;
  --surface: #131519;
  --surface-2: #181b20;
  --grey-soft: #1f2228;
  --border: #262a30;
  --border-strong: #363b43;
  --accent-ink: #ff8a55;
  --accent-soft: rgba(255, 107, 44, .13);
  --accent-line: rgba(255, 107, 44, .4);
  --on-ink: #0b0c0e;
  --focus-ring: rgba(255, 107, 44, .3);
  --cyan: #2cc3e6;
  --cyan-soft: rgba(31, 182, 217, .13);
  --cyan-ink: #6fd6ef;
  --cyan-line: rgba(31, 182, 217, .4);
  --blue: #5b8ff0;
  --blue-soft: rgba(47, 111, 228, .16);
  --green: #1fbf7f;
  --green-soft: rgba(18, 164, 107, .15);
  --green-ink: #62d9a6;
  --green-line: rgba(18, 164, 107, .45);
  --green-glow: rgba(31, 191, 127, .25);
  --red: #e84b59;
  --red-soft: rgba(224, 65, 79, .15);
  --red-ink: #ff8f99;
  --red-line: rgba(224, 65, 79, .45);
  --red-tint: rgba(224, 65, 79, .07);
  --amber: #e9a23b;
  --amber-soft: rgba(217, 138, 16, .15);
  --amber-ink: #f3c070;
  --amber-line: rgba(217, 138, 16, .45);
  --amber-tint: rgba(217, 138, 16, .07);
  --assistant: #a28cf2;
  --assistant-soft: rgba(124, 92, 214, .17);
  --assistant-ink: #c7b8fb;
  --assistant-line: rgba(124, 92, 214, .45);
  --overlay: rgba(0, 0, 0, .62);
  --shadow-color: rgba(0, 0, 0, .55);
  --shadow-soft-color: rgba(0, 0, 0, .3);
  --topbar-bg: rgba(11, 12, 14, .86);
  --hero: #16181d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
code { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
/* Read by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Nothing wraps: headings, buttons and table cells hold one line. Tables scroll sideways inside their panel. */
h1, h2, h3, th, td, button, .btn { white-space: nowrap; }
h1, h2, h3 { overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--accent); }
.panel-head > h2 + .count { margin-left: 8px; }
/* A caveat that matters, behind an "i" beside its heading: the title on hover, a note under the heading on a tap. */
.info {
  position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 7px; vertical-align: 1px;
  border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); cursor: pointer;
  font: 600 10.5px/1 var(--body); text-transform: none; letter-spacing: 0;
}
.info:hover, .info:focus-visible, .info[aria-expanded="true"] { color: var(--accent-ink); border-color: var(--accent); outline: none; }
.info:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring), 0 0 0 1px var(--accent); }
.info[aria-expanded="true"] { background: var(--accent-soft); }
/* A finger sized target around the small circle. */
.info::after { content: ""; position: absolute; inset: -10px; }
/* The caveat opened by a tap on its "i" (shell.js). */
.info-note {
  display: block; margin: 0 18px 12px; padding: 10px 12px; max-width: 720px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  font: 400 13px/1.5 var(--body); text-transform: none; letter-spacing: 0; white-space: normal;
}
summary .info-note, label + .info-note, h1 + .info-note, h2 + .info-note, h3 + .info-note { margin: 8px 0; }

/* OS shell: module rail + main column */
.os { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.os-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.rail {
  position: sticky; top: 0; z-index: 20; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px 14px;
}
.os-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; color: inherit; text-decoration: none; }
.os-mark {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 4px 12px var(--shadow-soft-color);
}
.os-mark svg { width: 72%; height: 72%; }
.os-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; white-space: nowrap; }
.os-name strong { font: 700 15.5px var(--head); letter-spacing: -.01em; }
.os-name small { font-size: 11.5px; color: var(--accent-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The module switcher under the logo (shell.js moduleSwitch): the current module, and a list of every module this
   person can open. The list is wider than the rail so each one line blurb fits. */
.switch { position: relative; margin-bottom: 12px; }
.switch-btn {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 10px 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  font: 600 14px var(--body); color: var(--ink); cursor: pointer;
}
.switch-btn:hover { border-color: var(--border-strong); }
.switch-btn:focus-visible, .switch-item:focus-visible, .rail-link:focus-visible, .rail-collapse:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.switch-btn .ico { width: 18px; height: 18px; flex: none; }
.switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.switch-btn > :is(.rail-live, .rail-ring) { margin-left: 0; }
.switch-chev { color: var(--muted); transition: transform .15s; }
.switch-btn[aria-expanded="true"] .switch-chev { transform: rotate(180deg); }
.switch-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 360px; max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px var(--shadow-soft-color);
}
.switch-title { margin: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.switch-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none;
}
.switch-item:hover, .switch-item:focus-visible { background: var(--surface-2); color: var(--ink); }
.switch-item[aria-current] { color: var(--ink); }
.switch-item > .ico { width: 18px; height: 18px; flex: none; }
.switch-item[aria-current] > .ico { color: var(--accent-ink); }
.switch-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.switch-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.switch-row strong { font-size: 13.5px; font-weight: 600; }
.switch-row .rail-live, .switch-row .rail-ring { margin-left: 0; }
.switch-text small { font-size: 12px; color: var(--muted); }
.switch-check { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }

/* The current module's pages. */
.rail-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.rail-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s;
}
.rail-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-link .ico { width: 18px; height: 18px; flex: none; }
a.rail-link:hover { background: var(--surface-2); color: var(--ink); }
/* The current page is an ember pill: white text in light mode, ink in dark, as the rail always was there. */
/* Light mode fills the pill with the deeper ember (getenginepulse.com's light text ember) so white text reads at 4.5:1 or better. */
.rail-link[aria-current="page"] { background: #b93d0b; color: #fff; font-weight: 600; box-shadow: 0 4px 14px var(--accent-glow); }
.rail-link[aria-current="page"]:hover { background: #a3360a; color: #fff; }
:root[data-theme="dark"] .rail-link[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
:root[data-theme="dark"] .rail-link[aria-current="page"]:hover { background: var(--accent-hover); color: var(--on-accent); }
.rail-live {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; padding: 1px 7px; border-radius: 999px;
  color: var(--green-ink); background: var(--green-soft);
}
.rail-ring { display: none; flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--green); }
/* data-phone: the phone's state wherever it lives (shell.js followPhone). Hollow when ready, solid on a call,
   blinking when it rings. */
[data-phone="ready"] .rail-ring { display: block; background: transparent; box-shadow: inset 0 0 0 2px var(--green); }
[data-phone="active"] .rail-ring { display: block; }
[data-phone="ringing"] .rail-ring { display: block; animation: blink .6s steps(2) infinite; }
.rail-link[aria-current="page"] .rail-ring { background: var(--on-accent); box-shadow: 0 0 0 3px var(--green); }
.rail-collapse {
  display: flex; align-items: center; gap: 11px; height: 38px; margin-top: 8px; padding: 0 10px;
  border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none;
  font: 500 13px var(--body); color: var(--muted); cursor: pointer;
}
.rail-collapse:hover { color: var(--ink); }
.rail-collapse .ico { width: 18px; height: 18px; flex: none; }

/* Collapsed (computers only): icons alone, names in tooltips (title) and for screen readers. */
@media (min-width: 901px) {
  :root[data-rail="collapsed"] { --rail-w: 72px; }
  :root[data-rail="collapsed"] .rail { padding: 18px 12px 14px; }
  :root[data-rail="collapsed"] .os-brand { justify-content: center; padding: 4px 0 14px; }
  :root[data-rail="collapsed"] :is(.os-name, .switch-name, .switch-btn .rail-live, .switch-chev, .rail-link > span, .rail-collapse > span) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  :root[data-rail="collapsed"] :is(.switch-btn, .rail-link, .rail-collapse) { justify-content: center; padding: 0; }
  :root[data-rail="collapsed"] .switch-menu { left: calc(100% + 8px); top: 0; }
  :root[data-rail="collapsed"] :is(.switch-btn, .rail-link) .rail-ring { position: absolute; top: 6px; right: 8px; margin: 0; }
  :root[data-rail="collapsed"] .rail-collapse .ico { transform: scaleX(-1); }
}

/* Header */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 24px; min-height: 72px;
  background: var(--topbar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.crumbs { min-width: 0; }
.crumb-trail { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.crumb-trail a { color: inherit; text-decoration: none; }
.crumb-trail a:hover { color: var(--accent-ink); }
.crumb-sep { color: var(--faint); }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; font-weight: 500; background: var(--surface);
  white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.ok { background: var(--green-soft); border-color: var(--green-line); color: var(--green-ink); }
.pill.ok i { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.pill.bad { background: var(--red-soft); border-color: var(--red-line); color: var(--red-ink); }
.pill.bad i { background: var(--red); animation: blink 1s steps(2) infinite; }
.pill.off { background: var(--grey-soft); color: var(--muted); }
.pill-info { gap: 6px; }
.pill-label { color: var(--muted); font-weight: 400; }
#pill-tx-name { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.clock { font-family: var(--mono); font-size: 13px; color: var(--ink-2); min-width: 64px; text-align: right; }
.store-pick .dd-btn { height: 30px; font-size: 13px; font-weight: 600; }

/* Banners */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: var(--red-solid); color: var(--on-status);
  font-size: 15px;
  animation: slide-down .3s ease-out;
}
.banner svg { width: 22px; height: 22px; flex: none; }
.banner-core { background: var(--amber-solid); }
/* A module read only or switched off at a store on screen (shell.js). */
.banner-switch { background: var(--amber-solid); }
/* DEMO_STORE: always on screen so nobody mistakes the sample store for the real one. */
.demo-strip {
  position: sticky; top: 0; z-index: 11;
  margin: 0; height: 26px; line-height: 26px; text-align: center;
  background: var(--accent-soft); color: var(--accent-ink); border-bottom: 1px solid var(--accent-line);
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.os.is-demo .topbar { top: 26px; }
/* View as (shell.js): on every page while an admin sees the app as someone else, so it is never mistaken for their own. */
.viewas-bar {
  position: sticky; top: 0; z-index: 11;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0; height: 34px; padding: 0 16px; min-width: 0;
  background: var(--amber-solid); color: var(--on-status); font-size: 13px; font-weight: 500;
}
.viewas-bar .ico { width: 16px; height: 16px; flex: none; }
.viewas-bar button {
  flex: none; height: 24px; padding: 0 10px; border: 1px solid currentColor; border-radius: 999px;
  background: none; color: inherit; font: 600 12.5px var(--body); cursor: pointer;
}
.viewas-bar button:hover { background: rgba(255, 255, 255, .16); }
.os.is-demo .viewas-bar { top: 26px; }
.os.is-viewing .topbar { top: 34px; }
.os.is-demo.is-viewing .topbar { top: 60px; }
.viewas-groups { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.viewas-group { display: flex; flex-direction: column; gap: 2px; }
.viewas-group h3 { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.viewas-item { width: 100%; border: 0; background: none; color: var(--ink); text-align: left; font: inherit; }
.viewas-dlg .auth-error { margin: 0 20px 12px; }

/* Layout */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 312px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
}
.count {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: var(--grey-soft); border-radius: 999px; padding: 1px 9px;
}
.empty { display: flex; gap: 10px; color: var(--muted); padding: 4px 18px 18px; margin: 0; font-size: 13px; }
.empty p { margin: 0; line-height: 1.45; }
.empty strong { display: block; color: var(--ink); font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.empty-dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--amber); animation: pulse 1.8s ease-in-out infinite; }

@media (min-width: 1201px) {
  .os { height: 100vh; overflow: hidden; }
  .os-main { overflow: hidden; }
  .layout { overflow: hidden; }
  .home { overflow-y: auto; }
  .conv-list, .commit-panel, .transcript { overflow-y: auto; }
}

/* Conversation list */
.conv-list { list-style: none; margin: 0; padding: 0 10px 10px; }
.conv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.conv + .conv { margin-top: 4px; }
.conv:hover { background: var(--surface-2); }
.conv.selected { background: var(--accent-soft); border-color: var(--accent-line); }
.conv:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.conv-caller { font-family: var(--mono); font-weight: 500; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
.conv-dur { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.conv-agent { font-size: 12px; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 9px; border-radius: 999px; justify-self: end; height: 22px;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ringing { background: var(--amber-soft); color: var(--amber-ink); }
.chip.ringing::before { animation: blink 0.8s steps(2) infinite; }
.chip.active { background: var(--green-soft); color: var(--green-ink); }
.chip.active::before { animation: pulse 1.6s ease-in-out infinite; }
.chip.transferring { background: var(--cyan-soft); color: var(--cyan-ink); }
.chip.transferring::before { animation: blink 0.8s steps(2) infinite; }
.chip.ended { background: var(--grey-soft); color: var(--muted); }
.chip.voicemail { background: var(--accent-soft); color: var(--accent-ink); }
.chip.assistant { background: var(--assistant-soft); color: var(--assistant-ink); }

/* Detail */
.detail-panel { overflow: hidden; }
.detail-empty { flex: 1; display: grid; place-items: center; padding: 40px; text-align: center; }
.detail-empty svg { width: 40px; height: 40px; color: var(--faint); }
.detail-empty p { margin: 6px 0 0; }
.detail-empty-inner { max-width: 360px; }
.detail-empty-inner svg { width: 52px; height: 52px; padding: 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.detail-empty-title { font: 700 18px var(--head); color: var(--ink); margin-top: 14px !important; }
.detail-empty-dial { margin-top: 18px !important; font: 600 15px var(--head); color: var(--accent-ink); letter-spacing: .01em; }
.detail-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 14px;
}
.detail-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title h1 { font-size: 26px; font-weight: 600; font-family: var(--mono); letter-spacing: .01em; }
.duration { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.conv-id { margin-top: 6px; font-size: 12px; color: var(--muted); }
.conv-id code {
  font-size: 11.5px; color: var(--accent-ink); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 6px; word-break: break-all;
}
.btn-transfer {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font: 600 14px var(--body);
  color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform .1s, background .15s;
}
.btn-transfer:hover { background: var(--accent-hover); }
.btn-transfer:active { transform: translateY(1px); }
.btn-transfer:disabled { background: var(--faint); box-shadow: none; cursor: default; }
.btn-transfer svg { width: 16px; height: 16px; }

/* Timeline */
.timeline {
  list-style: none; margin: 0; padding: 14px 22px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tl-step { display: flex; align-items: center; }
.tl-node {
  display: flex; flex-direction: column;
  padding: 6px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  min-width: 84px;
}
.tl-node strong { font-size: 13px; font-weight: 600; }
.tl-node span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.tl-node.live { border-color: var(--green-line); box-shadow: 0 0 0 3px var(--green-soft); }
.tl-node.live strong::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px;
  border-radius: 50%; background: var(--green); vertical-align: 1px;
  animation: pulse 1.6s ease-in-out infinite;
}
.tl-node.ringing { border-color: var(--amber-line); box-shadow: 0 0 0 3px var(--amber-soft); }
.tl-node.assistant { border-color: var(--assistant-line); box-shadow: 0 0 0 3px var(--assistant-soft); }
.tl-node.done { opacity: .62; }
.tl-node.caller strong { font-family: var(--mono); }
.tl-arrow { width: 26px; height: 12px; color: var(--faint); flex: none; margin: 0 4px; }
.tl-transfer {
  margin-right: 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--cyan-ink); background: var(--cyan-soft); border-radius: 999px; padding: 3px 9px;
}

/* Voicemail */
.voicemail { padding: 14px 22px; border-bottom: 1px solid var(--border); }
.voicemail-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.voicemail-length { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.voicemail audio { display: block; width: 100%; height: 36px; }

/* Transcript */
.transcript-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 22px 4px;
}
.transcript {
  flex: 1;
  padding: 10px 22px 22px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 240px;
  scroll-behavior: smooth;
}
.transcript .empty { padding: 20px 0; }
.bubble-row { display: flex; flex-direction: column; max-width: 78%; animation: fade-up .25s ease-out; }
.bubble-row.caller { align-self: flex-start; }
.bubble-row.agent { align-self: flex-end; align-items: flex-end; }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin: 0 6px 3px; display: flex; gap: 8px; }
.bubble-meta b { font-weight: 600; color: var(--ink-2); }
.bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 15px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
  transition: background .3s, color .3s, box-shadow .3s;
}
.caller .bubble { background: var(--grey-soft); border-bottom-left-radius: 5px; }
.agent .bubble { background: var(--accent-soft); color: var(--ink); border-bottom-right-radius: 5px; }
.bubble.interim { color: var(--faint); background: transparent; border: 1px dashed var(--border); font-style: italic; }
.bubble.interim::after { content: " …"; }
.bubble-row.has-commit .bubble {
  box-shadow: 0 0 0 2px var(--accent), 0 6px 20px var(--focus-ring);
  background: var(--surface);
  color: var(--ink);
}
.commit-tag {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 5px 6px 0; font-size: 11px; font-weight: 600;
  color: var(--accent-ink); text-transform: uppercase; letter-spacing: .05em;
}
.commit-tag::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.bubble-row.flash .bubble { animation: flash 1.2s ease-out; }

/* Commitments */
.commit-list { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.card {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px 14px 18px;
  position: relative; overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--accent), var(--cyan));
}
.card:hover { border-color: var(--accent-line); box-shadow: 0 4px 16px var(--focus-ring); }
.card.new { animation: card-in .55s cubic-bezier(.2, .9, .3, 1.2); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kind {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px;
}
.kind.callback { color: var(--cyan-ink); background: var(--cyan-soft); }
.kind.visit { color: var(--green-ink); background: var(--green-soft); }
.kind.purchase { color: var(--amber-ink); background: var(--amber-soft); }
.kind.other { color: var(--ink-2); background: var(--grey-soft); }
.card-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.card-summary { font-family: var(--head); font-size: 16px; font-weight: 600; line-height: 1.3; margin: 10px 0 8px; }
.card-due { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.card-due svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.card-quote {
  margin: 10px 0 12px; padding: 8px 12px;
  border-left: 2px solid var(--border);
  color: var(--ink-2); font-style: italic; font-size: 13.5px;
}
.conf { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.conf-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--grey-soft); overflow: hidden; }
.conf-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 3px; }
.conf b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.saved { display: inline-flex; align-items: center; gap: 4px; }
.saved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Coach: the live next line for the rep */
.coach {
  flex: none;
  margin: 0 16px 16px;
  padding: 16px 20px 14px;
  border-radius: 14px;
  color: var(--hero-ink);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--hero-glow), transparent 55%),
    var(--hero);
  border: 1px solid var(--accent-line);
  box-shadow: 0 12px 32px var(--shadow-color);
  position: sticky;
  bottom: 12px;
  z-index: 2;
}
.coach-head { display: flex; align-items: center; gap: 10px; }
.coach-label {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 12px var(--head); text-transform: uppercase; letter-spacing: .12em; color: var(--hero-accent);
}
.coach-label svg { width: 13px; height: 13px; }
.coach-kind {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 9px; border-radius: 999px; background: var(--hero-line); color: var(--hero-ink);
}
.coach-kind.next_line { background: var(--accent); color: var(--on-accent); }
.coach-kind.objection { background: var(--amber-solid); color: var(--on-status); }
.coach-kind.question { background: var(--cyan-solid); color: var(--on-status); }
.coach-kind.close { background: var(--green-solid); color: var(--on-status); }
.coach-time { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--hero-dim); }
.coach.paused { border-color: var(--hero-line); box-shadow: none; }
.coach.paused .coach-time { color: var(--red-line); font-family: var(--body); font-weight: 600; }
.coach.paused .coach-body { opacity: .55; }
.coach-body.fresh { animation: coach-in .5s cubic-bezier(.2, .9, .3, 1.1); }
.coach.flash { animation: coach-glow 1.4s ease-out; }
.coach-line { margin: 10px 0 4px; font: 600 21px/1.32 var(--head); letter-spacing: -.01em; overflow-wrap: anywhere; }
.coach-why { margin: 0; font-size: 13px; color: var(--hero-dim); overflow-wrap: anywhere; }
.coach-idle { margin: 10px 0 2px; font-size: 15px; color: var(--hero-dim); }
.coach-history { margin-top: 10px; border-top: 1px solid var(--hero-line); padding-top: 8px; }
.coach-history summary { cursor: pointer; font-size: 12px; color: var(--hero-dim); list-style: none; }
.coach-history summary::-webkit-details-marker { display: none; }
.coach-history summary::before { content: "▸ "; }
.coach-history[open] summary::before { content: "▾ "; }
.coach-history ol { list-style: none; margin: 8px 0 0; padding: 0; max-height: 132px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.coach-history li { font-size: 13px; color: var(--hero-ink); display: flex; gap: 8px; align-items: baseline; }
.coach-history li .coach-kind { flex: none; font-size: 10px; padding: 1px 7px; }

/* Call notes (ended calls) */
.notes {
  margin: 14px 14px 4px;
  padding: 16px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%);
  animation: fade-up .3s ease-out;
}
.notes-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.notes-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.notes-summary { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.notes h3 { margin: 0 0 6px; font: 600 11.5px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; gap: 9px; font-size: 13.5px; line-height: 1.4; }
.steps li::before {
  content: ""; flex: none; width: 14px; height: 14px; margin-top: 2px;
  border: 1.5px solid var(--accent); border-radius: 4px; background: var(--surface);
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd.unknown { color: var(--faint); font-weight: 400; }
.notes-pending { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Animations */
/* Rep phone (/rep) */
.phone {
  margin: 12px 12px 4px; padding: 14px 16px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.phone[data-state="ringing"] { border-color: var(--green); background: var(--green-soft); animation: ring-pulse 1.2s ease-in-out infinite; }
.phone[data-state="ringing"] .phone-state strong { font: 700 18px var(--head); color: var(--green-ink); }
.phone[data-state="ringing"] .ph-btn { height: 46px; font-size: 15px; }
.phone[data-state="active"] { border-color: var(--green-line); background: var(--green-soft); }
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phone-head h2 { font-size: 15px; }
.phone-head .dd-btn {
  font: 500 13px var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px;
}
.phone-state { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.phone-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.phone[data-state="connecting"] .phone-state i { background: var(--amber); animation: blink 1s steps(2) infinite; }
.phone[data-state="ready"] .phone-state i,
.phone[data-state="active"] .phone-state i { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.phone[data-state="ringing"] .phone-state i { background: var(--green); animation: blink .6s steps(2) infinite; }
.phone-detail { margin: 2px 0 0 17px; min-height: 1.5em; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.phone-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ph-btn {
  flex: 1 1 auto; height: 38px; padding: 0 14px;
  font: 600 14px var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.ph-btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.ph-btn.answer { color: var(--on-status); background: var(--green-solid); border-color: var(--green-solid); }
.ph-btn.decline { color: var(--on-status); background: var(--red-solid); border-color: var(--red-solid); }
.ph-btn.on { background: var(--amber-soft); border-color: var(--amber); }
.ph-btn:active { transform: translateY(1px); }
.phone-note { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
/* The pop-out phone window (/phone) */
.phone-window main { max-width: 420px; margin: 0 auto; padding: 12px 4px; }
.phone-window .phone-note { margin: 4px 16px; }
/* The call card (callcard.js): who the caller may be, on the monitor and the pop-out phone */
.callcard { margin: 0 22px 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.phone-window .callcard { margin: 0 12px 12px; }
.cc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cc-state { font-size: 12.5px; font-weight: 600; color: var(--amber-ink); }
.cc-state.ok { color: var(--green-ink); }
.cc-confirmed { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green-ink); }
.cc-matches { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cc-match { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cc-match.maybe { border-style: dashed; }
.cc-match.chosen { border-color: var(--green-line); box-shadow: inset 3px 0 0 var(--green); }
.cc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cc-top strong { font: 600 15px var(--head); }
.cc-kind { padding: 2px 8px; border-radius: 999px; font: 600 11px var(--body); text-transform: uppercase; letter-spacing: .04em; background: var(--grey-soft); color: var(--ink-2); }
.cc-kind.lead { background: var(--accent-soft); color: var(--accent-ink); }
.cc-kind.appointment { background: var(--cyan-soft); color: var(--cyan-ink); }
.cc-kind.ro { background: var(--amber-soft); color: var(--amber-ink); }
.cc-why { font-size: 12px; color: var(--muted); }
.cc-meta { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.cc-clock { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.cc-clock.silent { color: var(--red-ink); font-weight: 600; }
.cc-declined { margin: 4px 0 0; font-size: 12.5px; color: var(--amber-ink); }
.cc-btn { flex: none; white-space: nowrap; margin-top: 8px; height: 32px; padding: 0 12px; font: 600 13px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.cc-btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.cc-btn:disabled { opacity: .55; cursor: default; }
.cc-confirmed .cc-btn { margin-top: 0; }
.cc-error { margin: 6px 0 0; font-size: 13px; color: var(--red-ink); }
.cc-error:empty { display: none; }
.cc-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.cc-section h3 { margin: 0 0 6px; font: 600 11.5px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cc-dms + .cc-dms { margin-top: 8px; }
.cc-dms.chosen { padding-left: 10px; box-shadow: inset 3px 0 0 var(--green); }
.cc-vehicle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; padding: 6px 0; }
.cc-vehicle + .cc-vehicle { border-top: 1px dashed var(--border); }
.cc-vlabel { display: flex; flex-direction: column; font-size: 13.5px; }
.cc-vlabel code { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.cc-vehicle .cc-btn { margin-top: 0; }
.cc-recalls { flex-basis: 100%; }
.cc-recall-head { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.cc-recall-head.danger { color: var(--red-ink); }
.cc-recall { margin: 4px 0 0; font-size: 13px; line-height: 1.45; }
.cc-appraisal { display: block; color: inherit; text-decoration: none; }
.cc-appraisal:hover { color: var(--accent-ink); text-decoration: underline; }
.cc-link { display: inline-flex; align-items: center; text-decoration: none; }
/* A call ringing in the pop-out or another tab, shown on every other page */
.phone-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: 360px;
  padding: 12px 12px 12px 16px; border: 1px solid var(--green); border-radius: 12px;
  background: var(--green-soft); box-shadow: var(--shadow); animation: ring-pulse 1.2s ease-in-out infinite;
}
.phone-toast .ico { flex: none; width: 20px; height: 20px; color: var(--green-ink); }
.phone-toast-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.phone-toast-text strong { color: var(--green-ink); font: 700 15px var(--head); }
.phone-toast .ph-btn { flex: none; }
@keyframes ring-pulse { 50% { box-shadow: 0 0 0 8px var(--green-glow); } }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes slide-down { from { transform: translateY(-100%); opacity: 0; } }
@keyframes card-in {
  0% { opacity: 0; transform: translateX(24px) scale(.96); box-shadow: 0 0 0 0 var(--accent-glow); }
  60% { opacity: 1; box-shadow: 0 0 0 8px transparent; }
  100% { transform: none; }
}
@keyframes coach-in { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } }
@keyframes coach-glow { 0% { box-shadow: 0 0 0 4px var(--accent-glow), 0 12px 32px var(--shadow-color); } }
@keyframes flash { 0% { box-shadow: 0 0 0 6px var(--accent-glow); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* OS Home */
.home { flex: 1; padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 22px; }
.home > * { width: 100%; max-width: 1240px; margin-left: auto; margin-right: auto; }
.home-date { margin: 0; font-size: 13px; color: var(--muted); }
.home-greeting { margin-top: 2px; font-size: 30px; font-weight: 800; letter-spacing: -.03em; text-transform: none; color: var(--ink); }
.home-modules { display: flex; flex-direction: column; gap: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.tile h3 { margin: 0; font: 700 17px var(--head); letter-spacing: -.01em; }
.tile p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.tile-icon .ico { width: 21px; height: 21px; }
.tile-live { display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.tile-live::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
.tile-head { display: flex; align-items: center; gap: 14px; }
.tile-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 600; color: var(--green-ink); background: var(--green-soft);
  padding: 3px 10px; border-radius: 999px;
}
.tile-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stats dt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 4px 0 0; font: 700 30px var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile-actions { display: flex; gap: 10px; margin-top: auto; }
.tile-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0;
  padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 13px;
}
.tile-line strong { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.tile-line span { display: inline-flex; align-items: center; gap: 6px; }
.tile-line .ico { width: 15px; height: 15px; color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font: 600 14px var(--body); text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); }
.tile-next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile-next { position: relative; padding: 18px; background: var(--surface-2); box-shadow: none; }
.tile-next .tile-icon { background: var(--grey-soft); color: var(--muted); margin-bottom: 12px; }
.tile-next h3 { color: var(--ink-2); }
.tile-soon {
  position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px;
}
.tile-open { background: var(--surface); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.tile-open:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tile-open .tile-icon { background: var(--accent-soft); color: var(--accent-ink); }
.tile-open .tile-soon { color: var(--accent-ink); }
.home-recent { padding-bottom: 6px; }
.panel-link { font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.recent-list { list-style: none; margin: 0; padding: 0 10px 8px; }
.recent { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-top: 1px solid var(--border); }
.recent:first-child { border-top: 0; }
.recent-kind {
  flex: none; min-width: 96px; text-align: center; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.recent-kind.kind-callback { background: var(--cyan-soft); color: var(--cyan-ink); }
.recent-kind.kind-purchase { background: var(--green-soft); color: var(--green-ink); }
.recent-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recent-body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: 12.5px; color: var(--muted); }
.recent-at { flex: none; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Tablet: commitments drop under the transcript */
@media (max-width: 1200px) {
  .layout { flex: 1 0 auto; grid-template-columns: 260px minmax(0, 1fr); }
  .panel { min-height: auto; }
  .detail-panel { overflow: visible; }
  .commit-panel { grid-column: 1 / -1; }
  .commit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* Narrow: the rail becomes a top bar: the logo, the switcher as a small line under it, then the module's pages in a
   row that scrolls sideways. The collapse choice is for computers only. */
@media (max-width: 900px) {
  /* The rail stacks on top: it keeps its own height and the page takes the rest, even on a short page. */
  .os { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail {
    position: static; height: auto; gap: 4px;
    padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .os-brand { padding: 0 4px; }
  .os-mark { width: 32px; height: 32px; }
  .os-name small, .rail-collapse { display: none; }
  .switch { margin: 0; align-self: flex-start; }
  .switch-btn { width: auto; height: 30px; gap: 7px; padding: 0 6px; border: 0; background: none; font-size: 13px; color: var(--ink-2); }
  .switch-btn .ico { width: 16px; height: 16px; }
  .switch-menu { width: min(360px, calc(100vw - 24px)); }
  .rail-scroll { flex: none; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .rail-link { flex: none; height: 34px; padding: 0 10px; font-size: 13px; }
  .rail-link .ico { width: 16px; height: 16px; }
  /* The header wraps: the title and the buttons on the first line, the status pills and the clock on the second, so
     the title is never squeezed. */
  .topbar { position: static; flex-wrap: wrap; gap: 10px 12px; }
  .crumbs { flex: 1 1 0; }
  .pills { order: 3; flex: 1 1 calc(100% - 88px); min-width: 0; margin-left: 0; }
  .clock { order: 4; }
  .store-pick { order: 5; flex: 1 1 100%; }
  .home { padding: 20px 16px 24px; }
  .home-modules { grid-template-columns: minmax(0, 1fr); }
}

/* Phone */
@media (max-width: 720px) {
  .os-name strong { font-size: 14px; }
  .topbar { padding: 12px 16px; min-height: 0; }
  .page-title { font-size: 18px; }
  .pill { height: 26px; padding: 0 10px; font-size: 12px; }
  .banner { padding: 10px 16px; font-size: 14px; }
  .phone-toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  /* The confirmed customer keeps one line; Open profile and Change move under it. */
  .cc-confirmed { flex-wrap: wrap; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .conv-list { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px; scroll-snap-type: x mandatory; }
  .conv { flex: 0 0 210px; border-color: var(--border); scroll-snap-align: start; }
  .conv + .conv { margin-top: 0; }
  .detail-head { flex-direction: column; padding: 16px; }
  .detail-title h1 { font-size: 22px; }
  .conv-id code { display: block; width: fit-content; margin-top: 4px; font-size: 10.5px; }
  .btn-transfer { width: 100%; justify-content: center; }
  .timeline { padding: 12px 16px; }
  .tl-node { min-width: 0; }
  .tl-arrow { width: 18px; margin: 0 2px; }
  .transcript-head { padding: 14px 16px 4px; }
  .transcript { padding: 8px 16px 16px; }
  .bubble-row { max-width: 90%; }
  .commit-list { display: flex; }
  .coach { margin: 0 10px 10px; padding: 14px 16px 12px; }
  .coach-line { font-size: 19px; }
  .notes { margin: 12px 12px 4px; }
  .home-greeting { font-size: 25px; }
  /* One number per row, label left and number right, so no label is cut short. */
  .stats { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .stats div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; }
  .stats dd { margin: 0; font-size: 22px; }
  .tile-next-grid { grid-template-columns: minmax(0, 1fr); }
  .recent { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; }
  .recent-kind { min-width: 0; justify-self: start; }
  .recent-at { justify-self: end; align-self: center; }
  .recent-body { grid-column: 1 / -1; grid-row: 2; }
}

/* Sign in, forgot password, choose a password */
.auth { display: grid; grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 36px 44px; color: var(--hero-ink);
  background:
    radial-gradient(90% 70% at 0% 0%, var(--hero-glow), transparent 60%),
    var(--hero);
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--hero-line) 1px, transparent 1px), linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand-top { display: flex; align-items: center; gap: 12px; }
.auth-brand .os-name small { color: var(--hero-accent); }
.auth-pitch { max-width: 460px; margin: auto 0; }
.auth-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--hero-green);
}
.auth-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-glow); animation: pulse 1.8s ease-in-out infinite; }
.auth-headline { font: 700 34px/1.18 var(--head); letter-spacing: -.025em; text-transform: none; color: var(--hero-ink); }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 12px; font-size: 15px; color: var(--hero-ink); line-height: 1.45; }
.auth-points li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px;
  background: var(--hero-line) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9a6b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; animation: rise .35s ease-out; }
.auth-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin: 8px 0 26px; color: var(--muted); font-size: 14.5px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field .dd-btn {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font: 15px var(--body); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field .dd-btn:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
.field-hint { font-size: 12px; color: var(--muted); }

/* The dropdown (select.js): a button over the hidden native select, and a panel of options. White in light mode. */
.dd { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.field .dd { display: flex; }
/* A filter in a panel's header sits on one line with its label, at the height of the header's buttons. */
.panel-head .field { flex-direction: row; align-items: center; gap: 8px; }
.panel-head .field .dd-btn, .panel-head .field input { height: 36px; font-size: 14px; }
.dd-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn {
  flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  display: inline-grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  font: 500 14px var(--body); color: var(--ink); text-align: left; cursor: pointer; white-space: nowrap;
}
.dd-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.dd-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
.dd-btn:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.dd-text, .dd-sizer { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dd-sizer { display: grid; height: 0; visibility: hidden; }
.dd-sizer > span { grid-area: 1 / 1; }
.dd-caret { grid-area: 1 / 2; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.dd-btn[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
.dd-panel {
  position: fixed; z-index: 1000; margin: 0; padding: 5px; list-style: none; overflow-y: auto; max-width: calc(100vw - 16px);
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 12px 32px var(--shadow-color); outline: none; font: 14px var(--body);
}
.dd-panel li { padding: 8px 30px 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; position: relative; }
.dd-panel li.dd-active { background: var(--surface-2); }
.dd-panel li[aria-selected="true"] { font-weight: 600; color: var(--accent-ink); }
.dd-panel li[aria-selected="true"]::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 9px; height: 5px; margin-top: -4px;
  border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
.dd-panel li[aria-disabled] { color: var(--faint); cursor: default; }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.pw-eye:hover { background: var(--surface-2); color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); }
.pw-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye .eye-shut, .pw-eye[aria-pressed="true"] .eye-open { display: none; }
.pw-eye[aria-pressed="true"] .eye-shut { display: inline; }
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--red-soft); color: var(--red-ink); font-size: 13.5px; border: 1px solid var(--red-line);
}
.auth-submit { height: 46px; margin-top: 4px; font-size: 15px; border: 0; cursor: pointer; width: 100%; }
.auth-submit:disabled { opacity: .7; cursor: default; }
.auth-link {
  align-self: center; margin-top: 18px; padding: 4px;
  border: 0; background: none; cursor: pointer;
  font: 600 13.5px var(--body); color: var(--accent-ink); text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-alt { height: 46px; margin-top: 10px; width: 100%; font-size: 15px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.auth-skip { margin-top: 6px; color: var(--muted); font-weight: 500; }
.auth-done { padding: 16px; border-radius: 12px; background: var(--green-soft); border: 1px solid var(--green-line); }
.auth-done strong { display: block; font-size: 15px; color: var(--green-ink); }
.auth-done p { margin: 4px 0 0; color: var(--ink-2); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { padding: 20px; gap: 0; }
  .auth-pitch { display: none; }
  .auth-main { place-items: start center; padding: 32px 20px; }
}

/* The header's round icon buttons (Help, the bell) */
.hdr-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.hdr-btn:hover { background: var(--surface-2); color: var(--ink); }
.hdr-btn .ico { width: 18px; height: 18px; }

/* Help in the header (shell.js helpPanel) */
.help { position: relative; }
.help-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 320px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px var(--shadow-soft-color);
}
.help-panel h2 { margin: 0; padding: 8px 10px 6px; font: 700 15px var(--head); color: var(--ink); text-transform: none; letter-spacing: 0; }
.help-link {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.help-link:hover { background: var(--surface-2); }
.help-link .ico, .help-contact .ico { width: 18px; height: 18px; flex: none; color: var(--accent-ink); }
.help-link span { display: flex; flex-direction: column; min-width: 0; }
.help-link strong { font-size: 13.5px; font-weight: 600; }
.help-link small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.help-contact {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 0; padding: 10px; border-top: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2);
}
.help-contact a { color: var(--accent-ink); font-weight: 600; }

/* Profile pill and menu in the header */
.me { position: relative; }
.me-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px 0 4px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font: 600 13px var(--body); color: var(--ink); cursor: pointer;
}
.me-btn:hover { background: var(--surface-2); }
.me-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font: 700 11.5px var(--head);
}
.me-chev { width: 14px; height: 14px; margin-left: -4px; color: var(--muted); }
.me-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 264px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px var(--shadow-soft-color);
}
.me-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.me-who small { display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }
.me-who strong { display: block; font-size: 13.5px; }
.me-who span { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.me-who .me-role { margin-top: 6px; font-weight: 600; color: var(--accent-ink); }
.me-item {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  border: 0; background: none; font: 500 13.5px var(--body); color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left;
}
.me-item:hover { background: var(--surface-2); color: var(--ink); }
.me-item .ico { width: 16px; height: 16px; }
/* Appearance: Light, Dark and System side by side (shell.js themeChoice). */
.me-theme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 4px 0; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.me-theme button {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 6px;
  border: 0; border-radius: 8px; background: none; font: 500 12.5px var(--body); color: var(--ink-2); cursor: pointer;
}
.me-theme button:hover { color: var(--ink); }
.me-theme button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px var(--shadow-soft-color); }
.me-theme .ico { width: 15px; height: 15px; flex: none; }

/* Team (admins) */
.team { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.team .panel { overflow: hidden; }
.team-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.team-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--border); }
.team-table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.team-table tr:last-child td { border-bottom: 0; }
.team-name strong { display: block; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.active { background: var(--green-soft); color: var(--green-ink); }
.badge.pending { background: var(--amber-soft); color: var(--amber-ink); }
.badge.off { background: var(--grey-soft); color: var(--muted); }
/* Deactivating someone on Team: one box per store, a pick per kind of open work. */
.off-stores { display: flex; flex-direction: column; gap: 12px; }
.off-store { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.off-store legend { padding: 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Out of office (web/coverage.js), on Settings and in Team's dialog. */
.cov { display: flex; flex-direction: column; gap: 12px; }
.cov-h { margin: 6px 0 0; font: 700 14px var(--head); color: var(--ink); text-transform: none; letter-spacing: 0; }
.cov-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cov-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.cov-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cov-text strong { color: var(--ink); }
.cov-text > span { font-size: 12.5px; color: var(--muted); }
.cov-none { margin: 0; font-size: 13.5px; color: var(--muted); }
.cov-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.cov-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cov-form .btn { align-self: flex-start; }
@media (max-width: 420px) {
  .cov-dates { grid-template-columns: minmax(0, 1fr); }
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; cursor: pointer; }
.team-form { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.team-form .auth-submit { margin-top: 2px; }
.team-link { margin: 0 18px 18px; padding: 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.team-link strong { display: block; font-size: 13.5px; }
.team-link p { margin: 4px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.team-link-row { display: flex; gap: 8px; }
.team-link-row input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font: 12px var(--mono); color: var(--ink-2); background: var(--surface); }
.team-ok { margin: 0 18px 18px; }
.team-email { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.team-roles { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }.team-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.team-stores { list-style: none; margin: 0; padding: 0 6px 10px; }
.team-store { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; min-width: 0; }
.team-store .team-name { min-width: 0; }
.team-2fa { padding: 4px 6px 12px; }
.team-2fa .auth-error { margin: 4px 12px 0; }
.team-2fa-on { display: block; margin-top: 3px; font-size: 12px; color: var(--green-ink); }
/* Setting up an authenticator (web/two-step.js), on the code page and in Settings. The QR code keeps a white
   background in dark mode so phone cameras can read it. */
.ts-box { display: flex; flex-direction: column; gap: 14px; }
.ts-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.ts-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.ts-qr { width: 176px; height: 176px; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.ts-key-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ts-key-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.ts-key { font: 500 13.5px var(--mono); color: var(--ink); word-spacing: 2px; overflow-wrap: anywhere; user-select: all; }
.ts-form { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.ts-form input { font: 500 18px var(--mono); letter-spacing: .2em; }
.ts-done { margin: 0; font-weight: 600; color: var(--green-ink); }
.ts-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.ts-codes { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px 20px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 10px; background: var(--surface-2); font: 500 13.5px var(--mono); color: var(--ink); }
.ts-row { display: flex; flex-wrap: wrap; gap: 8px; }
#verify-code { font-family: var(--mono); letter-spacing: .12em; }
@media (max-width: 420px) {
  .ts-codes { grid-template-columns: minmax(0, max-content); }
}
.roles-dlg {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px var(--shadow-color);
}
.roles-dlg::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.roles-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.roles-head h2 { margin: 0; font: 700 20px var(--head); letter-spacing: -.02em; text-transform: none; color: var(--ink); }
.roles-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.roles-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.roles-x:hover { background: var(--surface-2); color: var(--ink); }
.roles-list { margin: 0; padding: 4px 20px 12px; border: 0; display: flex; flex-direction: column; gap: 4px; }
.roles-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.roles-item:hover { background: var(--surface-2); }
.roles-item input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.roles-item strong { display: block; font-size: 14px; }
.roles-item span { display: block; font-size: 12.5px; color: var(--muted); }
.roles-dlg .auth-error { margin: 0 20px 12px; }
.roles-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--border); }
.team-exceptions { list-style: none; margin: 0; padding: 0 20px 4px; display: flex; flex-direction: column; gap: 6px; }
.team-exceptions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.team-exceptions li > div { min-width: 0; }
.team-exceptions strong { display: block; font-size: 13.5px; }
.team-exceptions span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.team-exceptions .btn { flex: none; }
.team-roles.team-exception-allow { color: var(--green-ink); }
.team-roles.team-exception-deny { color: var(--amber-ink); }

@media (max-width: 1000px) {
  .team { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}
/* On a phone each person is a card: name, email, role and roles, status, then the buttons. */
@media (max-width: 720px) {
  .team-table thead { display: none; }
  .team-table, .team-table tbody, .team-table tr, .team-table td { display: block; }
  .team-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .team-table tr:last-child { border-bottom: 0; }
  .team-table td { padding: 2px 0; border-bottom: 0; overflow-wrap: anywhere; }
  .team-actions { justify-content: flex-start; margin-top: 8px; }
}
@media (max-width: 720px) {
  .help { display: none; }
  .me-btn .me-label, .me-chev { display: none; }
  .me-btn { padding: 0 4px; }
  /* The coach card is sticky on wide screens; on a phone the page scrolls and a sticky card covers the call chain. */
  .coach { position: static; }
}

/* "Useful?" under an AI result (ai-feedback.js). */
.aif { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; }
.aif-row, .aif-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.aif-q, .aif-done { color: var(--muted); white-space: normal; min-width: 0; }
.aif .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.aif-note { display: flex; gap: 6px; min-width: 0; }
.aif-note input { flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.aif-note input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
.aif-error { margin: 0; color: var(--red-ink); white-space: normal; }
