/* ==========================================================================
   MiniBytez CRM
   MiniBytez product demonstration: the standalone CRM platform.

   Visual language: white-first enterprise UI on a cool light ground, navy ink,
   a restrained teal accent, ruled panels, tables where tables belong, drawers
   for quick detail. No gradients, no glow, no glass. Colour carries meaning:
   status, risk and the one AI mark.
   This stylesheet is owned by this product alone and is shared with nothing.
   ========================================================================== */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --ink: #0f1b2d;
  --ink-2: #364255;
  --muted: #5f6b7e;
  --faint: #8a94a5;
  --line: #e1e5eb;
  --line-2: #edf0f4;
  --navy: #13233f;
  --navy-2: #22365a;

  --accent: #0f766e;
  --accent-2: #0b5f58;
  --accent-bg: #e7f3f1;
  --accent-line: #bcdcd6;

  --blue: #2b5cae;   --blue-bg: #eaf0fa;
  --green: #1d7348;  --green-bg: #e6f3eb;
  --amber: #9a5800;  --amber-bg: #fcf1df;  --amber-line: #efd3a4;
  --red: #b0291e;    --red-bg: #fcebe9;    --red-line: #f1c4be;
  --violet: #634aa8; --violet-bg: #f0ecf9;
  --slate: #475569;  --slate-bg: #edf0f4;

  --ai: #2f3d68;
  --ai-bg: #f4f6fb;
  --ai-line: #d8deee;
  --ai-chip: #e3e8f5;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-pop: 0 12px 32px rgba(15, 27, 45, 0.14), 0 2px 6px rgba(15, 27, 45, 0.06);

  --demo-h: 32px;
  --top-h: 56px;
  --side-w: 236px;

  --ff: "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--ff);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
details > summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; }
.skip:focus { left: 8px; top: 8px; }
.ic { flex: none; display: block; }

/* ------------------------------------------------------------------ demo bar */
.demobar {
  position: sticky; top: 0; z-index: 40;
  height: var(--demo-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  white-space: nowrap;
}
.demobar strong { color: #fff; font-weight: 600; }
.demobar__spacer { flex: 1; }
.demobar button, .demobar a {
  height: 22px; padding: 0 9px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.demobar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.demobar a:hover, .demobar button:hover { background: rgba(255, 255, 255, 0.16); text-decoration: none; }
.demobar :focus-visible { outline-color: #fff; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--demo-h)); }
.stage { min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; outline: none; }

.side {
  position: sticky; top: var(--demo-h);
  height: calc(100vh - var(--demo-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 0 10px 12px;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 16px 8px 14px; }
.side__brand div strong { display: block; font-size: 14.5px; color: var(--navy); letter-spacing: -0.01em; }
.side__brand div span { display: block; font-size: 11.5px; color: var(--muted); }
.mark { width: 28px; height: 28px; border-radius: 6px; background: var(--navy); display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 7px 6px; flex: none; }
.mark i { display: block; width: 4px; border-radius: 1px; background: #fff; }
.mark i:nth-child(1) { height: 7px; opacity: 0.7; }
.mark i:nth-child(2) { height: 14px; background: #5fc2b5; }
.mark i:nth-child(3) { height: 10px; opacity: 0.85; }
.side__group { padding-top: 10px; }
.side__group + .side__group { border-top: 1px solid var(--line-2); margin-top: 8px; }
.side__label { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: 5px;
  color: var(--ink-2); font-size: 13.5px;
}
.side a .ic { color: var(--faint); }
.side a:hover { background: var(--surface-3); text-decoration: none; }
.side a[aria-current="page"] { background: var(--accent-bg); color: var(--accent-2); font-weight: 600; }
.side a[aria-current="page"] .ic { color: var(--accent); }
.side__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__n { font-size: 11px; font-weight: 600; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.side__n--bad { background: var(--red-bg); color: var(--red); }
.side__n--amber { background: var(--amber-bg); color: var(--amber); }
.side__foot { margin-top: auto; padding: 16px 10px 4px; font-size: 11.5px; color: var(--faint); }
.scrim { display: none; }

.top {
  position: sticky; top: var(--demo-h); z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.top__spacer { flex: 1; }
.top .top__menu { display: none; }
.top__item { position: relative; }

.omni { position: relative; display: flex; align-items: center; gap: 8px; width: min(460px, 100%); height: 36px; padding: 0 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); }
.omni:focus-within { background: #fff; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-bg); }
.omni input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); outline: none; }
.omni input::placeholder { color: var(--faint); }
.omni input::-webkit-search-cancel-button { display: none; }
.omni kbd { font: 11px var(--ff-mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: #fff; }
.omni__results { position: absolute; top: 42px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 420px; overflow-y: auto; z-index: 50; }
.omni__group { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); padding: 8px 8px 4px; }
.omni__results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: none; border-radius: 5px; cursor: pointer; }
.omni__results button strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.omni__results button span { font-size: 12px; color: var(--muted); }
.omni__results button:hover, .omni__results button[aria-selected="true"] { background: var(--surface-3); }
.omni__empty { padding: 12px 8px; color: var(--muted); font-size: 13px; }

.me { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.me:hover { background: var(--surface-3); }
.me__text strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.me__text small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.me .ic { color: var(--faint); }

.menu { position: absolute; top: 44px; left: 0; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; }
.menu--right { left: auto; right: 0; }
.menu--wide { width: 360px; }
.menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; }
.menu > button:hover { background: var(--surface-3); }
.menu > button .ic { color: var(--muted); }
.menu > button > span { flex: 1; min-width: 0; }
.menu strong { display: block; font-size: 13px; font-weight: 600; }
.menu small { display: block; font-size: 12px; color: var(--muted); }
.menu__label { font-size: 11.5px; color: var(--muted); padding: 6px 10px 8px; }
.menu__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu__empty { padding: 16px 10px; color: var(--muted); font-size: 13px; }
.menu > button.unread strong { color: var(--ink); }
.menu > button .dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; align-self: flex-start; margin-top: 6px; }
.menu > button.unread .dot { background: var(--accent); }
.menu > button:not(.unread) strong { font-weight: 500; color: var(--ink-2); }

.badge { position: absolute; top: 1px; right: -3px; min-width: 14px; height: 14px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid #fff; box-sizing: content-box; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: #cfd5de; text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger:hover { background: #93211a; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn--xs { height: 24px; padding: 0 8px; font-size: 12px; }
.btn .ic { color: currentColor; }
.iconbtn { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 6px; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--surface-3); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; }
.linkbtn:hover { text-decoration: underline; }

.field {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid #d3d9e1; border-radius: 5px; background: #fff;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
textarea.field { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
select.field { padding-right: 28px; }
.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.control { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font: inherit; font-size: 13px; color: var(--ink); }
.control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 9px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 30px; width: 240px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: none; font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 27, 45, 0.1); }
.seg__n { font-size: 11px; color: var(--muted); font-weight: 500; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .n { font-size: 11px; color: var(--muted); background: var(--surface-3); border-radius: 8px; padding: 0 6px; font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip:hover { border-color: #cbd2dc; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }

/* ------------------------------------------------------------------ status marks */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill--slate { background: var(--slate-bg); color: var(--slate); }
.pill--blue { background: var(--blue-bg); color: var(--blue); }
.pill--teal { background: var(--accent-bg); color: var(--accent-2); }
.pill--green { background: var(--green-bg); color: var(--green); }
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.pill--red { background: var(--red-bg); color: var(--red); }
.pill--muted { background: var(--surface-3); color: var(--muted); }
.pill--violet { background: var(--violet-bg); color: var(--violet); }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.prio__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.prio__bars i { width: 3px; background: var(--line); border-radius: 1px; }
.prio__bars i:nth-child(1) { height: 5px; }
.prio__bars i:nth-child(2) { height: 8px; }
.prio__bars i:nth-child(3) { height: 11px; }
.prio--red .prio__bars i.on { background: var(--red); }
.prio--amber .prio__bars i.on { background: #c98a1d; }
.prio--muted .prio__bars i.on { background: var(--faint); }

.risk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.risk i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); }
.risk--red { color: var(--red); } .risk--red i { background: var(--red); }
.risk--amber { color: var(--amber); } .risk--amber i { background: #d08a1c; }
.risk--green { color: var(--green); } .risk--green i { background: #3e9a6a; }

.attn { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; }
.attn i { width: 9px; height: 9px; border-radius: 50%; }
.attn--high i { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.attn--med i { background: #d08a1c; box-shadow: 0 0 0 3px var(--amber-bg); }
.attn--none::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #cfd5de; }

.score { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; }
.score__track { width: 46px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.score__track i { display: block; height: 100%; border-radius: 3px; }
.score--hot .score__track i { background: var(--accent); }
.score--warm .score__track i { background: #5aa89e; }
.score--cool .score__track i { background: #a9b3c1; }
.score__n { font-weight: 600; color: var(--ink); min-width: 18px; }
.score__band { color: var(--muted); font-size: 12px; }
.score--hot .score__band { color: var(--accent-2); font-weight: 600; }
.score--compact .score__track { width: 34px; }

.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; flex: none; letter-spacing: 0.01em; }
.av--xs { width: 20px; height: 20px; font-size: 9.5px; }
.av--sm { width: 28px; height: 28px; font-size: 11px; }
.av--md { width: 36px; height: 36px; font-size: 13px; }
.av--lg { width: 52px; height: 52px; font-size: 18px; }
.av--a { background: #e2efec; color: #0b5f58; }
.av--b { background: #e5ebf7; color: #2b4f95; }
.av--c { background: #f3e9dc; color: #7c4b0d; }
.av--d { background: #ece7f6; color: #533b91; }
.av--e { background: #e8edf2; color: #37475d; }
.av--f { background: #f5e6e6; color: #8a2d26; }
.who { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; }

.due { font-size: 12.5px; white-space: nowrap; color: var(--ink-2); }
.due--bad { color: var(--red); font-weight: 500; }
.due--warn { color: var(--amber); font-weight: 500; }
.due--muted { color: var(--faint); }

/* ------------------------------------------------------------------ AI */
.aimark {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px;
  border-radius: 3px; border: 1px solid #ccd3ea; background: var(--ai-chip);
  color: var(--ai); font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap;
}
.aimark--auto { background: var(--violet-bg); border-color: #d9d0f0; color: var(--violet); letter-spacing: 0.02em; }
.aiblock { background: var(--ai-bg); border: 1px solid var(--ai-line); border-radius: var(--radius); padding: 14px 16px; }
.aiblock__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.aiblock__head h3 { font-size: 13.5px; color: var(--navy); }
.aiblock__body { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.aiblock__body p + p { margin-top: 6px; }
.aiblock--plain { background: #fff; }
.basis { margin-top: 10px; font-size: 12px; color: var(--muted); }
.basis summary { color: var(--ai); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.basis summary::-webkit-details-marker { display: none; }
.basis summary::after { content: "+"; font-weight: 600; margin-left: 2px; }
.basis[open] summary::after { content: "\2212"; }
.basis ul { margin-top: 6px; padding-left: 16px; list-style: disc; }
.basis li + li { margin-top: 2px; }
.basis p { margin-top: 6px; }

.rec { background: #fff; border: 1px solid var(--ai-line); border-left: 3px solid #d59a2c; border-radius: var(--radius); padding: 14px 16px; }
.rec--decided { border-left-color: var(--line); background: var(--surface-2); }
.rec__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec__meta { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.rec__title { font-size: 14.5px; color: var(--navy); margin-top: 8px; line-height: 1.4; }
.rec__record { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.rec__why { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.rec__actions { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--surface-2); }
.rec__actions li { display: flex; gap: 10px; padding: 9px 10px; font-size: 13px; }
.rec__actions li + li { border-top: 1px solid var(--line-2); }
.rec__actions strong { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.rec__actions span { display: block; color: var(--ink); }
.rec__ic { width: 26px; height: 26px; border-radius: 5px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.rec__preview { margin-top: 6px; }
.rec__preview summary { font-size: 12px; color: var(--accent); }
.rec__preview pre { white-space: pre-wrap; font: 12.5px/1.55 var(--ff); color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin: 6px 0 0; }
.rec__buttons { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rec__hint { font-size: 12px; color: var(--muted); margin-left: 4px; }
.rec__decided { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.rec--compact .rec__title { font-size: 13.5px; }
.rec + .rec { margin-top: 10px; }

/* ------------------------------------------------------------------ page */
.page { padding: 22px 28px 56px; max-width: 1560px; }
.page--full { max-width: none; }
.phead { margin-bottom: 18px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { color: var(--faint); }
.phead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead h1 { font-size: 22px; color: var(--navy); letter-spacing: -0.015em; line-height: 1.25; }
.phead p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.phead__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel__head { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel__head h2 { font-size: 14px; color: var(--navy); }
.panel__note { font-size: 12.5px; color: var(--muted); }
.panel__head > .panel__note:first-of-type { flex: 1; }
.panel__head > :last-child:not(h2):not(.panel__note) { margin-left: auto; }
.panel__body { padding: 14px 16px; }
.panel__foot { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.stack-lg > * + * { margin-top: 16px; }
.stack-md > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar__spacer { flex: 1; }
.toolbar .count { font-size: 12.5px; color: var(--muted); }

.empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.empty--page h1 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.empty--page { max-width: 520px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }

.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; padding: 6px 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 0 12px; height: 36px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: #f7f9fb; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl td.strong, .tbl td strong { color: var(--ink); font-weight: 600; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.tbl .nowrap { white-space: nowrap; }
.tbl--compact td { padding: 6px 12px; }
.tbl tfoot td { background: var(--surface-2); font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th-sort:hover { color: var(--ink); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--ink); }
.th-sort__ind { font-size: 11px; width: 8px; }
.namecell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.namecell > div { min-width: 0; }
.namecell .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.namecell a, .namecell button.link { color: var(--ink); font-weight: 600; }
.namecell .sub { margin-top: 0; }
button.link { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font: inherit; }
button.link:hover { text-decoration: underline; }
.tagline { display: flex; gap: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ views bar */
.views { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views button { height: 38px; padding: 0 12px; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.views button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.views button:hover { color: var(--ink); }
.views .n { font-size: 11px; background: var(--surface-3); border-radius: 8px; padding: 0 6px; color: var(--muted); font-weight: 600; }
.views__add { margin-left: 6px; }

/* ------------------------------------------------------------------ home */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.hello h1 { font-size: 22px; color: var(--navy); letter-spacing: -0.015em; }
.hello p { color: var(--muted); font-size: 13.5px; margin-top: 3px; max-width: 80ch; }
/* The strip holds as many figures as the profile's dashboard defines. Each figure rules its own
   left and top edge; the strip clips the rules on its outer edge, so any count lays out cleanly. */
.metrics { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.metric { padding: 12px 16px 13px; min-width: 0; position: relative; box-shadow: -1px 0 0 var(--line-2), 0 -1px 0 var(--line-2); }
.metric dt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric dd { font-size: 21px; font-weight: 600; color: var(--navy); letter-spacing: -0.02em; margin-top: 2px; line-height: 1.25; }
.metric small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric small.bad { color: var(--red); }
.metric small.good { color: var(--green); }
.metric a { position: absolute; inset: 0; }
.metric a:focus-visible { outline-offset: -2px; }
.metric .spark { position: absolute; right: 12px; top: 14px; }
.home { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }

.queue li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.queue li:last-child { border-bottom: 0; }
.queue__ic { width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-2); }
.queue__ic--bad { background: var(--red-bg); color: var(--red); }
.queue__ic--amber { background: var(--amber-bg); color: var(--amber); }
.queue__ic--ai { background: var(--ai-chip); color: var(--ai); }
.queue__ic--teal { background: var(--accent-bg); color: var(--accent-2); }
.queue__main { min-width: 0; }
.queue__title { font-size: 13.5px; font-weight: 600; color: var(--ink); display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.queue__title { width: 100%; text-align: left; }
a.queue__title:hover { color: var(--accent); }
.queue__ctx { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 1px; }
.queue__ctx .dotsep::before { content: "\00B7"; margin-right: 8px; color: var(--faint); }
.queue__act { display: flex; gap: 6px; align-items: center; }
.queue__more { padding: 10px 16px; font-size: 12.5px; border-top: 1px solid var(--line-2); }

.agenda li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.agenda li:last-child { border-bottom: 0; }
.agenda time { font-size: 13px; font-weight: 600; color: var(--ink); padding-top: 1px; }
.agenda time small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 400; }
.agenda strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.agenda .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.agenda li.past { opacity: 0.62; }
.agenda li.now { background: var(--accent-bg); }

.attnlist li { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.attnlist li:last-child { border-bottom: 0; }
.attnlist a { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.attnlist p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.attnlist .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }

.calls li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); align-items: start; }
.calls li:last-child { border-bottom: 0; }
.calls strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.calls p { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.calls .dur { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }

.teamtbl td:first-child { white-space: nowrap; }

/* ------------------------------------------------------------------ record pages */
.rhead { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 28px 0; }
.rhead__row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.rhead__id { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 260px; }
.rhead__id > span { flex: none; }
.rhead h1 { font-size: 22px; color: var(--navy); letter-spacing: -0.015em; line-height: 1.25; }
.rhead__facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 5px; font-size: 13px; color: var(--muted); align-items: center; }
.rhead__facts b { color: var(--ink); font-weight: 600; }
.rhead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rhead .tabs { margin-top: 14px; border-bottom: 0; }
.rbody { padding: 18px 28px 56px; max-width: 1640px; }

.c360 { display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.c360 > * { min-width: 0; }
.col-stack > * + * { margin-top: 14px; }
dl.profile { padding: 6px 16px 10px; }
dl.profile .kv { grid-template-columns: 112px minmax(0, 1fr); padding: 5px 0; }
.sidepanel-list li { padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.sidepanel-list li:last-child { border-bottom: 0; }
.sidepanel-list strong { font-weight: 600; color: var(--ink); }
.sidepanel-list .meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sidepanel-list .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tasklist li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; }
.tasklist input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }

.stagepath { display: flex; gap: 3px; margin-top: 8px; }
.stagepath i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.stagepath i.on { background: var(--accent); }
.stagepath i.lost { background: #c6ccd5; }

.nba { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.nba strong { display: block; font-size: 14px; color: var(--navy); }
.nba p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* composer */
.composer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.composer .tabs { padding: 0 8px; }
.composer__body { padding: 12px 14px; display: grid; gap: 8px; }
.composer__foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 14px 12px; flex-wrap: wrap; }
.composer__foot small { font-size: 12px; color: var(--muted); }

/* timeline */
.tlfilters { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.tl { padding: 4px 16px 12px; }
.tl__day { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); padding: 14px 0 6px 42px; }
.tl__item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 7px 0; }
.tl__item::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl__dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.tl__dot--call { color: var(--accent-2); background: var(--accent-bg); border-color: var(--accent-line); }
.tl__dot--email { color: var(--blue); background: var(--blue-bg); border-color: #cddaf1; }
.tl__dot--message { color: #2f7a52; background: var(--green-bg); border-color: #cbe5d6; }
.tl__dot--meeting { color: var(--violet); background: var(--violet-bg); border-color: #dcd3f0; }
.tl__dot--note { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.tl__dot--ai { color: var(--ai); background: var(--ai-chip); border-color: #ccd3ea; }
.tl__dot--sys { width: 30px; height: 30px; background: var(--surface-2); }
.tl__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl__head strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tl__head .kind { font-size: 12px; color: var(--muted); }
.tl__head time { font-size: 12px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.tl__text { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.tl__meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl__item--sys .tl__head strong { font-weight: 500; color: var(--ink-2); }
.tl__card { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font-size: 12.5px; }
.tl__card a { font-weight: 600; }

/* ------------------------------------------------------------------ opportunity */
.oppstrip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.oppstrip > div { padding: 12px 16px; min-width: 0; }
.oppstrip > div + div { border-left: 1px solid var(--line-2); }
.oppstrip dt { font-size: 12px; color: var(--muted); }
.oppstrip dd { font-size: 17px; font-weight: 600; color: var(--navy); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevrons { display: flex; margin-top: 14px; }
.chevrons button { flex: 1; min-width: 0; height: 34px; border: 0; background: var(--surface-3); color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; position: relative; padding: 0 8px 0 18px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevrons button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 4px 0 0 4px; padding-left: 12px; }
.chevrons button:hover { background: #e3e8ee; }
.chevrons button.past { background: var(--accent-bg); color: var(--accent-2); }
.chevrons button.current { background: var(--accent); color: #fff; font-weight: 600; }
.chevrons button.won { background: var(--green); color: #fff; }
.chevrons button.lost { background: #8a94a5; color: #fff; }
.lines td { white-space: nowrap; }

/* ------------------------------------------------------------------ pipeline */
.boardbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.boardsum { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.boardsum b { color: var(--ink); font-weight: 600; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(214px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; min-height: 240px; display: flex; flex-direction: column; }
.col__head { padding: 10px 12px 9px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 8px 8px 0 0; }
.col__title { display: flex; align-items: center; gap: 8px; }
.col__title strong { font-size: 13.5px; color: var(--navy); }
.col__title .n { font-size: 11.5px; color: var(--muted); background: var(--surface-3); border-radius: 8px; padding: 0 6px; font-weight: 600; }
.col__title .p { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.col__sum { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; }
.col__sum b { color: var(--ink); font-weight: 600; }
.col__body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col--won .col__head { border-top: 3px solid var(--green); }
.col--lost .col__head { border-top: 3px solid #9aa4b2; }
.col.drop { background: var(--accent-bg); border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line); }
.col__empty { font-size: 12px; color: var(--faint); text-align: center; padding: 16px 8px; border: 1px dashed var(--line); border-radius: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px 9px; box-shadow: var(--shadow-1); cursor: grab; position: relative; }
.card:hover { border-color: #cbd3dd; }
.card.dragging { opacity: 0.45; }
.card.hero { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-bg); }
.card__name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; width: 100%; }
.card__name:hover { color: var(--accent); }
.card__who { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.card__value { font-size: 14px; font-weight: 600; color: var(--navy); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.card__right { display: inline-flex; align-items: center; gap: 8px; }
.card .risk { font-size: 11.5px; }
.age { display: inline-flex; align-items: center; gap: 6px; }
.age__bar { width: 34px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.age__bar i { display: block; height: 100%; background: #8fb5ad; }
.age--slow .age__bar i { background: #d08a1c; }
.age--stuck .age__bar i { background: var(--red); }
.card__move { position: absolute; top: 6px; right: 6px; opacity: 0; }
.card:hover .card__move, .card:focus-within .card__move { opacity: 1; }
.card__move select { height: 22px; font-size: 11.5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; max-width: 110px; }
.stagepick { display: none; }

/* ------------------------------------------------------------------ appointments */
.week { display: grid; grid-template-columns: 52px repeat(var(--days, 5), minmax(120px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.week__corner { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.week__dayhead { padding: 8px 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.week__dayhead strong { display: block; color: var(--ink); font-size: 13.5px; }
.week__dayhead.today { background: var(--accent-bg); }
.week__dayhead.today strong { color: var(--accent-2); }
.week__hours { position: relative; }
.week__hour { height: 52px; font-size: 11px; color: var(--faint); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.week__col { position: relative; border-left: 1px solid var(--line-2); }
.week__line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }
.week__col.today { background-color: #fbfdfc; }
.week__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; }
.week__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.appt { position: absolute; left: 3px; right: 3px; border-radius: 4px; padding: 3px 7px; font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; border: 1px solid; border-left-width: 3px; text-align: left; font-family: inherit; }
.appt strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.appt--teal { background: #e9f5f3; border-color: #bfe0da; border-left-color: var(--accent); color: #0b4f49; }
.appt--blue { background: #edf2fb; border-color: #cbd8f0; border-left-color: #3566c8; color: #213f78; }
.appt--violet { background: #f2eefa; border-color: #dcd2f1; border-left-color: #7a57c7; color: #45307d; }
.appt--amber { background: #fcf3e3; border-color: #efd8ae; border-left-color: #d08a1c; color: #6b4108; }
.appt--slate { background: #f0f3f6; border-color: #d6dde6; border-left-color: #64748b; color: #334155; }
.appt.is-booked { border-style: dashed; border-left-style: solid; }
.appt.is-cancelled { opacity: 0.5; text-decoration: line-through; }
.appt.is-noshow { background: var(--red-bg); border-color: var(--red-line); border-left-color: var(--red); color: #7a1c14; }
.appt.is-attended { opacity: 0.78; }
.appt:focus-visible { outline-offset: 1px; }
.legendrow { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legendrow span { display: inline-flex; align-items: center; gap: 6px; }
.legendrow i { width: 12px; height: 10px; border-radius: 2px; border: 1px solid; }

.history li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 6px 0; font-size: 12.5px; }
.history li i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: 6px; }
.history strong { color: var(--ink); font-weight: 600; }
.history span { color: var(--muted); }

/* ------------------------------------------------------------------ communications */
.comms { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.filterlist { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.filterlist button { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: 5px; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; }
.filterlist button .ic { color: var(--faint); }
.filterlist button span { flex: 1; }
.filterlist button small { font-size: 11.5px; color: var(--muted); }
.filterlist button:hover { background: var(--surface-3); }
.filterlist button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-2); font-weight: 600; }
.filterlist button[aria-pressed="true"] .ic { color: var(--accent); }
.filterlist hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.feed li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: start; }
.feed li:hover { background: #f8fafb; }
.feed li:last-child { border-bottom: 0; }
.feed strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.feed .who2 { font-size: 12.5px; color: var(--muted); }
.feed p { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.feed .flags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tpl { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tpl h3 { font-size: 14px; color: var(--navy); }
.tpl pre { white-space: pre-wrap; font: 12.5px/1.55 var(--ff); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 10px; margin: 0; max-height: 150px; overflow: hidden; }
.tpl .merge { color: var(--accent-2); background: var(--accent-bg); border-radius: 3px; padding: 0 2px; }
.tpl footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: 12px; color: var(--muted); }
.compose__tools { display: flex; gap: 8px; grid-column: 1 / -1; }
.compose__basis { grid-column: 1 / -1; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ call */
.call { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.callhead { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); margin-top: 6px; align-items: center; }
.callhead b { color: var(--ink); font-weight: 600; }
.talk { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.talk__bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 1px; background: var(--line-2); }
.talk__bar i { display: block; height: 100%; }
.talk__bar i.rep { background: #3566c8; }
.talk__bar i.contact { background: #0f8f82; }
.talk__legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.talk__legend span { display: inline-flex; align-items: center; gap: 6px; }
.talk__legend i { width: 10px; height: 10px; border-radius: 2px; }
.transcript { padding: 6px 0; max-height: 720px; overflow-y: auto; }
.tline { display: grid; grid-template-columns: 52px 118px minmax(0, 1fr); gap: 10px; padding: 8px 16px; font-size: 13.5px; line-height: 1.55; border-left: 3px solid transparent; }
.tline time { font: 12px var(--ff-mono); color: var(--faint); padding-top: 2px; }
.tline .spk { font-size: 12.5px; font-weight: 600; color: #2b4f95; padding-top: 1px; }
.tline--contact .spk { color: var(--accent-2); }
.tline--contact { background: #fafcfc; }
.tline p { color: var(--ink); }
.tline[data-mark="objection"] { border-left-color: #d08a1c; background: #fffaf1; }
.tline[data-mark="need"], .tline[data-mark="intent"] { border-left-color: var(--accent); }
.tline[data-mark="budget"], .tline[data-mark="authority"], .tline[data-mark="timing"] { border-left-color: #3566c8; }
.tline[data-mark="next"] { border-left-color: var(--violet); }
.tline .flag { display: inline-flex; margin-left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.tline.hit { background: #fff6d6; }
.tline.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: #fbe7a6; } to { background: transparent; } }
.analysing { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.analysing i { display: block; width: 160px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--surface-3); overflow: hidden; position: relative; }
.analysing i::after { content: ""; position: absolute; left: -40%; top: 0; bottom: 0; width: 40%; background: var(--ai); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { to { left: 100%; } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.fact { border: 1px solid var(--line-2); background: #fff; border-radius: 5px; padding: 8px 10px; }
.fact dt { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 6px; }
.fact dd { font-size: 12.5px; color: var(--ink); margin-top: 3px; line-height: 1.45; }
.objections li { padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.objections li:first-child { border-top: 0; padding-top: 2px; }
.objections strong { color: var(--ink); font-weight: 600; }
.objections p { color: var(--ink-2); margin-top: 3px; }
.objections .meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 12px; color: var(--muted); }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.jump { border: 0; background: none; padding: 0; font: 12px var(--ff-mono); color: var(--accent); cursor: pointer; }
.jump:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ automations */
.flow { max-width: 760px; }
.node { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.node__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.node__kind { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.node--trigger .node__head { background: #eef2f8; } .node--trigger .node__kind { color: var(--navy); }
.node--cond .node__head { background: #fbf4e6; } .node--cond .node__kind { color: var(--amber); }
.node--action .node__head { background: var(--accent-bg); } .node--action .node__kind { color: var(--accent-2); }
.node__ic { width: 26px; height: 26px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.node__body { padding: 12px 14px; display: grid; gap: 8px; }
.node__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.node__row .control { height: 30px; }
.node__row .grow { flex: 1; min-width: 160px; }
.node__row .rm { margin-left: auto; }
.connector { width: 2px; height: 26px; background: #c9d0da; margin: 0 0 0 30px; position: relative; }
.connector::after { content: ""; position: absolute; bottom: -1px; left: -4px; border: 5px solid transparent; border-top-color: #c9d0da; border-bottom: 0; }
.wfgrid li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 110px 90px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.wfgrid li:last-child { border-bottom: 0; }
.wfgrid .wfname a { font-size: 14px; font-weight: 600; color: var(--ink); }
.wfgrid .wfname p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.wfgrid .chain { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.wfgrid .chain span { font-size: 11.5px; background: var(--surface-3); border-radius: 4px; padding: 1px 6px; color: var(--ink-2); }
.wfgrid .chain span.t { background: #e9eef6; color: var(--navy); }
.wfgrid .chain span.a { background: var(--accent-bg); color: var(--accent-2); }
.wfgrid .stat { font-size: 12.5px; color: var(--muted); }
.wfgrid .stat b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #cfd5de; border: 0; cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.12s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 18px; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.steps li { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.steps .st { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.steps .st--ok { background: var(--green-bg); color: var(--green); }
.steps .st--wait { background: var(--amber-bg); color: var(--amber); }
.steps .st--no { background: var(--surface-3); color: var(--muted); }
.steps .st--bad { background: var(--red-bg); color: var(--red); }
.testout { border: 1px dashed var(--accent-line); background: #fbfdfd; border-radius: 6px; padding: 12px 14px; margin-top: 14px; font-size: 13px; }

/* ------------------------------------------------------------------ reports */
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rgrid .span-2 { grid-column: 1 / -1; }
.fig { margin: 0; padding: 14px 16px; }
.fig .chart { display: block; width: 100%; height: auto; }
.chart__grid { stroke: #edf0f4; stroke-width: 1; }
.chart__base { stroke: #c3cad4; stroke-width: 1; }
.chart__tick { font: 11px var(--ff); fill: var(--muted); }
.chart__hit { fill: transparent; }
.chart__col:hover path, .chart__col:hover rect:not(.chart__hit) { opacity: 0.82; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend__line { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.bars li { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 5px 0; }
.bars__label { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__label small { display: block; font-size: 11.5px; color: var(--faint); }
a.bars__label { color: var(--ink); }
.bars__track { position: relative; height: 12px; }
.bars__track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.bars__track i.bars__over { opacity: 1; }
.bars__track:hover i { filter: brightness(0.94); }
.bars__value { font-size: 13px; color: var(--ink); text-align: right; font-weight: 600; white-space: nowrap; }
.funnel li { display: grid; grid-template-columns: 140px minmax(0, 1fr) 56px 48px; gap: 12px; align-items: center; padding: 6px 0; }
.funnel__label { font-size: 13px; color: var(--ink-2); }
.funnel__track { height: 22px; position: relative; }
.funnel__track i { position: absolute; left: 0; top: 0; bottom: 0; background: #0f8f82; border-radius: 0 4px 4px 0; }
.funnel li:nth-child(2) .funnel__track i { background: #16786d; }
.funnel li:nth-child(n+3) .funnel__track i { background: #0b4f48; }
.funnel li:nth-child(1) .funnel__track i { background: #3a9d90; }
.funnel__n { font-size: 13px; font-weight: 600; text-align: right; }
.funnel__rate { font-size: 12px; color: var(--muted); text-align: right; }
.stack li { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr) 70px; gap: 12px; align-items: center; padding: 5px 0; }
.stack__label { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack__track { display: flex; height: 14px; gap: 2px; }
.stack__track i { display: block; height: 100%; }
.stack__track i:last-child { border-radius: 0 4px 4px 0; }
.stack__n { font-size: 13px; font-weight: 600; text-align: right; }
.vtable { margin-top: 10px; font-size: 12px; }
.vtable summary { color: var(--muted); }
.vtable summary:hover { color: var(--accent); }
.vtable .tablewrap { margin-top: 8px; border: 1px solid var(--line-2); border-radius: 4px; }
.vtip { position: fixed; z-index: 120; pointer-events: none; background: var(--navy); color: #fff; border-radius: 6px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-pop); max-width: 260px; }
.vtip__head { font-weight: 600; margin-bottom: 4px; color: rgba(255, 255, 255, 0.86); }
.vtip__row { display: flex; align-items: center; gap: 7px; }
.vtip__row i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.vtip__row strong { font-weight: 600; }
.vtip__row span { color: rgba(255, 255, 255, 0.68); }
.spark { display: block; }
.insights li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.insights li:last-child { border-bottom: 0; }
.insights .bar { width: 3px; border-radius: 2px; background: var(--faint); }
.insights .bar--bad { background: var(--red); }
.insights .bar--warn { background: #d08a1c; }
.insights .bar--good { background: var(--green); }
.insights .bar--info { background: #3566c8; }
.insights strong { font-size: 13.5px; color: var(--ink); font-weight: 600; display: block; }
.insights p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.insights .meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

.brief { max-width: 980px; }
.brief__lead { font-size: 16px; line-height: 1.6; color: var(--ink); }
.brief h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 8px; }
.brief section + section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
ul.dots li { position: relative; padding-left: 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
ul.dots li + li { margin-top: 6px; }
ul.dots li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.delta { font-weight: 600; }
.delta--up { color: var(--green); }
.delta--down { color: var(--red); }

/* ------------------------------------------------------------------ settings */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.setrow { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; padding: 16px; border-bottom: 1px solid var(--line-2); }
.setrow:last-child { border-bottom: 0; }
.setrow h3 { font-size: 14px; color: var(--navy); }
.setrow p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modgrid li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.modgrid li:last-child { border-bottom: 0; }
.modgrid strong { font-size: 13.5px; color: var(--ink); }
.modgrid p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.capmatrix td, .capmatrix th { text-align: center; }
.capmatrix td:first-child, .capmatrix th:first-child { text-align: left; }
.capmatrix input { width: 16px; height: 16px; accent-color: var(--accent); }
.capmatrix .grp td { background: var(--surface-2); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.intgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
.integ { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.integ header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.integ h3 { font-size: 14px; color: var(--navy); }
.integ p { font-size: 12.5px; color: var(--ink-2); }
.integ small { font-size: 12px; color: var(--muted); }
.integ footer { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.stagelist li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 90px 90px 110px auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stagelist li:last-child { border-bottom: 0; }
.stagelist .idx { font-size: 12px; color: var(--faint); text-align: center; }
.stagelist input.control { width: 100%; }
.code { font: 12px/1.55 var(--ff-mono); background: #0f1b2d; color: #d7e0ee; border-radius: 6px; padding: 12px 14px; overflow-x: auto; margin: 0; white-space: pre; }
.preview-terms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ------------------------------------------------------------------ drawer */
#drawer[hidden] { display: none; }
.drawer__scrim { position: fixed; inset: 0; background: rgba(15, 27, 45, 0.18); z-index: 70; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); z-index: 71; overflow-y: auto; }
.drawer__x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.dr__head { padding: 20px 56px 14px 22px; border-bottom: 1px solid var(--line-2); }
.dr__eyebrow { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dr__head h2 { font-size: 19px; color: var(--navy); margin-top: 4px; outline: none; line-height: 1.3; }
.dr__sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dr__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dr__sec { padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.dr__sec:last-child { border-bottom: 0; }
.dr__sec > h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.dr__sec .kv { grid-template-columns: 130px minmax(0, 1fr); }
.factors li { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.factors li:last-child { border-bottom: 0; }
.factors .pts { text-align: right; font-weight: 600; color: var(--green); }
.factors .pts.neg { color: var(--red); }
.factors .pts.base { color: var(--muted); font-weight: 500; }
.factors .total { font-weight: 600; color: var(--ink); }
.bant { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bant label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.bant select { width: 100%; }
.qdots { display: inline-flex; gap: 3px; }
.qdots i { width: 9px; height: 9px; border-radius: 2px; background: var(--surface-3); border: 1px solid var(--line); }
.qdots i.yes { background: var(--accent); border-color: var(--accent); }
.qdots i.no { background: #fff; border-color: var(--red); }
.message { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 10px 12px; line-height: 1.55; }

/* ------------------------------------------------------------------ modal */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15, 27, 45, 0.36); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.overlay[hidden] { display: none; }
.modal { width: min(540px, 100%); background: #fff; border-radius: 8px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; max-height: 86vh; }
.modal--wide { width: min(760px, 100%); }
.modal__head { padding: 18px 52px 12px 20px; position: relative; border-bottom: 1px solid var(--line-2); }
.modal__head h2 { font-size: 17px; color: var(--navy); }
.modal__head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal__x { position: absolute; top: 12px; right: 12px; }
.modal__body { padding: 16px 20px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 14px; align-content: start; }
.modal__body > * { grid-column: 1 / -1; }
.modal__body > .formrow--half { grid-column: auto; }
.modal__section { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding-top: 6px; }
.modal__note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 4px; padding: 8px 10px; }
.modal__warn { font-size: 13px; color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 5px; padding: 8px 10px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 110; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(640px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--navy); color: #fff; border-radius: 6px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-pop); line-height: 1.45; }
.toast--warn { background: #5b3a06; }
.toast button { border: 1px solid rgba(255, 255, 255, 0.3); background: none; color: #fff; border-radius: 4px; height: 26px; padding: 0 9px; cursor: pointer; font-size: 12.5px; flex: none; }
.toast button:hover { background: rgba(255, 255, 255, 0.12); }

/* ------------------------------------------------------------------ guided scenario */
.story { position: fixed; left: 16px; bottom: 16px; z-index: 75; width: 360px; max-height: calc(100vh - 120px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
.story__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 12px 10px 16px; }
.story__head strong { display: block; font-size: 14px; color: var(--navy); }
.story__head span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.story__bar { height: 3px; background: var(--surface-3); margin: 0 16px; border-radius: 2px; overflow: hidden; }
.story__bar i { display: block; height: 100%; background: var(--accent); }
.story__steps { padding: 10px 12px 12px; }
.story__steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 7px 6px; border-radius: 6px; }
.story__steps li.current { background: var(--accent-bg); }
.story__steps li strong { font-size: 13px; font-weight: 600; color: var(--ink); display: block; line-height: 1.4; }
.story__steps li.done strong { color: var(--muted); font-weight: 500; }
.story__steps li.locked strong { color: var(--faint); }
.story__steps p { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.story__n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 11px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.story__steps li.done .story__n { background: var(--accent); border-color: var(--accent); color: #fff; }
.story__steps li.current .story__n { border-color: var(--accent); color: var(--accent-2); }
.story__actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.story__end { font-size: 12.5px; color: var(--green); padding: 0 16px 14px; }

/* ------------------------------------------------------------------ industry: first launch */
/* Enterprise configuration, not a theme picker: ruled white cards that state what each
   profile changes, on the same ground as the product itself. */
.onb { min-height: 100vh; background: var(--bg); }
.onb__main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 56px; outline: none; }
.onb__head { max-width: 780px; }
.onb__brand { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--navy); letter-spacing: -0.01em; }
.onb h1 { font-size: 30px; line-height: 1.2; color: var(--navy); letter-spacing: -0.02em; margin-top: 22px; }
.onb__lede { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin-top: 10px; }
.onb__adapts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; margin: 26px 0 30px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.onb__adapts li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-content: start; }
.onb__adapts strong { font-size: 13px; color: var(--ink); }
.onb__adapts span:not(.onb__tick) { grid-column: 2; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.onb__tick { grid-row: 1 / span 2; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.onb__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.onb__grid > li { display: flex; }
.onb__opt {
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 16px 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.onb__opt:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.onb__opt:hover .onb__select { color: var(--accent); }
.onb__opt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.onb__opt-head strong { font-size: 15px; color: var(--navy); letter-spacing: -0.01em; }
.onb__select { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent-2); }
.onb__current { flex: none; font-size: 11px; font-weight: 600; color: var(--accent-2); background: var(--accent-bg); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.onb__desc { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.onb__ctx { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.onb__facts { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.onb__fact { font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.onb__fact em { display: block; font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.onb__note { max-width: 780px; margin-top: 22px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* The configuring transition: what is being set up, ticked in order. */
.onb__cfg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.onb__cfg-panel { width: min(540px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 26px 28px 20px; box-shadow: var(--shadow-1); }
.onb__cfg-panel h1 { font-size: 20px; margin: 16px 0 12px; }
.onb__steps li { display: grid; grid-template-columns: 18px 150px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; animation: onb-in 0.3s ease both; animation-delay: calc(var(--i) * 125ms); }
.onb__steps li strong { color: var(--ink); font-weight: 600; }
.onb__steps li span:last-child { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onb__steps .onb__tick { grid-row: auto; background: var(--accent); color: #fff; align-self: center; }
@keyframes onb-in { from { opacity: 0.2; } to { opacity: 1; } }

/* ------------------------------------------------------------------ industry: indicator and switch */
.industry {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; margin-right: 4px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--surface); cursor: pointer;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.industry strong { color: var(--ink-2); font-weight: 600; }
.industry__sw { color: var(--accent-2); font-weight: 600; padding-left: 8px; border-left: 1px solid var(--line); }
.industry:hover { border-color: var(--accent-line); }
.side__industry { display: none; }
.indpick { display: grid; gap: 12px; }
.indpick__list { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.indpick__opt { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.indpick__opt:hover { border-color: var(--accent-line); }
.indpick__opt.is-selected { border-color: var(--accent); background: var(--accent-bg); }
.indpick__opt input { margin: 3px 0 0; accent-color: var(--accent); }
.indpick__opt strong { display: flex; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--ink); }
.indpick__opt small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--muted); }

/* Settings, CRM configuration: the three layers. */
.indcur { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.indcur strong { font-size: 15px; color: var(--navy); }
.indcur p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.layers { padding: 4px 16px 10px; }
.layer { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.layer + .layer { border-top: 1px solid var(--line-2); }
.layer strong { font-size: 13.5px; color: var(--ink); }
.layer p { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; line-height: 1.5; }
.layer__n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--navy); }
.layer--profile .layer__n { background: var(--accent); }
.layer--client .layer__n { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }

@media (max-width: 1024px) {
  .onb__adapts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side__industry {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center;
    width: calc(100% - 16px); margin: 0 8px 6px; padding: 7px 10px; text-align: left; cursor: pointer;
    border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
  }
  .side__industry span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
  .side__industry strong { grid-column: 1; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side__industry em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent-2); }
}
@media (max-width: 720px) {
  .onb__main { padding: 26px 16px 40px; }
  .onb h1 { font-size: 24px; margin-top: 18px; }
  .onb__lede { font-size: 14px; }
  .onb__adapts { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 20px 0 22px; }
  .onb__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .onb__cfg-panel { padding: 20px 18px 16px; }
  .onb__steps li { grid-template-columns: 18px minmax(0, 1fr); }
  .onb__steps li span:last-child { grid-column: 2; white-space: normal; }
  .indpick__list { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ responsive */
.hide-sm, .hide-md, .hide-lg { }
.show-sm { display: none; }
@media (max-width: 1520px) {
  .hide-lg { display: none; }
}
@media (max-width: 1380px) {
  .c360 { grid-template-columns: 270px minmax(0, 1fr); }
  .c360 > .c360__right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .c360 > .c360__right > * + * { margin-top: 0; }
  .metrics { grid-template-columns: repeat(var(--n-md, 4), minmax(0, 1fr)); }
  .home { grid-template-columns: minmax(0, 1fr) 340px; }
  .call { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .call { grid-template-columns: minmax(0, 1fr); }
  .call > :last-child { order: -1; }
  .oppstrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oppstrip > div:nth-child(4) { border-left: 0; }
  .oppstrip > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .wfgrid li { grid-template-columns: 44px minmax(0, 1fr) 110px; }
  .wfgrid li > .hide-md { display: none; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 272px; z-index: 80; transform: translateX(-102%); transition: transform 0.18s ease; box-shadow: var(--shadow-pop); }
  .side--open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 27, 45, 0.3); z-index: 79; }
  .top .top__menu { display: inline-flex; }
  .top { padding: 0 14px; }
  .hide-md { display: none; }
  .page, .rbody { padding: 18px 16px 48px; }
  .rhead { padding: 16px 16px 0; }
  .c360 { grid-template-columns: minmax(0, 1fr); }
  .c360 > .c360__right { grid-template-columns: minmax(0, 1fr); }
  .c360 > .c360__main { order: -1; }
  .comms { grid-template-columns: minmax(0, 1fr); }
  .filterlist { display: flex; gap: 4px; overflow-x: auto; padding: 4px; }
  .filterlist button { width: auto; flex: none; }
  .filterlist hr { display: none; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .rgrid, .grid-2, .grid-3, .split { grid-template-columns: minmax(0, 1fr); }
  .setrow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .story { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: 60vh; }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .stagepick { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
  .stagepick .lbl { margin: 0; }
  .stagepick select { flex: 1; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .board > .col:not(.col--current) { display: none; }
  .card__move { opacity: 1; position: static; margin-top: 8px; }
  .card__move select { max-width: none; width: 100%; height: 30px; }
  .me__text { display: none; }
  .omni kbd { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric .spark { display: none; }
  .oppstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oppstrip > div + div { border-left: 0; }
  .oppstrip > div:nth-child(even) { border-left: 1px solid var(--line-2); }
  .oppstrip > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .modal__body { grid-template-columns: minmax(0, 1fr); }
  .modal__body > .formrow--half { grid-column: 1 / -1; }
  .bars li { grid-template-columns: minmax(0, 1fr) 84px; }
  .bars__track { grid-column: 1 / -1; grid-row: 2; }
  .funnel li { grid-template-columns: minmax(0, 1fr) 50px 44px; }
  .funnel__track { grid-column: 1 / -1; grid-row: 2; }
  .stack li { grid-template-columns: minmax(0, 1fr) 60px; }
  .stack__track { grid-column: 1 / -1; grid-row: 2; }
  .tline { grid-template-columns: 44px minmax(0, 1fr); }
  .tline .spk { grid-column: 2; }
  .tline p { grid-column: 2; }
  .queue li { grid-template-columns: 30px minmax(0, 1fr); }
  .queue__act { grid-column: 2; }
  .wfgrid li { grid-template-columns: 44px minmax(0, 1fr); }
  .wfgrid li > .stat { display: none; }
  .stagelist li { grid-template-columns: 22px minmax(0, 1fr) 70px auto; }
  .stagelist li > .hide-sm { display: none; }
  .bant { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .kv, .dr__sec .kv, dl.profile .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .search input { width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  .phead h1, .rhead h1, .hello h1 { font-size: 20px; }
  .drawer { width: 100vw; }
  .demobar { gap: 8px; padding: 0 10px; }
  .top { gap: 4px; padding: 0 8px; }
  .omni { min-width: 0; }
  .views button { padding: 0 9px; }
  .chevrons button { font-size: 11px; padding: 0 4px 0 14px; }
}
@media (max-width: 400px) {
  .me .ic { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .demobar, .side, .top, .story, .toasts { display: none !important; }
  .shell { display: block; }
}
