/* Classess CRM — stone, steel and frost. Graphite carries the actions, frosted glass carries the chrome,
   and a brass mark shows everything the AI did. No blue anywhere: every colour below is a stone or a metal. */

:root {
  --paper: #e7e7e3;          /* limestone page under the frost */
  --surface: #fbfbfa;        /* solid panels: tables, inputs, dense lists */
  --surface-2: #efefec;      /* hovers, wells */
  --line: #d8d8d3;           /* hairlines */
  --line-strong: #c3c3bd;
  --field-line: #8b8d92;     /* input and control edges: >= 3:1 on surface */
  --text: #191b1f;
  --muted: #4b5058;
  --faint: #5b6068;          /* >= 4.5:1 on paper, surface and glass */
  --ink: #23262b;            /* graphite: primary actions, active nav, the assistant's voice */
  --ink-strong: #3b4047;     /* graphite hover, today's bar */
  --ink-wash: #e2e3e1;       /* a cool stone tint for chips, icons, the caller's bubble */
  --on-ink: #ffffff;
  --steel: #5d6670;          /* charts and meters */
  --bar: #6f7882;
  --brass: #a8854a;          /* AI marks */
  --brass-ink: #66501f;      /* AI text */
  --brass-wash: #efe9dc;
  --sage: #3b684e;           /* good */
  --sage-wash: #e1eae3;
  --clay: #a2433a;           /* danger, overdue */
  --clay-wash: #f4e4e0;
  --on-clay: #ffffff;
  --focus: #23262b;
  --focus-halo: #ffffff;
  /* glass: chrome and cards only; tables and inputs stay solid */
  --glass: rgb(250 250 249 / .64);
  --glass-strong: rgb(250 250 249 / .84);
  --glass-dense: rgb(249 249 248 / .94);   /* drawer, dialogs, Ask AI: dense text over moving content */
  --glass-line: rgb(25 27 31 / .09);
  --glass-hi: inset 0 1px 0 rgb(255 255 255 / .8);
  --blur: blur(22px) saturate(1.35);
  --scrim: rgb(24 26 30 / .34);
  --device: #212429;         /* the test console handset */
  --device-text: #eceef0;
  --device-muted: #a9aeb5;
  --rail: var(--glass);
  --rail-text: var(--text);
  --rail-muted: var(--muted);
  --backdrop:
    radial-gradient(1100px 760px at -8% -12%, #fafaf8 0%, rgb(250 250 248 / 0) 62%),
    radial-gradient(900px 640px at 108% 4%, #d9dad6 0%, rgb(217 218 214 / 0) 64%),
    radial-gradient(1200px 900px at 55% 118%, #f4f4f1 0%, rgb(244 244 241 / 0) 60%),
    linear-gradient(160deg, #ecece8, #e3e3df);
  --grain-opacity: .05;
  --shadow: 0 1px 1px rgb(20 22 26 / .04), 0 14px 34px -22px rgb(20 22 26 / .26);
  --shadow-lg: 0 2px 6px rgb(20 22 26 / .05), 0 42px 90px -36px rgb(20 22 26 / .42);
  --font-ui: "Instrument Sans", "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Tamil", "Noto Sans Kannada",
    "Noto Sans Bengali", "Noto Sans Gujarati", "Noto Sans Gurmukhi", "Noto Sans Malayalam", "Noto Sans Oriya", system-ui, sans-serif;
  --font-display: var(--font-ui);
  --w-display: 84%;          /* Instrument Sans' width axis: condensed steel for the big type */
  --r-xs: 2px;
  --r-sm: 3px;
  --r: 4px;
  --r-lg: 6px;               /* the most rounding anywhere */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111316; --surface: #1a1d21; --surface-2: #23272c;
    --line: #2c3137; --line-strong: #3a4047; --field-line: #767d86;
    --text: #eceef0; --muted: #b0b5bc; --faint: #989ea6;
    --ink: #d9dde2; --ink-strong: #f2f3f5; --ink-wash: #2a2e34; --on-ink: #15171a;
    --steel: #9aa3ad; --bar: #8c95a0;
    --brass: #c6a568; --brass-ink: #dcc28e; --brass-wash: #2e2a20;
    --sage: #8fc1a1; --sage-wash: #1b2a21; --clay: #e59f93; --clay-wash: #34201e; --on-clay: #15171a;
    --focus: #e8ebee; --focus-halo: #0b0c0e;
    --glass: rgb(31 34 39 / .56); --glass-strong: rgb(27 30 35 / .84); --glass-dense: rgb(26 29 33 / .95); --glass-line: rgb(255 255 255 / .08);
    --glass-hi: inset 0 1px 0 rgb(255 255 255 / .06);
    --scrim: rgb(0 0 0 / .56);
    --device: #0c0d0f; --device-text: #eceef0; --device-muted: #a3a9b0;
    --backdrop:
      radial-gradient(1100px 760px at -8% -12%, #24282e 0%, rgb(36 40 46 / 0) 62%),
      radial-gradient(900px 640px at 108% 4%, #1a1d22 0%, rgb(26 29 34 / 0) 64%),
      radial-gradient(1200px 900px at 55% 118%, #1d2025 0%, rgb(29 32 37 / 0) 60%),
      linear-gradient(160deg, #15171a, #0e1012);
    --grain-opacity: .07;
    --shadow: 0 1px 1px rgb(0 0 0 / .3), 0 14px 34px -22px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / .3), 0 42px 90px -36px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111316; --surface: #1a1d21; --surface-2: #23272c;
  --line: #2c3137; --line-strong: #3a4047; --field-line: #767d86;
  --text: #eceef0; --muted: #b0b5bc; --faint: #989ea6;
  --ink: #d9dde2; --ink-strong: #f2f3f5; --ink-wash: #2a2e34; --on-ink: #15171a;
  --steel: #9aa3ad; --bar: #8c95a0;
  --brass: #c6a568; --brass-ink: #dcc28e; --brass-wash: #2e2a20;
  --sage: #8fc1a1; --sage-wash: #1b2a21; --clay: #e59f93; --clay-wash: #34201e; --on-clay: #15171a;
  --focus: #e8ebee; --focus-halo: #0b0c0e;
  --glass: rgb(31 34 39 / .56); --glass-strong: rgb(27 30 35 / .84); --glass-dense: rgb(26 29 33 / .95); --glass-line: rgb(255 255 255 / .08);
  --glass-hi: inset 0 1px 0 rgb(255 255 255 / .06);
  --scrim: rgb(0 0 0 / .56);
  --device: #0c0d0f; --device-text: #eceef0; --device-muted: #a3a9b0;
  --backdrop:
    radial-gradient(1100px 760px at -8% -12%, #24282e 0%, rgb(36 40 46 / 0) 62%),
    radial-gradient(900px 640px at 108% 4%, #1a1d22 0%, rgb(26 29 34 / 0) 64%),
    radial-gradient(1200px 900px at 55% 118%, #1d2025 0%, rgb(29 32 37 / 0) 60%),
    linear-gradient(160deg, #15171a, #0e1012);
  --grain-opacity: .07;
  --shadow: 0 1px 1px rgb(0 0 0 / .3), 0 14px 34px -22px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / .3), 0 42px 90px -36px rgb(0 0 0 / .8);
  color-scheme: dark;
}
/* no backdrop-filter, or the viewer asked for less transparency: the same panels, solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, :root[data-theme] { --glass: var(--surface); --glass-strong: var(--surface); --glass-dense: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme] { --glass: var(--surface); --glass-strong: var(--surface); --glass-dense: var(--surface); --scrim: rgb(0 0 0 / .6); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 15px/1.5 var(--font-ui); font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* the frost: a still stone-to-white field with a fine grain, fixed under every glass panel */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { background: var(--backdrop); }
body::after { opacity: var(--grain-opacity); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] body::after { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; } }
/* glass recipe, shared by the rail, top bar, drawer, sheets, dialogs, Ask AI and cards */
.glass, .rail, .topbar, .tabbar, .drawer, .modal, .ask, .menu, .panel, .card, .sheet {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--text); text-decoration-color: var(--steel); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-halo); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--r); color: var(--text); }
.skip:focus { top: 8px; }
.num, table, time, .stat-v, .n, .count { font-variant-numeric: tabular-nums; }
kbd, .kbd { font: 500 11px/1 var(--font-ui); padding: 3px 5px; border-radius: var(--r-xs); border: 1px solid currentColor; opacity: .7; }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------------------------------------------------------- brand */
/* A text wordmark, no icon: CLASSESS in bold, CRM in regular weight, letter-spaced graphite. Uppercase comes from CSS
   so screen readers say "Classess CRM", not letters. */
.brand { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.brand span { font-weight: 400; color: var(--muted); }
.brand-lg { font-size: 26px; letter-spacing: .18em; margin: 0; }

/* ---------------------------------------------------------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 6px 14px; border-radius: var(--r); border: 1px solid var(--field-line);
  background: var(--surface); color: var(--text); font-weight: 550; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover { background: var(--ink-strong); border-color: var(--ink-strong); }
.btn-ai { background: var(--brass-wash); border-color: var(--brass); color: var(--brass-ink); }
.btn-ai:hover { background: color-mix(in srgb, var(--brass) 26%, var(--surface)); }
.btn-danger { color: var(--clay); border-color: var(--clay); }
.btn-danger-solid { background: var(--clay); border-color: var(--clay); color: var(--on-clay); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 14px; border-radius: var(--r); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: inherit; text-decoration: none; font-weight: 600;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.field-label svg { width: 13px; height: 13px; }
input[type="text"], input[type="search"], input[type="password"], input[type="tel"], input[type="email"],
input[type="datetime-local"], input:not([type]), select, textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; border-radius: var(--r);
  border: 1px solid var(--field-line); background: var(--surface); color: var(--text); font-size: 15px;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; box-shadow: 0 0 0 4px var(--focus-halo); }
.form-error { color: var(--clay); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.notice { padding: 10px 12px; border-radius: var(--r); font-size: 14.5px; }
.notice-warn { background: var(--brass-wash); color: var(--brass-ink); }
.notice-info { background: var(--ink-wash); color: var(--text); border-left: 2px solid var(--steel); }

/* ---------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; background: var(--glass-strong); border: 1px solid var(--glass-line); padding: 32px 28px; border-radius: var(--r-lg);
  box-shadow: var(--glass-hi), var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.login-title { font-size: 34px; font-stretch: var(--w-display); font-weight: 700; letter-spacing: -.02em; }
.login-sub { color: var(--muted); }

/* ---------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px 16px; overflow-y: auto;
  background: var(--rail); color: var(--rail-text); border-right: 1px solid var(--glass-line); box-shadow: var(--glass-hi); }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); color: var(--rail-muted); text-decoration: none; font-weight: 550; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { color: var(--rail-text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--on-ink); background: var(--ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 6px 14px -8px rgb(20 22 26 / .5); }
.nav .badge { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--clay); color: var(--on-clay); text-align: center; line-height: 20px; }
.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.rail-foot .btn-ai .kbd { margin-left: auto; opacity: 1; }
.rail-line { font-size: 13px; color: var(--rail-muted); padding: 0 6px; }
.rail-line a { color: var(--rail-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rail-tools { display: flex; gap: 2px; }
.rail-tools .icon-btn { color: var(--rail-muted); }
.rail-tools .icon-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 26%, transparent); flex: none; }

.topbar { display: none; }
.tabbar { display: none; }
.main { min-width: 0; padding: 32px clamp(16px, 3.4vw, 44px) 64px; outline: none; }
.view { max-width: 1240px; margin: 0 auto; display: grid; gap: 28px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: 10px 12px 10px 16px;
    background: var(--glass-strong); border-bottom: 1px solid var(--glass-line); box-shadow: var(--glass-hi); }
  .topbar-gap { flex: 1; }
  .main { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; z-index: 25;
    background: var(--glass-strong); border-top: 1px solid var(--glass-line); box-shadow: var(--glass-hi); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 1px; padding: 6px 0 4px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; border-radius: var(--r); position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--text); font-weight: 650; }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -4px; width: 26px; height: 3px; border-radius: 0 0 var(--r-xs) var(--r-xs); background: var(--ink); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); font-size: 10px; min-width: 16px; line-height: 16px; border-radius: var(--r-sm); background: var(--clay); color: var(--on-clay); text-align: center; padding: 0 4px; }
}

/* ---------------------------------------------------------- page heads */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: clamp(28px, 3.6vw, 40px); font-stretch: var(--w-display); font-weight: 700; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 19px; font-weight: 650; display: flex; align-items: baseline; gap: 10px; }
.section-title .count { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--faint); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a, .link-btn { font-size: 14px; font-weight: 500; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: none; }
.section-head a:hover, .link-btn:hover { text-decoration: underline; }
.panel { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-lg); padding: 20px; min-width: 0; box-shadow: var(--glass-hi), var(--shadow); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13.5px; }

/* ---------------------------------------------------------- dashboard */
.brief { display: grid; gap: 10px; padding: 8px 0 4px; }
.brief-greet { color: var(--muted); font-size: 16px; }
.brief-line { font-family: var(--font-display); font-stretch: var(--w-display); font-weight: 500; font-size: clamp(26px, 3.9vw, 46px); line-height: 1.12; letter-spacing: -.02em; max-width: 26ch; text-wrap: balance; }
.brief-line a { color: inherit; text-decoration: none; font-weight: 700; box-shadow: inset 0 -.1em 0 var(--steel); }
.brief-line a:hover { box-shadow: inset 0 -.3em 0 color-mix(in srgb, var(--steel) 40%, transparent); }
.brief-line a.warn { color: var(--clay); box-shadow: inset 0 -.1em 0 var(--clay); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { display: grid; gap: 0; min-width: 96px; }
.stat-v { font-family: var(--font-display); font-stretch: var(--w-display); font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13.5px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.dash-col { display: grid; gap: 28px; min-width: 0; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font: 400 11.5px var(--font-ui); }
.chart .bar { fill: var(--bar); }
.chart .bar.today { fill: var(--ink-strong); }
.chart .bar.zero { fill: var(--line-strong); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .bar.hover { opacity: .78; }
.chart .val { fill: var(--text); font: 600 12px var(--font-ui); }
.tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: var(--ink); color: var(--on-ink);
  padding: 5px 9px; border-radius: var(--r-sm); font-size: 13px; white-space: nowrap; box-shadow: var(--shadow); }

.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }

/* follow-up rows */
.fu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 2px; }
.fu-check { width: 24px; height: 24px; border-radius: var(--r-sm); border: 1.5px solid var(--field-line); background: var(--surface); display: grid; place-items: center; padding: 0; color: transparent; }
.fu-check svg { width: 14px; height: 14px; }
.fu-check:hover { border-color: var(--sage); color: var(--sage); }
.fu-check.done { background: var(--sage); border-color: var(--sage); color: var(--paper); }
.fu-title { font-weight: 500; overflow-wrap: anywhere; }
.fu.is-done .fu-title { text-decoration: line-through; color: var(--muted); }
.fu-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--muted); align-items: center; }
.fu-meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.fu-meta .who { color: var(--text); font-weight: 500; text-decoration: none; }
.fu-meta .who:hover { text-decoration: underline; }
.fu-actions { display: flex; gap: 2px; align-items: center; }
.due-over { color: var(--clay); font-weight: 600; }
.due-soon { color: var(--text); font-weight: 500; }
.prio { display: inline-flex; align-items: center; gap: 5px; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-xs); background: var(--faint); }
.prio-high::before { background: var(--clay); }
.prio-medium::before { background: var(--steel); }
.prio-low::before { background: var(--line-strong); }

/* who badges */
.by { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 1px 8px 1px 6px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.by::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.by-ai { background: var(--brass-wash); color: var(--brass-ink); }
.by-vidya { background: var(--ink-wash); color: var(--text); }
.by-human { background: var(--sage-wash); color: var(--sage); }

/* hot leads */
.lead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 2px; text-decoration: none; color: inherit; border-radius: var(--r); }
.lead:hover .lead-name { text-decoration: underline; }
.lead-main { display: grid; gap: 2px; min-width: 0; }
.lead-top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.lead-name { font-weight: 600; }
.lead-sub { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ink-wash); color: var(--text); font-family: var(--font-display); font-weight: 650; font-size: 14px; letter-spacing: .01em; box-shadow: inset 0 0 0 1px var(--line); }
.avatar svg { width: 18px; height: 18px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.score { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.score svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score .track { stroke: var(--line); }
.score .arc { stroke: var(--steel); stroke-linecap: butt; }
.score.hot .arc { stroke: var(--sage); }
.score b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-lg { width: 54px; height: 54px; }
.score-lg b { font-size: 16px; }

/* stage pip: progress through the pipeline, not a colour code */
.pip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.pip i { display: inline-flex; gap: 2px; }
.pip i b { width: 6px; height: 12px; border-radius: var(--r-xs); background: var(--line-strong); }
.pip i b.on { background: var(--ink); }
.pip.won i b { background: var(--sage); }
.pip.lost i b { background: transparent; box-shadow: inset 0 0 0 1.5px var(--clay); }
.pip.lost { color: var(--clay); }
.pip.won { color: var(--sage); }

.stage-bars { display: grid; gap: 10px; }
.stage-bar { display: grid; grid-template-columns: 112px minmax(0, 1fr) 32px; gap: 10px; align-items: center; text-decoration: none; color: inherit; font-size: 14.5px; }
.stage-bar:hover span:first-child { text-decoration: underline; }
.stage-bar .track { height: 10px; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.stage-bar .fill { display: block; height: 100%; border-radius: var(--r-sm); background: var(--bar); }
.stage-bar .fill.won { background: var(--sage); }
.stage-bar .fill.lost { background: var(--clay); opacity: .7; }
.stage-bar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; min-height: 26px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
a.chip:hover { border-color: var(--line-strong); }
.chip.ai { background: var(--brass-wash); border-color: color-mix(in srgb, var(--brass) 45%, transparent); color: var(--brass-ink); }
.chip.ai::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }
.chip .x { display: grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border-radius: var(--r-xs); border: 0; background: transparent; color: inherit; padding: 0; }
.chip .x:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.chip .x svg { width: 12px; height: 12px; }
.chip .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip-more { color: var(--muted); font-size: 13px; align-self: center; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 9px 0; position: relative; }
.feed li::before { content: ""; position: absolute; left: 10px; top: 28px; bottom: -6px; width: 1.5px; background: var(--line); }
.feed li:last-child::before { display: none; }
.feed .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.feed .dot svg { width: 12px; height: 12px; }
.feed .ai .dot { background: var(--brass-wash); color: var(--brass-ink); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--brass) 55%, transparent); }
.feed .vidya .dot { background: var(--ink-wash); color: var(--ink); }
.feed .human .dot { background: var(--sage-wash); color: var(--sage); }
.feed .ai .feed-text { color: var(--text); }
.feed-text { overflow-wrap: anywhere; }
.feed-meta { font-size: 13px; color: var(--faint); }
.feed-meta a { color: var(--muted); font-weight: 500; text-decoration: none; }
.feed-meta a:hover { text-decoration: underline; }

/* empty states */
.empty { display: grid; justify-items: start; gap: 8px; padding: 28px 4px; color: var(--muted); max-width: 52ch; }
.empty-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text); }
.empty.center { justify-items: center; text-align: center; margin: 0 auto; }
.empty.big { padding: 56px 16px; }

/* ---------------------------------------------------------- contacts */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .search { position: relative; flex: 1 1 260px; min-width: 0; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.toolbar .search input { padding-left: 36px; }
.toolbar select { width: auto; flex: 0 1 auto; min-width: 0; }
@media (max-width: 640px) { .toolbar select { flex: 1 1 calc(50% - 4px); } }
.result-count { font-size: 14px; color: var(--muted); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.ctable { width: 100%; border-collapse: collapse; }
.ctable th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.ctable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr { cursor: pointer; }
.ctable tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-cell a { color: var(--text); font-weight: 600; text-decoration: none; }
.who-cell a:hover { text-decoration: underline; }
.who-cell .ph { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctable td.c-who { min-width: 200px; }
.ctable td.c-tags { min-width: 150px; }
.ctable td.c-next { min-width: 200px; }
.ctable td.c-last { white-space: nowrap; font-size: 14px; color: var(--muted); }
.fu-count { display: block; font-size: 12.5px; color: var(--faint); }
.next-cell { max-width: 40ch; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pending-ai { display: inline-flex; align-items: center; gap: 6px; color: var(--brass-ink); font-size: 13.5px; }
.pending-ai::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.load-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .ctable thead { display: none; }
  .ctable, .ctable tbody, .ctable tr, .ctable td { display: block; }
  .ctable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .ctable tbody tr:last-child { border-bottom: 0; }
  .ctable td { padding: 0; border: 0; }
  .ctable td.c-who { grid-column: 1; }
  .ctable td.c-score { grid-column: 2; grid-row: 1; }
  .ctable td.c-stage, .ctable td.c-tags, .ctable td.c-next, .ctable td.c-last { grid-column: 1 / -1; }
  .ctable td.c-who, .ctable td.c-tags, .ctable td.c-next { min-width: 0; }
  .ctable td.c-last { font-size: 13px; color: var(--faint); display: flex; gap: 10px; }
  .fu-count { display: inline; }
  .next-cell { max-width: none; }
}

/* ---------------------------------------------------------- pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.col { display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--surface) 30%, transparent); border-radius: var(--r-lg); padding: 12px; min-height: 320px; scroll-snap-align: start; border: 1.5px dashed transparent; }
.col.drop { border-color: var(--steel); background: var(--ink-wash); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 4px; }
.col-head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.col-head .n { font-family: var(--font-ui); font-size: 13.5px; color: var(--faint); font-weight: 500; }
.col-cards { display: grid; gap: 8px; align-content: start; flex: 1; }
.col-empty { font-size: 13.5px; color: var(--faint); padding: 8px 4px; }
.card { background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; cursor: grab; box-shadow: var(--glass-hi), var(--shadow); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-name { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.card-name:hover { text-decoration: underline; }
.card-ph { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-next { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .score { width: 34px; height: 34px; }
.card .score b { font-size: 12px; }

.menu { position: fixed; z-index: 70; min-width: 180px; background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.menu-label { font-size: 12.5px; color: var(--faint); padding: 4px 10px 6px; }
.menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r); display: flex; gap: 8px; align-items: center; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }

/* ---------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ink); font-weight: 600; }
.tab .n { font-size: 12.5px; font-weight: 600; padding: 0 7px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); line-height: 19px; }
.tab .n.warn { background: var(--clay-wash); color: var(--clay); }

/* ---------------------------------------------------------- calls */
.calls .row { display: grid; grid-template-columns: 34px minmax(0, 1.1fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 13px 16px; border: 0; background: none; border-bottom: 1px solid var(--line); color: inherit; }
.calls li:last-child .row { border-bottom: 0; }
.calls .row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.kind-ico { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; background: var(--ink-wash); color: var(--text); }
.kind-ico svg { width: 17px; height: 17px; }
.kind-ico.demo { background: var(--sage-wash); color: var(--sage); }
.kind-ico.callback { background: var(--brass-wash); color: var(--brass-ink); }
.row-name { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 13.5px; color: var(--muted); }
.row-sum { font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-when { font-size: 13.5px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .calls .row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .calls .row-sum { grid-column: 2 / -1; }
}

/* transcript */
.transcript { display: grid; gap: 10px; padding: 4px 0; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: var(--r-lg); overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble-who { font-size: 12px; font-weight: 600; color: var(--faint); margin-bottom: 2px; }
.msg-user { justify-self: start; }
.msg-user .bubble { background: var(--surface-2); border-bottom-left-radius: var(--r-sm); }
.msg-assistant { justify-self: end; display: grid; justify-items: end; }
.msg-assistant .bubble { background: var(--ink); color: var(--on-ink); border-bottom-right-radius: var(--r-xs); }
.msg-assistant .bubble-who { text-align: right; }
.bubble.tool { background: transparent !important; color: var(--faint) !important; border: 1px dashed var(--line-strong); font-size: 13.5px; }

/* ---------------------------------------------------------- insights */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 28px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 2px 10px; font-size: 14.5px; }
.hbar .lbl { overflow-wrap: anywhere; }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: var(--r-sm); background: var(--bar); }
.hbar .fill.positive { background: var(--sage); }
.hbar .fill.negative { background: var(--clay); }
.hbar .fill.neutral { background: var(--faint); }
.gap-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 16px 0; }
.gap-topic { font-weight: 600; font-size: 16.5px; }
.gap-count { font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.gap-count small { display: block; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--faint); }
.gap-q { grid-column: 1 / -1; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.gap-q li { color: var(--muted); padding-left: 12px; border-left: 2px solid var(--brass); font-size: 14.5px; overflow-wrap: anywhere; }
.gap-foot { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--faint); }
.digest { white-space: pre-wrap; font-size: 16px; line-height: 1.6; max-width: 70ch; overflow-wrap: anywhere; }
.digest-panel { border-left: 3px solid var(--brass); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-sm); }

/* ---------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 45; width: min(680px, 100vw); background: var(--glass-dense); border-left: 1px solid var(--glass-line); box-shadow: var(--glass-hi), var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }
.drawer-body { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.d-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--glass-dense); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--line); }
.d-bar .gap { flex: 1; }
.d-sec { padding: 20px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.d-sec:last-child { border-bottom: 0; }
@media (max-width: 520px) { .d-sec { padding: 18px 16px; } }
.d-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.d-name { font-size: 26px; font-stretch: var(--w-display); font-weight: 700; letter-spacing: -.015em; overflow-wrap: anywhere; }
.d-phone { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-phone a { color: inherit; }
.d-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.d-row select { width: auto; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.d-score-reason { font-size: 14px; color: var(--muted); }
.ai-note { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: var(--r-xs) var(--r) var(--r) var(--r-xs); padding: 14px 16px; display: grid; gap: 10px; }
.ai-note-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--brass-ink); }
.ai-summary { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-next { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-weight: 500; overflow-wrap: anywhere; }
.ai-next svg { width: 18px; height: 18px; color: var(--brass-ink); margin-top: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--muted); }
.facts b { color: var(--text); font-weight: 500; }
.lock-note { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--faint); }
.lock-note svg { width: 12px; height: 12px; }
.tag-add { display: flex; gap: 6px; max-width: 340px; }
.tag-add input { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.d-h { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.addfu { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.addfu .t { grid-column: 1 / -1; }
@media (max-width: 620px) { .addfu { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .addfu .due { grid-column: 1 / -1; } }
.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 9px 0; position: relative; }
.tl > li::before { content: ""; position: absolute; left: 10px; top: 30px; bottom: -8px; width: 1.5px; background: var(--line); }
.tl > li:last-child::before { display: none; }
.tl .call-card { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; text-align: left; width: 100%; color: inherit; }
button.call-card:hover { border-color: var(--line-strong); }
.call-card .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.call-card .t span { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.call-card .s { font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.call-card .open { font-size: 13.5px; color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--steel); text-underline-offset: 3px; }
.note-form { display: grid; gap: 8px; }
.note-form .form-actions { justify-content: flex-start; }
.d-loading { padding: 40px 24px; color: var(--muted); }

/* ---------------------------------------------------------- ask AI */
.ask { position: fixed; z-index: 50; right: 16px; bottom: 16px; top: 16px; width: min(440px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--glass-dense); border: 1px solid var(--glass-line); border-radius: var(--r-lg); box-shadow: var(--glass-hi), var(--shadow-lg); overflow: hidden; animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(10px); opacity: .5; } }
@media (max-width: 600px) { .ask { inset: 0; width: 100vw; border-radius: 0; border: 0; } }
.ask-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.ask-title { font-size: 18px; display: flex; align-items: center; gap: 10px; flex: 1; }
.ask-log { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.ask-intro { color: var(--muted); display: grid; gap: 12px; }
.ask-intro p { max-width: 40ch; }
.suggest { display: grid; gap: 6px; }
.suggest button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px; color: var(--text); }
.suggest button:hover { border-color: var(--brass); }
.ask-msg { display: grid; gap: 8px; }
.ask-msg.user { justify-items: end; }
.ask-msg .b { padding: 9px 13px; border-radius: var(--r-lg); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; }
.ask-msg.user .b { background: var(--ink-wash); border-bottom-right-radius: var(--r-xs); }
.ask-msg.assistant .b { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: var(--r-xs); }
.ask-msg.error .b { background: var(--clay-wash); color: var(--clay); }
.ask-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.thinking { display: inline-flex; gap: 4px; padding: 12px 14px; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); animation: pulse 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
.ask-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: end; }
.ask-form textarea { min-height: 44px; max-height: 160px; resize: none; }
.ask-ctx { font-size: 13px; color: var(--muted); padding: 0 18px 8px; }

/* ---------------------------------------------------------- modal */
.modal { border: 1px solid var(--glass-line); padding: 0; border-radius: var(--r-lg); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--glass-dense); color: var(--text); box-shadow: var(--glass-hi), var(--shadow-lg); }
.modal::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-in { display: grid; gap: 16px; padding: 22px 24px 20px; }
.modal-in.wide { padding-bottom: 8px; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 21px; font-weight: 650; overflow-wrap: anywhere; }
.modal-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.shortcuts dt { display: flex; gap: 4px; }
.shortcuts dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; margin: 0; } .modal-in { padding: 18px 16px; } }

/* ---------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 900px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--on-ink); padding: 11px 12px 11px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.toast.error { background: var(--clay); color: var(--on-clay); }
.toast .msg { flex: 1; overflow-wrap: anywhere; }
.toast button { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: var(--r); padding: 3px 10px; font-weight: 600; opacity: .9; }
.toast.new { border-left: 4px solid var(--brass); }

.skeleton { color: var(--faint); padding: 24px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .chip.ai::before, .ai-dot, .by::before { forced-color-adjust: none; }
  .bar, .fill { forced-color-adjust: none; }
}

/* ---------------------------------------------------------- small-screen fixes */
.view > *, .dash-col > * { min-width: 0; }
@media (max-width: 720px) {
  .calls .row-when { grid-row: 1; grid-column: 3; align-self: start; }
}
@media (max-width: 520px) {
  .fu { grid-template-columns: auto minmax(0, 1fr); }
  .fu-actions { grid-column: 2; margin-left: -8px; }
}
@media (max-width: 420px) {
  .hide-xs { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .d-bar { padding: 10px 12px; gap: 4px; }
}

/* ================================================================ v2: teaching Vidya
   Knowledge, Pitch, FAQ and the browser test console. Same ink/paper/marigold system;
   grades reuse it: leaf = good, slate = deflected, marigold = risky, madder = wrong. */
:root { --g-good: var(--sage); --g-deflected: var(--faint); --g-risky: var(--brass); --g-wrong: var(--clay); }

/* rail groups + mobile "more" */
.nav-group { font-size: 12.5px; font-weight: 600; color: var(--rail-muted); padding: 14px 10px 4px; margin-top: 6px; border-top: 1px solid var(--line); }
.nav .badge.soft { background: var(--brass-wash); color: var(--brass-ink); box-shadow: inset 0 0 0 1px var(--brass); }
@media (max-width: 900px) {
  .tabbar .tab-more { display: grid; justify-items: center; gap: 1px; padding: 6px 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 500; border-radius: var(--r); position: relative; background: none; border: 0; min-width: 0; }
  .tabbar .tab-more svg { width: 21px; height: 21px; }
  .tabbar .tab-more span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .tab-more[aria-current="page"] { color: var(--text); font-weight: 650; }
  .tabbar .tab-more[aria-current="page"]::before { content: ""; position: absolute; top: -4px; width: 26px; height: 3px; border-radius: 0 0 var(--r-xs) var(--r-xs); background: var(--ink); }
  .tabbar .tab-more .dot-badge { position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
}
.menu a { text-align: left; padding: 9px 10px; border-radius: var(--r); display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.menu a svg { width: 18px; height: 18px; color: var(--muted); }
.menu a:hover, .menu a:focus-visible { background: var(--surface-2); outline: none; }
.menu a[aria-current="page"] { font-weight: 650; color: var(--text); box-shadow: inset 2px 0 0 var(--ink); }
.menu a .badge { margin-left: auto; font-size: 11.5px; font-weight: 600; min-width: 18px; padding: 0 5px; border-radius: var(--r-sm); background: var(--clay); color: var(--on-clay); text-align: center; line-height: 18px; }

/* shared controls */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
.seg label { position: relative; flex: 1 1 auto; min-width: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: var(--r); font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; text-align: center; white-space: nowrap; }
.seg span small { font-size: 12px; font-weight: 400; color: var(--faint); }
.seg input:checked + span { background: var(--ink); color: var(--on-ink); box-shadow: 0 1px 2px rgb(20 22 26 / .18); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg input:disabled + span { cursor: not-allowed; opacity: .6; }
.seg.block { display: flex; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 38px; height: 22px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--field-line); background: linear-gradient(var(--surface), var(--surface)) 3px 50% / 14px 14px no-repeat, var(--surface-2); transition: background-position .15s; }
.switch input:checked { border-color: var(--ink); background: linear-gradient(var(--on-ink), var(--on-ink)) 19px 50% / 14px 14px no-repeat, var(--ink); }
.switch input:not(:checked) { background: linear-gradient(var(--field-line), var(--field-line)) 3px 50% / 14px 14px no-repeat, var(--surface-2); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled { opacity: .55; cursor: not-allowed; }
.badge-test { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: var(--r-sm); line-height: 19px; background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 0 8px; border-radius: var(--r-sm); line-height: 21px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.tag-core { background: var(--ink-wash); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-detail { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-off { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-warn { background: var(--brass-wash); color: var(--brass-ink); }
.tag-bad { background: var(--clay-wash); color: var(--clay); }
.tag-ok { background: var(--sage-wash); color: var(--sage); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spacer { flex: 1; }
.count-note { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.count-note.over { color: var(--clay); font-weight: 600; }
del.d, ins.d { text-decoration: none; border-radius: var(--r-xs); padding: 0 1px; }
del.d { background: var(--clay-wash); color: var(--clay); text-decoration: line-through; text-decoration-thickness: 1px; }
ins.d { background: var(--sage-wash); color: var(--sage); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
details.disclose > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .12s; margin-right: 2px; }
details.disclose[open] > summary::before { transform: rotate(45deg); }

/* ---------------------------------------------------------- knowledge */
.drop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 18px; align-items: center; padding: 22px 24px; border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong); background: var(--surface); transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--steel); background: var(--ink-wash); }
.drop-ico { width: 48px; height: 48px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--ink-wash); color: var(--text); }
.drop-ico svg { width: 22px; height: 22px; }
.drop-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.drop-sub { font-size: 14px; color: var(--muted); }
.drop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .drop { grid-template-columns: minmax(0, 1fr); padding: 18px; } .drop-ico { display: none; } }
.docs { margin-top: 10px; }
.doc { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 2px; }
.doc .kind-ico { width: 34px; height: 34px; }
.doc-name { font-weight: 600; overflow-wrap: anywhere; }
.doc-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: center; }
.doc-err { grid-column: 2 / -1; font-size: 13.5px; color: var(--clay); overflow-wrap: anywhere; }
.doc-bar { grid-column: 2 / -1; height: 4px; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.doc-bar span { display: block; height: 100%; background: var(--steel); border-radius: var(--r-sm); transition: width .15s; }
@media (max-width: 560px) { .doc { grid-template-columns: 34px minmax(0, 1fr); } .doc .row-actions { grid-column: 2; } }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-processing { color: var(--brass-ink); }
.st-processing::before { background: var(--brass); animation: pulse 1.2s ease-in-out infinite; }
.st-done { color: var(--sage); }
.st-error { color: var(--clay); }

.kb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 6px; }
.kb-tools .search { position: relative; flex: 1 1 240px; min-width: 0; }
.kb-tools .search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.kb-tools .search input { padding-left: 36px; }
.kb-tools select { width: auto; flex: 0 1 auto; }
@media (max-width: 640px) { .kb-tools select { flex: 1 1 calc(50% - 4px); } }
.kb-groups { display: grid; gap: 24px; margin-top: 14px; }
.kb-group h3 { font-size: 16px; font-weight: 650; display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.kb-group h3 .count { font-family: var(--font-ui); font-size: 13.5px; font-weight: 500; color: var(--faint); }
.kc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; width: 100%; text-align: left; padding: 12px 16px; border: 0; background: none; color: inherit; }
.kc:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.kc-title { font-weight: 600; overflow-wrap: anywhere; }
.kc-body { grid-column: 1 / -1; font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; font-size: 12.5px; color: var(--faint); }
.kc-item.archived .kc-title, .kc-item.archived .kc-body { opacity: .6; }
.kc-item .kc { padding-bottom: 6px; }
.kc-item:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.kc-item .kc:hover { background: none; }
.kb-group-sub { font-size: 13.5px; color: var(--faint); margin: -4px 0 8px; }
.kc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 0 16px 12px; font-size: 12.5px; color: var(--faint); }
.kc-facts { display: flex; flex-wrap: wrap; gap: 2px 0; min-width: 0; }
.kc-facts > span + span::before { content: "·"; margin: 0 6px; }
@media (max-width: 560px) { .kc-facts { gap: 2px 10px; } .kc-facts > span + span::before { content: none; } }
.kc-topic { color: var(--muted); font-weight: 600; }
/* what Vidya may say: five statuses, each a word plus a tone (never colour alone) */
.tag.info::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.info-live { background: var(--sage-wash); color: var(--sage); }
.tag.info-direction { background: var(--ink-wash); color: var(--text); }
.tag.info-planned { background: var(--brass-wash); color: var(--brass-ink); }
.tag.info-verify { background: var(--clay-wash); color: var(--clay); }
.tag.info-deprecated { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); text-decoration: line-through; }
.info-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.info-chip { font-size: 13px; min-height: 30px; }
.info-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.info-chip:first-child::before { display: none; }
.info-chip.info-live::before { background: var(--sage); }
.info-chip.info-direction::before { background: var(--steel); }
.info-chip.info-planned::before { background: var(--brass); }
.info-chip.info-verify::before { background: var(--clay); }
.info-chip.info-deprecated::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.info-chips .info-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.info-chips .info-chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.info-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* sources: build kit IDs, website pages, notes */
.srcs { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.src { display: inline-flex; align-items: center; max-width: 100%; padding: 0 6px; line-height: 20px; border-radius: var(--r-xs); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.src-kit { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; letter-spacing: .01em; }
.src-web { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.src-web:hover { text-decoration-color: currentColor; border-color: var(--line-strong); }
.src-note { font-style: italic; border-style: dashed; }
.src-more { font-size: 12px; color: var(--faint); }
.src-prev { margin-top: 2px; min-height: 22px; }
.form-grid > .field.top { align-content: start; }
fieldset.aud-set { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.aud-set legend { padding: 0; margin-bottom: 6px; }
.chk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chk-chip { position: relative; display: inline-flex; }
.chk-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px; border-radius: var(--r-sm); border: 1px solid var(--field-line);
  background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.chk-chip span::before { content: ""; width: 12px; height: 12px; border-radius: var(--r-xs); border: 1.5px solid var(--field-line); flex: none; }
.chk-chip input:checked + span { background: var(--ink-wash); color: var(--text); border-color: var(--ink); }
.chk-chip input:checked + span::before { background: var(--ink); border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink-wash); }
.chk-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the lead's own words from a demo booking or callback: institution, position, size, the number to ring */
.lead-facts { display: grid; gap: 2px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.lead-facts a { color: var(--text); }
.said { font-size: 12px; color: var(--faint); font-weight: 400; }
@media (forced-colors: active) { .info-chip::before, .tag.info::before, .chk-chip span::before { forced-color-adjust: none; } .chk-chip input:checked + span { outline: 2px solid CanvasText; } }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.versions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.versions .v-h { font-size: 13.5px; font-weight: 600; }
.versions .v-b { grid-column: 1 / -1; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }

.proposal { display: grid; gap: 12px; }
.proposal + .proposal { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.prop-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.prop-title { font-weight: 650; font-size: 16.5px; overflow-wrap: anywhere; }
.prop-from { font-size: 13.5px; color: var(--faint); }
.diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.diff-pane { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); min-width: 0; }
.diff-pane.new { border-color: color-mix(in srgb, var(--sage) 40%, var(--line)); }
.diff-pane h4 { font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.diff-pane .prose { font-size: 15px; }
@media (max-width: 720px) { .diff { grid-template-columns: minmax(0, 1fr); } }

.gap-src { font-size: 13.5px; color: var(--muted); }
.gap-src b { color: var(--text); font-weight: 600; }
.gap-detail { grid-column: 1 / -1; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--brass); font-size: 14.5px; overflow-wrap: anywhere; }
.gap-item details { grid-column: 1 / -1; }
.answer-form { display: grid; gap: 10px; margin-top: 10px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.answer-form .form-actions { justify-content: flex-start; margin: 0; }

.meter { display: grid; gap: 6px; }
.meter-track { height: 12px; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; position: relative; }
.meter-fill { display: block; height: 100%; border-radius: var(--r-xs); background: var(--steel); }
.meter.over .meter-fill { background: var(--clay); }
.meter-l { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.meter-l b { color: var(--text); font-variant-numeric: tabular-nums; }
.compiled { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; max-height: 560px; overflow: auto; padding: 16px 18px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }

/* ---------------------------------------------------------- pitch */
.pitch { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) {
  .pitch { grid-template-columns: minmax(0, 1fr); }
  .pitch.editing .script-nav { display: none; }
  .pitch:not(.editing) .script-ed { display: none; }
}
@media (min-width: 961px) { .back-to-list { display: none !important; } }
.script-nav { display: grid; gap: 18px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 2px; }
@media (max-width: 960px) { .script-nav { position: static; max-height: none; } }
.script-group h2 { font-size: 15px; font-weight: 650; display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px 4px; }
.script-group h2 .count { font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--faint); }
.script-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.script-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--r); border: 1px solid transparent; background: none; color: inherit; }
.script-item:hover { background: var(--surface); border-color: var(--line); }
.script-item[aria-current="true"] { background: var(--surface); border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--ink); }
.script-item .t { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.script-item .secs { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.script-item .w { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.script-item.off .t { color: var(--muted); }
.script-ed { display: grid; gap: 16px; }
.script-ed .panel { display: grid; gap: 16px; }
.ed-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.ed-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .ed-top, .ed-meta { grid-template-columns: minmax(0, 1fr); } }
.script-body { font-size: 17px !important; line-height: 1.62 !important; min-height: 220px; padding: 14px 16px !important; }
.speak { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-items: center; }
.speak-n { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.speak-n b { color: var(--text); font-family: var(--font-display); font-size: 17px; font-weight: 650; }
.ruler { position: relative; height: 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.ruler .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--sage) 26%, transparent); border-radius: var(--r-sm); }
.ruler .mark { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: var(--r-xs); background: var(--ink); transition: left .15s; }
.ruler.long .mark { background: var(--clay); }
.speak-hint { grid-column: 1 / -1; font-size: 13px; color: var(--faint); }
.speak-hint.long { color: var(--clay); }
.beats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: beat; }
.beats li { counter-increment: beat; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.beats li::before { content: counter(beat); width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font: 700 13px/1 var(--font-display); }
.beats .bt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.beats .bs { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.beats .bs.long { color: var(--clay); font-weight: 600; }
.beat-check { grid-column: 2 / -1; font-size: 13px; color: var(--faint); font-style: italic; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-bar select { width: auto; min-width: 0; max-width: 180px; }
.dirty-note { font-size: 13.5px; color: var(--brass-ink); font-weight: 500; }
.improve { border-left: 3px solid var(--brass); }
.chip-toggle { cursor: pointer; }
.chip-toggle[aria-pressed="true"] { background: var(--brass-wash); border-color: var(--brass); color: var(--brass-ink); }
.proposal-box { display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--brass) 50%, transparent); background: var(--surface); }
.proposal-box .prose { font-size: 16px; line-height: 1.6; }

/* ---------------------------------------------------------- FAQ */
.grade-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--muted); }
.grade-legend span { display: inline-flex; align-items: center; gap: 6px; }
.grade-legend i, .gdot { width: 10px; height: 10px; border-radius: var(--r-xs); display: inline-block; flex: none; }
.g-good { background: var(--g-good); } .g-deflected { background: var(--g-deflected); } .g-risky { background: var(--g-risky); } .g-wrong { background: var(--g-wrong); }
.grades { display: flex; height: 8px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); gap: 2px; min-width: 80px; }
.grades span { display: block; height: 100%; }
.grades-lg { height: 12px; }
.grade { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 0 8px; border-radius: var(--r-sm); line-height: 21px; white-space: nowrap; }
.grade-good { background: var(--sage-wash); color: var(--sage); }
.grade-deflected { background: var(--surface-2); color: var(--muted); }
.grade-risky { background: var(--brass-wash); color: var(--brass-ink); }
.grade-wrong { background: var(--clay-wash); color: var(--clay); }
.faq-list { list-style: none; margin: 0; padding: 0; }
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: 0; }
.faq > details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(120px, 200px) 18px; gap: 6px 16px; align-items: center; padding: 14px 16px; }
.faq > details > summary::-webkit-details-marker { display: none; }
.faq > details > summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.faq > details > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted); transform: rotate(45deg); justify-self: center; margin-top: -4px; transition: transform .12s; }
.faq > details[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq-n { font-family: var(--font-display); font-stretch: var(--w-display); font-size: 26px; font-weight: 700; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.faq-n small { display: block; font-family: var(--font-ui); font-size: 12px; font-weight: 500; color: var(--faint); margin-top: 3px; }
.faq-t { display: grid; gap: 3px; min-width: 0; }
.faq-topic { font-weight: 650; font-size: 16px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.faq-q { color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
.faq-meta { font-size: 13px; color: var(--faint); }
.faq-g { display: grid; gap: 5px; }
.faq-g .grades { width: 100%; }
.faq-g small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) {
  .faq > details > summary { grid-template-columns: 44px minmax(0, 1fr) 14px; padding: 14px 12px; }
  .faq-g { grid-column: 2 / 3; grid-row: 2; }
  .faq > details > summary::after { grid-column: 3; grid-row: 1; }
  .faq-n { font-size: 22px; }
}
.faq-body { padding: 4px 16px 22px 88px; display: grid; gap: 18px; }
@media (max-width: 720px) { .faq-body { padding: 4px 12px 18px; } }
.qa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.qa { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.qa-q, .qa-a { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
.qa-q b, .qa-a b { font-size: 12.5px; font-weight: 600; color: var(--faint); padding-top: 2px; }
.qa-q span { font-weight: 500; }
.qa-a span { color: var(--text); }
.qa-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); padding-left: 70px; }
@media (max-width: 520px) { .qa-q, .qa-a { grid-template-columns: minmax(0, 1fr); gap: 0; } .qa-foot { padding-left: 0; } }
.teach { display: grid; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass); }
.teach textarea { min-height: 96px; }
.faq-admin { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; }
.faq-admin form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; flex: 1 1 280px; }
.faq-admin .field { flex: 1 1 200px; }
.faq-head-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }

/* ---------------------------------------------------------- test console */
.tv { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .tv { grid-template-columns: minmax(0, 1fr); } }
.tv-side { display: grid; gap: 16px; position: sticky; top: 16px; }
@media (max-width: 960px) { .tv-side { display: contents; } } /* lets the live handset stick across the whole console */
.tv-setup { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
.tv-setup legend { padding: 0; }
.tv-q { display: grid; gap: 6px; }
.tv-q > .field-label { color: var(--text); font-weight: 600; font-size: 14px; }
.scen { display: grid; gap: 6px; }
.scen label { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.scen label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.scen input { margin: 3px 0 0; accent-color: var(--ink); width: 16px; height: 16px; }
.scen b { font-weight: 600; }
.scen small { grid-column: 2; font-size: 13px; color: var(--muted); }
.scen-extra { display: grid; gap: 10px; padding: 2px 0 0 0; }
.tv-note { font-size: 13px; color: var(--muted); }

.handset { background: var(--device); color: var(--device-text); border-radius: var(--r-lg); padding: 20px 20px 18px; display: grid; gap: 14px; justify-items: center; text-align: center; box-shadow: var(--shadow); }
.hs-status { font-size: 14.5px; color: var(--device-muted); min-height: 22px; display: inline-flex; align-items: center; gap: 8px; }
.hs-status.live { color: var(--device-text); }
.hs-status .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fc1a1; box-shadow: 0 0 0 4px rgb(143 193 161 / .22); }
.hs-time { font-family: var(--font-display); font-stretch: var(--w-display); font-weight: 600; font-size: 44px; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--device-text); }
.hs-time small { display: block; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--device-muted); margin-top: 6px; letter-spacing: 0; }
.hs-time.warn { color: #dcc28e; }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 44px; width: 100%; }
.wave i { width: 4px; height: 3px; border-radius: var(--r-xs); background: rgb(255 255 255 / .22); transition: height .06s linear; }
.wave.on i { background: rgb(255 255 255 / .85); }
.wave.muted i { background: rgb(255 255 255 / .14); }
.hs-btns { display: flex; align-items: center; justify-content: center; gap: 18px; }
.call-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: #3d6f50;
  box-shadow: 0 10px 26px -12px rgb(61 111 80 / .9), inset 0 1px 0 rgb(255 255 255 / .18), inset 0 -3px 0 rgb(0 0 0 / .18); transition: transform .1s, background .15s; }
.call-btn svg { width: 30px; height: 30px; }
.call-btn:hover { background: #335f44; }
.call-btn:active { transform: scale(.96); }
.call-btn.end { background: #a2433a; box-shadow: 0 10px 26px -12px rgb(162 67 58 / .9), inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -3px 0 rgb(0 0 0 / .18); }
.call-btn.end:hover { background: #8c3830; }
.call-btn.end svg { transform: rotate(135deg); }
.call-btn:disabled { opacity: .6; cursor: progress; }
.call-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 50%; }
.round-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .2); background: rgb(255 255 255 / .06); color: var(--device-text); display: grid; place-items: center; }
.round-btn svg { width: 20px; height: 20px; }
.round-btn:hover { background: rgb(255 255 255 / .12); }
.round-btn[aria-pressed="true"] { background: var(--device-text); color: var(--device); }
.round-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 50%; }
.hs-label { font-size: 12.5px; color: var(--device-muted); }
.hs-err { background: rgb(229 159 147 / .16); color: #f3cfc8; border-radius: var(--r); padding: 10px 12px; font-size: 14px; text-align: left; width: 100%; }
.hs-err:empty { display: none; }

.tv-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: min(72vh, 760px); padding: 0; overflow: hidden; }
.tv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tv-head h2 { font-size: 17px; font-weight: 650; }
.tv-head .chips { flex: 1; }
.speaking { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.speaking i { display: inline-flex; gap: 2px; align-items: center; height: 14px; }
.speaking i b { width: 3px; height: 4px; border-radius: var(--r-xs); background: currentColor; animation: talk .9s ease-in-out infinite; }
.speaking i b:nth-child(2) { animation-delay: .15s; } .speaking i b:nth-child(3) { animation-delay: .3s; } .speaking i b:nth-child(4) { animation-delay: .45s; }
@keyframes talk { 50% { height: 14px; } }
.tv-log { overflow-y: auto; padding: 18px; display: grid; gap: 12px; align-content: start; overscroll-behavior: contain; max-height: 64vh; min-height: 320px; }
@media (max-width: 960px) { .tv-log { max-height: none; min-height: 260px; } }
.tv-log .bubble { font-size: 15.5px; max-width: 100%; }
/* the row carries the width cap: a % on the bubble would resolve against its own shrink-to-fit row and wrap short lines */
.tv-log .msg-user, .tv-log .msg-assistant { max-width: 82%; }
.tv-log .msg-user { display: grid; justify-items: start; }
.tv-log .msg-user .bubble.interim { background: transparent; border: 1px dashed var(--line-strong); color: var(--faint); font-style: italic; }
.tv-log .msg-assistant.streaming .bubble::after { content: ""; display: inline-block; width: 6px; height: 1em; margin-left: 3px; vertical-align: -2px; background: currentColor; opacity: .55; animation: pulse 1s infinite; }
.msg-foot { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--faint); }
.lat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: var(--r-sm); line-height: 20px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; cursor: help; }
.lat.fast { background: var(--sage-wash); color: var(--sage); }
.lat.slow { background: var(--clay-wash); color: var(--clay); }
.lat svg { width: 12px; height: 12px; }
.tv-event { justify-self: center; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--faint); }
.tv-event .chip { font-size: 13px; }
.tv-event.err { color: var(--clay); }
.tv-empty { align-self: center; justify-self: center; max-width: 46ch; text-align: center; color: var(--muted); display: grid; gap: 8px; padding: 40px 8px; }
.tv-empty .empty-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); }
.tv-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.tv-sum { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r); background: var(--surface-2); justify-self: stretch; }
.tv-sum .stats { border: 0; padding: 0; gap: 8px 28px; }
.tv-sum .stat-v { font-size: 22px; }
.msg-foot:empty { display: none; }
.msg-assistant .msg-foot { justify-content: flex-end; flex-wrap: wrap; }
.gap-item > .tag { align-self: start; justify-self: end; }
details.disclose > summary svg { width: 16px; height: 16px; flex: none; }
.qa .grade-deflected { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.lat-wrap { display: inline-flex; gap: 4px 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.msg-user .lat-wrap { justify-content: flex-start; }
/* phones: during a call the handset shrinks to a sticky bar so Hang up is always in reach */
@media (max-width: 960px) {
  .tv-log { max-height: 58vh; }
  .handset.live { position: sticky; top: 62px; z-index: 5; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "status btns" "time btns"; justify-items: start; text-align: left; gap: 2px 12px; padding: 12px 14px; border-radius: var(--r-lg); }
  .handset.live .hs-status { grid-area: status; }
  .handset.live .hs-time { grid-area: time; font-size: 26px; }
  .handset.live .hs-time small, .handset.live .wave, .handset.live .hs-label { display: none; }
  .handset.live .hs-btns { grid-area: btns; gap: 10px; }
  .handset.live .call-btn { width: 56px; height: 56px; }
  .handset.live .call-btn svg { width: 24px; height: 24px; }
  .handset.live .round-btn { width: 44px; height: 44px; }
  .handset.live .hs-err { grid-column: 1 / -1; }
}
.docs.uploads:not(:empty) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 16px; margin-top: 12px; }
.menu a .badge.soft { background: var(--brass-wash); color: var(--brass-ink); box-shadow: inset 0 0 0 1px var(--brass); }
.ed-save { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) { .improve .tag-add { flex-wrap: wrap; } .improve .tag-add input { flex: 1 1 100%; } }

/* ================================================================ v3: dialer, lines, costs, standing, notes, settings
   Same stone/steel/frost system. Status colours stay in the stone family: sage = talked, brass = try again,
   clay = failed or blocked, graphite = happening now. */

/* shared */
.seg input:checked + span small { color: inherit; opacity: .78; }
.icon-btn[aria-pressed="true"] { background: var(--ink-wash); color: var(--text); }
.link-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link-btn svg { width: 14px; height: 14px; }
.clay-t { color: var(--clay); }
.tag svg, .dnc-mark svg { width: 12px; height: 12px; }
input[type="checkbox"] { accent-color: var(--ink); width: 17px; height: 17px; margin: 0; cursor: pointer; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .4; }
input[type="number"], input[type="time"] { width: 100%; min-height: 38px; padding: 7px 11px; border-radius: var(--r); border: 1px solid var(--field-line); background: var(--surface); color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--ink); }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 8px; align-items: start; font-size: 14.5px; cursor: pointer; margin-top: 10px; }
.check input { margin-top: 3px; }
.check small { display: block; color: var(--muted); font-size: 13px; }
.field-switch { align-self: end; min-height: 38px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 550; color: var(--muted); text-decoration: none; justify-self: start; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 16px; height: 16px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.page-sub q { color: var(--text); quotes: "“" "”"; }

/* lines meter: the rail's gauge and the phone top bar's readout */
.lines { display: grid; gap: 7px; padding: 10px 10px 11px; border-radius: var(--r); text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi); }
.lines:hover { border-color: var(--line-strong); }
.lines-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lines-l { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.lines b { font-size: 15px; font-weight: 650; }
.lines-ticks { display: flex; gap: 2px; height: 8px; }
.lines-ticks i { flex: 1; min-width: 2px; border-radius: var(--r-xs); background: var(--line-strong); }
.lines-ticks i.on { background: var(--ink); }
.lines.full .lines-ticks i.on, .lines-big.full .lines-ticks i.on { background: var(--clay); }
.lines.full b { color: var(--clay); }
.lines-sm { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 9px; min-height: 32px; align-items: center; }
.lines-sm .lines-l { font-size: 12px; }
.lines-sm b { font-size: 14px; }
.lines-sm.busy b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--sage); vertical-align: 2px; }

/* selection bar (contacts and campaign items) */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 36px; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 4px 4px 12px; border-radius: var(--r);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line-strong); box-shadow: var(--glass-hi), var(--shadow); }
.selbar-n { font-size: 14px; font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
/* the row holding a visible selection bar sticks, so the bulk actions stay in reach while you scroll */
.list-head:has(.selbar:not([hidden])), .section-head:has(.selbar:not([hidden])) { position: sticky; top: 10px; z-index: 6; padding: 6px 6px 6px 12px; border-radius: var(--r-lg);
  background: var(--glass-dense); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), var(--shadow); }
.list-head .selbar, .section-head .selbar { border: 0; box-shadow: none; background: transparent; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (max-width: 900px) { .list-head:has(.selbar:not([hidden])), .section-head:has(.selbar:not([hidden])) { top: 64px; } }
.ctable th.c-sel, .ctable td.c-sel { width: 40px; padding-right: 0; }
.ctable tbody tr.is-sel { background: color-mix(in srgb, var(--ink-wash) 70%, transparent); }
.who-text { display: grid; gap: 1px; min-width: 0; }
.who-top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.who-top a { color: var(--text); font-weight: 600; text-decoration: none; }
.who-top a:hover { text-decoration: underline; }
.who-sum { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.who-cell .who-text { flex: 1; }
.dnc-mark { line-height: 19px; }
.card-sum { font-size: 13.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-next { display: grid !important; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; align-items: start; }
.card-next svg { width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.card-next span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .dnc-mark { justify-self: start; }
@media (max-width: 860px) {
  .ctable tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ctable td.c-sel { grid-column: 1; grid-row: 1; width: auto; padding-top: 10px; }
  .ctable td.c-who { grid-column: 2; grid-row: 1; }
  .ctable td.c-score { grid-column: 3; grid-row: 1; }
  .ctable td.c-stage, .ctable td.c-tags, .ctable td.c-next, .ctable td.c-last { grid-column: 2 / -1; }
  .ctable:not(:has(.c-sel)) tr { grid-template-columns: minmax(0, 1fr) auto; }
  .ctable:not(:has(.c-sel)) td { grid-column: 1 / -1; }
  .who-sum { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* calls: cost beside the time */
.calls .row-when { display: grid; justify-items: end; gap: 2px; }
.row-cost { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.call-card .t .row-cost { margin-left: auto; }
.cost-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cost-box-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.cost-box-h b { font-size: 18px; }
.cost-kv { font-size: 14px; }
.cost-kv dd { text-align: right; }

/* dashboard: what calls cost */
.costs .section-head { flex-wrap: wrap; }
.costs .seg span { min-height: 28px; padding: 2px 10px; font-size: 13px; }
.cost-body { display: grid; gap: 14px; }
.cost-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cost-v { font-family: var(--font-display); font-stretch: var(--w-display); font-size: 40px; font-weight: 650; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cost-l { font-size: 13.5px; color: var(--muted); }
.cost-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cost-rates dt { font-size: 13px; color: var(--muted); }
.cost-rates dd { margin: 0; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cost-split { display: flex; gap: 2px; height: 8px; border-radius: var(--r-xs); overflow: hidden; background: var(--surface-2); }
.cost-split span { display: block; flex-basis: 0; min-width: 3px; }
.cost-split .live, .cost-legend i.live { background: var(--ink); }
.cost-split .post, .cost-legend i.post { background: var(--brass); }
.cost-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cost-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cost-legend i { width: 9px; height: 9px; border-radius: var(--r-xs); }

/* drawer: the call guard, where things stand, permission, notes */
.d-guard { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 16px; font-size: 13.5px; background: var(--brass-wash); color: var(--brass-ink); border-bottom: 1px solid var(--line); }
.d-guard.block { background: var(--clay-wash); color: var(--clay); }
.d-guard > svg { width: 16px; height: 16px; flex: none; }
.d-guard > span { flex: 1 1 220px; }
.d-cost b { color: var(--text); }
.standing { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 2px 0 var(--brass); }
.st-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.st-h .d-h { justify-content: flex-start; }
.st-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--faint); }
.st-sum { display: grid; gap: 6px; }
.st-edit { justify-self: start; margin-left: -8px; }
.st-form { display: grid; gap: 8px; }
.st-form .small svg { width: 12px; height: 12px; vertical-align: -1px; }
.st-form .form-actions { justify-content: flex-start; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .st-grid { grid-template-columns: minmax(0, 1fr); } }
.st-card { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.st-l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.st-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.st-s { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.st-card .link-btn { justify-self: start; margin-top: 4px; }
.d-h svg { width: 16px; height: 16px; vertical-align: -3px; }
.perm-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: end; }
.perm-form .form-actions { margin: 0; }
@media (max-width: 620px) { .perm-form { grid-template-columns: minmax(0, 1fr); } .perm-form .form-actions { justify-content: flex-start; } }
.dnc-switch { align-items: flex-start; padding-top: 4px; }
.dnc-switch > span { display: grid; gap: 1px; }
.dnc-switch small { color: var(--muted); font-size: 13px; }
.dnc-switch input:checked { border-color: var(--clay); background: linear-gradient(var(--on-clay), var(--on-clay)) 19px 50% / 14px 14px no-repeat, var(--clay); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { padding: 9px 10px 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.note.pinned { border-color: var(--line-strong); box-shadow: inset 2px 0 0 var(--ink); }
.note.ai:not(.pinned) { box-shadow: inset 2px 0 0 var(--brass); }
.note-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.note-h .icon-btn.sm { width: 28px; height: 28px; }
.note-acts { display: inline-flex; flex: none; gap: 2px; margin-left: auto; } /* pin, edit and delete wrap as one group */
.note-pin { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--text); }
.note-pin svg { width: 12px; height: 12px; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.note .note-form { margin-top: 6px; }
.note-form .form-actions { justify-content: flex-start; }

/* dialer */
.lines-panel { display: grid; gap: 14px; }
.lines-big { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; }
.lines-n { font-family: var(--font-display); font-stretch: var(--w-display); font-size: 22px; color: var(--muted); white-space: nowrap; }
.lines-n b { font-size: 46px; font-weight: 650; color: var(--text); letter-spacing: -.02em; }
.lines-big .lines-ticks { height: 22px; gap: 3px; }
.lines-panel .stats { padding: 0; border: 0; }
.live-calls .live-call { display: grid; grid-template-columns: 34px minmax(0, auto) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; }
.live-call a { font-weight: 600; color: var(--text); }
.cstat { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--text); }
.cstat i { width: 8px; height: 8px; border-radius: var(--r-xs); background: var(--faint); }
.cstat-running i { background: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 25%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.cstat-running { color: var(--sage); }
.cstat-paused i { background: var(--brass); }
.cstat-paused { color: var(--brass-ink); }
.cstat-draft i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.cstat-draft { color: var(--muted); }
.cstat-done i { background: var(--ink); }
.cstat-cancelled i { background: var(--clay); }
.cstat-cancelled { color: var(--clay); }
.cprog { display: flex; gap: 1px; height: 8px; width: 100%; min-width: 120px; border-radius: var(--r-xs); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.cprog span { display: block; height: 100%; }
.cprog .ok { background: var(--sage); }
.cprog .na { background: var(--brass); }
.cprog .bad { background: var(--clay); }
.cprog .skip { background: var(--line-strong); }
.cprog .live { background: var(--ink); }
.camps td { vertical-align: top; }
.camps .cp-name { min-width: 220px; }
.camps .cp-name a { font-weight: 650; color: var(--text); text-decoration: none; }
.camps .cp-name a:hover { text-decoration: underline; }
.camps .cp-prog { min-width: 180px; }
.camps .cp-prog .cprog { margin: 6px 0 6px; }
.camps .cp-out { white-space: nowrap; }
.camps .cp-out > span { display: block; }
.camp-sum { display: grid; gap: 16px; }
.camp-prog { display: grid; gap: 6px; }
.camp-prog .cprog { height: 12px; }
.camp-sum .stats { padding: 0; border: 0; gap: 8px 30px; }
.stat.is-live .stat-v { color: var(--sage); }
.istat { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 0 8px; border-radius: var(--r-sm); line-height: 22px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); }
.istat-dialing, .istat-ringing, .istat-in_call { background: var(--ink); color: var(--on-ink); }
.istat-completed { background: var(--sage-wash); color: var(--sage); }
.istat-no_answer, .istat-busy { background: var(--brass-wash); color: var(--brass-ink); }
.istat-failed { background: var(--clay-wash); color: var(--clay); }
.istat-skipped, .istat-cancelled { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); }
.items td { vertical-align: top; }
.items td.c-tries { white-space: nowrap; }
.items td.c-call { white-space: nowrap; }
.items td.c-call .row-cost { display: block; }
.items td.c-act .row-actions { justify-content: flex-end; flex-wrap: nowrap; }
.items tr.it-in_call, .items tr.it-ringing, .items tr.it-dialing { background: color-mix(in srgb, var(--ink-wash) 60%, transparent); }
@media (max-width: 860px) { .items td.is-empty { display: none !important; } }
@media (max-width: 860px) {
  .camps tr { grid-template-columns: minmax(0, 1fr) auto; }
  .camps td { grid-column: 1 / -1; }
  .camps td.cp-name { grid-column: 1; min-width: 0; }
  .camps td.cp-status { grid-column: 2; grid-row: 1; }
  .camps td.cp-prog { min-width: 0; }
  .camps td.cp-out > span { display: inline; margin-right: 10px; }
  .items td.c-stage, .items td.c-tries, .items td.c-cause, .items td.c-call, .items td.c-act { grid-column: 2 / -1; }
  .items td.c-stage { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .items td.c-act .row-actions { justify-content: flex-start; }
  .items td.c-tries::before { content: "Tries "; color: var(--muted); }
}

/* the campaign sheet: a tall glass panel on the right; full screen on phones */
.modal.as-sheet { margin: 0 0 0 auto; width: min(640px, 100vw); height: 100vh; height: 100dvh; max-height: none; max-width: 100vw;
  border-radius: var(--r-lg) 0 0 var(--r-lg); border-right: 0; animation: slide-in .2s ease-out; }
.modal.as-sheet .modal-in { min-height: 100%; align-content: start; padding-bottom: 0; }
.sheet-in .tv-setup { gap: 10px; }
.sheet-in .tv-setup legend { margin-bottom: 8px; }
.sheet-actions { position: sticky; bottom: 0; z-index: 2; margin: auto -24px 0; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--line); }
@media (max-width: 600px) { .modal.as-sheet { border-radius: 0; } .sheet-actions { margin: auto -16px 0; padding-left: 16px; padding-right: 16px; } }
.purpose-chips { margin-top: 6px; }
.purpose-chips .chip { cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.purpose-chips .chip:hover { border-color: var(--field-line); }
.src-pane { margin-top: 2px; }
.pick { display: grid; gap: 8px; }
.pick-bar { display: flex; align-items: center; gap: 6px; }
.pick-bar > span { flex: 1; }
.pv-list.pick-list li { display: block; padding: 0; }
.pick-row { width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 20px minmax(0, auto) minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; padding: 7px 12px; cursor: pointer; }
.pick-row:hover { background: var(--surface-2); }
.adv-grid { margin-top: 12px; }
.pv { border-top: 1px solid var(--line); padding-top: 14px; }
.preview { display: grid; gap: 12px; }
.preview[aria-busy="true"] { opacity: .6; }
.pv-head { font-size: 16px; }
.pv-head b { font-family: var(--font-display); font-stretch: var(--w-display); font-size: 26px; font-weight: 650; }
.pv-list { list-style: none; margin: 0; padding: 0; display: grid; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.pv-list li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0 10px; align-items: baseline; padding: 7px 12px; border-top: 1px solid var(--line); }
.pv-list li:first-child { border-top: 0; }
.pv-name { font-weight: 600; overflow-wrap: anywhere; }
.pv-list .ph { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-list .who-sum { grid-column: 1 / -1; max-width: none; }
.pv-skips { display: grid; gap: 8px; }
.pv-skip .pv-list { margin-top: 8px; max-height: 200px; }

/* settings */
.settings { display: grid; gap: 24px; max-width: 900px; }
.settings .panel { display: grid; gap: 14px; }
.settings .section-head { margin-bottom: 0; }
.pace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
@media (max-width: 720px) { .pace-grid { grid-template-columns: minmax(0, 1fr); } }
.pace-row { display: flex; align-items: center; gap: 12px; }
.pace-row input { flex: 1; min-width: 0; }
.pace-v { min-width: 56px; text-align: right; font-weight: 650; font-size: 17px; }
.langs th[scope="row"] { font-weight: 400; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.langs tbody tr { cursor: default; }
.langs tbody tr:last-child th { border-bottom: 0; }
.lang-n { display: block; font-weight: 600; }
.lang-native { display: block; font-size: 13.5px; color: var(--muted); }
.langs td select { min-width: 200px; }
.langs td.c-act { text-align: right; width: 1%; white-space: nowrap; }
@media (max-width: 860px) {
  .langs tr { grid-template-columns: minmax(0, 1fr) auto !important; }
  .langs th[scope="row"] { grid-column: 1; padding: 0; border: 0; }
  .langs td { grid-column: 1 / -1 !important; }
  .langs td.c-act { grid-column: 2 !important; grid-row: 1; width: auto; }
  .langs td select { min-width: 0; }
}
.field.narrow { max-width: 360px; }
.settings-actions { position: sticky; bottom: 12px; z-index: 4; justify-content: flex-start; padding: 10px; border-radius: var(--r-lg);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--glass-hi), var(--shadow); }
.pace { align-content: start; }
@media (max-width: 900px) { .settings-actions { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.ed-bar select { max-width: 160px; }
.lines-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
@media (max-width: 720px) { .lines-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .topbar { gap: 4px; padding-left: 12px; } .topbar .brand span { display: none; } }

.who-text .ph { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-line a { white-space: nowrap; }
.modal.as-sheet[open] { display: flex; flex-direction: column; }
.modal.as-sheet #modal-body { flex: 1 0 auto; display: flex; flex-direction: column; }
.modal.as-sheet .sheet-in { flex: 1 0 auto; display: flex; flex-direction: column; gap: 16px; }
.switch input[type="checkbox"] { width: 38px; height: 22px; accent-color: auto; opacity: 1; }
.switch input[type="checkbox"]:disabled { opacity: .55; }
@media (max-width: 680px) { .drawer { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
