/* Base tokens shared by the desk, Messenger, Help Center and phone line.
   Pages may override them (chat.css does); desk.css adds desk-only tokens. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --quiet: #8a8a8a;
  --page: #f7f7f6;
  --surface: #ffffff;
  --inset: #f7f7f6;
  --subnav: #f7f7f6;
  --hover: #f0f0ef;
  --selected: #ebebea;
  --line: #e6e6e4;
  --soft-line: #efefed;
  --control-line: #d9d9d6;
  --control-line-hover: #c4c4c0;
  --accent: #1f5eff;
  --accent-hover: #1747c7;
  --accent-soft: #eef3ff;
  --accent-line: #d4e0ff;
  --focus: #1f5eff;
  --focus-ring: color-mix(in srgb, var(--focus) 22%, transparent);
  --success-ink: #137a3f;
  --success-soft: #e7f6ec;
  --warning-ink: #9a5b00;
  --warning-soft: #fff4dc;
  --danger-ink: #c4262e;
  --danger-soft: #fdecec;
  --rail: #f2f2f0;
  --mark: #e8eeff;
  --shadow: rgb(0 0 0 / .08);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
  --shadow-pop: 0 8px 28px rgb(0 0 0 / .12), 0 0 0 1px rgb(0 0 0 / .04);
  --shadow-dialog: 0 24px 64px rgb(0 0 0 / .18);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .63; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, p { margin: 0; }

/* Primary buttons use --primary-fill when a page defines it (the desk: black),
   otherwise the page accent (Messenger and Help Center brand color). */
.button {
  min-height: 32px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md, 8px);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button:hover { background: var(--hover); border-color: var(--control-line-hover, var(--control-line)); }
.button.primary { background: var(--primary-fill, var(--accent)); border-color: var(--primary-fill, var(--accent)); color: var(--primary-text, #fff); }
.button.primary:hover { background: var(--primary-hover, var(--accent-hover)); border-color: var(--primary-hover, var(--accent-hover)); }
.icon-button { width: 32px; min-height: 32px; padding: 0; }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  mask: url('/icons.png') var(--icon-x, 0px) 0 / 324px 18px no-repeat;
  vertical-align: middle;
}
.i-people { --icon-x: -18px; }
.i-code { --icon-x: -36px; }
.i-external { --icon-x: -54px; }
.i-sort { --icon-x: -72px; }
.i-search { --icon-x: -90px; }
.i-check { --icon-x: -108px; }
.i-send { --icon-x: -126px; }
.i-copy { --icon-x: -144px; }
.i-close { --icon-x: -162px; }
.i-chat { --icon-x: -180px; }
.i-right { --icon-x: -198px; }
.i-left { --icon-x: -216px; }
.i-reopen { --icon-x: -234px; }
.i-user { --icon-x: -252px; }
.i-unassigned { --icon-x: -270px; }
.i-clock { --icon-x: -288px; }
.i-panel { --icon-x: -306px; }
.i-report, .i-book { mask: none; background: none; position: relative; }
.i-report::before {
  content: ''; position: absolute; inset: 3px 2px 2px; background: currentColor;
  clip-path: polygon(0 62%, 23% 62%, 23% 100%, 39% 100%, 39% 34%, 62% 34%, 62% 100%, 76% 100%, 76% 0, 100% 0, 100% 100%, 0 100%);
}
.i-book::before { content: ''; position: absolute; inset: 2px 2px 2px 3px; border: 1.5px solid currentColor; border-radius: 2px; }
.i-book::after { content: ''; position: absolute; left: 6px; top: 6px; width: 6px; height: 1px; background: currentColor; box-shadow: 0 3px currentColor; }

.brand-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  background: url('/bettercom-mark.png') center / contain no-repeat;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: var(--avatar-size, 38px);
  height: var(--avatar-size, 38px);
  border-radius: 50%;
  background: #e6eaf2;
  color: #44536e;
  font-size: var(--avatar-font, 13px);
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  user-select: none;
}
.avatar.tone-1 { background: #e9e4f2; color: #614b85; }
.avatar.tone-2 { background: #efe4ea; color: #764d67; }
.avatar.tone-3 { background: #e1ecf3; color: #375e77; }
.avatar.tone-4 { background: #f1e4de; color: #805445; }
.avatar.tone-5 { background: #f1ebdd; color: #755c2f; }
.avatar.agent-avatar { background: var(--mark); color: var(--accent-hover); }
.help-font-serif { font-family: Georgia, "Times New Roman", serif; }
.help-font-humanist { font-family: Verdana, Geneva, sans-serif; }

.messenger-call {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.messenger-call p { margin: 0; }
.messenger-call-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.messenger-call video { display: block; max-width: 100%; max-height: 26vh; border-radius: 8px; background: #12141c; }
.call-recording-controls { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
